profbit
Posts: 45
Joined: Fri May 05, 2017 4:34 am

SG92R servo motor moves during power up.

Thu Mar 08, 2018 12:51 pm

Good day,
I'm in trouble everytime I power up my raspberry pi. My servo motor always moves because of the shock (i think). I've googled some sort of solutions which include adding resistor. I'm new with resistor, so I have here my set of questions:
1) is it true that resistor will fix my problem?
2) If yes, how many ohms do I need on resistor if using SG92R?
3) Where should I solder it? without considering the use of breadboard.

Thanks in advance!

User avatar
joan
Posts: 14658
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: SG92R Electrical Shock

Thu Mar 08, 2018 12:55 pm

I have no idea why a resistor would help in any way.

I presume at start up the servo takes interference on the control line to be a pulse and tries to move in response.

A capacitor between the control line and ground might help.

profbit
Posts: 45
Joined: Fri May 05, 2017 4:34 am

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 11:15 am

how do I add it?
can you link me a store page of recommended capacitor?
where should I solder/connect it?

PiGraham
Posts: 3705
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 11:58 am

profbit wrote:
Thu Mar 08, 2018 12:51 pm
Good day,
I'm in trouble everytime I power up my raspberry pi. My servo motor always moves because of the shock (i think).
I don't think it's unusual for servos to twitch at power on. Why does that matter to you?

profbit
Posts: 45
Joined: Fri May 05, 2017 4:34 am

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 12:14 pm

Good day,

thank you for your response. The reason is that I use servo as my lock a chest

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 12:33 pm

Most if not all servos twitch on power up its because you are supplying power to the control circuit in the servo but no PWM pulse to set a position, just a random high or low voltage pulse.

Some add on driver boards for the pi have an option to set a default position for the servo on power up because the driver board is able to control the servo without pi input.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

PiGraham
Posts: 3705
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 12:35 pm

profbit wrote:
Fri Mar 09, 2018 12:14 pm
Good day,

thank you for your response. The reason is that I use servo as my lock a chest
How much does it move?
Does it move only one way? What if you change the locked position to the other end of travel? Does the move then become to lock rather than unlock?

profbit
Posts: 45
Joined: Fri May 05, 2017 4:34 am

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 1:41 pm

pcmanbob wrote:
Fri Mar 09, 2018 12:33 pm
Most if not all servos twitch on power up its because you are supplying power to the control circuit in the servo but no PWM pulse to set a position, just a random high or low voltage pulse.

Some add on driver boards for the pi have an option to set a default position for the servo on power up because the driver board is able to control the servo without pi input.
Do you have any other options?

profbit
Posts: 45
Joined: Fri May 05, 2017 4:34 am

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 1:42 pm

PiGraham wrote:
Fri Mar 09, 2018 12:35 pm
profbit wrote:
Fri Mar 09, 2018 12:14 pm
Good day,

thank you for your response. The reason is that I use servo as my lock a chest
How much does it move?
Does it move only one way? What if you change the locked position to the other end of travel? Does the move then become to lock rather than unlock?
Yup it’s moving making it unlocked.

pcmanbob
Posts: 7937
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: SG92R servo motor moves during power up.

Fri Mar 09, 2018 1:44 pm

Another option is to control the power to your servo using another gpio and a 2N2222 transistor.

That way you can keep the transistor turned off until your program starts , then once you have started the PWM and set a default duty cycle you can power up the servo, with little movement but returning to the position set.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Troubleshooting”