31#ifndef CONTROL_SYSTEM_PID_PID_LPF_1_FF_H
32#define CONTROL_SYSTEM_PID_PID_LPF_1_FF_H
118 void init(T dt_, T Kp_, T Ki_, T Kd_, T fc_, T u_k_1_, T u_k_2_, T u_max_);
137 void set_param(T dt_, T Kp_, T Ki_, T Kd_, T fc_, T u_k_1_, T u_k_2_, T u_max_);
156 T
update(T x_0, T x, T u_ff_ = 0.0);
177 void merge(T u_k_1_);
T u_ff
Feed-forward control input.
void set_u_0(T u_k_1_)
Sets the previous controller output.
T e_k_1
Previous control error.
T get_fc()
Gets the derivative filter cutoff frequency.
T dt
Controller sampling time.
T get_u_max()
Gets the maximum controller output.
PID_LPF_1_FF()
Constructs a PID controller with filtered derivative and feed-forward support.
T e_k_2
Control error from two iterations ago.
void set_Kd(T Kd_)
Sets the derivative gain.
T get_u_k_1()
Gets the previous controller output.
T u_k_1
Previous controller output.
T u_max
Maximum controller output.
void set_dt(T dt_)
Sets the controller sampling time.
void set_ff(T u_ff_)
Sets the feed-forward control input.
void init(T dt_, T Kp_, T Ki_, T Kd_, T fc_, T u_k_1_, T u_k_2_, T u_max_)
Initializes the PID controller.
T u_k_2
Controller output from two iterations ago.
void set_fc(T fc_)
Sets the derivative filter cutoff frequency.
T tau
Time constant of the derivative low-pass filter.
T get_e_k_1()
Gets the previous control error.
void reset()
Resets the PID controller state.
void set_Ki(T Ki_)
Sets the integral gain.
T get_e_k_2()
Gets the control error from two iterations ago.
uint8_t start
Controller startup state.
void set_u_max(T u_max_)
Sets the maximum controller output.
T get_Kd()
Gets the derivative gain.
T get_Ki()
Gets the integral gain.
T get_dt()
Gets the controller sampling time.
void merge(T u_k_1_)
Merges an external controller output into the PID state.
void set_Kp(T Kp_)
Sets the proportional gain.
T update(T x_0, T x, T u_ff_=0.0)
Computes the PID control output with feed-forward.
T get_ff()
Gets the feed-forward control input.
void set_param(T dt_, T Kp_, T Ki_, T Kd_, T fc_, T u_k_1_, T u_k_2_, T u_max_)
Sets the PID controller parameters.
T get_Kp()
Gets the proportional gain.
Contains control-system algorithms and controllers.
Contains proportional-integral-derivative controller implementations.
Utility functions for the Control System library.