SECOND VERSION
Roll Angle and Oscillating Motion
To carry out the activity, and to be able to calculate the oscillating movement to which the mBot can be subjected, we need to know what the roll angle is. It is defined as the angle of lateral inclination that the perpendicular of the plane of the vehicle forms with forms the vertical. When the mBot is in a horizontal plane, the angle of inclination will be approximately 0, since it has a small margin of error.
When the mBot is in an inclined plane, the angle of inclination will be equal to that of the surface. In addition, the Ranger will show graphically in the LED Matrix its lateral inclination, that is, the angle it presents with respect to the longitudinal axis (Y). If this angle exceeds the value set by the potentiometer, it will warn of this by means of an acoustic and luminous signal.
Since the Auriga board that the Ranger incorporates has an integrated inertial measurement module (IMU) with a gyro and a 3-axis accelerometer, so it is enough to use the accelerometer value corresponding to the longitudinal axis of the Ranger (Y axis) to obtain the lateral angle of inclination directly.
Pitch Angle
The Pitch Movement, whose name is of nautical origin, is used in the automotive world to indicate the longitudinal inclination of a vehicle with respect to the horizontal plane. In particular the pitch angle is the one that the longitudinal axis of the vehicle forms with the horizontal plane.
When traveling on a horizontal road the pitch angle will be approximately 0, since there is a small deviation of the sensor. When going up a slope, we will have a positive pitch angle. During the activity, the Ranger will graphically show in the LED Matrix its longitudinal inclination, that is, the angle of pitch or turn it presents with respect to the transverse axis (X). If this angle exceeds the value set by the potentiometer, it will warn of this with an acoustic and luminous signal. Also, in the TFT LCD Screen we will show the angle of the plane.