Quote:
Originally Posted by apples000
... The problem is that the pid loop won't work if you're trying to control speed. With a positional PID loop, when the setpoint is reached, the pid loop will output a zero command to the motor. ...
|
No, that's not how PID works. If you set the constant for I (Integral) to an appropriate value, the PID output will be a good value to maintain the setpoint. A zero output is what would happen if you used a Proportional only control.
Controlling speed and position aren't really different, once you get your units of measurement and conversion factors (converting motor input to desired output) right. Position seems different because when the system reaches the setpoint, typically the output should go to zero. If you think of controlling position on an incline, then you still need a non-zero output when the system reaches the setpoint, so it's about the same.
Here are some good threads on PID control:
Robodox Guide to velocity control using PID
2012: Tuning the Jaguar's Speed Control PID Loop
Alternative to PID speed control