Shop OBEX P1 Docs P2 Docs Learn Events
Servo Double Hacking Fix — Parallax Forums

Servo Double Hacking Fix

ercoerco Posts: 20,256
edited 2011-08-09 18:53 in Robotics
I just made an interesting discovery working on my new robot Woodrow. I hacked up some 1/4 scale analog servos to make them continuous rotation (CR) for my drive motors. Anyone who has a BoeBot or other CR servo bot knows that CR servos never stay nulled for very long. You always have to tweak the pot to get them to stop at a 1.5 ms pulsewidth. Then something changes: temp, humidity, wind direction, sunspots, you name it, and the servo ain't nulled no mo'. Quite frustrating at a minimum when your robot slowly creeps in random directions when it should be stopped. And a real dealbreaker for odometry/dead reckoning, which is what I'm after here. I need the robot to STOP when I say stop.

I wired the 5V, 20 mA coil of one of my favorite Aromat ultrasensitive relays in parallel with the servo control wire. The servo still works properly, and the relay can't fire over the range of servo pulsouts since the duty cycle is so low, essentially. But I can fire the relay using high/low commands on the servo line instead of pulsouts. So... I plan to hack into the servos again. This will wire the DPDT relay contacts to the servo motor leads, for a choice of normal servo operation or disconnected from the servo electronics and dynamically braked. So to stop, instead of pulsout 7,750 I'll just use high 7. Instant braking, no creep, without using any extra IO pins.

I'm fat dumb & happy unless/until Gordon or Mike comes along and tells me that I'll burn up my servos feeding them a constant 5V signal instead of pulses. I've tested them for ~30 minutes continuously and all's well so far.

Comments

  • RonPRonP Posts: 384
    edited 2011-08-09 00:53
    erco,

    Now that's thinking outside the box sounds like a good fix, until. Just have to wait and see.

    Ron
  • Spiral_72Spiral_72 Posts: 791
    edited 2011-08-09 07:56
    That's a weird and great idea! which leads to something I'd like to try in addition to this :)

    If you pulseout to the servo, insert a SPDT relay inline, the signal through one relay contact to the signal line of the servo. The signal also goes to the coil via 555 250ms off delay. +5V is wired to the servo power through the second relay contact.

    SO if you want the servo to stop, you don't pulseout anything... If you wanna move the servo, you pulseout, the servo gets the signal and +5V through the off delay of the 555,

    Hmmm, you'd lose your brake function though wouldn't you??



    Oh well, your idea is better and less complicated I think :)
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-08-09 08:21
    With an analog servo you can simply stop sending it pulses, and it will no longer turn. That's easy to do with the BS2, but some controllers (like the Scott Edwards SSC) don't have a provision for this.

    I'm unclear as to whether you depower the motors with the relay or what. Some brands (not Futaba, at least the recent ones) will burn out if you apply 5V to the signal line when the power line is at ground.

    Putting 5V on the signal line, rather than removing the pulses, should work, as long as the servo remains powered.

    If you hack into the leads of the motor in the servo then the above doesn't matter, but then if I went to that trouble, I'd probably get a cheap serial-controlled H-bridge and not use the servo electronics at all.

    -- Gordon
  • ercoerco Posts: 20,256
    edited 2011-08-09 08:37
    Ultimately I want coasting and braking (shorting the leads together), so I will also use the "stop sending pulses" method to coast. But for braking, the DPDT relay will disconnect the motor from the servo connections and short the motor leads together.

    @Gordon: Sure I could use an H-bridge, but I'm a happy hacker!
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-08-09 16:46
    I always marvel at these systems where the motor can stop on a dime. Some years back, when I worked for some post production outfits in Hollywood, I designed a contraption for controlling the wind motors for going through a reel of 35mm motion picture film, and stop at predefined frames. It used an encoder to keep track of the frame count, and had to intelligently adjust for speed and torque based on how much film was being transferring from the supply reel to the take up reel. It's no fun trying to stop a motor with a full reel of film (which is about 2000 feet) in tug, and know how much braking is needed. This stuff isn't light, and while polyester-based film doesn't snap off easily, it scratches if you try to brake things too quickly, and the film slides against itself. Film companies get naturally upset when they deliver to you $1,500+ worth of new film only to get it back scratched.

    In the end the math was burdensome, so I slowed it down overall, and moved to the target points with longer deacceleration times. It worked, but I've always thought it could be much better with a modern MCU and motor driver. And someone who is better at math than I am!

    -- Gordon
  • Martin_HMartin_H Posts: 4,051
    edited 2011-08-09 18:16
    Neat idea. I take it the video in the worm gear thread was this system in action?
  • ercoerco Posts: 20,256
    edited 2011-08-09 18:53
    @Martin_H: Sort of. That's the rig I'm working on now, Woodrow. All I've done so far is verify that I can control the relay and servo over the same line. But that video did not have the relay installed for dynamic braking yet; I just made the video 'cuz I was pleasantly surprised that that other processor's Schmitt trigger inputs worked perfectly well with my homemade encoder sensor, just an IR LED & phototransistor. My favorite Hamamatsu P5587 encoder sensors are unobtainium now, I'm forced to find new hardware!
Sign In or Register to comment.