13#ifndef DISCRETE_LIB_H_
14#define DISCRETE_LIB_H_
23#define POS_INF DBL_MAX
25#define NEG_INF (-DBL_MAX)
44 double denominator[3];
52 double prev_output[2];
136inline double Cascade(
double input,
198inline double PID(
double input,
double Differentiate(double input, Differentiator *term, double lower_lim, double upper_lim)
Definition discrete-lib.c:101
void IntegratorInit(Proportional gain, double timestep, Integrator *result)
Definition discrete-lib.c:53
double Cascade(double input, Biquad sys[], int size, double lower_lim, double upper_lim)
Definition discrete-lib.c:71
float Proportional
Control Block: Proportion.
Definition discrete-lib.h:60
double Integrate(double input, Integrator *term, double lower_lim, double upper_lim)
Definition discrete-lib.c:89
double PID(double input, Proportional *p, Integrator *i, Differentiator *d, double lower_lim, double upper_lim)
Definition discrete-lib.c:114
void DifferentiatorInit(Proportional gain, double timestep, Differentiator *result)
Definition discrete-lib.c:59
Biquad.
Definition discrete-lib.h:36
Control Block: Differentiator.
Definition discrete-lib.h:78
double prev_input
Previous input.
Definition discrete-lib.h:80
double prev_output
Previous output.
Definition discrete-lib.h:81
Proportional gain
Differential Gain (with Timestep)
Definition discrete-lib.h:79
Control Block: Integrator.
Definition discrete-lib.h:67
double prev_input
Previous input.
Definition discrete-lib.h:69
double prev_output
Previous output.
Definition discrete-lib.h:70
Proportional gain
Integral Gain (with Timestep)
Definition discrete-lib.h:68