succes

Dependencies:   microbit

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PID.h Source File

PID.h

00001 #ifndef _PID_H
00002 #define _PID_H
00003 
00004 // Shamelessly ripped from the interwebs
00005 
00006 typedef struct {
00007     double windup_guard;
00008     double proportional_gain;
00009     double integral_gain;
00010     double derivative_gain;
00011     double prev_error;
00012     double int_error;
00013     double control;
00014 } PID;
00015  
00016 void pid_zeroize(PID* pid);
00017 void pid_update(PID* pid, double curr_error, double dt);
00018     
00019 #endif