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
Diff: bench.cpp
- Revision:
- 7:edb876c98565
- Parent:
- 6:02507d7a6f51
- Child:
- 8:bc467f5fe7c3
diff -r 02507d7a6f51 -r edb876c98565 bench.cpp --- a/bench.cpp Mon Dec 09 11:15:47 2019 +0000 +++ b/bench.cpp Mon Dec 09 12:51:14 2019 +0000 @@ -1,12 +1,11 @@ #include "bench.h" /** - * Create an object representing the testbench; the 4 AS5048 sensors - * with the offsets specified by the constants kOffsetsDegrees[4] - * @param mosi: mosi pin for sensor chain - * @param miso: miso pin for sensor chain - * @param sck: clock pin for sensor chain - * @param cs: chip select pin for sensor chain + * Create an object representing the test rig + * @param mosi: mosi pin for sensor chain (SPI angle sensors) + * @param miso: miso pin for sensor chain (SPI angle sensors) + * @param sck: clock pin for sensor chain (SPI angle sensors) + * @param cs: chip select pin for sensor chain (SPI angle sensors) * @param use5kNLoadCell: if 5kN load cell is used (if false, 1kN sensor is used) * @param p_lcm101: analog input pin for load cell * @param p_spte0: analog input pin for pressure sensor 0 @@ -64,13 +63,14 @@ /** * Initialises: timers, SD card + * Prints a welcome message and information on the logging frequency and sensor + * reading rate */ void Bench::initialise() { //setup the timing tick_update.attach_us(this,&Bench::update,timing::kTimeControlUs); - - + // set rate at which data is printed tick_serial.attach_us(this,&Bench::PrintStatus,timing::kTimeSerialPrintUs); @@ -152,10 +152,10 @@ // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = /** - * Update routine for the testbench. + * Update routine for the test rig * - Updates the angle buffer of the sensor array * - ... that's it for now (add filtering?) - * Note that angles lag one Update() behind, due to the way the SPI + * Note that angles lag one update() behind, due to the way the SPI * protocol works. */ void Bench::update() @@ -164,7 +164,7 @@ } /** - * Obtain the joint angle in degrees. + * Obtain the joint angle in degrees * These are the angles at the time of two Update() calls back * @param joint: the joint for which the angle is requested (as enumerated in * class header - TOES, KNEE, ANKLE, HIP @@ -176,7 +176,7 @@ } /** - * Obtain the joint angle in degrees. + * Obtain the joint angle in degrees * These are the angles at the time of two Update() calls back * @param joint: the joint for which the angle is requested (a number starting * from 0 indicating the position in the sensor daisy chain) @@ -192,7 +192,7 @@ } /** - * Obtain the joint angle in radians. + * Obtain the joint angle in radians * These are the angles at the time of two Update() calls back * @param joint: the joint for which the angle is requested (as enumerated in * class header - TOES, KNEE, ANKLE, HIP @@ -204,7 +204,7 @@ } /** - * Obtain the joint angle in radians. + * Obtain the joint angle in radians * These are the angles at the time of two Update() calls back * @param joint: the joint for which the angle is requested (a number starting * from 0 indicating the position in the sensor daisy chain) @@ -236,7 +236,7 @@ } /** - * The force applied vertically at the hip join in N. + * The force applied vertically at the hip joint in N * @return: force */ float Bench::getForce() @@ -293,7 +293,7 @@ } /** - * The valve state (true is on/pressurising and false is off/depressurising) + * The valve state (true is on/pressurising and false is off/depressurising). * @return: valve state */ bool Bench::getValve() { @@ -306,7 +306,7 @@ /** * Check contents of SD card and count files in order - * to ensure unique file name for logging data + * to ensure unique file name for logging data. */ void Bench::InitSdCard() { @@ -346,7 +346,7 @@ /** * Start logging data * param fname_append: a string describing the name appended to each logged file - * (along with its unique loggging number) + * (along with its unique loggging number). */ void Bench::StartLogging(const char * fname_append) { @@ -391,7 +391,7 @@ /** - * Stop logging data + * Stop logging data. */ void Bench::StopLogging() {