Hey guys,
I've been designing a biomechanical system to track a participants leg motion while walking. The sensors will include 3 IMU's and 2 FSR's, and will synchronously store data to a microSD card using the T4.1. (I realize the photo below has the T3.6, I've since upgraded)
The IMU's are CH Robotics UM7's and each will be sending gyro {x,y,z}, accel {x,y,z}, and euler {r,p,y} data as binary packets at 255Hz. The UM7's are each allotted a Serial bus, since I couldn't get the SPI code to work. I've created a library to read from the UM7 sensor over UART using the Arduino IDE, and is available here. I'm fairly new to programming, so I'll take any pointers/help you guys have! The UM7 doesn't have an interrupt pin...
The FSR's will each send analog data at 1000Hz as a ground truth.
I've been using Bill Greiman's ExFatLogger example to attempt to store all the data. I'm finding it difficult to synchronously read data from the IMU's since I need to probe the specific Serial bus while in the logRecord() function (I don't have an issue with the FSR's since they're analog and match the ExFatLogger example exactly). Here's what I've done for logRecord() using one UM7 for roll, pitch, and yaw as a test:
The ExFatLogger.h contents:
The output I get with the above changes to ExFatLogger gives me:
for all datasets. I've confirmed the sensor works and that my wiring is correct (storing data from some analog sensors).
As far as I understand, I think the logData() function in the ExFatLogger is taking too much time between the UM7 samples. Is there a way I could store the UART data into a buffer then copy it to data->in[] once the program enters logRecord()? Let me know if you need more information and thanks in advance!
I've been designing a biomechanical system to track a participants leg motion while walking. The sensors will include 3 IMU's and 2 FSR's, and will synchronously store data to a microSD card using the T4.1. (I realize the photo below has the T3.6, I've since upgraded)
The IMU's are CH Robotics UM7's and each will be sending gyro {x,y,z}, accel {x,y,z}, and euler {r,p,y} data as binary packets at 255Hz. The UM7's are each allotted a Serial bus, since I couldn't get the SPI code to work. I've created a library to read from the UM7 sensor over UART using the Arduino IDE, and is available here. I'm fairly new to programming, so I'll take any pointers/help you guys have! The UM7 doesn't have an interrupt pin...
The FSR's will each send analog data at 1000Hz as a ground truth.
I've been using Bill Greiman's ExFatLogger example to attempt to store all the data. I'm finding it difficult to synchronously read data from the IMU's since I need to probe the specific Serial bus while in the logRecord() function (I don't have an issue with the FSR's since they're analog and match the ExFatLogger example exactly). Here's what I've done for logRecord() using one UM7 for roll, pitch, and yaw as a test:
Code:
void logRecord(data_t* data, uint16_t overrun) {
if(Serial1.available()) {
if(imu.decode(Serial1.read())) {
data->in[0] = imu.roll;
data->in[1] = imu.pitch;
data->in[2] = imu.yaw;
}
}
}
Code:
#ifndef ExFatLogger_h
#define ExFatLogger_h
struct data_t {
float in[3];
};
#endif // ExFatLogger_h
Code:
0.00 overrun -1
As far as I understand, I think the logData() function in the ExFatLogger is taking too much time between the UM7 samples. Is there a way I could store the UART data into a buffer then copy it to data->in[] once the program enters logRecord()? Let me know if you need more information and thanks in advance!