|
ME 405 Romi
|
Classes | |
| class | Controller |
| This file contains a class to create a PID Controller object. More... | |
Functions | |
| change_Ref (self, reference) | |
| change_Ref changes the set point of the controller. | |
| get_Ref (self) | |
| get_Ref returns the current set point of the controller. | |
| get_Error (self) | |
| get_Error returns the current Riemann Sum integral of the errors of the controller. | |
| proportional_Control (self, measure) | |
| proportional_Control returns a saturated effort value based on the error of the system from the set point using proportional control only. | |
| pi_Control (self, measure, dt) | |
| pi_Control returns a saturated effort value based on the error of the system from the set point using proportional and integral control only. | |
| error_sat (self, err) | |
| error_sat is a function which returns the saturated integral of the error based on this instance of the controller saturation value. | |
| effort_sat (self, eff) | |
| effort_sat is a function which returns the saturated effort of the controller based on this instance of the controllers saturation value. | |
| change_Gains (self, k_p, k_i, k_d) | |
| change_Gains changes this instance's gain values. | |
Variables | |
| reference = reference | |
| summed_errors = self.error_sat(self.summed_errors) | |
| K_p = k_p | |
| K_i = k_i | |
| K_d = k_d | |
| controller.change_Gains | ( | self, | |
| k_p, | |||
| k_i, | |||
| k_d ) |
change_Gains changes this instance's gain values.
| k_p | : k_p is the new proportional gain. |
| k_i | : k_i is the new integral gain. |
| k_d | : k_d is the new derivative gain. |
Definition at line 106 of file controller.py.
| controller.change_Ref | ( | self, | |
| reference ) |
change_Ref changes the set point of the controller.
| reference | : reference is the new set point of the controller. |
Definition at line 40 of file controller.py.
| controller.effort_sat | ( | self, | |
| eff ) |
effort_sat is a function which returns the saturated effort of the controller based on this instance of the controllers saturation value.
| eff | : eff is the effort value being saturated. |
Definition at line 94 of file controller.py.
| controller.error_sat | ( | self, | |
| err ) |
error_sat is a function which returns the saturated integral of the error based on this instance of the controller saturation value.
| err | : err is the error sum value being saturated. |
Definition at line 84 of file controller.py.
| controller.get_Error | ( | self | ) |
get_Error returns the current Riemann Sum integral of the errors of the controller.
Definition at line 51 of file controller.py.
| controller.get_Ref | ( | self | ) |
get_Ref returns the current set point of the controller.
Definition at line 47 of file controller.py.
| controller.pi_Control | ( | self, | |
| measure, | |||
| dt ) |
pi_Control returns a saturated effort value based on the error of the system from the set point using proportional and integral control only.
@detail The integral of the error is done using a simple Riemann sum that looks at how long it has been since the last time the controller was ran. This integral is saturated to stop the integral from making the motors go insane when some unexpected behavior occurs. The effort is also saturated.
| measure | : measure is the current state of the system being controlled |
| dt | : dt is the time since the last run of pi_Control in ms |
Definition at line 72 of file controller.py.
| controller.proportional_Control | ( | self, | |
| measure ) |
proportional_Control returns a saturated effort value based on the error of the system from the set point using proportional control only.
| measure | : measure is the current state of the system being controlled |
Definition at line 56 of file controller.py.
| controller.K_d = k_d |
Definition at line 109 of file controller.py.
| controller.K_i = k_i |
Definition at line 108 of file controller.py.
| controller.K_p = k_p |
Definition at line 107 of file controller.py.
| controller.reference = reference |
Definition at line 41 of file controller.py.
| controller.summed_errors = self.error_sat(self.summed_errors) |
Definition at line 78 of file controller.py.