![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
for Infotag
Dependencies: Library_Cntrl Library_Misc
Diff: ControllerLoop.h
- Revision:
- 5:768e10f6d372
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ControllerLoop.h Thu Feb 25 20:28:45 2021 +0000 @@ -0,0 +1,39 @@ +#include "mbed.h" +#include "EncoderCounter.h" +#include "EncoderCounterIndex.h" +#include "DiffCounter.h" +#include "LinearCharacteristics.h" +#include "ThreadFlag.h" +#include "path_1d.h" +#include "PID_Cntrl.h" +#include "Unwrapper_2pi.h" + + + +extern EncoderCounter counter1,counter2; +extern EncoderCounterIndex index1,index2; +extern DiffCounter diff1,diff2; +extern path_1d *current_path; +extern LinearCharacteristics i2pwm; +extern PwmOut i_des1, i_des2; +extern DigitalOut i_enable; +extern Timer glob_ti; + +// This is the loop class, it is not a controller at first hand, it guarantees a cyclic call +class ControllerLoop +{ +public: + ControllerLoop(float Ts); + virtual ~ControllerLoop(); + + +private: + void loop(void); + Thread thread; + Ticker ticker; + ThreadFlag threadFlag; + Timer ti; + float Ts; + void sendSignal(); + +};