Shop OBEX P1 Docs P2 Docs Learn Events
Continious rotation servo rotates only one direction, regardless the pot setting — Parallax Forums

Continious rotation servo rotates only one direction, regardless the pot setting

CuriousOneCuriousOne Posts: 931
edited 2013-05-09 11:23 in General Discussion
Hello.

I built a basic stamp controlled pan/tilt/focus control system for my telescope. It uses two parallax standard continious rotation servos and worm gear drive, powered by dc motor. Whole device salvaged from car seat motorized adjustment. The schematics are as follows:

On the "main" device, there's 12V 5A switching power supply, which via 7805 IC delivers 5V to Basic Stamp 2P and LCD screen, 1602 type, which is used for position control. The 12V from "main" device goes to "telescope" end, where input voltage goes into DC/DC converter, which outputs stable 12V for dc motor supply. The DC/DC converter is used to compensate voltage drop accross the power cable. Same input voltage goes into 7806, which outputs 6V and is used for servo power supply. There's also a video balun, which gets signal from camera. I'm using standard CAT5E patchcord for operation. Everything was working just fine on the bench, problems started when I decided to move the "telescope" end outside, for real-life operation. I'm using 10ft patchcord of CAT5E cable in this case (at bench I've used maybe 2ft patchcord). The problem is, that with any power "glimpse", or DC motor control commands (I'm using the popular bridge driver IC from STMicroelectronics) servos jerk, and if I touch a wire that leads to control pin of servo, servo starts rotation counter-clockwise! assuming that was some interference to control line, I've soldered 10k resistor at "telescope" end to servo control line and GND. It does not help. Ok, replaced resistor with 1k one, that helped, but now servo rotates only counter-clockwise, regardless which PULSOUT value I feed to it. Playing with adjustment resistor also gave no result, it always rotates counter-clockwise. The circuit is done on PCB, every power line has 220uf electrolytic and 0.1uf ceramic capacitors near all major ICs, ground and power lines are wide, and when tracing PCB I did it in way to exclude stray currents.

What I can do?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-04-23 09:29
    CuriousOne wrote:
    ... The problem is, that with any power "glimpse", or DC motor control commands (I'm using the popular bridge driver IC from STMicroelectronics) servos jerk ...
    I do not get this sentence. What do you mean by "glimpse?" Also, what role does the DC motor controller IC play? (Servos do not need an external DC motor controller.)

    Perhaps attaching a schematic and code will help.

    -Phil
  • CuriousOneCuriousOne Posts: 931
    edited 2013-04-23 09:43
    "glimpse" means anything, say mobile phone calls, I switched on soldering gun and so on. Code and schematics will be attached tomorrow, don't have them here. DC motor controller drives the DC motor, which is used for panning. One servo does tilt, another one does focus.
  • xanaduxanadu Posts: 3,347
    edited 2013-04-23 19:34
    CuriousOne wrote: »
    ...Everything was working just fine on the bench, problems started when I decided to move the "telescope" end outside, for real-life operation. I'm using 10ft patchcord of CAT5E cable in this case (at bench I've used maybe 2ft patchcord)...

    Put a hole in your roof and leave it on the bench :)

    What's your pinouts on the Cat5e cable? For the balun that should be great especially at 10' but for power run something heavier. Hopefully you're not using it as a servo extension, the microcontroller is on the telescope right? Servo wires are less than a few feet?
  • ercoerco Posts: 20,256
    edited 2013-04-23 20:09
    Glimpse, or "glitch"?
  • CuriousOneCuriousOne Posts: 931
    edited 2013-04-23 21:08
    Anything that causes EM fields. even if mobile phone is in close proximity and there's incoming call, servos start to rotate.
  • RS_JimRS_Jim Posts: 1,764
    edited 2013-04-24 05:09
    If you bought your ten foot patch cable from Radio Shack, it is a crossover cable and won't work no matter what you try!
    Jim
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-04-24 07:40
    Silly question... did the ground connection to the servo get disconnected? <- you said that it worked on your bench, but now it only rotates in one direction. At a 20ms repeat rate required by the servo's, that's 50Hz ... with an unconnected ground, the 50/60Hz mains is "close enough" to trigger servos in a way that they would move in only one direction.
  • CuriousOneCuriousOne Posts: 931
    edited 2013-04-24 09:20
    bothservos.jpg

    No, ground does not get disconnected. But yes, electricity here is 50hz.

    I did further investigations today. Both servos use same twisted pair (different conductors) for control signal. I've disconnected one servo from cpu side and servo side, hooked both wires in paralel and connected in such way to left over servo. Still the same problem.

    Next, I thought maybe servos run out of juice, so hooked servos directly to 7805, which powers BS2P, but used long run for signal cable, same problem - if disconnected, rotates on touch and disregards commands.

    Next, I thought maybe power is OK, but problem is in control signal interference, so I left servos connected to power to 7806 as they should be and used short (half feet) cable to run the signal - strange problem. Servo does not jerks any more, but also does not responds to control - when I press a button, I hear it tries to do something, but does nothing. The power to servo applied at that moment is exactly 6V.

    Next, servo connected with 2ft cable to BS2P and 7805 - works just fine, no jitter, rotates both directions as commanded.

    So, there's something weird, and for workaround, I'm thinking about going RS-485, but still, power should be applied to servo end via same ethernet cable (PoE).

    Here's simplified schematics how things are hooked up.
    1024 x 639 - 143K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-04-24 12:02
    If you haven't already done so, try putting a large electrolytic cap across the servo's power leads at the servo end of the cable.

    -Phil
  • CuriousOneCuriousOne Posts: 931
    edited 2013-04-24 12:13
    Already tried, 1000uF 25V Rubycon. I even isolated capacitor and servo from other circuitry by additional schottky diode - no effect. It should be noted that it appears there's strong electromagnetic field in my room. I attached about 20cm free hanging wire to LED lead, and hold led in hand by another lead - it comes on!
  • xanaduxanadu Posts: 3,347
    edited 2013-04-24 12:17
    CuriousOne wrote: »
    Already tried, 1000uF 25V Rubycon. I even isolated capacitor and servo from other circuitry by additional schottky diode - no effect. It should be noted that it appears there's strong electromagnetic field in my room. I attached about 20cm free hanging wire to LED lead, and hold led in hand by another lead - it comes on!

    Call 1 (800) EXORCISM. Tell them I sent you they'll probably give you a couple bucks off.
  • CuriousOneCuriousOne Posts: 931
    edited 2013-04-24 12:32
    I filmed the LED light up video, being uploaded right now :) will post link shortly...
  • CuriousOneCuriousOne Posts: 931
    edited 2013-05-09 11:23
    If anyone interested, Ive fixed things, but it took quite long way.

    first, I switched to Rs-485 for control. This required rewrite of code and additional stamp on servo side. Second, I've replaced wires going to servo with shielded ones. Third, totally isolated dc dc converter is used for servo power supply, no other load connected to it. Things work just fine now even with 300 feet cable, bur budget is ...... :-)
Sign In or Register to comment.