Gyro/IMU based kill switch for board

Hi,

I plan to add some advanced gyro/IMU based protections to my board .
This should work in similar way as Fliteboard protection - which detects board angle and acceleration to decide whether you are still on board :slight_smile:

The plan is to either add it to Bremote V2 or make it independent small brick which you could install in any board.

But maybe this was already implemented somewhere ? ( I could not find )

For reference - some of AI hints for it:

IMU-Based Kill Algorithm for e-Foil (Summary)

Goal

Instantly stop the motor only during a real crash or wipeout, while allowing:

  • prone (belly) starts
  • standing up on foil
  • aggressive carving and pumping

No leash, no magnetic lanyard.
The IMU acts as an independent safety judge.


1. Core Concept (How the algorithm thinks)

Do NOT kill based on board angle.
Angle alone is unreliable in foiling.

Instead, detect loss of controlled motion, characterized by:

  • sudden, high rotational speed
  • unstable gravity vector
  • violent acceleration changes
  • persistence over a short time window

A real crash looks like chaos, not a clean maneuver.


2. Signals Used from the IMU

Minimum required:

  • Gyroscope (ωx, ωy, ωz) → angular velocity
  • Accelerometer (ax, ay, az)

Derived values:

  • gyro_magnitude = overall rotational speed
  • acc_norm = magnitude of acceleration vector (≈ 1 g when stable)
  • jerk = rapid change in acceleration over time

3. State Machine (Very Important)

The system is state-based, not just threshold-based.

States

  1. IDLE / SAFE
    Motor not armed or throttle = 0
  2. ARMING GRACE
    Short grace period after throttle > 0
    Allows prone start + standing up
  3. RUN
    Normal riding, crash detection active
  4. KILLED (LATCHED)
    Motor forcibly stopped until reset conditions are met

4. Grace Period (Critical for Prone Starts)

When throttle first becomes active:

  • Ignore crash detection for ~1.5–3.0 seconds
  • This prevents false kills while:
    • lying on the board
    • transitioning to standing
    • stabilizing on foil

5. Crash Detection Logic (Key Part)

Event Indicators

Typical starting thresholds (to be tuned):

  • E1 – High rotation
    • Very fast angular motion
  • E2 – Gravity instability
    • Acceleration magnitude far from ~1 g
    • (near free-fall or hard impact)
  • E3 – High jerk
    • Sudden acceleration change (violent motion)

Decision Rule

A crash is declared if:

At least 2 of the 3 events
persist for ~80–150 milliseconds

This filters out:

  • carving (usually high rotation only)
  • pumping (acceleration spikes without chaos)
  • normal foil dynamics

6. Why This Works (Carving vs Crash)

Controlled Maneuvers

  • Rotation is smooth and mostly on one axis
  • Gravity vector remains stable
  • Acceleration changes are gradual
  • Events do not persist together

Real Crash

  • Rotation on multiple axes
  • Gravity vector collapses or spikes
  • Sharp acceleration changes
  • Chaotic signal persists briefly

The algorithm detects loss of control, not movement itself.


7. Kill Action and Latching

When a crash is detected:

  • Immediately assert KILL output to the motor controller
  • Ignore throttle commands completely
  • Stay latched in KILL state

Reset Conditions

Motor can only re-arm when:

  • Throttle = 0
  • Board motion is stable
  • Acceleration ≈ 1 g
  • Rotation is low
  • Stability persists for ~1–2 seconds

This prevents accidental re-engagement.


8. Recommended Hardware Architecture

Best practice:

IMU + small MCU  →  Motor Controller KILL input
  • IMU runs independently of the remote
  • Does not interfere with normal throttle control
  • Overrides everything only during a crash
  • Safe for ESC (no battery power cuts)

9. IMU Selection Guidance (Summary)

Best characteristics:

  • Low gyro noise
  • Good vibration tolerance
  • High sample rate (≥200 Hz)
  • Raw gyro + accelerometer access

Preferred types:

  • Modern InvenSense or Bosch IMUs
  • Avoid relying on absolute angle estimation
  • Raw dynamics matter more than orientation

10. What This Achieves

  • Works with prone starts
  • No leash or magnet required
  • No false kills during carving
  • Immediate shutdown during wipeouts
  • Behavior comparable to commercial e-foils (Flite-style)
1 Like

I did think about making something similar, but did not yet get to it,

Personally I think you are making it too complicated.
I am convinced angle alone will work.

In a crash situation the board is actually not doing any rapid rotation most of the time, but rather a tilt toward overfoiling while adding a bit of roll creating a banking movement.

The rider is doing the chaotic movement you describe.

I also think you overestimate the angle you achieve while carving or pumping (why would you pump on motor anyway?).

I have added a IMU to the BRemote2 RX and got that running.
But after thinking it over, I would assume it would be more useful as an external device and also easier to build.

I will start with simple angle check ( for board receiver ) and some logging for the controller - as you said no point to complicate it unless I collect data.

I am still learning, so there will be a lot of test cases :wink:

1 Like

You might find something useful in this discussion

Kill switch methods