2025-11-19 7:32 AM
I'm using an IMU ISM330BX on my electric bicycle, and I want to detect while I'm cycling, if I'm ascending or descending a climb, and then calculate which is the angle in degrees or percentage of the slope. For this I'm using Sensor Fusion Function SFLP, which combines accelerometer and gyroscope data, and using the Gravity Vector to calculate the Pitch.
When I'm static, not moving the bicycle forward or backward, just lift the front wheel while the rear wheel touches the ground, simulating pedaling uphill. The results are quite good and I can calculate the pitch and transform to degrees.
The problem rise when I'm pedalling, then exists acceleration and decelerations, in this situation I can not distinguish if there is a slope (positive or negative) because these accelerations forces are masking the pitch. I tested different filter options trying to acquire the best results, but It doesn't matter which filter option I choose that always I found the same problem.
I attached a picture called Pitch.png, where I'm just pedalling on a flat surface accelerating and then braking. As you can see Pitch measurement is really affected by accelerations forces.
Do you know how I can process pitch data in order to eliminate these accelerations forces and only measure pitch due tilt angle? or which configuration on the IMU I need to change to have better results?
The current configuration I have is this, values are decimal.
Thanks in advance