embeddedlibrary
reusable software modules for embedded systems
Control Subsystem

Data Structures

struct  pid_controller_t
 

Typedefs

typedef struct pid_controller_t pid_controller_t
 
typedef struct pid_controller_t pid_controller_t
 

Functions

void PID_Reset (pid_controller_t *pid_handle)
 
int32_t PID_Step (pid_controller_t *pid_handle, int32_t meas)
 
float PID_Step (pid_controller_t *pid_handle, float meas)
 

Detailed Description

Created on: Mar 17, 2014

Author
: Bradley Ebinger Updated on: Feb 15, 2015
: Anthony Merlino
Version
2015.02.15

Typedef Documentation

Structure to hold PID controller data

  • kp, ki, and kd are the gain coefficients of the proportional, integral and derivative terms respectively
  • prev_error - the error computed last time step to be used for derivative computation
  • accum_error - the total accumulated error of the system to be used for integral computation
  • prev_time - the last time the PID was updated, to be used for integral and derivative computations

Structure to hold PID controller data

  • kp, ki, and kd are the gain coefficients of the proportional, integral and derivative terms respectively
  • prev_error - the error computed last time step to be used for derivative computation
  • accum_error - the total accumulated error of the system to be used for integral computation
  • prev_time - the last time the PID was updated, to be used for integral and derivative computations

Function Documentation

void PID_Reset ( pid_controller_t pid_handle)

Resets the error and previous timestep of the PID controller.

Sets the gain parameters, resets the error's and time

Parameters
pid_handle- a handle to the PID structure to initialize
curr_time- the current time for prev_time to be reset to
float PID_Step ( pid_controller_t pid_handle,
float  meas 
)

Updates the PID controller and returns the computed output

Parameters
pid_handle- a handle to the PID structure to update
stpt- the setpoint of the system
meas- the current measurement of the value
Returns
int32_t PID_Step ( pid_controller_t pid_handle,
int32_t  meas 
)

Updates the PID controller and returns the computed output

Parameters
pid_handle- a handle to the PID structure to update
stpt- the setpoint of the system
meas- the current measurement of the value
Returns