Matti Borchers / Mbed 2 deprecated mbed_amf_controlsystem_iO_copy

Dependencies:   mbed-rtos mbed

Fork of mbed_amf_controlsystem_iO_copy by Oliver Wenzel

Revision:
15:141de2b5646d
Parent:
14:48cdd880ca1a
Child:
17:76636aaf80de
diff -r 48cdd880ca1a -r 141de2b5646d Controller/MachineDirectionController.cpp
--- a/Controller/MachineDirectionController.cpp	Sun Feb 07 10:41:16 2016 +0000
+++ b/Controller/MachineDirectionController.cpp	Sun Feb 07 18:55:50 2016 +0000
@@ -9,7 +9,7 @@
 
 void MachineDirectionController::init() {
     timer_velocity_sampling_time=0.01;
-    
+    max_velocity = 2.0;
     l_Ki=0.1*timer_velocity_sampling_time;
 }
 
@@ -19,32 +19,32 @@
         velocity_set = *(float*)velocity_set_event.value.p;
     }
     
-    velocity_current_event = imu_queue_velocity->get(0);
+   /* velocity_current_event = imu_queue_velocity->get(0);
     if (velocity_current_event.status == osEventMessage) {
         velocity_current = *(float *)velocity_current_event.value.p;
-    }
+    }*/
 }
 
 void MachineDirectionController::cylic_control() {
     check_queues();
-    if( velocity_set < 0.1)
-    {
-        velocity_set=velocity_set_alt;
-        }
-        else if(velocity_set > 1.0){
-            velocity_set=1.0;
-        }
+    if( velocity_set < 0.1) {
+        velocity_set = velocity_set_alt;
+    } else if(velocity_set > max_velocity){
+        velocity_set = max_velocity;
+    }
+    
+    velocity_set = 1.2;
     
     Vorsteuerung=88.316*velocity_set+175.17;
     //l_e = velocity_set-velocity_current;
-//l_esum = l_esum + l_e;
+    //l_esum = l_esum + l_e;
 
-  //  PI_Regler =l_Kp*l_e+l_Ki * l_esum;
+    //PI_Regler =l_Kp*l_e+l_Ki * l_esum;
 
-   // l_output=Vorsteuerung+PI_Regler;
+    //l_output=Vorsteuerung+PI_Regler;
 
 
-   // l_PWM = 1500+l_output;
+    //l_PWM = 1500+l_output;
     l_PWM=1500+Vorsteuerung;
     if(l_PWM<1500) {
         l_PWM = 1500;