I want to control a "Servo motor analoog Micro Servo 9g SG90 360°/continous rotation" with a python script. I do understand the control of a 180° servo but somehow the 360° is not reacting the same.

I want to use the servo to turn like a dial of a clockwork, in this case the dial will show the current moonphase.

So I need the Servo to turn to a specific angle or turn a specific angle. I save the angle in a file after it has turned so I can calculate the difference in current and desired angle is and use that difference to calculate the duty.

But i really dont understand how I can calculate the duty to turn 1°. I got my PWM set on 50Hz.

Can anyone explain me how I can achieve my goal?

*edit: Servo information:

No-load speed: 0.12 seconds / 60 degrees (4,8V)

Stall torque: 1,2 - 1,4 kg / cm (4,8V)

Dead-set: 7 microseconds

PWM-value 185 causes motor to stop.

PWM-value 175 causes motor to turn CW

PWM-value 195 causes motor to turn CCW

PWM-value 62 causes motor to stop because of to low input.

  • add feedback to the servo, so that you can determine its position
    – jsotola
    Jul 8 at 15:55
  • downvoting because it is a question about a servo, not a question about Raspberry Pi
    – jsotola
    Jul 8 at 15:57

1 Answer 1


You can not do this with a continuous rotation servo.

With a standard servo you specify an angle - the servo stops when it reaches that angle. With a continuous rotation servo you specify a speed of rotation - the servo keeps spinning at that speed until you tell it to stop or specify another speed.

You need to buy a standard servo and use gearing to extend the range of movement or use a stepper motor instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.