That's what the example does, but the PID routine itself can be used for MANY different things.
In Henrik's example, it's controlling "Position". But if the numbers presented to the PID are representative of the Speed, then it will adjust the output until the Speed is matched.
It doesn't really matter what it is, temperature, humidity, speed, acceleration ...
If you can read it, then you can make a "Setpoint" within that range.
The PID loop adjusts the output until the "Reading" and the "Setpoint" are the same.
It does it in a way that is as fast as possible while minimizing overshoot and rejecting spurious influences as much as it can.
All you need to do, is find a way to read the speed of the motor, and a way to control the speed of the motor, which I think you already have.
<br>
Bookmarks