Anti-Sway Capstone 1.0
|
Discrete Control Law Implementation Library. More...
Macros | |
#define | SATURATE(val, lo, hi) val < lo ? lo : (val > hi ? hi : val) |
Saturates a value. | |
Functions | |
static double | EvaluateBiquad (Biquad *sys, double input) |
void | IntegratorInit (Proportional gain, double timestep, Integrator *result) |
void | DifferentiatorInit (Proportional gain, double timestep, Differentiator *result) |
double | Cascade (double input, Biquad sys[], int size, double lower_lim, double upper_lim) |
double | Integrate (double input, Integrator *term, double lower_lim, double upper_lim) |
double | Differentiate (double input, Differentiator *term, double lower_lim, double upper_lim) |
double | PID (double input, Proportional *p, Integrator *i, Differentiator *d, double lower_lim, double upper_lim) |
Discrete Control Law Implementation Library.
#define SATURATE | ( | val, | |
lo, | |||
hi ) val < lo ? lo : (val > hi ? hi : val) |
Saturates a value.
Saturates a value to be between some low and high value
val | The numerical value to saturate |
lo | The numerical lower limit |
hi | The numerical upper limit |
Evaluates to val iff lo <= val <= hi, lo iff val < lo and hi iff val > hi
|
inline |
Executes a dynamic, discrete time system by using its biquad decomposition.
input | The input to the system |
sys | The system, as an array of biquads |
size | The size of sys |
lower_lim | The lower saturation limit of the system |
upper_lim | The upper saturation limit of the system |
|
inline |
Timesteps a Differentiation
input | The input to the differentiator |
term | A pointer to an differentiator term |
lower_lim | The lower saturation limit of the system |
upper_lim | The upper saturation limit of the system |
void DifferentiatorInit | ( | Proportional | gain, |
double | timestep, | ||
Differentiator * | result ) |
Initializes a Differentiator
gain | The gain to assign the differentiator |
timestep | The timestep to approximate the differentiator |
result | A return parameter, which becomes the differentiator with the gain and timestep |
|
inlinestatic |
Evaluates a singular dynamic distrete time biquad within a system, which itself is a system.
sys | The system |
input | The system's input |
|
inline |
Timesteps an Integration
input | The input to the integrator |
term | A pointer to an integrator term |
lower_lim | The lower saturation limit of the system |
upper_lim | The upper saturation limit of the system |
void IntegratorInit | ( | Proportional | gain, |
double | timestep, | ||
Integrator * | result ) |
Initializes an Integrator
gain | The gain to assign the integrator |
timestep | The timestep to approximate the integrator |
result | A return parameter, which becomes the integrator with the gain and timestep |
|
inline |
Timesteps a PID Controller
input | The input to the PID Controller |
p | A pointer to the proportional term |
i | A pointer to the integrator term |
d | A pointer to the differentiator term |
lower_lim | The lower saturation limit of the system |
upper_lim | The upper saturation limit of the system |