A PID controller is a standard component in industrial control applications which tries to keep a measured value at a given target value (the setpoint). The measured value has to be plugged into the input slot (input_slot) and the output of the PID controller can be read from output_slot.
For example, you can use a PID controller in conjunction with the joints in the ODEDynamics component to keep a hinge or slider at a particular position. In this case the angle or position is used as input to the PID controller and the output controls the motor velocity.
setpoint is the target value that should be maintained.
Kp is the weight for the proportional part, Ki the weight for the integral part and Kd the weight for the derivative part.
maxout and minout are used to clamp the output value.
A PIDController has the following slots:
Slot | Type | Access | Description |
---|---|---|---|
input_slot | float | rw | The “measured” value |
setpoint_slot | float | rw | The target value |
output_slot | float | r | Controller output |
maxout_slot | float | rw | Maximum output value |
minout_slot | float | rw | Minimum output value |
Kp_slot | float | rw | Weight for the proportional term |
Ki_slot | float | rw | Weight for the integral term |
Kd_slot | float | rw | Weight for the derivative term |