Test of pmic GPA with filter

Dependencies:   mbed

Fork of nucf446-cuboid-balance1_strong by RT2_Cuboid_demo

Revision:
26:492c7ab05e67
Parent:
22:715d351d0be7
--- a/main.cpp	Mon Apr 09 18:23:10 2018 +0000
+++ b/main.cpp	Tue Apr 10 12:24:57 2018 +0000
@@ -30,7 +30,10 @@
 float D = 0.2f;
 IIR_filter pt2(w0, D, Ts, 1.0f);
 
-GPA gpa1(1.0f, 200.0f,50, 5, 100, Ts, 1.0f,1.0f);       // init GPA, see references there
+// GPA gpa1(1.0f, 200.0f, 50, 5, 100, Ts, 1.0f, 1.0f);       // init GPA, see references there
+float  fexcDes[5] = {10.0f, 20.0f, 30.0f, 40.0f, 50.0f};
+// GPA gpa1(1.0f, 200.0f, fexcDes, sizeof(fexcDes)/sizeof(fexcDes[0]), 5, 100, Ts, 1.0f, 1.0f);
+GPA gpa1(fexcDes, sizeof(fexcDes)/sizeof(fexcDes[0]), 5, 100, Ts, 1.0f, 1.0f);
 // user defined functions
 void updateControllers(void);   // speed controller loop (via interrupt)
 void pressed(void);             // user Button pressed
@@ -51,6 +54,17 @@
     gpa1.reset();
     pt2.reset(0.0f);
     
+    gpa1.printGPAmeasPara();
+    /*
+    gpa1.printNfexcDes();
+    printLine();
+    for(int i = 0; i < 5; i++) {
+        printf(" frequancy points:  %9.3f\r\n", fexcDes[i]);
+    }
+    printLine();
+    printf(" number of frequancy points:  %2i\r\n", sizeof(fexcDes)/sizeof(fexcDes[0]));
+    */
+    
     // attach controller loop to timer interrupt
     ControllerLoopTimer.attach(&updateControllers, Ts); //Assume Fs = 400Hz;
 }