controller module¶
- class controller.PIController(actuator_cb, actuator_gain, sensor_cb, sensor_gain, saturation_range)[source]¶
Bases:
objectGeneric PI (Proportional + Integral) controller for MicroPython.
- Each run() call:
reads sensor
computes error and dt
updates integral (with anti-windup)
computes PI output
clamps to saturation
sends to actuator
- property Ki: float¶
- property Kp: float¶
- set_feed_forward(setpoint, gain)[source]¶
Set feed-forward setpoint and gain.
Feed-forward effort is computed as
ff_term = gain * setpointand is added to the PI effort before saturation.- Return type:
None
- property set_point: float¶