stopping servo motors
perry.gnoid
Posts: 10
hi all -
I'm using a continuous rotation servo that I'm attempting to position into 3 places - essentially the cw and ccw extremes plus a "middle". once the motor reaches a position, i was hoping to send a "stall" pw (essentially set to 750) to make the motors stop and hold their place. this works for awhile, but soon the motors refuse to stop and begin to slowly turn.
it is not practical for me to continue adjusting the potentiometer, so is there another way to "kill" the motor so it stops hearing any pw commands for a pause?
thanks for your help
I'm using a continuous rotation servo that I'm attempting to position into 3 places - essentially the cw and ccw extremes plus a "middle". once the motor reaches a position, i was hoping to send a "stall" pw (essentially set to 750) to make the motors stop and hold their place. this works for awhile, but soon the motors refuse to stop and begin to slowly turn.
it is not practical for me to continue adjusting the potentiometer, so is there another way to "kill" the motor so it stops hearing any pw commands for a pause?
thanks for your help
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Phil
for example, what i want is to rotate ccw to a position and once there hold that spot unitl the motor receives another message to move someplace else. i'm getting it to stop by setting the pw value to, my cutoff of 750. like this:
pw = 1500
SEROUT sDat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 7, pw. LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
pw = 750
SEROUT sDat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 0, pw. LOWBYTE, pw.HIGHBYTE, CR]
this works for awhile, but after several movements, the holding frequency does't work - allowing the motor to slowly rotate and therefore completely messing with the idea of trying to position with some amount of accuracy.
i'm also trying to use 64 motors (yikes!!) for this project, so steppers are out of the question for me.
If you turn off the servo pulses entirely, the servo will shut down so that the motor and the control circuitry is off. The geartrain adds enough friction so that, if there's not much load, it might not slip. The load would have to be pretty light.
-Phil
I thought of an optical encoder, with simple DC motor but not enough pins. Pretending an extravagant budget, what was the suggestion that you were thinking Mike?
I would like to try the suggestion of stopping the pulse signals, but I've banged my head against the wall so many times today that I can't figure out how to do this! - Suggestions? I tried to simply reverse the pin direction (in my case pin 15 is connected to the servo control board) and napping to no avail. I'm definitely missing something...
thanks everyone
Many R/C servo manufacturers produce a winch servo which may do exactly what you want. As I remember there are 3.5 rotations of the servo horn from "lock" to "lock".
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1) For stopping the servo pulses, I was thinking of trying two options, setting the servo pulse time to zero with the !SC command and setting the servo pulse time longer than the repetition rate (of roughly 20ms). This would use an !SC value of greater than 10000. I'm not sure how the PSC would respond to these values. I would expect the servo to stop responding to pulses much narrower than about 500us, so !SC values on the order of 0-10 should not activate the servo.
2) When I mentioned a limited number of positions, I was thinking of using a little "flag" and IR interrupter with an IR emitter on one side and an IR detector on the other. The flag would interrupt the IR beam and the rising edge of the pulse can give a pretty good position indicator. Two or three sensors can give you position limits and maybe a mid-point can give you reference points for recalibration. A serial input shift register like the 74HC195 can give you 8 inputs per device with only three I/O pins needed and is cascadable. You could also use an I2C I/O expander with only two I/O pins, particularly if you're using a Stamp with the built-in I2C commands.
I tried sending the upper and lower extreme values - what appears to happen is that the psc ignores them - and moves to the next direction if there is one, or simply continues to rotate endlessly in that same direction.
I also tried fooling it by having it look on an empty pin in the fpin construct - after the timeout, moving back to a subroutine for the next position. this seemed to work for a bit, but again after some time, the motor starts to slowly crank again.
the motor's you suggested are certainly nice, though fairly expensive, especially for 64 of them.
take care
When you say the extreme values, do you mean 500 and 1000? You cannot exceed these values from the PSC. Putting in a higher/lower number might result in unpredictable behavior.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I do mean those values - unless I completely misunderstood mike's suggestions (likely possible), i was hoping to "confuse" the psc to stop sending pulses.
with serout to the psc, what other arguments can get passed to the motor that could stop the transmission of pwm? could the pin get set temporarilly to an incoming/listening state?
I attempted using a timeout by listening to an empty pin (shot in the dark). Here's test code that attempts to rotate one direction, hold for a pause and then rotate in the opposite.
' {$STAMP BS2PX]
' {PBASIC 2.5]
Sdat CON 15
Baud CON 1646
Start:
pw=1300
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
pw=750
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 100
SEROUT Sdat\0, Baud+$8000, 2000, Right, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
Right:
pw=250
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
pw=750
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 100
SEROUT Sdat\0, Baud+$8000, 2000, Start, [noparse][[/noparse]"!SC", 15, 7, pw.LOWBYTE, pw.HIGHBYTE, CR]
thanks
p
I haven’t tested your output to see what effect it has on the PSC, but the 1300 and 250 are out of range as far as I know. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support