PID制御計算用ライブラリ

Dependents:   ROBOCON2017_archan ROBOCON2017_suchan

Committer:
Akito914
Date:
Wed Sep 28 01:42:33 2016 +0000
Revision:
1:f1f6c98a4b12
Parent:
0:52549f6dd024
Child:
2:e340bdcb9bca
???????????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Akito914 0:52549f6dd024 1
Akito914 0:52549f6dd024 2 #ifndef __CAL_PID_HPP__
Akito914 0:52549f6dd024 3 #define __CAL_PID_HPP__
Akito914 0:52549f6dd024 4 #include "mbed.h"
Akito914 0:52549f6dd024 5
Akito914 0:52549f6dd024 6
Akito914 0:52549f6dd024 7 class cal_pid{
Akito914 0:52549f6dd024 8 public:
Akito914 0:52549f6dd024 9 cal_pid();
Akito914 0:52549f6dd024 10 ~cal_pid();
Akito914 0:52549f6dd024 11 void param(float _p_gain,float _i_gain,float _d_gain);
Akito914 0:52549f6dd024 12 void period(float _control_period);
Akito914 0:52549f6dd024 13 void output(signed long _min,signed long _max);
Akito914 0:52549f6dd024 14 void reset();
Akito914 1:f1f6c98a4b12 15 signed long get_pid(signed long position,signed long targ,int rd=1);
Akito914 0:52549f6dd024 16 private:
Akito914 0:52549f6dd024 17 signed long error;
Akito914 0:52549f6dd024 18 signed long past_error;
Akito914 0:52549f6dd024 19 signed long egral_error;
Akito914 0:52549f6dd024 20 signed long integral_error;
Akito914 0:52549f6dd024 21 signed long differential_error;
Akito914 0:52549f6dd024 22 float p_gain;
Akito914 0:52549f6dd024 23 float i_gain;
Akito914 0:52549f6dd024 24 float d_gain;
Akito914 0:52549f6dd024 25 float control_period;
Akito914 0:52549f6dd024 26 signed long p_part;
Akito914 0:52549f6dd024 27 signed long i_part;
Akito914 0:52549f6dd024 28 signed long d_part;
Akito914 0:52549f6dd024 29 signed long output_min;
Akito914 0:52549f6dd024 30 signed long output_max;
Akito914 0:52549f6dd024 31 signed long operate;
Akito914 0:52549f6dd024 32 };
Akito914 0:52549f6dd024 33
Akito914 0:52549f6dd024 34
Akito914 0:52549f6dd024 35
Akito914 0:52549f6dd024 36 #endif