How to covert $xyz$ value to speed?

33 Views Asked by At

There is a sensor (accelerometer) on pedal of indoor bike which sends out $xyz$ value and we want to convert them to cycling speed but we just can't.

It has a default of $5$ speed when not moving. And when we move upward it goes up to $> 5$, but when it goes down it goes down to $0$.

https://i.stack.imgur.com/qWeKD.jpg

For example $y = 5$ default (not moving). We cycle the pedal, we are going up, the speed goes up to $10$ We continue cycling, its now going down it goes $y = 0$ BUT If we are at high speed example $25$ is going up Then going down would be around $12$ Thats how its behaviour is

We have $x, y, z$ values and we are getting the magnitudes which are the speeds on the picture

We need to find a way to have a constant speed when cycling down based on the current behaviour on the image