Test program with the RT black boxes

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
pmic
Date:
Mon Apr 15 09:48:55 2019 +0000
Parent:
35:009a1efb5e82
Commit message:
change basic stuff for demo Otto and Rene

Changed in this revision

GPA.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/GPA.cpp	Thu Feb 07 09:08:11 2019 +0000
+++ b/GPA.cpp	Mon Apr 15 09:48:55 2019 +0000
@@ -1,7 +1,7 @@
 /*
     GPA: Frequency point wise gain and phase analyser to measure the frequency respone function (FRF) of a dynamical system, based on the one point DFT
 
-         Hint:        If the plant has a pole at zero, is unstable or weakly damped the measurement has to be perfomed
+         Hint:        If the plant has a pole at zero, is unstable or weakly damped the measurement has to be perfomed 
                       in closed loop (this is NOT tfestimate, the algorithm is based on the one point DFT).
          Assumption:  The system is and remains at the desired steady state of interest when the measurment starts
 
--- a/main.cpp	Thu Feb 07 09:08:11 2019 +0000
+++ b/main.cpp	Mon Apr 15 09:48:55 2019 +0000
@@ -41,7 +41,7 @@
 Timer t;                                // timer to analyse Button
 
 // controller parameters etc.
-float Ts = 0.00005f;                    // sample time
+float Ts = 0.001f;                    // sample time
 // float Ts = 0.001f;                      // sample time
 float u  = 0.0f;
 float y1 = 0.0f;
@@ -103,8 +103,8 @@
 
     gpa1.reset();
     gpa2.reset();
-    gpa1.printFullGPAmeasPara();
-    gpa1.printGPAmeasPara();
+    // gpa1.printFullGPAmeasPara();
+    // gpa1.printGPAmeasPara();
     
     prbs.reset();
     // prbs.printPRBSind();
@@ -131,35 +131,35 @@
     y1 = u2inp(inp1.read());
     y2 = u2inp(inp2.read());
     
-    /*
+    ///*
     // update prbs, has to be done before writing the output
     if(doRun) exc = Aprbs*prbs();
     else exc = 0.0f;
     if(doRun && k++ < Nexp*Nprbs) pc.printf("%10i %10.3e %10.3e\r\n", k, exc, y2);
-    */
+    //*/
+    
+    ///*
+    // open loop measurement
+    u = w + exc;
+    //*/
     
     /*
-    // open loop measurement
-    u = w + exc;
-    */
-    
-    ///*
     // update controller output
     // u = rolloff(w - y2 + exc);
     // u = pi_cntr(u);
     
     u = pi_cntr(w - y2 + exc); // no roll-off
     // u = pi_cntr(w - y2)  + exc; // no roll-off
-    //*/
+    */
                
     // write controller output
     out.write(out2u(u));
     
-    ///*   
+    /*   
     // update gpa, has to be done after writing the outpupt
     if(doRun) exc = gpa1(u, y2);
     else exc = 0.0f;
-    //*/
+    */