PID controlled Servo's

Tags: #<Tag:0x00007fe222ebb318>


I am working on a servo based robotic arm. Right now i am just using the servo library to set the angle of the arm. However, i was wondering if i used PID to control the movement of the arm it would give a more “natural” movement to it? If yes, which PID library is best suited for this task?


The library contains this which you could try?


A servo automatically moves to the set angle (as determined by its PWM signal) as quickly as the hardware allows. There’s no reason you need to set it to the destination angle in one step, however. You can pick intermediate steps, for example making them have smaller angle deltas (slower) at the start and end positions, and large angle deltas (faster) in the middle, which would probably look more natural.


Yeah this is what i am trying to do.

Would you suggest I can achieve this via PID control, or is there anything else more suited for something like this?


If you’re rolling your own servo controller then pid all the way. A hobby servo would already have this control built in. Here’s a nice one with diagrams.