Torque calculation added to leg readout
Dependencies: AS5048 LCM101 MODSERIAL PinDetect SDFileSystem mbed
Fork of heros_leg_readout by
constants.cpp@3:3fd9f1a00381, 2018-06-05 (annotated)
- Committer:
- Technical_Muffin
- Date:
- Tue Jun 05 08:51:45 2018 +0000
- Revision:
- 3:3fd9f1a00381
- Parent:
- 2:84d479fe9b5e
added torque calculation to the main file of the code. New calibration values were also added to correctly display the values.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
megrootens | 0:3855d4588f76 | 1 | #include "constants.h" |
megrootens | 0:3855d4588f76 | 2 | |
megrootens | 0:3855d4588f76 | 3 | namespace sensors { |
megrootens | 0:3855d4588f76 | 4 | |
megrootens | 0:3855d4588f76 | 5 | // LCM101-100kgf force sensor |
Technical_Muffin | 2:84d479fe9b5e | 6 | const float kLcm101Offset = -1.52; |
Technical_Muffin | 2:84d479fe9b5e | 7 | //This is currently the offset for the S610 sensor -5.41; |
Technical_Muffin | 2:84d479fe9b5e | 8 | //Offset for LCM101 sensor = -1.52 |
Technical_Muffin | 2:84d479fe9b5e | 9 | const float kLcm101Factor = 970.55; |
Technical_Muffin | 2:84d479fe9b5e | 10 | //This is currently the factor for the S610 sensor 977.35; |
Technical_Muffin | 2:84d479fe9b5e | 11 | //Factor for LCM101 sensor is 970.55 |
Technical_Muffin | 2:84d479fe9b5e | 12 | |
megrootens | 0:3855d4588f76 | 13 | // AS5048 abs angle sensor chain |
megrootens | 0:3855d4588f76 | 14 | const int kNumJoints = 4; |
megrootens | 0:3855d4588f76 | 15 | |
megrootens | 0:3855d4588f76 | 16 | const char *kJointNames[] = {"Toes","Ankle","Knee","Hip"}; |
megrootens | 0:3855d4588f76 | 17 | const float kOffsetsDegrees[] = {83.2f,6.3f,170.7f,6.5f}; |
megrootens | 0:3855d4588f76 | 18 | const bool kDirections[] = {false,true,false,true}; |
megrootens | 0:3855d4588f76 | 19 | } |
megrootens | 0:3855d4588f76 | 20 | |
megrootens | 0:3855d4588f76 | 21 | namespace timing { |
megrootens | 0:3855d4588f76 | 22 | const int kTimeControlUs = 1000; // 1000 Hz control loop |
megrootens | 0:3855d4588f76 | 23 | const int kTimeLogDataUs = 20000; // 50 Hz data logging |
megrootens | 0:3855d4588f76 | 24 | const int kTimeSerialPrintUs = 500000; // 2 Hz serial print |
megrootens | 0:3855d4588f76 | 25 | |
megrootens | 0:3855d4588f76 | 26 | const int kSerialBaudrate = 115200; |
megrootens | 0:3855d4588f76 | 27 | } |