How to calculate slope angle from accelerometer



Mechanics

Release date:2023/5/19         

 ・In Japanese
<premise knowledge>
 ・Accelerometer mechanism
 ・Radian method


Describes how to calculate the slope angle using an accelerometer

■Slope definition

Slope is defined as the ratio of distance traveled horizontally to height gained vertically. For example, if you go 100m and climb 5m vertically, the gradient is 5%.



For example, to calculate the angle θ when the gradient is 5%:



Click here for how to convert between degrees and radians.

■Slope calculation

<When the object is stationary>
Calculate the slope from the acceleration (= force) applied to the sensor as follows. The sensor detects the following "A" component.



For example, the slope angle when the acceleration sensor outputs 3.0[m/s2] is as follows.



<When the object is moving>
As shown below, when a vehicle equipped with a sensor is going uphill, the acceleration detected by the sensor is the result of two factors: the vehicle's tilt and the acceleration of the vehicle itself. Therefore, if there is a sensor other than the accelerometer that can detect the moving speed of the vehicle, the gradient of the slope can be obtained by subtracting the acceleration of the moving vehicle from the detected value of the accelerometer.



When going downhill
When the vehicle is in free fall downhill, the sensor does not detect gravitational acceleration, so the output is zero. However, because the vehicle detects the speed of descending with other sensors, the final acceleration is a negative value in calculating the slope, and it can be determined that it is a descending slope.











List of related articles



Mechanics