robot

Dependencies:   FastPWM3 mbed

Revision:
25:3f2b585ae72d
Parent:
24:5e18a87a0e95
Child:
26:955a1dfc2705
--- a/main.cpp	Sat Nov 05 14:02:22 2016 +0000
+++ b/main.cpp	Sat Nov 05 15:49:11 2016 +0000
@@ -31,7 +31,7 @@
 float last_d = 0.0f, last_q = 0.0f;
 float d_ref = 0.0f, q_ref = 0.0f;
 
-bool control_enabled = true;
+bool control_enabled = false;
 
 void commutate();
 void zero_current();
@@ -89,8 +89,8 @@
 }
 
 void commutate() {
-    //if(control_enabled && !throttle_in.get_enabled()) go_disabled();
-    //if(!control_enabled && throttle_in.get_enabled()) go_enabled();
+    if(control_enabled && !throttle_in.get_enabled()) go_disabled();
+    if(!control_enabled && throttle_in.get_enabled()) go_enabled();
     
     update_velocity();