PID Controller.
More...
|
| def | __init__ (self, P=0.2, I=0.0, D=0.0, current_time=None) |
| |
| def | clear (self) |
| | Clears PID computations and coefficients.
|
| |
| def | update (self, feedback_value, current_time=None) |
| | Calculates PID value for given reference feedback
|
| |
| def | setKp (self, proportional_gain) |
| | Determines how aggressively the PID reacts to the current error with setting Proportional Gain.
|
| |
| def | setKi (self, integral_gain) |
| | Determines how aggressively the PID reacts to the current error with setting Integral Gain.
|
| |
| def | setKd (self, derivative_gain) |
| | Determines how aggressively the PID reacts to the current error with setting Derivative Gain.
|
| |
| def | setWindup (self, windup) |
| | Integral windup, also known as integrator windup or reset windup, refers to the situation in a PID feedback controller where a large change in setpoint occurs (say a positive change) and the integral terms accumulates a significant error during the rise (windup), thus overshooting and continuing to increase as this accumulated error is unwound (offset by errors in the other direction).
|
| |
| def | setSampleTime (self, sample_time) |
| | PID that should be updated at a regular interval.
|
| |
◆ __init__()
| def SimScripts.PID.PID.__init__ |
( |
|
self, |
|
|
|
P = 0.2, |
|
|
|
I = 0.0, |
|
|
|
D = 0.0, |
|
|
|
current_time = None |
|
) |
| |
◆ clear()
| def SimScripts.PID.PID.clear |
( |
|
self | ) |
|
Clears PID computations and coefficients.
◆ setKd()
| def SimScripts.PID.PID.setKd |
( |
|
self, |
|
|
|
derivative_gain |
|
) |
| |
Determines how aggressively the PID reacts to the current error with setting Derivative Gain.
◆ setKi()
| def SimScripts.PID.PID.setKi |
( |
|
self, |
|
|
|
integral_gain |
|
) |
| |
Determines how aggressively the PID reacts to the current error with setting Integral Gain.
◆ setKp()
| def SimScripts.PID.PID.setKp |
( |
|
self, |
|
|
|
proportional_gain |
|
) |
| |
Determines how aggressively the PID reacts to the current error with setting Proportional Gain.
◆ setSampleTime()
| def SimScripts.PID.PID.setSampleTime |
( |
|
self, |
|
|
|
sample_time |
|
) |
| |
PID that should be updated at a regular interval.
Based on a pre-determined sampe time, the PID decides if it should compute or return immediately.
◆ setWindup()
| def SimScripts.PID.PID.setWindup |
( |
|
self, |
|
|
|
windup |
|
) |
| |
Integral windup, also known as integrator windup or reset windup, refers to the situation in a PID feedback controller where a large change in setpoint occurs (say a positive change) and the integral terms accumulates a significant error during the rise (windup), thus overshooting and continuing to increase as this accumulated error is unwound (offset by errors in the other direction).
The specific problem is the excess overshooting.
◆ update()
| def SimScripts.PID.PID.update |
( |
|
self, |
|
|
|
feedback_value, |
|
|
|
current_time = None |
|
) |
| |
Calculates PID value for given reference feedback
. math:: u(t) = K_p e(t) + K_i \int_{0}^{t} e(t)dt + K_d {de}/{dt} .. figure:: images/pid_1.png :align: center Test PID with Kp=1.2, Ki=1, Kd=0.001 (test_pid.py)
◆ current_time
| SimScripts.PID.PID.current_time |
◆ DTerm
◆ int_error
| SimScripts.PID.PID.int_error |
◆ ITerm
◆ Kd
◆ Ki
◆ Kp
◆ last_error
| SimScripts.PID.PID.last_error |
◆ last_time
| SimScripts.PID.PID.last_time |
◆ output
| SimScripts.PID.PID.output |
◆ PTerm
◆ sample_time
| SimScripts.PID.PID.sample_time |
◆ SetPoint
| SimScripts.PID.PID.SetPoint |
◆ windup_guard
| SimScripts.PID.PID.windup_guard |
The documentation for this class was generated from the following file:
- lsvsim/simulationscripts/simScripts/src/hlcc/SimScripts/PID.py