24#ifndef CONTROL_SYSTEM_PID_PID_S_H
25#define CONTROL_SYSTEM_PID_PID_S_H
106 void init(T dt_, T Kp_, T T_i_, T T_d_, T I_max_, T u_max_,
bool d_filter_ =
false, T fc_ = 10.0);
124 void set_param(T dt_, T Kp_, T T_i_, T T_d_, T I_max_, T u_max_,
bool d_filter_ =
false, T fc_ = 10.0);
143 T
update(T x_0, T x, T u_ff_ = 0.0);
T get_u()
Gets the controller output.
void set_param(T dt_, T Kp_, T T_i_, T T_d_, T I_max_, T u_max_, bool d_filter_=false, T fc_=10.0)
Sets the PID controller parameters.
void merge(T u_k_1_)
Merges an external controller output into the PID state.
T u_ff
Feed-forward control input.
T get_D()
Gets the derivative contribution.
T get_T_i()
Gets the integral time constant.
T e_k_1
Previous control error.
T T_i
Integral time constant.
T get_ff()
Gets the feed-forward control input.
bool get_d_filter()
Gets the derivative filter enable state.
T u
PID controller output.
void set_dt(T dt_)
Sets the controller sampling time.
bool d_filter
Derivative filter enable state.
void set_Ti(T T_i_)
Sets the integral time constant.
T get_P()
Gets the proportional contribution.
bool start
Controller startup state.
void set_I_max(T I_max_)
Sets the maximum integral contribution.
T I_max
Maximum allowed integral contribution.
T update(T x_0, T x, T u_ff_=0.0)
Computes the PID control output.
T get_u_max()
Gets the maximum controller output.
T P
Proportional contribution.
void set_fc(T fc_)
Sets the derivative filter cutoff frequency.
PID_S()
Constructs a PID controller.
T fc
Cutoff frequency of the derivative filter.
T get_fc()
Gets the derivative filter cutoff frequency.
T get_T_d()
Gets the derivative time constant.
T get_I()
Gets the integral contribution.
LPF_1< T > lpf
First-order low-pass filter used for derivative filtering.
T get_I_max()
Gets the maximum integral contribution.
void set_Td(T T_d_)
Sets the derivative time constant.
T get_Kp()
Gets the proportional gain.
T D
Derivative contribution.
void set_d_filter(bool d_filter_)
Enables or disables derivative filtering.
T u_max
Maximum allowed controller output.
void set_Kp(T Kp_)
Sets the proportional gain.
T get_e_k_1()
Gets the previous control error.
T T_d
Derivative time constant.
void reset()
Resets the PID controller state.
T dt
Controller sampling time.
void init(T dt_, T Kp_, T T_i_, T T_d_, T I_max_, T u_max_, bool d_filter_=false, T fc_=10.0)
Initializes the PID controller.
void set_u_max(T u_max_)
Sets the maximum controller output.
void set_ff(T u_ff_)
Sets the feed-forward control input.
T get_dt()
Gets the controller sampling time.
T I
Integral contribution.
Contains control-system algorithms and controllers.
Contains proportional-integral-derivative controller implementations.
Utility functions for the Control System library.