Fertig

Dependencies:   mbed

Fork of RT2_P3_students by TeamSurface

Revision:
3:769ce5f06d3e
Parent:
1:a30512c3ac73
Child:
4:16f47c056c7c
Child:
5:d79c437626e7
diff -r a30512c3ac73 -r 769ce5f06d3e main.cpp
--- a/main.cpp	Mon Apr 09 05:50:04 2018 +0000
+++ b/main.cpp	Mon Apr 09 08:01:29 2018 +0000
@@ -7,7 +7,7 @@
 #include "DiffCounter.h"
 #include "IIR_filter.h"
 #include "LinearCharacteristics.h"
-#include "PI_Cntrl.h"
+//#include "PI_Cntrl.h"
 /* Cuboid balance on one edge on Nucleo F446RE
 
  **** IMPORTANT: use ..\Labormodelle\RT-MOD054 - Würfel\Escon_Parameter_4nucleo.edc 
@@ -45,6 +45,8 @@
 float out_value = 1.6f;                 // set voltage on 1.6 V (0 A current)
 float w_soll = 10.0f;                   // desired velocity
 float Ts = 0.002f;                      // sample time of main loops
+int k = 0;
+LinearCharacteristics i2u(0.8f,-2.0f);
 //------------------------------------------
 // ... here define variables like gains etc.
 //------------------------------------------
@@ -73,6 +75,12 @@
     counter1.reset();   // encoder reset
     diff.reset(0.0f,0.0f);
     ControllerLoopTimer.attach(&updateControllers, Ts); //Assume Fs = ...;
+    
+    float value = i2u(22.2);
+    
+    
+    
+    
 }
 //******************************************************************************
 //---------- control loop (called via interrupt) -------------
@@ -82,7 +90,7 @@
     float vel = diff(counts);           // motor velocity 
     
     // ... your code 
-    
+    out.write(i2u(1.5f)/3.3f);
     if(++k >= 199){
         k = 0;
         pc.printf("omega_soll=%3.2f omega=%3.2f \r\n",w_soll,vel);