Merged to branch

Dependencies:   USBDevice mbed EquatorStrutController LightWeightSerialTransmit

Fork of EquatorStrutDigitalMonitor by Stewart Coulden-Smith

Files at this revision

API Documentation at this revision

Comitter:
alpesh
Date:
Thu Aug 07 08:52:19 2014 +0000
Parent:
4:2ec05810bc47
Child:
6:bfe745b152fa
Commit message:
SerialTransmit Changes

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Aug 07 08:38:18 2014 +0000
+++ b/main.cpp	Thu Aug 07 08:52:19 2014 +0000
@@ -147,7 +147,7 @@
 
 double GetSpeed()
 {
-    if ((RunningTime - lastTime) > 10000)
+    if ((RunningTime - lastTime) > 10000 || interruptPeriod == 0)
     {
         return 0.0;
     }
@@ -397,7 +397,7 @@
 double ErrorInt;
 double ErrorDer;
 
-double KpGain = 0.002;
+double KpGain = 0.001;
 double KiGain = 0.0;
 double KdGain = 0.0;
 
@@ -435,9 +435,9 @@
                     pwm = 1.0;
                 }
             
-                else if (NewPwm < 0.0)
+                else if (NewPwm < -1.0)
                 {
-                    pwm = 0.0;
+                    pwm = -1.0;
                 }
             
                 else
@@ -481,18 +481,22 @@
 
     while(1)
     {
+        
+        
         while(position < 200)
         {
+            SerialTransmit();
+            
             Controller();
         }
         
-        TargetSpeed = -50.0
+        TargetSpeed = -50.0;
         
         while(position > 10)
         {
+            SerialTransmit();
+            
             Controller();
         }
-        
-        SerialTransmit();
     }
 }
\ No newline at end of file