3.2.4 Process
After the sensors have been turned on, the ab_process function must be called in one of the following ways:
• In the configured interrupt callback (or high priority task triggered by the configured interrupt) if the int_pin
parameter of the configuration structure is different from none (that is, one interrupt pin is connected to the
host and used to provide the data-ready signal). The ab_process function must be completely executed
before receiving the next interrupt callback: it is required to ensure an execution time lower than 1 / (ODR +
10%).
• In a timer callback (or high priority task triggered by the timer), if the int_pin parameter of the configuration
structure is none, the timer must be configured to elapse at a desired rate (lower than the selected ODR).
The ab_process function must be completely executed before receiving the next timer callback.
In the ab_process function, sensor data are read and runtime safety mechanisms are executed. If the interrupt
pin is configured, the time between two consecutive interrupt callbacks (that is, delta-time or dtime) must be
measured and passed to the ab_process function as input, expressed in microseconds. If the interrupt pin is not
configured (that is, int_pin is set to none), the dtime input parameter is not used by the ab_process function.
The ab_process function implements the whole set of [IRC] and [ARC] safety mechanisms. The user can get
the latest sensor data (both of them) by calling the ab_get_data function. The returned data are rotated based
on rot0 and rot1 rotation matrices. If the user is not interested in getting the primary or secondary sensor data, it
can pass the NULL pointer to the ab_get_data function as the input parameter. The bias of the accelerometer and
gyroscope sensors cannot be evaluated while moving. For this reason, the user must specify in the library if the
vehicle is stationary or not. If the vehicle is stationary, the bias check mechanisms are active, otherwise they are
inactive.
3.2.5 Tuning
The ab_get_tuning_data function is called by the user to retrieve the current limits (maximum or minimum values)
to tune the thresholds for quasi-stuck, pulse, and redundancy software safety mechanisms. Such a procedure
should be repeated in several application scenarios and with a statistically significant sample of different devices
in order to cover part-to-part variability effects and environmental effects.
Assumption #20: It is assumed that the customer performs the Tuning procedure to properly configure the
thresholds with attention to the specific vehicle, application scenarios, and part-to-part population variability, so
that quasi-stuck, pulse, and redundancy software safety mechanisms work as they are intended and are robustly
managing expected intrinsic product variability and application environment effects.
In particular, the thresholds that are defined in the ab struct function are shown in Table 5.
Table 4. Configurable thresholds of quasi-stuck, pulse, and redundancy software safety mechanisms
Software safety mechanism Configurable threshold About the threshold
ARC_SM_03 – Q-Stuck monitoring acc_qs_ths accelerometer sensor quasi-stuck threshold, expressed in [g].
If acc_qs_ths = 0, the quasi-stuck check is disabled.
ARC_SM_03 – Q-Stuck monitoring gyr_qs_ths gyroscope sensor quasi-stuck threshold, expressed in [dps].
If gyr_qs_ths = 0, the quasi-stuck check is disabled.
ARC_SM_04 – Pulse transition acc_pul_ths accelerometer sensor pulse threshold, expressed in [g]
ARC_SM_04 – Pulse transition gyr_pul_ths gyroscope sensor pulse threshold, expressed in [dps]
ARC_SM_05 – Redundancy acc_red_ths accelerometer sensor redundancy threshold, expressed in [g]
ARC_SM_05 – Redundancy gyr_red_ths gyroscope sensor redundancy threshold, expressed in [dps]
The generalization of the PCB layout and the specific needs of the customer may require a dedicated tuning of
the above thresholds. To better detail these values, the user may benefit from the following addendum.
• The variables acc_qs_ths and gyr_qs_ths refer to the level of signal oscillation that can be recognized as
unreliable for the noise characteristics of the sensor.
• The variables acc_pul_ths and gyr_pul_ths refer to the allowed maximum amplitude of spikes occurring
for the output signal. This value can be considered constant for the same device part number, but it can be
refined according to the specific setup and environmental conditions.
• For the variables acc_red_ths and gyr_red_ths, the mechanism implements a check on the redundancy/
correlation value derived from the signals of IMU0 and IMU1. The computed value can vary due to the
distance of the sensors and environmental conditions.
AN5691
Enabling safety mechanisms and software APIs
AN5691 - Rev 5 page 20/28