Motor control for robots. More compact, less object-oriented revision.

Dependencies:   FastPWM3 mbed-dev-f303

Fork of Hobbyking_Cheetah_V1 by Ben Katz

Revision:
27:501fee691e0e
Parent:
26:2b865c00d7e9
Child:
28:8c7e29f719c5
--- a/main.cpp	Mon May 01 15:22:58 2017 +0000
+++ b/main.cpp	Wed May 17 14:53:22 2017 +0000
@@ -249,8 +249,8 @@
                 //TIM1->CCR2 = 0x708*(1.0f);     
                 
                 //controller.i_q_ref = controller.t_ff/KT_OUT;   
-                //torque_control(&controller);      
-                controller.i_q_ref = 1; 
+                torque_control(&controller);      
+                //controller.i_q_ref = 1; 
                 commutate(&controller, &gpio, controller.theta_elec);           // Run current loop
                 spi.Sample();                                                   // Sample position sensor
                 toggle.write(0);