0

I have Feetech FS5323M servo, with Sweep example code from Arduino site, it works fine, it rotates from 0 to 180 degree and back as expected.

The problem comes when I try to set servo position. I've added a simple servo.write(90); in setup, to reset servo position, but it didn't work (writeMicroseconds(1500); also failed).

After digging a little bit, I've discovered that I can rotate the servo only by a couple of degrees from its current physical position.

If the servo is at 140 degrees, I can move it back and forth only up to 7 degrees, value bigger than this will result in servo staying at its current position. So if I want to move it to 180 degrees I have to make a loop and go to this position in steps of 1-7 degrees (with delay = 15 * degree).

I attached external 2A power to the circuit and connected the grounds. It didn't solve the problem. The circuit is very simple, just servo connected to pin 3, without anything else. I also tried to add a 300uF capacitor between power and ground.

Edit 1: I've tested pin 9 and 10 and the same happens. Sadly I have no way to test it on any other board because I have only one, same goes for the servo. I uploaded sweep example with the step size of 10, the servo didn't move or even twitched. I tried it both with a delay of 15 as well as 150.

Edit 2: I've tested the program with only one servo.write(90); statement, but the issue hasn't been resolved. I tried it in setup and later in loop, in both programs there was only one write statement.

  • Quite interesting, does it happen on multiple Arduino boards (or other pins?) and does it happen on other servo's (of same and different type) as well? – Paul Nov 10 '18 at 18:53
  • start with the sweep example ..... modify the step size to 10 and upload the new code ..... does it still fail? – jsotola Nov 10 '18 at 20:22
0

The problem comes when I try to set servo position. I've added a simple servo.write(90); in setup, to reset servo position, but it didn't work

Understand that the method "setup()" in the Arduino paradigm is only run once after power up or reset. Any code in "setup()" which positions the servo will immediately get over written by the code that positions the servo in the "loop()" method. Likely this happens so quickly that the servo will not even react to the line "servo.write(90);".

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.