1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-17 04:26:00 +02:00
cdf2018-principal/chef/src/common.h

22 lines
509 B
C
Raw Normal View History

2018-05-11 15:58:18 +02:00
#ifndef __COMMON_H_
#define __COMMON_H_
#include <time.h>
struct PID {
struct timespec lastCalc;
float KP;
float KI;
float KD;
float prevErr;
float integErr;
};
void diffTime(const struct timespec* debut, const struct timespec* fin, struct timespec* ecoule);
float diffTimeSec(const struct timespec* debut, const struct timespec* fin);
void resetPID(struct PID *pid);
void initPID(struct PID *pid, float KP, float KI, float KD);
float updatePID(struct PID *pid, float err);
#endif