ADI 16448 Gyro -- SPI issue bypass

If anyone is interested, I have a working SPI driver for this gyro that bypasses the the burst mode SPI issue, by periodically reading the individual registers. It appears to be working okay, but the changes are very new. Unfortunately this driver consumes about 10% CPU time on the roboRIO. For now I didn’t care because I’m hoping there is an “auto burst mode SPI” fix soon…
I haven’t put the code in github, but I can do this if there is interest.

5 Likes

Count me interested!

Oof.

image

I will be very grateful if you put the code in github!

Still better then:

1 Like

I am interested as well!

So in my haste, I forget to mention that I was only making this change for the LabVIEW driver. However one could take those changes and port them back into the Java/C++ drivers. (If you do that I’d be happy to host the changes here if you like.)

To use the changes, set the “Use Register Mode” input to the Open routine to TRUE. Otherwise the driver will use the problematic Auto SPI routines.
image

I got a little carried away with reducing the CPU consumption. It turned out the original changes used more than 10%, closer to 12-15%. However I was able to get this down to about 7%. I had to remove the accel, mag, and baro pressure reads to do this.

Also this version only supports one 16448 IMU on a robot.

This version does keep the “continuous” calibration data collection that was in the original. It allows an instantaneous calibration to be requested. The saved data is used to calculate new calibration offsets.

I also re-enabled the IMU internal Bartlett filtering function. I set it to the default value of 0x02. Does anyone know why it was turned off. If you want to disable it change the “write config” routine.

I haven’t done a lot of testing with this, but it appears to work okay. If you have enhancements, or fixes, please offer them through github.

The repository for the driver is here.

I was playing with an mpu6050. I first used an Arduino to read then stream from serial.

Next phase was using a pi zero, with an Ethernet and using network tables.

An implementation of gyro that read network tables was used in the drivetrain code.

I posted a newer release. This one further reduces the roboRIO CPU consumption. It also turns on the filtering (bartlett) and averaging (decimation) to further reduce the roboRIO cpu consumption and increase repeatability. It seems that specifying a calibration time between 8 and 11 seconds works pretty well. (I may do the 16470 next if there is interest.)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.