Mercurial > hg > beaglert
annotate include/Pid.h @ 150:ebbfb154351a ClockSync
Now leveraging BBB's lock between xenomai clock and audio clock for ultra-accurate, low-latency clocking. CAVEAT: fractions of samples drifts will occurr every time the clock is changed
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Tue, 22 Sep 2015 04:09:13 +0100 |
parents | 134bff10e561 |
children | 8f98b32d0e23 |
rev | line source |
---|---|
giuliomoro@149 | 1 /* |
giuliomoro@149 | 2 * Pid.h |
giuliomoro@149 | 3 * |
giuliomoro@149 | 4 * Created on: 14 Sep 2015 |
giuliomoro@149 | 5 * Author: giulio |
giuliomoro@149 | 6 */ |
giuliomoro@149 | 7 |
giuliomoro@149 | 8 #ifndef PID_H_ |
giuliomoro@149 | 9 #define PID_H_ |
giuliomoro@149 | 10 #include <stdio.h> |
giuliomoro@149 | 11 |
giuliomoro@149 | 12 class Pid{ |
giuliomoro@149 | 13 private: |
giuliomoro@149 | 14 float integralError; |
giuliomoro@149 | 15 float pastError; |
giuliomoro@149 | 16 float error; |
giuliomoro@149 | 17 float differentialError; |
giuliomoro@149 | 18 float output; |
giuliomoro@149 | 19 float kp; |
giuliomoro@149 | 20 float ki; |
giuliomoro@149 | 21 float kd; |
giuliomoro@149 | 22 float ts; |
giuliomoro@149 | 23 int idleTimeout; |
giuliomoro@149 | 24 int timeoutCount; |
giuliomoro@149 | 25 void updateIntegralError(); |
giuliomoro@149 | 26 void updateDifferentialError(); |
giuliomoro@149 | 27 public: |
giuliomoro@149 | 28 Pid(); |
giuliomoro@149 | 29 float setError(float anError); |
giuliomoro@149 | 30 void setIdleTimeout(int aIdleTimeout); |
giuliomoro@149 | 31 float getOutput(); |
giuliomoro@149 | 32 }; |
giuliomoro@149 | 33 |
giuliomoro@149 | 34 |
giuliomoro@149 | 35 |
giuliomoro@149 | 36 #endif /* PID_H_ */ |