Bluetooh LE solutions for E46 M3
With the introduction of the Bluetooth Low Energy (BLE) and later the Bluetooth 5 specification, the Bluetooth technology has emerged as an interesting technology to be used within trackday racing. The solution for streaming CAN data to Harry's Lap Timer, proved to be so promising that it was decided to test the concept further by streaming of Brake Disc Temperature measurements over BLE.
The BLE solutions on this site are custom built around the high performing Rigado BMD-series for the Nordic nRF52 SoCs and the Nordic SoftDevice software stack. Hence, all solutions are not only Bluetooth 4.x compliant, but automatically Bluetooth 5 compliant, with all the advantages it implies over the old Bluetooth 4.x.
CAN data to Harry's Lap Timer over BLE
The experience from the development of streaming CAN data over BLE to Harry's Lap Timer, proved that there were no problems streaming data at 100Hz to a capable BLE device. Streaming data to Harry's Lap timer at 100Hz for video overlay, is a bit overkill, and the data stream was constrained to 25Hz for fast data, 1Hz for the slow (like temperatures) and 10Hz for GPS data. Anyway, our BLE solution outperforms any Bluetooth OBDII/ELM327 solution for the E46 M3. The solution works for iOS as well as for Android with Harry's Lap Timer v23.x.
Brake Disc Temperatures over BLE
While a solution for Brake Disc Temperatures over CAN was availabe, the opportunity to transmit the Brake Disc Temperatures over BLE had to be explored. The most important reason why is that for each sensor, one avoids extending the CAN bus to the harsh environment experienced close to the brake calipers and discs. Also the powering can be done quite simple. Only two wires (+12V and GND) is required, or one can omit 12V completely by using a battery. The power supply requirements are very flexible, demanding minium 2.7V and maximum 15V. With a current consumption of only ~10mA when measuring, many track hours can be expected from e.g. powering the sensor from a small 500mAh battery (~50h). Default the Brake Disc Temperatures are streamed over BLE at 50Hz. Max streaming frequency is determined by the BLE specification to 133Hz.
BLE to CAN Gateway
Streaming of data over BLE, means that there has to be "something" receiving the data. A BLE to CAN gateway is developed, which receives the BLE data from the Brake Disc Temperature devices and retransmits them onto the CAN bus. By this it is possible to utilize the Brake Disc Temperatures in the airVentDisplay, as well as stream them for data logging and later analysis. If Harry's Lap Timer should get support for brake disc temperatures, they can easily be streamed over BLE to Harry's Lap Timer.
Damper Displacement Estimation over BLE (in development)
The Brake Disc Temperature sensor can be equipped with a MEMS sensor, measuring acceleration and rotational velocity. By combining these data with a Time-of-Flight (ToF) laser sensor added to the damper for displacement measurements, estimates of the damper displacement can be done. The MEMS data and ToF data are not only inaccurate and noisy, but do also require quite different sampling frequencies. To deal with the accuracy and noise challenges as well as the different sampling frequencies, a Kalmanfilter is implemented locally on the nRF SoC (Edge Computing). The Kalmanfilter contains a digital twin of the relationship between displacement, velocity and acceleration, and is tuned to the tolerance of the MEMS and ToF sensors to produce estimates within 2mm tolerance of the damper displacement. The estimated damper displacement is of course streamed over BLE (default 50Hz).
Figure 1: Simulation results from a system with progressive springs and critical damping
Figure 2: Simulation results from a system with progressive springs and less-than-critical damping (underdamped)
Implementing a Kalmanfilter on the nRF52 SoC
The results of damper displacement estimation indicated promising results in a simulated environment. A critical moment of truth was wether or not the nRF52 SoC was able to run the computationally costly Kalmanfilter, together with the rest of the tasks implemented. The computation of the IR temperatures for the Brake Discs are by them selves quite computationally demanding, using the full 4th order and power of 1/4 equations without table lookup.
Another critical factor was to find a good matrix library well suited for embedded systems, i.e. a library not using malloc(). It turned out that the excellent embedded version of Lapack, EmbeddedLapack by Daniel Martensson, had all the matrix library functions needed to implement a well performing Kalmanfilter. The tests revealed that the nRF52 SoC had no problems running the custom designed Kalmanfilter, together with the rest of the tasks loaded onto this tiny system.