Sensor Software
The purpose of the Inertial Measurement Unit (IMU) board is to record the acceleration and angular velocity of the car, this is useful for the mechanical team to perform vehicle dynamics analysis. The IMU board will communicate with the STM32 micro controller using SPI; the IMU chip will act as the SPI slave with STM32 being the master. The data received is then sent to telemetry. The driver for the board is in charge of reading in accelerometer and gyroscope data in 3 axes. The data received must be time stamped such that it can be cross referenced with the rest of the telemetry data (GPS, power data, accelerator pedal position, driver controls, etc.). It would also be nice to provide a visual simulation of the data collected.
Operating modes
The IMU Chip (LSM6DS3USTR) has three operating modes available:
- only accelerometer active and gyroscope in power-down
- only gyroscope active and accelerometer in power-down
- both accelerometer and gyroscope sensors active with independent ODR (output data rate)
SPI Interface
The board will communicate using 4-wire SPI. The read command is performed with 16 clock pulses. A multiple-byte read command is performed by adding blocks of 8 clock pulses to the previous one.
bit 0: READ bit. The value is 1.
bit 1-7: This is the address field of the indexed register.
bit 8-15: This is the data that will be read from the device (MSb first).
bit 16- … : Further data in multiple byte reads