Autodrone
Multi-Domain Vehicle
pid.h File Reference

This files initializes and updates the PID controller. More...

Go to the source code of this file.

Data Structures

struct  PIDdata
 

Typedefs

typedef struct PIDdata PIDdata_t
 

Functions

void initPID (void)
 Initializes the PID states. More...
 
float updatePID (float error, float deltaT, uint8_t reset, struct PIDdata *PIDparameters)
 Updates the PID states. More...
 
void initPIDvalues (void)
 Allows the user to change the PID values. More...
 
void setPIDstates (uint8_t IDPid, float value)
 Set the state of the PIDs. More...
 
void zeroPIDstates (void)
 Set all states to 0. More...
 

Variables

uint8_t pidReset
 

Detailed Description

This files initializes and updates the PID controller.

Author
Jeremy Wolfe
Date
07 MAR 2022

Typedef Documentation

◆ PIDdata_t

typedef struct PIDdata PIDdata_t

Function Documentation

◆ initPID()

void initPID ( void  )

Initializes the PID states.

Returns
Void.

◆ initPIDvalues()

void initPIDvalues ( void  )

Allows the user to change the PID values.

Returns
Void.

◆ setPIDstates()

void setPIDstates ( uint8_t  IDPid,
float  value 
)

Set the state of the PIDs.

Parameters
IDPidWhich PID state you want to change.
valueThe value to write.
Returns
Void.

◆ updatePID()

float updatePID ( float  error,
float  deltaT,
uint8_t  reset,
struct PIDdata PIDparameters 
)

Updates the PID states.

Parameters
errorCommanded changed minus measured change.
deltaTTime between updates in sec.
resetIf the PID states should be reset.
*PIDparametersStruct containing the parameters of the PID controller.
Returns
float Output from the algorithm.

◆ zeroPIDstates()

void zeroPIDstates ( void  )

Set all states to 0.

Returns
Void.

Variable Documentation

◆ pidReset

uint8_t pidReset
extern