Servomotor: Can not maintain a position

Hello, I bought servo motors, GS-9025MG.
And I have a problem, when I ask the servo to go to an angle, he does not maintain it.
Let me explain, if I say for example servo.write (60); the servo will go back and forth between angle 0 and 60 without stopping.
The result is the same when I use the writeMicroseconds function, the servo will go back and forth between 0 and the angle corresponding to the angle in microseconds.
I have four servos of this model and all four have the same result, while I have several other models of servos that work very well.
I tested to feed them on an external power supply also always without result.
Something must have escaped me but I do not see what.
Here is the engine datasheet: https://datasheet.octopart.com/SER0011-DFRobot-datasheet-108057571.pdf
In case, I’m on an Arduino Mega 2560.
thank you in advance

Hi @McFly613 and welcome to the forum!

Can you post complete Arduino code? Which servo models that you have a working fine?

#include <Servo.h> 

Servo pouceGauche;

void setup() {

pouceGauche.attach(44);

}

void loop() {

pouceGauche.write(60);
delay(2000);
pouceGauche.write(120);
delay(2000);

}

And the models that work well are numerous:
HS-422 Hitec
HS-805BB Hitec
HS-225MG
HS-645MG

Hmmmm strange!

@geraldinebc15 do you maybe have a hint what could it be?

@igor_X is the GS-9025MG a continuous rotation servo? If so, the write command is speed not position.

Arduino write()

Hey @bmoscato, I also saw that explanation from Arduino.

I think GS-9025MG is a standard servo.

Aslo, as @McFly613 explained, motor goes correctly to position which is set by write function, but also returns to starting position. If it is a continues rotation servo, than it would rotate in different speeds.

1 Like

@McFly613 Can you confirm with the same code that the other servos work? Can you try the English version of the servo library?

I confirm that it is standard servo.
The problem I mentioned is what happens when he “receives” again.
Most of the time, he is content to have random movements very jerky.

I confirm that with the same code, the other models of servos work.
I even try to plug on the same pin servo GS-9025MG (the one that does anything) and a servo that works (HS-422 Hitec)
Result on 422, he works well and goes to the requested angles and the other continues to make random and jerky movements.
And I did not know there were several servo library origin.
I already try to update or uninstall / install the library without result.
After I doubt that the problem comes from there because the other servos work very well with the one I have.

All signs point to something defective in the servo’s electronics. Can you contact your point of sale for a final option and possibly an exchange?

I hoped I could find a solution. I will make an exchange or refund I think.
But it’s still a lot that the 4 servo of this same model is the same failure.

It certainly does seem odd. Note that the current requirements are quite high for the servo (1A at 6V no load). Is there a chance it’s browning out and your power source cannot provide enough current? Under load, it will consume even more. Its a power hungry little servo.
http://www.goteckrc.com/Download/GS-9025MG.pdf

1 Like

I tested several power always without result. I’ll try again tonight

@McFly613 are you testing with only 1 servo connected?

Of course, most of my tests, I did with a single servo connected.

1 Like

Hi there @McFly613

If 4 units of the same model have the same problem it probably means that the issue isn’t a defect in the servos and as the code works for other servos it leads me to believe the problem is in the setup. As @cbenson suggested the issue could be the power requirements. If the servo is powered from the Arduino when there is overcurrent it may reset the board and re-attach() the servo. To see if the board is resetting, add these lines in setup() then open the monitor and see if the sketch is restarting.

Serial.begin(9600);
Serial.println(“TEST”);
pouceGauche.attach(44);

You should only see “TEST” once, if you see it many times then you know what the problem is. If that’s the case I suggest reading these guides


I just re-read the original post in case I missed something and you actually mentioned you also tried an external power supply so maybe the problem isn’t what I previously mentioned but I guess it’s worth a try.

The other thing I noticed is that the datasheet says:

Operation Travel 60°±10°

But you are trying to reach 120°, that may cause an error. Could you try setting lower angles and see if that works? Maybe 30° and 60° and let us know how it goes.

3 Likes

Hi @geraldinebc15, I had this idea too, but to my surprise the arduino does not restart. In any case, the message in the setup (); don’t come back.
And for “Operation Travel 60 ° ± 10 °”, I saw, but at any angle the servo makes random movements.
I made a loop “for” which added a degree of angle to each loop. Starting from 0 to 180, no results.

And @cbenson, I tried again with a new power this time in 6V and with enough amps.
Unfortunately no results, I really believed in your idea because I did not really pay attention to the intensity of my batteries.

We don’t sell the servo to be able to test it… at a bit of a loss.

Hmm that is really strange

The only other thing I can think of is that there is an issue with the setup. You don’t happen to be using a solderless breadboard, do you? Breadboards are commonly rated for 1A@5V or any other combination that produces a power dissipation of 5W, also due to the temporary nature of the contacts, most breadboards have a current limit of 1A or less. So in your case (1A@6V) it would be best not to use one.

When I tested in 6V, I plugged directly I did not go through a breadboard …
Thank you very much for your time and your help, but I confess myself defeated.
I think I will make a refund.

I see, well then good luck with that.

I hope you are able to continue with your project soon :smile: