Quote:
Originally Posted by Ether
Make sure you scale the feedforward appropriately and then clamp the result after you add it to the PID output.
|
Quote:
Originally Posted by mommazzboy
Can you expand on this some?
|
Yes, but first let me make a recommendation:
Seriously consider the approach Martin has described in his
earlier post in this thread. Really.
Quote:
|
We're setting the motor outputs in PWM, so the input to the VI needs to be between -1 and 1 inclusive, so we should make sure that the sum of the feedforward and the output of the PID never goes out of that range. Is that what you mean by "scale the feedforward appropriately"?
|
No. What I mean by "scale the feedforward appropriately" is that you must scale the feedforward so that adding it to the PID output makes sense.
If your PID setpoint is in rpm, and your PID output is +/-1, then it would not make sense to add the setpoint to the PID output without first scaling the setpoint. Adding 4000 (rpm) to the PID's +/-1 output would make the PID completely ineffective.
After you've added the feedforward to the output of the PID, you should then clamp that sum to whatever range the downstream code is expecting. In LabVIEW I think that's called "in range and coerce", or some such thing.