Servo example did not response

Hello, I have trouble with the servo example on both C++ and Python. I connect a SG90 servo to pin 1, connect 5v power to pin 12 by a breadboard power supply module, then run the Servo example on Python but the servo does not response. I check the voltage on pins and it is 5v on each one, I also stop running arducopter. How can I fix this!
Thank you

Hi @vqh2308,

Could you post here the output you get after you run the example?

Does not look like you are plugged in to the signal pin. Looks like the lead that goes to the bread board is only plugged in to the low and middle pin which only power and ground

Hello Tatiana! Here is my result

Hello Barry, the 12 pin is my BEC plug in, which power my pins for pwm output, so I only need to plug in power and ground.

Ah yes I see now…

@vqh2308,

Is there any chance that something is wrong with the servo? Do you have another servo to test?

So I checked the ADC on Navio2, I saw this


A1 output is 18V, but when I used a multimeter to checked, the output on every pin is 5V. Is there anything wrong?

Hi @vqh2308,

Values you see in the ADC example output are correct. There’s an issue with showing A1 voltage in this example and we’re in process of fixing it.

So, at least it’s clear that the servo rail is supplied with power. Do you have an RC transmitter and receiver? You can connect the servo to one of the receiver channels and check if moving the transmitter sticks affects servo’s position. Just to check whether this servo works or not.

I already tried my servo with a receiver and transmitter and it worked fine. When I use navio to control ESC and motor through mission planner, it works. May be I will try it with another kind of servo other than sg90 to see if it work.

@vqh2308,

This servo should work too.
Haven’t you changed anything in the example code?
The servo is connected to the first PWM output, isn’t it?

Yeah, the pin right next to ppm pin, and I did not change anything in example code

@vqh2308,

Could you please try powering the servo rail from the UART port and test the servo example once more?

You can connect wires as shown on the picture in this comment:

It does not work, the servo is not moving. When I try the servo with arduino uno, it works normally. I think maybe there is something wrong with the period or pulse width range.

Oh yeah, the problem is not from my navio2 board, it is the servo. When I changed the example to
while (True):
pwm.set_duty_cycle(SERVO_MIN)
# time.sleep(1)
# pwm.set_duty_cycle(SERVO_MAX)
# time.sleep(1)
The servo did work. I figured out that some sg90 servo have errors that it does not response to loop command, it can only move to a specify angle. Therefore, I will use other servos to try on.
Anyway, thanks for considering my questions again!

1 Like

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