How to use PID in a servo motor

I have two servos and I want to controll their speed, I want to make them equal
Plz I need an answer urgently and an example plz

Try typing into Google 'how to control servo motor speed with arduino'.
First result details how to use the VarSpeedServo library, which appears pretty easy to use.

Plz I need an answer urgently and an example plz

First, I don't like it when people say "urgent" because it seems to suggest that you are more important than other people who are asking questions.

Second, the Forum is not for providing details and an example. If you have some code that is not working the way you want and you post your program we will certainly try to help.

What do you mean by "servo"? Do you mean a hobby servo such as is used to control flying model airplanes? OR, do you mean an industrial servo that does much the same job as a stepper motor.

What is the project you are trying to create? It is much easier to help when we understand the context of your question. Perhaps if I knew what your project is your need for PID would be more obvious.

If you are trying to make a robot move in a straight line by carefully matching the speeds of two motors I reckon you will be disappointed, even if you do get the speeds matched.


Continuous rotation servo, or normal servo (moving to a certain angle)?

If the first: encoder or other speedometer + PID library.
If the second: make them move in steps, so not in one go from 0 to 180, but in 180 steps, and provide steps slower than the slowest of the two can move.

It seems not to have been urgent after all. :slight_smile: