Buoyancy Firmware  1.0
Buoyancy Vehicle Firmware Documentation
PID.h File Reference
#include "main.h"
#include "nrf_systick.h"
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for PID.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pid_controller
 Structure that holds PID all the PID controller data, multiple instances are posible using different structures for each controller. More...
 

Macros

#define TICK_SECOND   32768UL
 Instead of using systick, RTC is use, which run at 32,768 kHz. More...
 

Typedefs

typedef struct pid_controllerpid_t
 

Enumerations

enum  pid_control_directions { E_PID_DIRECT, E_PID_REVERSE }
 Defines if the controler is direct or reverse. More...
 

Functions

pid_t pid_create (pid_t pid, float *in, float *out, float *set, float kp, float ki, float kd)
 Creates a new PID controller. More...
 
bool pid_need_compute (pid_t pid)
 Check if PID loop needs to run. More...
 
void pid_compute (pid_t pid)
 Computes the output of the PID control. More...
 
void pid_tune (pid_t pid, float kp, float ki, float kd)
 Sets new PID tuning parameters. More...
 
void pid_sample (pid_t pid, uint32_t time)
 Sets the pid algorithm period. More...
 
void pid_limits (pid_t pid, float min, float max)
 Sets the limits for the PID controller output. More...
 
void pid_auto (pid_t pid)
 Enables automatic control using PID. More...
 
void pid_manual (pid_t pid)
 Disables automatic process control. More...
 
void pid_direction (pid_t pid, enum pid_control_directions dir)
 Configures the PID controller direction. More...