Quote:
Originally Posted by Tom Line
Ok, I made a couple edits to the original post in the hopes of preventing someone who stubles onto this thread to use the first, incorrect one.
Please double check my writing on the 'corrected' pseudocode.
|
You left out the "int" calculation
Code:
Correct pseudocode
Prop = (setpoint - measured_value) * Prop Gain
Der = (error - previous_error)/dt * Der Gain
Feed_Forward = Last_Output
Output = prop + int + Feed_Forward