The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
PeriodicPI.h@19:05b8123905fb, 2017-04-24 (annotated)
- Committer:
- balsamfir
- Date:
- Mon Apr 24 21:37:50 2017 +0000
- Revision:
- 19:05b8123905fb
- Parent:
- 17:47e107f9587b
Commit before share
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
balsamfir | 5:f655435d0782 | 1 | #ifndef PERIODIC_PI_H |
balsamfir | 5:f655435d0782 | 2 | #define PERIODIC_PI_H |
balsamfir | 5:f655435d0782 | 3 | |
balsamfir | 5:f655435d0782 | 4 | #include "mbed.h" |
balsamfir | 5:f655435d0782 | 5 | |
balsamfir | 5:f655435d0782 | 6 | class PeriodicPI |
balsamfir | 5:f655435d0782 | 7 | { |
balsamfir | 5:f655435d0782 | 8 | public: |
balsamfir | 5:f655435d0782 | 9 | PeriodicPI(float periodSec, float kP=0, float kI=0); |
balsamfir | 6:52686c25e4af | 10 | float Run(float error, float bound); |
balsamfir | 5:f655435d0782 | 11 | float GetIntegral(); |
balsamfir | 5:f655435d0782 | 12 | float GetOutput(); |
balsamfir | 17:47e107f9587b | 13 | void Reset(); |
balsamfir | 5:f655435d0782 | 14 | |
balsamfir | 5:f655435d0782 | 15 | float kP; |
balsamfir | 5:f655435d0782 | 16 | float kI; |
balsamfir | 5:f655435d0782 | 17 | |
balsamfir | 5:f655435d0782 | 18 | private: |
balsamfir | 5:f655435d0782 | 19 | float integral; |
balsamfir | 5:f655435d0782 | 20 | float output; |
balsamfir | 5:f655435d0782 | 21 | float periodSec; |
balsamfir | 5:f655435d0782 | 22 | |
balsamfir | 5:f655435d0782 | 23 | }; |
balsamfir | 5:f655435d0782 | 24 | |
balsamfir | 5:f655435d0782 | 25 | #endif // PERIODIC_PI_H |