cancel
Showing results for 
Search instead for 
Did you mean: 

Vehicle crash and roll detection demo leverages on MLC and FSM embedded in ISM330DHCX

Denise SANFILIPPO
ST Employee

1. Demo Functionality and definition

In this demonstration, a remote-control (RC) car is used instead of an actual car, and the MLC and FSM embedded in ST's 6-axis MEMS sensor detect the inertial frame of reference of the vehicle in real time.

The following six states of movement of the RC (remote-control) car to be detected by the MLC were defined.

  • Status 0: Stop (The car is stopped, no movement and no vibration).
  • Status 1: Running (The car is moving on a smooth surface).
  • Status 2: Rough Road (The car is moving on very rough surface with high vibration).
  • Status 3: On a Bank (The car is rolling right or left, regardless of moving or stopping status).
  • Status 4: On a Slope (The car is on a slope with the front or rear up or down, regardless of moving or stopping status).
  • Status 5: Overturned (The car has turned over and is upside down).

 

DeniseSANFILIPPO_0-1687168142365.png

In addition to the MLC, we programmed the FSM to recognize if the car has crashed. The crash raises a flag when the RC car hits something from the front (front-end collision).

  • Crash 0: No crash is detected.
  • Crash 1: Front-end collision is detected.
DeniseSANFILIPPO_1-1687168142377.png

To make the position of the RC car easily understood, we also implemented the Motion FX library in the STM32 project to show the 3D graphics of the car.

Note that these are defined for demonstration purposes only with a RC car but they do not represent real car use cases.

2. Board and Software Setup

The hardware setup is very simple. We are just using an STWIN kit (STEVAL-STWINKT1B) by fixing it on top of the commercial remote-control car as shown in the picture below.

 

DeniseSANFILIPPO_2-1687168142406.png

The device used in this demo is ISM330DHCX, which is an industrial grade 6-axis IMU present inside the STWIN kit. An automotive-grade 6-axis MEMS sensor is the ASM330LHHX, but for demonstration purposes, we used the STWIN kit due to the similarity in functionality.

For data transmission to the PC, wireless communication by Bluetooth® Low Energy is used. So, it does not need any cables.

The software used is Unico-GUI, Unicleo-GUI and AlgoBuilder:

  • Unico-GUI is used to make a configuration file of the MLC and FSM for ISM330DHCX.
  • AlgoBuilder is used to develop the firmware for the STM32L4R9 host MCU of the STWIN kit. This firmware configures ISM330DHCX, reads the outputs of the MLC / FSM, and passes them to Unicleo-GUI via the Bluetooth® Low Energy component.
  • Unicleo-GUI graphically displays the results of sensor fusion, vehicle status by the MLC, and crash detection by the FSM.

 

DeniseSANFILIPPO_3-1687168142430.png

3. Configuring the MLC

By using the above hardware setup, we collected data logs for each status (classes to be recognized, which are described in Section 1) and made the configuration of the MLC. The main parameters are shown below.

Basic settings of the MEMS sensor

Device: ISM330DHCX

XL ODR: 104Hz

XL FS: +/-4g

Gyro ODR: 104Hz

Gyro FS: +/-2000dps

Power mode: High-performance mode (XL & Gyro)

Configuration parameters of the MLC for vehicle status recognition

MLC ODR: 104Hz

Window length: 208 samples (about 2 seconds)

Filters: No

Selected features:

  • MEAN_on_ACC_X,Y,Z, V and V2
  • VAR_on_ACC_X,Y,Z,V and V2
  • VAR_on_GY_X,Y,Z V and V2
  • ENERGY_on_ACC_X,Y,Z,V and V2

Meta classifier: No

The resulting decision tree is shown in the figure below.

 

DeniseSANFILIPPO_4-1687168142437.png

To obtain this decision tree, we have referred to the guidelines described in DT0139. In other words, we did a data check, a cleaning to eliminate error data and a visual check manually. But no optimization, such as pruning, is carried out due to time and resource constraints.

4Configuring the FSM for crash detection

We also implemented accident detection on the front-end of the RC car in the FSM, because the FSM is better suited to detect short-term events such as accidents than the MLC.

This figure shows the accident detection parameters we defined for the demo using Unico-GUI for the FSM.

DeniseSANFILIPPO_5-1687168142448.png

The axis to be detected is only +Y, and the threshold is set to -2[g], whose value was determined by trial and error.

To automatically clear the output register of the FSM after a few seconds, the firmware has some additional command and timer settings in addition to the main part for shock detection.

5. Generating firmware for STM32

To implement the MLC and FSM configuration, we developed firmware for STM32L4R9, which is the host MCU of the STWIN kit. The following figure shows the algorithm block diagram of the firmware we made using AlgoBuilder.

DeniseSANFILIPPO_6-1687168142451.png
 
"STWIN BLE” was selected as the target board in the “Firmware Settings” dialog box of AlgoBuilder.

The firmware generated by AlgoBuilder is uploaded to the STWIN kit as described above, so that the output can be seen in Unicleo-GUI as shown in the figure below.

 

DeniseSANFILIPPO_7-1687168142455.png

The 3D graphics of the blue car show the result of 9-axis sensor fusion computed by the STM32 library. The number appearing in the “Vehicle Status” box shows the output of the MLC described in Section 3, while the red bar and the number appearing in the “Crash” box displays the output of the FSM described in Section 4.

 

6. Demonstration at the automotive exhibition

The prepared demonstration system is shown in the picture below:

 

DeniseSANFILIPPO_8-1687168142542.png

The STWIN kit sends the calculated data and detected status of the RC car in real time via Bluetooth® to the PC Unicleo-GUI. Then the Unicleo-GUI displays the received data/status graphically.

The RC car was remotely controlled by us in a 2m x 2m area, where there were some obstacles such as slopes, banks, walls, and rough surfaces.

Let us see together how this demo kit worked at the exhibition.

The following pictures show some cases of the RC car’s position and the outputs of the demo firmware, which were recognized by the MLC and FSM.

When the RC car is piloted over the bumped area, then the “Vehicle status” shows “2” (i.e. rough road status) on the screen as defined in Section 1.

DeniseSANFILIPPO_9-1687168142612.png

If the RC car is tilted to the left (or right), then “Vehicle status” shows “3” (i.e. on bank status) correctly on Unicleo-GUI.

DeniseSANFILIPPO_10-1687168142676.png

When the RC car is climbing or descending the slope, then “Vehicle status” shows “4” (i.e. on a slope) correctly (same for the rear-end of the car).

DeniseSANFILIPPO_11-1687168142741.png

If the RC car hits the wall from the front-end, then Unicleo-GUI shows a red bar and the status of “Crash” becomes “1” (i.e. stop status) detected by the FSM.

DeniseSANFILIPPO_12-1687168142793.png

The demo worked successfully during the show and proved to be effective. In fact, many visitors stopped to watch it and asked many questions, also providing feedback.

7. Conclusion

In this article we described vehicle crash and roll detection as well as status detection (motion or stationary) in a demo that leverages on the MLC and FSM using a remote-control car and the STWIN kit.

To develop the demo software, we used Unico-GUI, Unicleo-GUI, and AlgoBuilder, which are free-to-use tools downloadable from st.com. These tools developed for MEMS sensors support intelligent functions such as MLC / FSM present in ST's latest MEMS sensors and enable your design to achieve high performance and low power consumption.

Moreover, this makes the creation of original demos/prototypes easier, as no coding is required.

Version history
Last update:
‎2023-06-20 08:15 AM
Updated by: