Stability driving servos

With a username like mine I probably should not even mention servo stability, but here's a question;
I want to control a servo for a model railroad turnout, and would like to hear what you do, there should be
a number of such applications in use. I know servos produce noise, and need decoupling, and will try that,
but so far I have only tried breadboarding experiments, and that's what bugs me a little bit.
First I made a basic program using servo and servopos, and 08M2, that works fine, but on applying power the servo jerks
a couple of millimeters. No big deal, but this could damage a turnout. Then I found another code, with "bit banging",
written to make servos stable and precise (well done Hippy). This worked as described, very exact movement.

Now to my questions, both sets of code have the jerk on powerup, any suggestions about that ?
I think this doesn't look like noise from the servo ?
Also, the download circuit uses 22 kohm in series, plus 10 kohm to ground, but the recommended basic servocircuit use 100 kohm to gnd, and the servo pin
connected through a resistor, which I haven't used. Could that affect the chip ? I did "lose" the servo a couple of times....
Sorry about the long story.
/Peter
 

papaof2

Senior Member
It seems that many servos do that. One solution is to send the servo to the desired start up position before turning off the device and to power up the device by first powering the electronics and have them sending the desired servo position before you power the servo.

It's not a PICAXE problem, as there is a similar discussion on another chip forum:
 
It seems that many servos do that. One solution is to send the servo to the desired start up position before turning off the device and to power up the device by first powering the electronics and have them sending the desired servo position before you power the servo.

It's not a PICAXE problem, as there is a similar discussion on another chip forum:
Thanks,
Makes perfectly sense, when you think a little beyond the breadboard. Should be easy too to add a mosfet or relay and code for it a little bit
down the program. Will definitely try this, and noise suppression.
/Peter
 

hippy

Technical Support
Staff member
It's not a PICAXE problem, as there is a similar discussion on another chip forum:
It's a PITA when it happens. It may be worth setting the servo control pin high or low as soon as one can when the PICAXE starts, perhaps issuing a short pulse to force its to where it's wanted. But if it is determined to kick on power-up there may be little option but to look towards servos which don't or keep it powered off until there is a stream of servo pulses being emitted.
 
It seems that many servos do that. One solution is to send the servo to the desired start up position before turning off the device and to power up the device by first powering the electronics and have them sending the desired servo position before you power the servo.

It's not a PICAXE problem, as there is a similar discussion on another chip forum:
Thank you, I have ordered a MOSFet to test delaying servopower. /Peter
 
It's a PITA when it happens. It may be worth setting the servo control pin high or low as soon as one can when the PICAXE starts, perhaps issuing a short pulse to force its to where it's wanted. But if it is determined to kick on power-up there may be little option but to look towards servos which don't or keep it powered off until there is a stream of servo pulses being emitted.
Agree, but those fairly simple SG90 servos have their issues. I have ordered a mosfet to try delaying servopower, and will also add caps on power supply lines. Incidentally I already have an Arduino board, controlling 4 servos, and that works just about the same way.
So, will see what can be done
/Peter
 

erco

Senior Member
Before powering down, park the servo at the extreme limit in the direction of motion at powerup so it can't move any further.

Different servos move in different directions on powerup, you may have to switch brands if you need one particular endpoint.
 
Top