Generation 3 of the Harp project

Dependencies:   Servo TMP36 GZ buffered-serial1 chan_fatfs_sd nmea_parser watchdog mbed-rtos mbed

Fork of HARP2 by Tyler Weaver

Files at this revision

API Documentation at this revision

Comitter:
tylerjw
Date:
Thu Jan 17 18:09:16 2013 +0000
Parent:
30:b81274979e73
Child:
32:4f811b397720
Commit message:
Tested release servo, updated release servo logic.

Changed in this revision

config.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/config.h	Thu Jan 17 01:44:32 2013 +0000
+++ b/config.h	Thu Jan 17 18:09:16 2013 +0000
@@ -24,6 +24,9 @@
 const float SERVO_R_MAX = 0.0006; // servo calibration
 const float SERVO_R_MIN = -0.0015; // servo calibration
 
+const float SERVO_RELEASE_MIN = -0.0011;
+const float SERVO_RELEASE_MAX = 0.0004;
+
 const int RELEASE_ALT = 4572; // 15k ft in meeters
 const int ALARM_ALT = 2133; // altitude to key alarm on descent
 
--- a/main.cpp	Thu Jan 17 01:44:32 2013 +0000
+++ b/main.cpp	Thu Jan 17 18:09:16 2013 +0000
@@ -3,7 +3,6 @@
 *
 * TODO: Test Servo Code
 *       Test Watchdog Timer
-*       Test Append file and f_size() macro
 */
 
 #include "mbed.h"
@@ -210,7 +209,7 @@
         queue_sensor_line.put(message);
 
         sensor_wd = true; // kick the dog
-        Thread::wait(500);
+        Thread::wait(200);
     }
 }
 
@@ -229,18 +228,12 @@
     left_s.calibrate_min(SERVO_L_MIN);
     right_s.calibrate_max(SERVO_R_MAX);
     right_s.calibrate_min(SERVO_R_MIN);
-
-    // TODO: Calibrate release servo
+    release_s.calibrate_max(SERVO_RELEASE_MAX);
+    release_s.calibrate_min(SERVO_RELEASE_MIN);
 
     left_s = 0.0;
     right_s = 0.0;
-
-    // TODO: Move release servo in and out to allow attachment on startup
-    release_s = 0.0; // NOT TESTED!
-    Thread::wait(1000);
-    parachute_wd = true; // kick the dog
-    Thread::wait(1000);
-    release_s = 1.0;
+    release_s = 0.0;
 
     ////////////////////////////////////////////////////////////////////////////////
 
@@ -258,7 +251,10 @@
             parachute_wd = true; // kick the dog
 
         if(!is_released)
-            release_s = 0.0; // let go of the balloon (NOT Tested)
+        {
+            release_s = 1.0; // let go of the balloon
+            is_released = true;
+        }
         
         if(counter < test_length) // test flight -- (NOT Tested)
         {