Lsm6ds3Measurements

Page Actions

Understanding the LSM6DS3 measurement data

Static measurements

Before trying to understand movement we simply read out accelerometer and gyroscope data over a certain period of time. I used 1s for the measurements.

First we simply lay down the magic wand flat onto the table and measure. Here are the results:
gyroscope gyroscope corrected
horizontal_gyro.png hor_gyro_corr.png
Since there is no movement, we expect the gyroscope values to be all zero. It can be seen, that there is a small offset error in the measurements. I take the average of all gyroscope values and subtract the offset from the measured values, which gives us the plot on the right.

Now the accelerometer measurements:
Accelerometer horizontal Accelerometer vertical
acc_horizontal.png acc_vertical.png
Even though the lsm6ds3 does not move, we nevertheless see an acceleration on the z-axis. This is due to the earth gravity and corresponds to 1g

When putting the magic wand vertically, which is its default orientation, then it is the (negative) y-axis, which sees gravity. We can also see that this position is slightly less stable and there are more variations in the x and z values.

The measurements tell us the lsm6ds3 orientation in space, shown below:

orient_lsm6ds3.png

When moving down, we move in negative y direction, moving from left to right means moving in negative x direction and moving back means moving in negative z direction.

Linear movements

When moving linearily, the gyroscope should always measure the same values. Gravity will also constantly affect the different axis in the same way (no transfer from one axis to another) which simplifies interpretation of the data substantially.

In order to keep things simple, we first make measurements where we move the wand along the y-axis (up-down), then along the x-axis (left-right) and finally along the z-axis (back and forth). First up-down:

Accelerometer up-down movement Up-down movement with gravity correction
acc_up-down.png acc_up-down_corr.png
As expected, we see up-down acceleration. In the left plot we have unfiltered data from the accelerometer, while on the second one I try to compensate for gravity. We see that in this case the oscillation happens around zero.

Left right (movement along the x-axis) and back-forth (movement along the z-axis) is even simpler because the corresponding axis is not affected by gravity.
Left right movement Left right movement gravity compensated
acc_left-right.png acc_left-right_corr.png

Back-forth movement Back-forth movement gravity compensated
acc_back-forth.png acc_back-forth_corr.png
Last not least, we can try to calculate the velocity at which the lsm6ds3 is moving in space. I do this for the back and forth movement.

velocity_back_forth.png

We observe that the oscillation amplitude of the velocity curve on the z-axis increases slowly, and that the velocities for the x and y axis slightly increase. Since the velocity is calculated by integration of the acceleration values, any small error is added at each summation step, resulting in the observed effect.

Rotation

Rotation is measured by the gyroscope, which measures the speed of rotation around any of the new axis. Here is a gyroscope measurement when rotating arounc the x-axis:

rotation_x.png

To calculate an angle we must therefore integrate the gyroscope values. The gyroscope output data rate is programmed to 104 Hz, which means the the time between measurements is ~ 10 ms. dt in the integration is therefore 1/104 s. The orientation of the IMU during the roation is shown here:

orient_rotate_x.png

When looking at the accelerometer data during rotation we see changes in y and z, while the acceleration in x direction is virtually zero.

accel_rotate_x.png

-- %USERSIG{UliRaich - 2026-01-03}%

Comments


 
I Attachment Action Size Date Who Comment
acc_back-forth.pngpng acc_back-forth.png manage 70 K 03 Jan 2026 - 19:50 UnknownUser  
acc_back-forth_corr.pngpng acc_back-forth_corr.png manage 69 K 03 Jan 2026 - 19:50 UnknownUser  
acc_horizontal.pngpng acc_horizontal.png manage 20 K 03 Jan 2026 - 20:11 UnknownUser  
acc_left-right.pngpng acc_left-right.png manage 64 K 03 Jan 2026 - 19:50 UnknownUser  
acc_left-right_corr.pngpng acc_left-right_corr.png manage 65 K 03 Jan 2026 - 19:50 UnknownUser  
acc_up-down.pngpng acc_up-down.png manage 59 K 03 Jan 2026 - 19:50 UnknownUser  
acc_up-down_corr.pngpng acc_up-down_corr.png manage 63 K 03 Jan 2026 - 19:50 UnknownUser  
acc_vertical.pngpng acc_vertical.png manage 24 K 03 Jan 2026 - 20:11 UnknownUser  
accel_rotate_x.pngpng accel_rotate_x.png manage 41 K 03 Mar 2026 - 11:24 UnknownUser  
hor_gyro_corr.pngpng hor_gyro_corr.png manage 43 K 03 Jan 2026 - 19:58 UnknownUser  
horizontal_gyro.pngpng horizontal_gyro.png manage 27 K 03 Jan 2026 - 19:58 UnknownUser  
lsm6ds3_orient.pngpng lsm6ds3_orient.png manage 5 K 04 Jan 2026 - 16:10 UnknownUser  
orient_lsm6ds3.pngpng orient_lsm6ds3.png manage 14 K 04 Jan 2026 - 16:23 UnknownUser  
orient_rotate_x.pngpng orient_rotate_x.png manage 25 K 03 Mar 2026 - 11:19 UnknownUser  
rotation_x.pngpng rotation_x.png manage 38 K 03 Mar 2026 - 11:19 UnknownUser  
velocity_back_forth.pngpng velocity_back_forth.png manage 49 K 03 Jan 2026 - 19:50 UnknownUser  
Topic revision: r4 - 03 Mar 2026, UliRaich