HM Command — Harsh Maneuver Detector
Driving event detection with 8 independent instances and 8 algorithms: acceleration and braking by GPS; turns, strong maneuver and crashes by accelerometer.
What is it for?
| Use case | Description |
|---|---|
| 🏎️ Driving scoring | Evaluate driver’s driving style |
| 🚨 Safety alerts | Notify harsh braking or dangerous maneuvers |
| 💥 Crash detection | Identify collisions or accidents |
| 📈 Fleet analysis | Generate behavioral statistics |
Description
The HM module detects driving events using 8 independent instances (HM00-HM07) where each can be configured for any algorithm type (0-7):
- HMxx = Module index (independent instance)
- eventType = Detection algorithm type (0-7)
- Total flexibility: HM03 can use algorithm type 5, HM00 can use type 2, etc. The type is set by
eventType, not by the index.
Configuration
Syntax
Full configuration (parameters are positional and trailing ones may be omitted):
SHMxx,eventType,magnitude,min_speed_kmh,hysteresis_percent,time_window_ms,cooldown_sShort forms (no comma between xx and the letter):
| Form | Action |
|---|---|
SHMxxE | Enable module |
SHMxxD | Disable module (keeps the configuration, but does not detect) |
SHMxxR | Reset to default configuration |
SHMxxE,... / SHMxxD,... / SHMxxR,... | Combine enable/disable/reset with parameters |
QHMxx | Query current configuration |
Parameters
| Parameter | Description |
|---|---|
| xx | Module instance (00-07) |
| eventType | Algorithm to use (0-7) |
| magnitude | Threshold: km/h per second for GPS (types 0-1), mg for accelerometer (types 2-7) |
| min_speed_kmh | Minimum GPS speed (0 = no restriction). Types 5-7 ignore it |
| hysteresis_percent | Percentage added to the threshold |
| time_window_ms | Minimum sustained duration (0 = instantaneous) |
| cooldown_s | Time between events (anti-spam) |
Algorithm Types
🌐 GPS-based (Types 0-1)
They measure the GPS speed change from one second to the next. They do not depend on how the device is mounted.
| Type | Icon | Name | Detects | Reference values |
|---|---|---|---|---|
| 0 | 🏎️ | GPS Acceleration | Gains ≥ magnitude km/h in one second | 5-7 km/h/s, min_vel 5 km/h, window 1000 ms |
| 1 | 🛑 | GPS Braking | Loses ≥ magnitude km/h in one second | 6-9 km/h/s, min_vel 10 km/h, window 1000 ms |
📐 Accelerometer with minimum speed (Types 2-4)
| Type | Icon | Name | Detects | Reference values |
|---|---|---|---|---|
| 2 | ↪️ | Left Turn | Positive Y axis ≥ threshold | 220-330 mg, min_vel 15 km/h, window 2000 ms |
| 3 | ↩️ | Right Turn | Negative Y axis ≥ threshold | 220-330 mg, min_vel 15 km/h, window 2000 ms |
| 4 | 🌀 | Strong maneuver (centripetal) | Total horizontal force √(x²+y²): turn, braking, acceleration or combined | 250-330 mg, min_vel 20 km/h, window 2000 ms |
⚡ Crashes (Types 5-7)
They ignore min_speed_kmh: they also detect with the vehicle stopped.
| Type | Icon | Name | Detects | Reference values |
|---|---|---|---|---|
| 5 | ↔️ | Side crash | |Y axis| ≥ threshold | 1500-2000 mg, window 0 |
| 6 | ⬆️ | Frontal crash | X axis ≤ −threshold | 1500-2000 mg, window 0 |
| 7 | ⬇️ | Rear crash | X axis ≥ +threshold | 1500-2000 mg, window 0 |
How the Firmware Evaluates
GPS: one sample per second
The speed change is evaluated once per second and must hold for consecutive seconds until time_window_ms is completed; if one second falls short of the threshold, the count restarts. With a window of T ms, T/1000 + 1 consecutive seconds are needed:
| time_window_ms | Consecutive seconds | Example with magnitude 9 (braking) |
|---|---|---|
| 100 or 1000 | 2 | Lose 18 km/h in 2 s (≈0.25 g) |
| 2000 | 3 | Lose 27 km/h in 3 s |
| 3000 | 4 | Lose 36 km/h in 4 s |
| 4000 | 5 | Lose 45 km/h in 5 s (does not happen in practice) |
For types 0-1 use a 1000 ms window and 0 hysteresis. With windows of 3000 ms or more detection almost never fires. A sharp braking shorter than 2 seconds is not seen by GPS.
Accelerometer
The device reads the accelerometer every 20 ms and averages 4 readings (about 80 ms); HM checks that average every 100 ms. time_window_ms requires the threshold to hold on every check within that period, and with 0 a single one is enough. magnitude is in mg (1000 mg = 1 g).
Hysteresis
hysteresis_percent is added to the threshold: effective threshold = magnitude × (1 + hysteresis_percent / 100). There is no deactivation threshold, so more hysteresis makes it harder to fire. Example: 330 mg with 10 % fires from 363 mg.
Cooldown
After an event, the same instance does not detect again until cooldown_s seconds have passed.
Device Orientation
Types 2-7 use the accelerometer axes. If the device was not calibrated (see Axis Calibration), the board axes are used as installed:
- Tilted device: gravity adds to the horizontal axes (10° ≈ 170 mg) and one side fires before the other.
- Rotated device: left and right, or frontal and rear, may be swapped, and a turn may read as braking.
Before deploying to a fleet, test it on one vehicle: make a clear left turn and check which event arrives, then brake firmly on a straight road and check that no turn fires. Side crashes (type 5) and strong maneuver (type 4) use the axis magnitude, so they depend less on orientation.
Presets by Vehicle Class
These are the same presets offered by the configurator under Modules → Maneuvers → Presets. The three classes use the same slot map, so the rules work for any of them. They are starting values: tune them with the fleet’s real events.
🚗 Car / Light
>SHM00E,0,7,5,0,1000,5< // Harsh acceleration: +7 km/h per second, 2 consecutive s
>SHM01E,1,9,10,0,1000,5< // Harsh braking: −9 km/h per second, 2 consecutive s
>SHM02E,2,330,15,10,2000,3< // Harsh left turn: 0.36 g sustained 2 s
>SHM03E,3,330,15,10,2000,3< // Harsh right turn: 0.36 g sustained 2 s
>SHM04E,5,2000,0,5,0,30< // Side crash: 2.1 g, no delay
>SHM05E,6,2000,0,5,0,30< // Frontal crash: 2.1 g, no delay
>SHM06E,7,2000,0,5,0,30< // Rear crash: 2.1 g, no delay
>SHM07E,4,330,20,10,2000,5< // Strong maneuver: 0.36 g horizontal sustained 2 s🚛 Van / Fleet
>SHM00E,0,6,5,0,1000,5< // Harsh acceleration: +6 km/h per second, 2 consecutive s
>SHM01E,1,8,10,0,1000,5< // Harsh braking: −8 km/h per second, 2 consecutive s
>SHM02E,2,280,15,0,2000,3< // Harsh left turn: 0.28 g sustained 2 s
>SHM03E,3,280,15,0,2000,3< // Harsh right turn: 0.28 g sustained 2 s
>SHM04E,5,2000,0,5,0,30< // Side crash: 2.1 g, no delay
>SHM05E,6,2000,0,5,0,30< // Frontal crash: 2.1 g, no delay
>SHM06E,7,2000,0,5,0,30< // Rear crash: 2.1 g, no delay
>SHM07E,4,300,20,0,2000,5< // Strong maneuver: 0.30 g horizontal sustained 2 s⛽ Heavy / Hazmat
>SHM00E,0,5,5,0,1000,5< // Harsh acceleration: +5 km/h per second, 2 consecutive s
>SHM01E,1,6,10,0,1000,5< // Harsh braking: −6 km/h per second, 2 consecutive s
>SHM02E,2,220,15,0,2000,5< // Harsh left turn: 0.22 g sustained 2 s
>SHM03E,3,220,15,0,2000,5< // Harsh right turn: 0.22 g sustained 2 s
>SHM04E,5,1500,0,5,0,30< // Side crash: 1.6 g, no delay
>SHM05E,6,1500,0,5,0,30< // Frontal crash: 1.6 g, no delay
>SHM06E,7,1500,0,5,0,30< // Rear crash: 1.6 g, no delay
>SHM07E,4,250,20,0,2000,5< // Strong maneuver: 0.25 g horizontal sustained 2 sFull Example: Event and Black Box
Each maneuver fires a rule that generates its event (UC0 report) and the black box with the seconds before and after, all to the log so nothing is lost without coverage.
>SCXBB,U0,1,10,20< // Black box: UC0 every 1 s, 10 samples after and 20 before
>SRL70E;TRG=HM00+;ACC={GBBFFH;@LOG}{GU070H;@LOG}< // Event 70: harsh acceleration
>SRL71E;TRG=HM01+;ACC={GBBFFH;@LOG}{GU071H;@LOG}< // Event 71: harsh braking
>SRL72E;TRG=HM02+;ACC={GBBFFH;@LOG}{GU072H;@LOG}< // Event 72: harsh left turn
>SRL73E;TRG=HM03+;ACC={GBBFFH;@LOG}{GU073H;@LOG}< // Event 73: harsh right turn
>SRL74E;TRG=HM04+;ACC={GBBFFH;@LOG}{GU074H;@LOG}< // Event 74: side crash
>SRL75E;TRG=HM05+;ACC={GBBFFH;@LOG}{GU075H;@LOG}< // Event 75: frontal crash
>SRL76E;TRG=HM06+;ACC={GBBFFH;@LOG}{GU076H;@LOG}< // Event 76: rear crash
>SRL77E;TRG=HM07+;ACC={GBBFFH;@LOG}{GU077H;@LOG}< // Event 77: strong maneuver- The content of each black box sample and each event is defined by the UC00 report: include date, time and position.
- A very strong turn or braking may also generate the strong maneuver event (77).
- The black box sends one burst at a time: if another maneuver happens while the later samples are being sent, that second burst is not generated (its event is).
- Number events between 00 and 99 if the platform reads the number as decimal.
To add the maneuvers to the trip score, add {STPGCI,n} to each rule: acceleration → GC2, braking → GC3, turns → GC4 (see GC Counters).
Validations
Limits by Parameter
| Parameter | Unit | Minimum | Maximum |
|---|---|---|---|
| magnitude (GPS, types 0-1) | km/h per second | 1 | 50 |
| magnitude (accelerometer, types 2-7) | mg | 50 | 8000 |
| min_speed_kmh | km/h | 0 | 200 |
| hysteresis_percent | % | 0 | 50 |
| time_window_ms | ms | 0 | 30000 |
| cooldown_s | s | 0 | 120 |
Types 0-4 don’t allow time_window_ms=0: the firmware auto-corrects it to 100 ms and returns a WARNING.
Recommendations
For Crash Detection
- Types 5, 6 and 7 with magnitude between 1500 and 2000 mg
time_window_msat 0: a crash lasts about 100 ms and a longer window lets it through- Long
cooldown_s(30 s)
For Driver Evaluation
- Acceleration and braking by GPS (types 0-1) with a 1000 ms window and 0 hysteresis
- Turns and strong maneuver (types 2-4) with a 2000 ms window to filter potholes
- Moderate
cooldown_s(3-5 s) - Combine with the TRIP module counters for the trip score
Before Deploying to a Fleet
- Run the orientation test on at least one vehicle
- Review the number of events in the first week and tune
magnitudeper vehicle class
Associated Signals
| Signal | Index | Suitable for conditional use |
|---|---|---|
| HM | 00-07 | NO |
Available triggers are HM00+ to HM07+. Positive edge only.
Compatibility
See Also
- Axis Calibration — Accelerometer calibration
- AC Command — Accelerometer reading
- CXAC Command — Accelerometer configuration
- MVT Command — Movement detection
- Black Box (CXBB) — Reports before and after an event
- GC Counters — Per-trip driving score