|
ME 405 Romi
|
This file contains a class to create a PID Controller object. More...
Public Member Functions | |
| __init__ (self, K_p, K_i, K_d, err_sat, eff_sat) | |
Public Attributes | |
| K_p = K_p | |
| K_i = K_i | |
| K_d = K_d | |
| int | summed_errors = 0 |
| int | reference = 0 |
| err_sat = err_sat | |
| effort_saturation = eff_sat | |
This file contains a class to create a PID Controller object.
These objects are always initialized as PID controllers but can be ran as any combination of P, I, and D controllers. They are to be treated as classical controls single input, single output controllers.
The controller object has gains that are given to it on initialization. The object holds a set point and will use classical control theory of errors from the setpoint for return values when asking for control. The object also handles saturating the integral error sum and the output effort as set on initialization.
The Controller class is a classical PID controller that implements single input, single output control when called to. The user gives it gains and setpoints and calls the control function for efforts.
init is the Controller object initializer which takes 5 arguments. The arguments the gains and saturation points of the classical controller.
| K_p | : K_p is the proportional gain. |
| K_i | : K_i is the integral gain. |
| K_d | K_d is the derivative gain, but it is not implemented as it was not used in the project. |
| err_sat | : err_sat is the saturation point for the integral of the error to stop I control from becoming unstable. |
| eff_sat | : eff_sat is the saturation point for the output effort. |
Definition at line 19 of file controller.py.
| controller.Controller.__init__ | ( | self, | |
| K_p, | |||
| K_i, | |||
| K_d, | |||
| err_sat, | |||
| eff_sat ) |
Definition at line 21 of file controller.py.
| controller.Controller.effort_saturation = eff_sat |
Definition at line 28 of file controller.py.
| controller.Controller.err_sat = err_sat |
Definition at line 27 of file controller.py.
| controller.Controller.K_d = K_d |
Definition at line 24 of file controller.py.
| controller.Controller.K_i = K_i |
Definition at line 23 of file controller.py.
| controller.Controller.K_p = K_p |
Definition at line 22 of file controller.py.
| int controller.Controller.reference = 0 |
Definition at line 26 of file controller.py.
| int controller.Controller.summed_errors = 0 |
Definition at line 25 of file controller.py.