Class TorqueController
Defined in File speed_sae_controller.hpp
Class Documentation
-
class TorqueController
Public Functions
-
TorqueController()
Constructor for the TorqueController class.
-
void initialize(const float &kk_torque, const float &ki_torque, const float &maximum_torque)
initialize the PI controller parameters
- Parameters:
kk_torque – Proportional gain for PI controller
ki_torque – Integral gain for PI controller
maximum_torque – Maximum allowable torque
-
void reset()
Reset the controller state This function resets the integral error and the last recorded time.
-
float pi_controller(const float &velocity_reference, const float &velocity_current, float &error_speed, float &error_integral, float &term_proportional, float &term_integral)
PI controller for speed control.
- Parameters:
velocity_reference – Desired speed reference
velocity_current – Current speed of the vehicle
error_speed – Reference to store speed error
error_integral – Reference to store integral error
term_proportional – Reference to store proportional term
term_integral – Reference to store integral term
- Returns:
float Calculated torque to be applied
-
TorqueController()