servodisc goodness

Dependencies:   mbed-dev-f303

Revision:
7:a278f58cdbd3
Parent:
6:1143996ac690
--- a/main.cpp	Mon Jan 15 16:12:52 2018 +0000
+++ b/main.cpp	Mon Jan 22 05:33:06 2018 +0000
@@ -111,16 +111,17 @@
         */
       Control();
       
-      /*
+      
       if(count > 5000){
           //io.printf("derp\n\r");
           //pc.printf("derp\n\r");
-          pc.printf("%d  \n\r", q_raw);
+          //pc.printf("Encoder:   %d  AND:   %d\n\r", q_raw, d_in.read());
           //printf("%f   %f\n\r", dq, dqdebug);
           //d_out = !d_out;
           count = 0;
           }
-          */
+          
+          
           //a_out.write(q/2.0f);
           
   TIM1->SR = 0x0; // reset the status register
@@ -190,6 +191,7 @@
         if(data == '\n')
         receive_move_sequence(pc,&state_machine_info);
     }
+    //reset_mbed();
 }
 
 // END STATE MACHINE CODE
@@ -291,8 +293,8 @@
     
     //q_ref = 0.0f;
     if(run_control == 0){
-        e = 0;
-        //e = 40.0f*(q_ref - q) + .2f*(0.0f-dq);
+        //e = 0;
+        e = 100.0f*(q_ref - q) + .25f*(0.0f-dq);
         }
     if(run_control&(abs(q_ref - q))<.05f){
         printf("control done\n\r");}