Reply To: Time Scale
I have been using a baud rate of 115200. I just double checked my ratio of valid to total packets (I haven’t looked at this in a while and have gave a rough guess earlier). For 3 runs which should have lasted roughly 30 seconds each I was getting on average 1144 valid packets out of 2860 total packets or roughly 4 out of 10 valid packets. The IMU was broadcasting at 100 Hz. The 30 seconds was the time difference from IMU packets, the code stops after the time difference is over 30 seconds.
I reduced the baud rate to 57600 and also reduced the broadcast frequency to 30 Hz. The results were worse. For 2 runs which should have lasted roughly 30 seconds each. I got 531 valid out of 13787 total and 136 valid out of 30346 total. Again the 30 seconds was the time difference from IMU packets, the code stops after the time difference is over 30 seconds.
I know that based on the output counter message I have in my code that when running the IMU at both 57600 and 115200 there are periods when code gets stuck waiting for a valid packets after the code has been running for a few seconds. At 11520 this pause is very brief but at 57600 the pause can last what seems to be roughly 20-40 seconds at times.
I believe this is an indication that the timing of the baud rates of the BeagleBone and IMU are not staying aligned correctly. I am not sure what might be cause this or what I maybe able to do to correct it.
I should also mention that currently in my code I receive each character/byte from the IMU one at a time, filling a buffer manually/my own software function, rather than using a pre-built library function which access the buffer from hardware. I had originally converted this from an arduino code, and did not find it neccessary to switch to different functions. I will try switching to library function which access the buffer status from hardware to see if this results in a significant improvement.
If you have other suggestions/observations please let me know, any additional hints will be greatly appreciated.