Detect braking on helmet

Hello,

I try to design a program to detect braking on bike. I use accelerometer and gyrometer to create an simple IMU.
I try many program to try to detect braking parts on my log without success.

My euler angle estimation works properly but when brake happen, the imu estimate an pitch but it is not.

Can someone give me article or tips to do that?

Post your circuit and code if you want help improving/fixing it...

So I use that code to create the IMU:

https://github.com/m5stack/M5StickC/blob/master/src/utility/MahonyAHRS.cpp
I only use that function:

void MahonyAHRSupdateIMU(float gx, float gy, float gz, float ax, float ay, float az,float *pitch,float *roll,float *yaw)

I use that kit for LSM6DSL including accelerometer and gyrometer.

I suggest to mount the sensor on the bike, with the Z axis up, and monitor just the horizontal X and Y accelerations. Unless the sensor orientation changes, the magnitude of the horizontal acceleration

accel = sqrt(ax*ax + ay*ay)

should be a useful estimate.

Thank you for the answer.

Unfortunatly, I already try that but as the helmet is moving the orientation is moving and wrong detection are made.

I tried to use the previous IMU algorithm, but when there are brakes, The algorithm detect an pitch due to acceleration .

Then don't use the helmet, or the IMU code, as suggested.

The IMU code you downloaded does not seem to be working correctly. There are many others you could try.

You've set yourself a significant challenge here. The device must be able to detect braking of the motorcycle from a device which is not connected directly to the bike, but indirectly via a human body with a neck that rolls, pitches and yaws independently of the bike!

Phew - I'd be impressed if you got that working. Perfectly possible, of course, but definitely challenging.

In fact, I try 5 different version of IMU with acc/gyro but the result is the same and is normal.

When you brake the accelerometer get more acceleration along longitudinal axe and the program believe the helmet is going down.

I try to find article or paper with deal with that problem, but I can't find .

I find many product with propose brake system detection:

But I dont really understand how it is possible to do that with only accelerometer and gyrometer.

You could read their patent.

Brake Free uses gyrometer + accelerometer in combination with our patented brake detection algorithm to detect all types of braking.

Isn't that where the gyro comes in? Rotating the helmet downwards will be picked up by the gyro, whereas deceleration won't, so that is how your code can tell the difference.

In fact when you use IMU algorithm is the value of angle from accelerometers is integrate over the time so after few second the deceleration due to brake is interpreted as an angle.
I don't find any imu algorithm with deals with that problem.

Why not put a micro switch on the brake lever ?

The data from the rate gyro are integrated, not from the accelerometer. Did you forget to calibrate the rate gyro and subtract the offsets?

There already is one. It operates the brake light.

Sorted then ?

Ask the OP! :laughing:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.