Mirror actuator for RT2 lab
Dependencies: Library_Cntrl Library_Misc
ControllerLoop.h@5:768e10f6d372, 2021-02-25 (annotated)
- Committer:
- altb2
- Date:
- Thu Feb 25 20:28:45 2021 +0000
- Revision:
- 5:768e10f6d372
- Child:
- 6:9ebeffe446e4
first commit of Mirror actuator
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 5:768e10f6d372 | 1 | #include "mbed.h" |
altb2 | 5:768e10f6d372 | 2 | #include "EncoderCounter.h" |
altb2 | 5:768e10f6d372 | 3 | #include "EncoderCounterIndex.h" |
altb2 | 5:768e10f6d372 | 4 | #include "DiffCounter.h" |
altb2 | 5:768e10f6d372 | 5 | #include "LinearCharacteristics.h" |
altb2 | 5:768e10f6d372 | 6 | #include "ThreadFlag.h" |
altb2 | 5:768e10f6d372 | 7 | #include "path_1d.h" |
altb2 | 5:768e10f6d372 | 8 | #include "PID_Cntrl.h" |
altb2 | 5:768e10f6d372 | 9 | #include "Unwrapper_2pi.h" |
altb2 | 5:768e10f6d372 | 10 | |
altb2 | 5:768e10f6d372 | 11 | |
altb2 | 5:768e10f6d372 | 12 | |
altb2 | 5:768e10f6d372 | 13 | extern EncoderCounter counter1,counter2; |
altb2 | 5:768e10f6d372 | 14 | extern EncoderCounterIndex index1,index2; |
altb2 | 5:768e10f6d372 | 15 | extern DiffCounter diff1,diff2; |
altb2 | 5:768e10f6d372 | 16 | extern path_1d *current_path; |
altb2 | 5:768e10f6d372 | 17 | extern LinearCharacteristics i2pwm; |
altb2 | 5:768e10f6d372 | 18 | extern PwmOut i_des1, i_des2; |
altb2 | 5:768e10f6d372 | 19 | extern DigitalOut i_enable; |
altb2 | 5:768e10f6d372 | 20 | extern Timer glob_ti; |
altb2 | 5:768e10f6d372 | 21 | |
altb2 | 5:768e10f6d372 | 22 | // This is the loop class, it is not a controller at first hand, it guarantees a cyclic call |
altb2 | 5:768e10f6d372 | 23 | class ControllerLoop |
altb2 | 5:768e10f6d372 | 24 | { |
altb2 | 5:768e10f6d372 | 25 | public: |
altb2 | 5:768e10f6d372 | 26 | ControllerLoop(float Ts); |
altb2 | 5:768e10f6d372 | 27 | virtual ~ControllerLoop(); |
altb2 | 5:768e10f6d372 | 28 | |
altb2 | 5:768e10f6d372 | 29 | |
altb2 | 5:768e10f6d372 | 30 | private: |
altb2 | 5:768e10f6d372 | 31 | void loop(void); |
altb2 | 5:768e10f6d372 | 32 | Thread thread; |
altb2 | 5:768e10f6d372 | 33 | Ticker ticker; |
altb2 | 5:768e10f6d372 | 34 | ThreadFlag threadFlag; |
altb2 | 5:768e10f6d372 | 35 | Timer ti; |
altb2 | 5:768e10f6d372 | 36 | float Ts; |
altb2 | 5:768e10f6d372 | 37 | void sendSignal(); |
altb2 | 5:768e10f6d372 | 38 | |
altb2 | 5:768e10f6d372 | 39 | }; |