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

Dependencies:   SPTE_10Bar_5V mbed AS5048 SDFileSystem MODSERIAL PinDetect LCM101 LinearActuator

Revision:
4:1cdce6c6c94e
Parent:
2:84d479fe9b5e
Child:
5:63063a9fa51c
--- a/constants.cpp	Tue Jun 05 08:51:45 2018 +0000
+++ b/constants.cpp	Fri Oct 12 12:12:55 2018 +0000
@@ -3,12 +3,21 @@
 namespace sensors {
     
     // LCM101-100kgf force sensor
-    const float kLcm101Offset = -1.52;
+    const float kLcm101Offset = 1.99;//-1.52;
     //This is currently the offset for the S610 sensor -5.41;
     //Offset for LCM101 sensor = -1.52
-    const float kLcm101Factor = 970.55;
+    const float kLcm101Factor = 969.2;//970.55;
     //This is currently the factor for the S610 sensor 977.35;
     //Factor for LCM101 sensor is 970.55
+    
+    // Pressure sensor slope and offset values for a gauge pressure reading in bar
+    const float kSPTE0Offset = -2.47;
+    
+    const float kSPTE0Factor = 12.5; //
+        
+    const float kSPTE1Offset = -2.47;
+    
+    const float kSPTE1Factor = 12.5; //   
         
     // AS5048 abs angle sensor chain
     const int kNumJoints = 4;
@@ -19,8 +28,10 @@
 }
 
 namespace timing {
-    const int kTimeControlUs            =   1000;   // 1000 Hz control loop
-    const int kTimeLogDataUs            =  20000;   //   50 Hz data logging
+    const int TimeControlHertz = 5000;// control loop sample rate
+    const int LogDataHertz = 500; //data log sample rate
+    const int kTimeControlUs            =   1000000/TimeControlHertz;   // 1000 Hz control loop
+    const int kTimeLogDataUs            =  1000000/LogDataHertz;   //   200 Hz data logging
     const int kTimeSerialPrintUs        = 500000;   //    2 Hz serial print
   
     const int kSerialBaudrate = 115200;