Shop OBEX P1 Docs P2 Docs Learn Events
stopping servo motors — Parallax Forums

stopping servo motors

perry.gnoidperry.gnoid Posts: 10
edited 2007-09-17 21:15 in BASIC Stamp
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

Comments

  • D FaustD Faust Posts: 608
    edited 2007-09-15 21:22
    You could cut it off from power.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-15 21:24
    Why are you using a continuous-rotation servo for this? It sould seem that, since your objective is positioning rather than continuous motion, a normal servo would be the better choice.

    -Phil
  • perry.gnoidperry.gnoid Posts: 10
    edited 2007-09-15 22:18
    I'm trying to generate 12" of linear movement, both forward and backward, with a winch system so i'm using the continuous because i need to generate even more than 180º rotation to accomplish the length, even with a 3" spool.

    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-15 23:19
    Servos, whether standard or continuous motion, are just not suitable for the sort of control you're hoping for. They were designed for R/C use where there's mostly eye-hand coordination type feedback. The standard servos are pretty good at repeated repositioning, but the continuous motion servos are created by disabling the feedback mechanism, thus weakening the control accuracy. There's not much you can do to improve this without increasing your expense significantly. If you have a limited number of positions involved, you could make your own position sensor and do the feedback yourself, but the Stamp is not likely going to be able to handle the number of motors involved and the servo controller is simply not designed for doing the feedback control itself.

    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-15 23:21
    If the load on your spool is minuscule, you can just stop sending pulses. In point of fact, the holding torque of a continuous servo not being pulsed isn't that much less than one being pulsed at 1.5mS, coming mainly from internal gear friction. But if your load is that small, why not just go to an eight-inch spool and use a normal servo? Your holding torque will be much greater and the repeatability much more reliable. If an eight-inch spool is out of the question, a four-inch spool in the attached configuration would also work.

    -Phil
    277 x 400 - 8K
  • perry.gnoidperry.gnoid Posts: 10
    edited 2007-09-16 00:45
    i am lucky in that there really isn't much of a load as i'm trying to generate horizontal linear motion - essential a drawer mechanism. i have the winch/motor central with wire rope attached to the front and back - rotation just pulls.

    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
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-09-17 07:37
    Perry -

    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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-17 13:45
    perry.gnoid,
    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.
  • skylightskylight Posts: 1,915
    edited 2007-09-17 13:46
    you must be able to get non drift accurate servos as used for gobo positioning in moving lights etc are they prohibitively·expensive?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-17 14:03
    I just Googled "winch servos" and the HiTec HS785-HB will give you 3-4 turns with a spool circumference of 3.75". That'll give you a 12" linear travel all with regular servo control.
  • perry.gnoidperry.gnoid Posts: 10
    edited 2007-09-17 18:13
    thanks mike for your suggestions:
    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-17 18:24
    Perry,

    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
  • perry.gnoidperry.gnoid Posts: 10
    edited 2007-09-17 20:21
    Hi Chris-
    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-17 21:15
    Perry,

    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
Sign In or Register to comment.