PDA

View Full Version : PWM Motor control Question!



Jimbo30
04-17-2010, 08:41 AM
Previously I tested a PWM signal using a 1uF and a 10K ohm combo using a 5v motor and I was able to control the speed very well.· However, I am testing and attempting to now use the 12V motors for my project and the PWM signal is not working very well.· I was reading through the Basic Stamp reference manual and it is suggesting, "How long the capacitor will hold the voltage depends on how much current is drawn from it by external circuitry, and the internal leakage of the capacitor."· Currently I have my charge time at 50ms set up from the previous test with the 5V motor and I am wondering if the rule of thumb is to decrease or increase the charge time?· ANY insight or suggestions would be appreciated.· I am finding out motors are·a pain to work with.··http://forums.parallax.com/images/smilies/shakehead.gif

stamptrol
04-18-2010, 01:51 AM
Are you saying you were driving the motor directly from the Stamp pin?

What type of drive circuit is used to provide the high current needed by the motor? The Stamp definitely can't do it without a transistor to do the current switching.

Perhaps a sketch would help us help you.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

Jimbo30
04-18-2010, 03:18 AM
Stamptrol -- nope, I am using a motor driver from Solarbotics presently and I attached a picture so you can get a better idea.· My input voltage for the motors is 13.2 Volts

Jimbo30
04-18-2010, 05:34 AM
I seemed to have figured it out and found the right combination of resistor/capacitor for a better charge time more suited for the motor I am using.···

stamptrol
04-18-2010, 09:33 AM
Good, good. What you're doing with the PWM command is digitally creating an analog voltage for the motor driver to use. See the Stamp Help files in the editor for more info.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

Beau Schwabe
04-18-2010, 10:01 AM
Jimbo30,

That's not the proper way to drive that motor controller.... The PWM command from the Stamp is designed to create an analog reference through a resistor and capacitor as you have done, and not directly drive a motor. The motor controller from Solarbotics expects a digital signal and what you are giving it is an analog signal... probably causing it to operate in it's linear mode and it's most likely getting HOT. The motor controller from Solarbotics can take a PWM signal, but not the type of signal generated from the Stamp.

Reference:
http://www.solarbotics.com/products/k_cmd/resources/

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Jimbo30
04-19-2010, 06:19 AM
Beau,

Thanks for your feedback, but I got it·to work last night after I realized·my silly mistakehttp://forums.parallax.com/images/smilies/lol.gif·· I am sending the PWM signal to the enable pin of the solarbotics·board for speed·and, of course, digital signals to the logic pins for motor direction and motor braking.··It works great!








Beau Schwabe (Parallax) said...
Jimbo30,

That's not the proper way to drive that motor controller.... The PWM command from the Stamp is designed to create an analog reference through a resistor and capacitor as you have done, and not directly drive a motor. The motor controller from Solarbotics expects a digital signal and what you are giving it is an analog signal... probably causing it to operate in it's linear mode and it's most likely getting HOT. The motor controller from Solarbotics can take a PWM signal, but not the type of signal generated from the Stamp.

Reference:
http://www.solarbotics.com/products/k_cmd/resources/

Jimbo30
04-19-2010, 06:23 AM
I even made a makeshift heat sink and put a small fan so I should be able to use these solarbotics H-bridge boards for what I am doing. I don't know it works great so far and that's all that matters, I guess.