26 #include "nrf_systick.h" 42 #define TICK_SECOND 32768UL 106 pid_t
pid_create(pid_t
pid,
float* in,
float* out,
float*
set,
float kp,
float ki,
float kd);
140 void pid_tune(pid_t pid,
float kp,
float ki,
float kd);
159 void pid_limits(pid_t pid,
float min,
float max);
void pid_tune(pid_t pid, float kp, float ki, float kd)
Sets new PID tuning parameters.
Definition: PID.c:97
void pid_limits(pid_t pid, float min, float max)
Sets the limits for the PID controller output.
Definition: PID.c:127
enum pid_control_directions direction
Definition: PID.h:79
unsigned char uint8_t
Definition: nrf_drv_uart_PP.c:22
pid_t pid_create(pid_t pid, float *in, float *out, float *set, float kp, float ki, float kd)
Creates a new PID controller.
Definition: PID.c:32
float omin
Maximum value allowed at the output.
Definition: PID.h:69
float * input
Current Process Value.
Definition: PID.h:61
void pid_manual(pid_t pid)
Disables automatic process control.
Definition: PID.c:160
void pid_compute(pid_t pid)
Computes the output of the PID control.
Definition: PID.c:59
pid_t pid
Create PID controller instnace.
Definition: mission.c:23
float Kd
Stores the gain for the Derivative term.
Definition: PID.h:67
float Kp
Stores the gain for the Proportional term.
Definition: PID.h:65
float omax
Minimum value allowed at the output.
Definition: PID.h:70
void pid_direction(pid_t pid, enum pid_control_directions dir)
Configures the PID controller direction.
Definition: PID.c:165
struct pid_controller * pid_t
Definition: PID.h:82
float * setpoint
Controller Setpoint.
Definition: PID.h:63
Structure that holds PID all the PID controller data, multiple instances are posible using different ...
Definition: PID.h:59
float Ki
Stores the gain for the Integral term.
Definition: PID.h:66
void pid_sample(pid_t pid, uint32_t time)
Sets the pid algorithm period.
Definition: PID.c:117
void pid_auto(pid_t pid)
Enables automatic control using PID.
Definition: PID.c:146
uint32_t sampletime
Defines the PID sample time.
Definition: PID.h:76
float iterm
Accumulator for integral term.
Definition: PID.h:72
uint32_t lasttime
Stores the time when the control loop ran last time.
Definition: PID.h:75
pid_control_directions
Defines if the controler is direct or reverse.
Definition: PID.h:50
float lastin
Last input value for differential term.
Definition: PID.h:73
bool pid_need_compute(pid_t pid)
Check if PID loop needs to run.
Definition: PID.c:52
unsigned int uint32_t
Definition: nrf_drv_uart_PP.c:30
uint8_t automode
Defines if the PID controller is enabled or disabled.
Definition: PID.h:78
float * output
Corrective Output from PID Controller.
Definition: PID.h:62