All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
_pidController Struct Reference

Structure to hold all data for one instance of a PID controller. More...

#include <pidlib.h>

Data Fields

int16_t enabled
 enable or diable pid calculations More...
 
int16_t res1
 word alignment of Kp More...
 
float Kp
 proportional constant More...
 
float Ki
 integral constant More...
 
float Kd
 derivative constant More...
 
float Kbias
 bias constant More...
 
float error
 error between actual pisition and target More...
 
float last_error
 error last time update called More...
 
float integral
 integrated error More...
 
float integral_limit
 limit for integrated error More...
 
float derivative
 change in error from last time More...
 
float error_threshold
 threshold below which error is ignored More...
 
float drive
 calculated motor drive in range +/- 1.0 More...
 
int16_t drive_raw
 motor drive in the range +/- 127 More...
 
int16_t drive_cmd
 linearized motor drive in the range +/- 127 More...
 
tVexSensors sensor_port
 digital or analog port with the position sensor More...
 
int16_t sensor_reverse
 flag indicating the sensor values should be reversed More...
 
int32_t sensor_value
 current value of the position sensor More...
 
int32_t target_value
 the target value More...
 

Detailed Description

Structure to hold all data for one instance of a PID controller.

Note
Currently at 64 bytes memory usage

Field Documentation

int16_t enabled

enable or diable pid calculations

int16_t res1

word alignment of Kp

float Kp

proportional constant

float Ki

integral constant

float Kd

derivative constant

float Kbias

bias constant

float error

error between actual pisition and target

float last_error

error last time update called

float integral

integrated error

float integral_limit

limit for integrated error

float derivative

change in error from last time

float error_threshold

threshold below which error is ignored

float drive

calculated motor drive in range +/- 1.0

int16_t drive_raw

motor drive in the range +/- 127

int16_t drive_cmd

linearized motor drive in the range +/- 127

tVexSensors sensor_port

digital or analog port with the position sensor

int16_t sensor_reverse

flag indicating the sensor values should be reversed

int32_t sensor_value

current value of the position sensor

int32_t target_value

the target value


The documentation for this struct was generated from the following file: