Mirror actuator for RT2 lab

Dependencies:   FastPWM

Revision:
15:9f32f64eee5b
Parent:
11:d43f8b421d6d
Child:
16:28b6bb8a4b7f
--- a/main.cpp	Wed Apr 28 12:51:02 2021 +0000
+++ b/main.cpp	Sun May 02 08:17:06 2021 +0000
@@ -1,5 +1,6 @@
 #include "mbed.h"
 #include "math.h" 
+#include <stdio.h>
 //------------------------------------------
 #define PI 3.1415927f
 //------------------------------------------
@@ -55,15 +56,14 @@
 //------------------------------------------
 // ----- User defined functions -----------
 ControllerLoop loop(Ts);                        // this is forthe main controller loop
-uart_comm_thread uart_com(&serial_port,.05f);   // this is the communication thread
+uart_comm_thread uart_com(&serial_port,.025f);   // this is the communication thread
 Timer glob_ti;                                  // the global timer
 path_1d p1;             // pathplanner (under constr.)
 path_1d p2;             // pathplanner (under constr.)
 path_1d *current_path;
 // --------- GPA -----------------------------
 //init values: f0,   f1, nbPts, A0, A1, Ts
-GPA      myGPA(5 , 2400,    40, 25, 25, Ts);
-float exc=0.0;              // excitation GPA
+GPA      myGPA(5 , 2450,    40, 35, 25, Ts);
 //------------------------------------------------------------------------------
 // --------- Mirror kinematik, define values, trafos etc there
 Mirror_Kinematic mk;
@@ -86,10 +86,10 @@
     i_enable = 0;       // disable current first
     counter1.reset();   // encoder reset
     counter2.reset();   // encoder reset
-    mk.set_offsets(1401,1510);          // individal set values for global position
+    mk.set_offsets(328,8);          // individal set values for global position
     glob_ti.start();
     glob_ti.reset();
-    loop.init_controllers();
+    //loop.init_controllers();
     uart_com.start_uart();
     loop.start_loop();
     i_des1.write(i2u(0));
@@ -118,6 +118,6 @@
         i_enable = 0;
     while(1)
         {
-        ThisThread::sleep_for(200);
+        ThisThread::sleep_for(100);
         }
 }   // END OF main