Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: PWM problem  (Read 675 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i'm trying to modify pwm frequency to fit to my DC motor, i think i would need at least 20khz, the problem seems that i'm not good at it smiley-grin

i'm testing this code :

Code:
//First clear all three prescaler bits:
int prescalerVal = 0x07; //create a variable called prescalerVal and set it equal to the binary                                                       number "00000111"
TCCR0B &= ~prescalerVal; //AND the value in TCCR0B with binary number "11111000"

//Now set the appropriate prescaler bits:
int prescalerVal = 1; //set prescalerVal equal to binary number "00000001"
TCCR0B |= prescalerVal; //OR the value in TCCR0B with binary number "00000001"

this should bring my pin 5 and 6 to 64khz ... but no luck, my motor seems to still have problem, when i increase the duty cycle it spins , not at full power, and in 30sec it stops.

(i'm driving it with an SN754410NE, wich i used with some other smaller dc without any problem)

when i connect the motor to the +5V from my generator it spins like hell ...

its so frustrating ...  :-/
« Last Edit: March 17, 2010, 06:20:37 am by xqtm » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 654
Posts: 35023
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Running at 64KHz or even 20KHz is not likely to work with a motor. This is because a motor is an inductive load and at initial switch on it looks like an open circuit. It takes time for the current to rise in the coil and switching it so rapidly is not allowing it to rise very far before you cut it off again.
I would expect it to run but not as fast.
I am not sure why it stops after 30 seconds, is the chip overheating?
« Last Edit: March 17, 2010, 06:53:07 am by Grumpy_Mike » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 194
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

chip aint overheating, and everyone that used this kind of motors told me that need a pwm to ~20khz

anyway i'm trying at different frequencys but i dunno if i'm doing it in the right way ... 'cause seems no difference between frequencys
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: