IMU and RC receiver on Teensy 4.1 problem

Status
Not open for further replies.

Pete1241

New member
Hello all, in my project I have two IMUs (Adafruit BNO055 and Adafruit FXOS8700 + FXAS21002) and RC receiver (6 channels) connected to Teensy 4.1. This RC receiver produces PWM at 50hz which teensy is reading them through interrupts using attachInterrupt() function. Now, the way I have it setup is higher-level processor (say an Nvidia Jetson) can request IMU information by sending a string via USB to teensy, which teensy will run provided adafruit library functions to acquire IMU data and send it back to higher-level processor.

The problem is occasionally, with seemingly no pattern, there would be an impossibly high read in IMU data such as acceleration of 1,000,000 m/s^2. This also occur for angular velocity as well. I believe the cause is the interrupts from RC receiver PWM would occasionally by chance happens in the middle of IMU reads function, which causes it to misread the data due to timing issue. This is because this problem seems to only happen when RC receiver is active.

Do you think my assessment is correct? I have heard that Input Capture is a more efficient way to go about this, but I am not sure if it is true or it would even solve this problem. What should I do?

Thank you for your help in advance.
 
Status
Not open for further replies.
Back
Top