Ruprecht Altenburger
/
simple_program
Simple program for introduction of mirror actuator.
Diff: ControllerLoop.h
- Revision:
- 6:9ebeffe446e4
- Parent:
- 5:768e10f6d372
- Child:
- 7:942fd77d5e19
--- a/ControllerLoop.h Thu Feb 25 20:28:45 2021 +0000 +++ b/ControllerLoop.h Thu Apr 01 13:38:54 2021 +0000 @@ -5,19 +5,24 @@ #include "LinearCharacteristics.h" #include "ThreadFlag.h" #include "path_1d.h" -#include "PID_Cntrl.h" +#include "PIDT2_Cntrl.h" #include "Unwrapper_2pi.h" - - +#include "Mirror_Kinematic.h" +#include "data_structs.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 LinearCharacteristics i2u; +//extern AnalogOut i_des1, i_des2; +extern AnalogOut i_des2; extern DigitalOut i_enable; extern Timer glob_ti; +extern Mirror_Kinematic mc; +extern DigitalOut laser_on; +extern DATA_Xchange data; +extern DigitalOut led1; // This is the loop class, it is not a controller at first hand, it guarantees a cyclic call class ControllerLoop @@ -25,6 +30,9 @@ public: ControllerLoop(float Ts); virtual ~ControllerLoop(); + void start_loop(void); + void init_controllers(void); + private: @@ -35,5 +43,9 @@ Timer ti; float Ts; void sendSignal(); - + bool is_initialized; + void find_index(void); + PIDT2_Cntrl v_cntrl[2]; + Unwrapper_2pi uw2pi1; + Unwrapper_2pi uw2pi2; };