embeddedlibrary
reusable software modules for embedded systems
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
pid.h
Go to the documentation of this file.
1
16
#ifndef PID_H
17
#define PID_H
18
19
#include <stdint.h>
20
#include <stdbool.h>
21
36
typedef
struct
pid_controller_t
{
37
// Setpoint
38
int32_t setpoint;
39
// PID Coefficients
40
int16_t kp;
// Proportional
41
int16_t ki;
// Integral
42
int16_t kd;
// Derivitive
43
// Error
44
int32_t prev_error;
// Used in Derivitive Calc
45
int32_t prev_i;
46
int32_t max_i;
47
// Integral/Derivitive dt calculation
48
uint32_t prev_time;
49
}
pid_controller_t
;
50
51
61
void
PID_Reset
(
pid_controller_t
*pid_handle);
62
71
int32_t
PID_Step
(
pid_controller_t
*pid_handle, int32_t meas);
72
73
#endif
74
pid_controller_t
Definition:
pid.h:36
PID_Step
int32_t PID_Step(pid_controller_t *pid_handle, int32_t meas)
Definition:
pid.c:9
pid_controller_t
struct pid_controller_t pid_controller_t
PID_Reset
void PID_Reset(pid_controller_t *pid_handle)
Definition:
pid.c:3
include
pid.h
Generated on Wed Apr 29 2015 21:53:52 for embeddedlibrary by
1.8.9.1