DC Motor Pulsing Problem
David Handy
Posts: 11
I am trying to use the BASIC Stamp along with a motor controller to run a DC motor. First, I tried a SyRen 25 in Simplified Serial mode. However, that yielded poor results. The motor turned in small pulses, rather than moving continuously. Next, I tried the R/C Input mode, using the PULSOUT command. The same problem occurred with that method.
So, I decided to purchase the HB-25 because it was made by Parallax so I figured it would yield improved results. Now, the motor will not even turn. I have the motor controller connected to pin 12 (where the servos normally connect) as I am using the PULSOUT command. I have also tried pin 13.
As suggested in other threads, I have turned on the the Stamp prior to giving power to the HB-25.
My program is as follows:
' {$STAMP BS2}
' {$PBASIC 2.0}
DO
PAUSE 20
PULSOUT 12, 200
LOOP
Thanks in advance for any assistance you can provide.
So, I decided to purchase the HB-25 because it was made by Parallax so I figured it would yield improved results. Now, the motor will not even turn. I have the motor controller connected to pin 12 (where the servos normally connect) as I am using the PULSOUT command. I have also tried pin 13.
As suggested in other threads, I have turned on the the Stamp prior to giving power to the HB-25.
My program is as follows:
' {$STAMP BS2}
' {$PBASIC 2.0}
DO
PAUSE 20
PULSOUT 12, 200
LOOP
Thanks in advance for any assistance you can provide.
Comments
Can you give more information about the motor?
I am currently trying to power a bilge pump motor, but I have also tried some small DC motors from RadioShack. With each of them I encounter the same problem.
I see from the HB-25 page, 6V is at the controller's lower voltage limit. If the battery has a low charge the voltage may have dropped below 6V. Also just because a battery shows one voltage with a DMM doesn't mean it has the same voltage when it's under load.
Sorry if I'm suggesting stuff you've already tried. I do not know what your experience level is.
Again, I don't know how much experience you have so I'll just say this anyway.
We see a lot of servo/motor problems here on the forum where the servo or motor just seems to pulse or jitter. Very frequently the problem ends up being the power supply. When the motor (or servo) first starts to move it draws a lot of current. If the power supply can't keep up with this current, the voltage will drop causing problems like resetting the microcontroller (either the BS2 or the uC used by the motor controller PCB).
So not only would it be helpful to know what the voltage of the battery is but also how much current it can supply. Many "wall wart" type supplies also have trouble providing enough current for motor and servos.
It's not guaranteed that his is a power supply problem but I think the odds are pretty high that it is.
If you check the timing of the PULSOUT on page 347 of the Basic Stamp syntax and Reference Manual
PULSOUT timing is 2us instead of 10us
A PULSOUT count of 200 with the BS2 should give a pulse of approx 400 Microseconds.
You may see a different result if you change the PULSOUT 12, 200 to something like PULSOUT 12, 900
That should give you a 1.8ms pulse, which I believe should drive the motor.
I hope this helps you.
Thanks!
It appears to me that each model of the Basic Stamp controllers were faster than the one before.
It's important in that you can select a controller that will have the speed and features you need without breaking the bank.
Of course your difficulty could also be power supply or circuit related also as others have mentioned.
Voltage drops, poor batteries and Miswired circuits have kept me scratching my head in the past and it's always one of these things I check
out when things seem to be getting whacky.