Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BX-car by
Diff: controller.h
- Revision:
- 11:03d5aa2511c4
- Parent:
- 9:33b99cb45e99
- Child:
- 13:a33a7705fe2b
--- a/controller.h Tue Jun 24 10:06:54 2014 +0000 +++ b/controller.h Thu Jun 26 09:15:35 2014 +0000 @@ -6,7 +6,14 @@ { public: - float de_v; + + float de_kp; + float de_ip; + float de_dp; + + + + float de_output; /* @@ -46,19 +53,19 @@ * Reinitializes controller internals. Automatically * called on a manual to auto transition. */ - void reset(void); + // void reset(void); /* * Set how fast the PID loop is run. * @param interval PID calculation peformed every interval seconds. */ - void setInterval(float interval); + // void setInterval(float interval); /* * Set the bias. * @param bias The bias for the controller output. */ - void setBias(float bias); +// void setBias(float bias); /* * PID calculation. @@ -78,18 +85,23 @@ private: - bool usingFeedForward; + // bool usingFeedForward; //Actual tuning parameters used in PID calculation. float Kc_; - float tauR_; + float tauI_; float tauD_; + + + + float pParam_; + float iParam_; + float dParam_; + + float accError_; //Raw tuning parameters. - float pParam_; - float iParam_; - float dParam_; - + //The point we want to reach. float setPoint_; //The thing we measure. @@ -104,19 +116,27 @@ float inMin_; float inMax_; float inSpan_; + float outMin_; + float outMid_; float outMax_; float outSpan_; + float ctrl_Lbound; + float ctrl_Ubound; + + + + //The accumulated error, i.e. integral. - float accError_; + //float accError_; //The controller output bias. - float bias_; + // float bias_; //The interval between samples. float tSample_; //Controller output as a real world value. - volatile float realOutput_; + // volatile float realOutput_; };