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