Code for the COVR project DROPSAW project test rig (previously used for the Heros testing).

Dependencies:   SPTE_10Bar_5V mbed AS5048 SDFileSystem MODSERIAL LCM101_DROPSAW LinearActuator

Committer:
cnckiwi31
Date:
Mon Oct 26 11:55:27 2020 +0000
Revision:
15:a84d54e25775
Parent:
13:219c16e7d32c
Code ready for inclusion in documentation (compiles, but no last check on runBenchmarkExperiment1() code done)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cnckiwi31 15:a84d54e25775 1 /* Copyright 2020 Allan Joshua Veale
cnckiwi31 15:a84d54e25775 2
cnckiwi31 15:a84d54e25775 3 Licensed under the Apache License, Version 2.0 (the "License");
cnckiwi31 15:a84d54e25775 4 you may not use this file except in compliance with the License.
cnckiwi31 15:a84d54e25775 5 You may obtain a copy of the License at
cnckiwi31 15:a84d54e25775 6
cnckiwi31 15:a84d54e25775 7 http://www.apache.org/licenses/LICENSE-2.0
cnckiwi31 15:a84d54e25775 8
cnckiwi31 15:a84d54e25775 9 Unless required by applicable law or agreed to in writing, software
cnckiwi31 15:a84d54e25775 10 distributed under the License is distributed on an "AS IS" BASIS,
cnckiwi31 15:a84d54e25775 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
cnckiwi31 15:a84d54e25775 12 See the License for the specific language governing permissions and
cnckiwi31 15:a84d54e25775 13 limitations under the License.
cnckiwi31 15:a84d54e25775 14 */
cnckiwi31 15:a84d54e25775 15
megrootens 0:3855d4588f76 16 #include "constants.h"
megrootens 0:3855d4588f76 17
cnckiwi31 15:a84d54e25775 18 /** Default values for constants
cnckiwi31 15:a84d54e25775 19 */
cnckiwi31 15:a84d54e25775 20
megrootens 0:3855d4588f76 21 namespace sensors {
surajgiri 13:219c16e7d32c 22 const bool use5kN = false;
megrootens 0:3855d4588f76 23
megrootens 0:3855d4588f76 24 // LCM101-100kgf force sensor
cnckiwi31 15:a84d54e25775 25 const float kLcm101Offset = -1.5;
cnckiwi31 15:a84d54e25775 26 const float kLcm101Factor = 970.55;
cnckiwi31 15:a84d54e25775 27
cnckiwi31 5:63063a9fa51c 28 // Equation from 7/6/2018 calibration used:
cnckiwi31 5:63063a9fa51c 29 // kLcm101Offset = 1.99
cnckiwi31 5:63063a9fa51c 30 // kLcm101Factor = 969.2
cnckiwi31 5:63063a9fa51c 31 // Equation from 8/3/2019 calibration used:
cnckiwi31 5:63063a9fa51c 32 // kLcm101Offset = 4.31
cnckiwi31 5:63063a9fa51c 33 // kLcm101Factor = 1001.1
cnckiwi31 5:63063a9fa51c 34
cnckiwi31 4:1cdce6c6c94e 35
cnckiwi31 5:63063a9fa51c 36 // Gen5kN force sensor
cnckiwi31 15:a84d54e25775 37 const float kGen5kNOffset = 0;
cnckiwi31 15:a84d54e25775 38 const float kGen5kNFactor = 5530;
cnckiwi31 15:a84d54e25775 39
cnckiwi31 5:63063a9fa51c 40 // Equation from 21/2/2019 calibration used:
cnckiwi31 5:63063a9fa51c 41 // kLcm101Offset = 21.2
cnckiwi31 5:63063a9fa51c 42 // kLcm101Factor = 5530
cnckiwi31 15:a84d54e25775 43
cnckiwi31 5:63063a9fa51c 44
cnckiwi31 4:1cdce6c6c94e 45 // Pressure sensor slope and offset values for a gauge pressure reading in bar
cnckiwi31 5:63063a9fa51c 46 // Equation from 25/6/2018 calibration used:
cnckiwi31 15:a84d54e25775 47 const float kSPTE0Offset = -2.33;
cnckiwi31 15:a84d54e25775 48 const float kSPTE0Factor = 12.0;
cnckiwi31 15:a84d54e25775 49
cnckiwi31 15:a84d54e25775 50 const float kSPTE1Offset = -2.47;
cnckiwi31 15:a84d54e25775 51 const float kSPTE1Factor = 12.5;
cnckiwi31 4:1cdce6c6c94e 52
cnckiwi31 5:63063a9fa51c 53 // Equation from 21/2/2019 calibration used
cnckiwi31 5:63063a9fa51c 54 // kSPTE0Offset = -2.33
cnckiwi31 5:63063a9fa51c 55 // kSPTE0Factor = 12.0
cnckiwi31 4:1cdce6c6c94e 56
Technical_Muffin 2:84d479fe9b5e 57
megrootens 0:3855d4588f76 58 // AS5048 abs angle sensor chain
cnckiwi31 15:a84d54e25775 59 const int kNumJoints = 1;// if hard leg used again - use 4
megrootens 0:3855d4588f76 60
cnckiwi31 15:a84d54e25775 61 const char *kJointNames[] = {"Knee"};// if hard leg used again - use {"Toes","Ankle","Knee","Hip"}
cnckiwi31 15:a84d54e25775 62 const float kOffsetsDegrees[] = {250};// if hard leg used again - use {83.2f,6.3f,170.7f,6.5f}
cnckiwi31 15:a84d54e25775 63 const bool kDirections[] = {true};// if hard leg used again - use {false,true,false,true}
megrootens 0:3855d4588f76 64 }
megrootens 0:3855d4588f76 65
megrootens 0:3855d4588f76 66 namespace timing {
cnckiwi31 5:63063a9fa51c 67 const int TimeControlHertz = 1000;// control loop sample rate
surajgiri 13:219c16e7d32c 68 const int LogDataHertz = 249; //data log sample rate
cnckiwi31 15:a84d54e25775 69 const int SerialPrintHertz = 2; //print rate of serial
cnckiwi31 15:a84d54e25775 70
cnckiwi31 15:a84d54e25775 71 //corresponding values as a period
cnckiwi31 4:1cdce6c6c94e 72 const int kTimeControlUs = 1000000/TimeControlHertz; // 1000 Hz control loop
cnckiwi31 4:1cdce6c6c94e 73 const int kTimeLogDataUs = 1000000/LogDataHertz; // 200 Hz data logging
cnckiwi31 5:63063a9fa51c 74 const int kTimeSerialPrintUs = 1000000/SerialPrintHertz; // 2 Hz serial print
surajgiri 11:fc82dd22a527 75
cnckiwi31 15:a84d54e25775 76 const int minKeyInt = 1; //minimum key press interval in s. if key is pressed more than once in this time interval it will just register as one press
cnckiwi31 15:a84d54e25775 77 const int kSerialBaudrate = 115200; //serial data rate
cnckiwi31 15:a84d54e25775 78
cnckiwi31 15:a84d54e25775 79 const int PWMHertz = 10000;//linear actuator PWM frequency
cnckiwi31 5:63063a9fa51c 80 }
cnckiwi31 5:63063a9fa51c 81
cnckiwi31 5:63063a9fa51c 82 namespace rigStructure {
cnckiwi31 5:63063a9fa51c 83 const bool invertedRig = false; //indicates if rig is inverted or not (for internal torque calculation)
megrootens 0:3855d4588f76 84 }