Public Member Functions | |
| __init__ (self, pid_params=PidParams(), min_value=-100, max_value=100) | |
| set_pid_params (self, pid_params) | |
| get_pid_params (self) | |
| get_setpoint (self) | |
| change_setpoint (self, setpoint) | |
| compute_output (self, input_value) | |
| reset_controller (self) | |
Static Protected Attributes | |
| int | _min_value = -100 |
| int | _max_value = 100 |
| _pid = PidParams() | |
| int | _setpoint = 0 |
| bool | _change_sign = False |
| int | _last_error = 0 |
| int | _output = 0 |
| int | _integral = 0 |
Construct a new PID controller object kp proportional gain ki integral gain kd derivative gain
| onepi.utils.pid_controller.PidController.__init__ | ( | self, | |
| pid_params = PidParams(), | |||
| min_value = -100, | |||
| max_value = 100 ) |
construtor
| onepi.utils.pid_controller.PidController.change_setpoint | ( | self, | |
| setpoint ) |
Change the setpoint or reference value. This is the value the PID controller is trying to reach. setpoint: reference value
| onepi.utils.pid_controller.PidController.compute_output | ( | self, | |
| input_value ) |
Computes the output command by applying the PID control algorithm input_value: current input value return: float output command value
| onepi.utils.pid_controller.PidController.get_pid_params | ( | self | ) |
returns pid params
| onepi.utils.pid_controller.PidController.get_setpoint | ( | self | ) |
returns the setpoint
| onepi.utils.pid_controller.PidController.reset_controller | ( | self | ) |
resets the gains
| onepi.utils.pid_controller.PidController.set_pid_params | ( | self, | |
| pid_params ) |
updates pid params