MinIMU V3 Oscillations

Hello, bought the MinIMU V3 (imu01c) and I am configuring it with an Arduino Nano for a project. I am having some weird behavior using the example provided in the Arduino IDE: “MinIMU9AHRS”. My angles start oscillating from low to high and high to low on a loop. The sensor is not moving and it is placed on a flat surface but the angles keep increasing and decreasing. I have tried to isolate the sensor from any magnetic interference with no luck. Can you please provide some assistance? Thanks in advance.


I am sorry you are having trouble getting the behavior you want from the MinIMU. It sounds like you might not have calibrated the magnetometer at all, or very well. Can you run the Calibrate.ino sketch from the LSM303 library, making sure to point the sensor in all directions as you do so? You can then update lines 74 to 79 of MinIMU9AHRS.ino with those minimum and maximum values.


I ran the calibration code as instructed but I am still getting the oscillations. I am also unable to use the corrected angles by declaring the “OUTPUT” variable to 1, as they jump all over the place. This IMU is driving some servo motors wireless using xbee communication for pan and tilt and as soon as it turns on, the servos start to oscillate.

Servos have their own internal feedback system which they use to maintain the position of their output, so they are not a good tool to use to evaluate the results of your MinIMU AHRS code. You should troubleshoot any jitter or oscillations at the servo output separately from the MinIMU as its own issue.

As for your MinIMU, can you post a sample of the Euler angles you are getting from the AHRS code? Also, what values are you using for your calibration constants?


I know that about servos. I am not using my servos position as a reference
for the output of the IMU. I am using the serial output displayed by the
code as the positional reference of the IMU, which is showing the
previously mentioned oscillations. I managed to get rid of the big
oscillations, but the sensor still drifts about ± 4 degrees after movement
has stopped.

I understand you deal with a lot of people that don’t know much about what
they are doing, please, don’t take me as one of them.

Are you seeing drift only on the yaw axis? That is usually a sign of a magnetometer that is not calibrated perfectly; you could try to calibrate it again to see if the behavior changes or improves at all, although +/-4 degrees does not sound like a lot and might be about as good as you can get with the MinIMU9AHRS software.

If you are still getting other oscillations or problems with the output that you think are abnormal, it would help to have more information so that we can try to understand the issue better. Can you post a sample of the Euler angles you are getting from the AHRS code like I asked in my previous reply? Could you also post what magnetometer constants you are using? It might also help to get a video that shows your MinIMU, your setup and work environment, and the visualization shown in the Python test program.


looks like the guy that knows all about everything, realises he made a basic mistake due to the lack of a response:grin:.

@kevin1961 I found this response today as a surprise. But let me address your comment real quick. I would like to extend an invitation to you to come and see me in TX. I would like to go over what I know on the topic at hand. Secondly, I would like to discuss your internet balls, I would like to find out if they are as big as you think they are! You sound like the typical keyboard warrior that hides behind his keyboard thinking they are tough!! But in the attempt to not sound like you , I really , really would like to invite you here. Let me know if that works for you snowflake!

I finished this project and decided to take a break from it. The behavior of the sensor still happens after multiple calibration attempts. I uploaded a video of the device that has the sensor inside so you can see the behavior. The unit, moves a few degrees on the yaw after movement has stopped. This behavior is also exhibited in the output of the program, this is not a servo problem. Here are the numbers acquired from the calibration routine: min: { -2741, -4562, -2909} max: { +2406, +1329, +4188}. Please refer to the video link for the drift problem:

could l be so bold to suggest, that the cal values would suggest to me that the IMU isn’t calibrated correctly on the y axis and possible the z axis. In the numerous V3’s l have l, there min/max are more equal than the figures you have.
In looking at the vid, l would suggest you maybe asking to much of these cheap units, as the quick hand movement you do l thought the tracking was doing very well, from what l have seen if this was a Kalman filter they would overshot then correct back would be way worse.
Your humble servant, Snowflake

@alexisrosa, you might double-check that when calibrating the magnetometer, the MinIMU is pointed in every direction. When I do it, it helps me to imagine painting the inside of a basketball with the tip of the MinIMU, making sure to cover every part of it. If you are still interested in troubleshooting after double-checking that, you can start by posting a sample of the Euler angles you are getting from the AHRS code.