A port of the ROBOTC pidlib library. More...
#include <stdlib.h>
#include <math.h>
#include "ch.h"
#include "hal.h"
#include "vex.h"
#include "pidlib.h"
#include "fastmath.c"
Macros | |
#define | _LinearizeDrive(x) PidDriveLut[abs(x)] * sgn(x) |
Macro to optimize LUT access. More... | |
Functions | |
pidController * | PidControllerInit (float Kp, float Ki, float Kd, tVexSensors port, int16_t sensor_reverse) |
Initialize the PID controller. More... | |
pidController * | PidControllerInitWithBias (float Kp, float Ki, float Kd, float Kbias, tVexSensors port, int16_t sensor_reverse) |
Initialize the PID controller - includes bias. More... | |
int16_t | PidControllerUpdate (pidController *p) |
Update the pid process variables. More... | |
void | PidControllerMakeLut () |
Create a power based lut. More... | |
A port of the ROBOTC pidlib library.
#define _LinearizeDrive | ( | x) | PidDriveLut[abs(x)] * sgn(x) |
Macro to optimize LUT access.
pidController* PidControllerInit | ( | float | Kp, |
float | Ki, | ||
float | Kd, | ||
tVexSensors | port, | ||
int16_t | sensor_reverse | ||
) |
Initialize the PID controller.
pidController* PidControllerInitWithBias | ( | float | Kp, |
float | Ki, | ||
float | Kd, | ||
float | Kbias, | ||
tVexSensors | port, | ||
int16_t | sensor_reverse | ||
) |
Initialize the PID controller - includes bias.
int16_t PidControllerUpdate | ( | pidController * | p) |
Update the pid process variables.
void PidControllerMakeLut | ( | void | ) |
Create a power based lut.