Version 3 is with update to the test rig with a linear actuator

Dependencies:   SPTE_10Bar_5V mbed AS5048 SDFileSystem MODSERIAL PinDetect LCM101 LinearActuator

Files at this revision

API Documentation at this revision

Comitter:
surajgiri
Date:
Tue Oct 20 12:50:40 2020 +0000
Parent:
11:fc82dd22a527
Commit message:
Update with linear actuator

Changed in this revision

constants.cpp 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
diff -r fc82dd22a527 -r 219c16e7d32c constants.cpp
--- a/constants.cpp	Wed Aug 12 12:05:58 2020 +0000
+++ b/constants.cpp	Tue Oct 20 12:50:40 2020 +0000
@@ -1,7 +1,7 @@
 #include "constants.h"
 
 namespace sensors {
-    const bool use5kN = true;
+    const bool use5kN = false;
     
     // LCM101-100kgf force sensor
     // Equation from 7/6/2018 calibration used:
@@ -11,10 +11,10 @@
     // kLcm101Offset = 4.31
     // kLcm101Factor = 1001.1
     
-    const float kLcm101Offset = 4.31;//-1.52;
+    const float kLcm101Offset = -1.5;//-1.52;
     //This is currently the offset for the S610 sensor -5.41;
     //Offset for LCM101 sensor = -1.52
-    const float kLcm101Factor = 1001.1;//970.55;
+    const float kLcm101Factor = 970.55;//970.55;
     //This is currently the factor for the S610 sensor 977.35;
     //Factor for LCM101 sensor is 970.55
     
@@ -47,13 +47,13 @@
     const int kNumJoints = 1;
 
     const char *kJointNames[]     = {"Knee"};//{"1","Knee","3","4"};
-    const float kOffsetsDegrees[] = {76.9};//{180,180,180,180};
+    const float kOffsetsDegrees[] = {250};//{180,180,180,180};
     const bool kDirections[] = {true};//{true,true,true,true};
 }
 
 namespace timing {
     const int TimeControlHertz = 1000;// control loop sample rate
-    const int LogDataHertz = 250; //data log sample rate
+    const int LogDataHertz = 249; //data log sample rate
     const int SerialPrintHertz = 2; //print rate of serial 
     const int kTimeControlUs            =   1000000/TimeControlHertz;   // 1000 Hz control loop
     const int kTimeLogDataUs            =  1000000/LogDataHertz;   //   200 Hz data logging
diff -r fc82dd22a527 -r 219c16e7d32c main.cpp
--- a/main.cpp	Wed Aug 12 12:05:58 2020 +0000
+++ b/main.cpp	Tue Oct 20 12:50:40 2020 +0000
@@ -43,8 +43,8 @@
     string colNames[] = {"Target pressure (kPa)","Cycle",}; //add data headings
     leg.setExtraColumns(colNames,2);
     
-    float targetP = 350;                                                                                                                                                                                             0; //Target pressure in kPa
-    int expCycles = 100; //Number of sit to stand to sit cycles 
+    float targetP = 300;                                                                                                                                                                                        
+    int expCycles = 40; //Number of sit to stand to sit cycles 
     float vals[] = {targetP,0}; //set initial values of data that will be logged
     leg.setExtraData(vals);
     
@@ -60,7 +60,7 @@
     while (true) {
         if (leg.isLogging()) {
             leg.pc.printf("Logging started");
-            //runFatigueExperiment0(expCycles,targetP,10,10);
+            runFatigueExperiment0(expCycles,targetP,10,10);
             //runBenchmarkExperiment0();
             runBenchmarkExperiment1(75, 1, 10);    
             //runFailureExp0(targetP);        
@@ -82,7 +82,7 @@
     //The experiment starts when logging does
     Timer flowT;//used to time flow into and out of actuator
     float loopTime = 0.1; //(s) time between checking pressure
-    int num_file = 10; //number of data files to save 
+    int num_file = 1; //number of data files to save 
     
     for (int i=0; i<num_file; i++) {