Back and forth servo modification for remote cars

I have the servo driver from the sg90 that I own. How do I change the rotation of the servo so that it can go forward and backward without stopping to use it as a mini remote car and what is the code?

It sounds like you want to turn a conventional servo into what is known as a "continuous rotation servo" which is not really a servo at all

If so then Google is your friend Convert Servo To Continuous Rotation Servo

As to the code, start by trying the Sweep example to see how the value written to the converted servo controls its speed and direction but not its position

Briefly: If you use the Servo.h library with a 360 degree servo, the value servo.write(90); will be close to the 360 degree servo "stop" position - you will need to try "angle" values greater than and less than 90 (degrees) for the just-right "stop" position (for the 360 degree servo). The closer the "angle" is to "0 degrees", the greater the counter-clockwise movement of the 360 degree servo. The closer the "angle" is to "180 degrees", the greater the clockwise movement of the 360 degree servo.

You need to strip the potentiometer out of the servo and just connect to the motor ( take the PCB out? ) . You then have a geared motor you can drive forward and backwards .

No. The wires to the potentiometer should instead be connected to a voltage divider as if the pot were centered.

Use a matched set that adds up to about the pot's value, like two 4K7 for a 10K pot.

Better: use a pot of the same value wired where the servo pot was, and use it to tune the servo so that 90 is as close to stopped as it can be made.

Whatever else is in the servo electronics-wise must remain to receive the control signal and drive the motor to reduce the error.

Which won't reduce, because there's no feed back pot, so anything not 90 will drive the servo at a speed one way or the other forever.

a7

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.