I cannot believe that I'm the only one who noticed that! I would write it off as a faulty device but I've got two brand new once here that produce identical output with the same unmodified firmware (V1.9)
Here is the description of the problem:
1. Initialize IMU level
2. Slowly turn 90 in roll
3. Return to horizontal orientation.
4. Slowly turn -90 in roll
5. Return to horizontal orientation.
6. Repeat for pitch and yaw (yaw rotate 360 in 90 deg increments)
Each axis output should correspond to the number of degrees turned. Instead I get the following:
Roll reading: actual roll: - 90 deg -> RLL output: - 120
+ 90 deg -> RLL output: + 120
Pitch reading: actual pitch: -90 deg -> PCH output: -50 (goes from 0 to -89 and then decreases to -50)
+90 deg -> PCH output: +50 (goes from 0 to 89 and then decreases to 50)
Yaw reading: actual yaw: 0 deg -> YAW output: 180
90 deg -> YAW output: 108
180 deg -> YAW output: 45
270 deg -> YAW output: -40
360 deg -> YAW output: -180
I agree, they should put a disclaimer on the order page that the software doesn't really work. But it is open source, so I guess we need to lower our expectations.
If you take a clean V1.9 "example" code and implement the changes described above everything should work like a charm. All the angles are correct and output tracks with the unit movements.
Oh, BTW you might want to disable your onboard magnetometer. Magnetometer output is wrong as well. It needs to be calibrated and have an offset applied.
yup it works f9 after disabling the magnetometer :)
Okay, either I'm missing something or my unit is broken. A fair bit of data here, so bear with me.
I created a fork of the Arduimu 1.9.8 code and hosted it on github. In it I have 2 branches, master and correcting. In master I have a SampleOutput.txt that contains the raw serial dump from basically stock code. (Basically means changed outputs, disabled magnetometer, formatted comments, and a longer GPS timeout. No measurement functionality changed.)
In the branch correcting, I have two versions of the code. One is with 8192 gravity and with Ki_PITCHROLL and Kp_PITCHROLL modified. The other is with 8192 gravity and with Accel_Scale() used to modify read_adc returns.
Then I have a spreadsheet with three pages. The first page is formatted raw dump using stock code, the second is with PITCHROLL modified, and the third is with Accel_Scale() use. For each I tested by letting the calibration finish then rotating to a roll of 90, then back to 0 and through to -90 (or the opposite direction. Of three, two match direction. That's me rotating one of the in the wrong order, not the unit reporting wrong) then back to level. Then I pitched +90 and back down and stopped the log.
The spreadsheet contains the roll and pitch charted. As you can see by viewing them, they are not right. The only thing I wasn't sure of from the previous instructions is the weights. What is that in reference to?
Here are the links referenced above:
Could someone who has successfully gotten v3 working verify whether my changes are correct? I'm not familiar enough with IMUs, DCM, or even hardware development, to readily determine on my own what's wrong.
In my experience it seems close to impossible to get anybody to help on ArduIMU issues. I can't really help you with your problem except to say that I got v3 working correctly. It seems that you are trying to do to many things at the same time. If you can take a clean build and implement only the changes mentioned in this thread and post your output, I might be able to help. Right now it is just too confusing.
Thanks for the reply, Artem. I'm not sure what you mean by "trying to do too many things at the same time". The only functional changes present in the repository are the changes you recommended.
I'll point out the changed files so you can easily compare with what you suggested be changed.
The first change is to change gravity to 8192 and use different values (your recommended values) for Kp_ROLLPITCH and Ki_ROLLPITCH.
The second change is to retain the 8192 gravity but remove the Kp and Ki changes, and add the Accel_Scale() calls that you recommended.
As I said, you mentioned changing weights but I'm not clear on what that means. As my charts indicate in the spreadsheet in my previous post, one can sense what the axes are doing, but they don't report the correct values.
ya i too tried the same what u have Caleb but not successful yet to operate my arduino at higher speed....i would like if Artem would specify the changes ance again more clearly .....
i the attached file column O denotes the corresponding total distance and N the current displacement...the logic used for converting acc to dist is
and this is repeated for entire set of readings...can anyone please verify this method...
On keeping the magnetometer off ,there is drift is gyro(yaw)readings....any idea how to encounter this drift ...?? what changes do i need to put into the code if i want my gps to take readings periodically ...i.e switch on the gps ..take readings and aging switch it off periodically to save power...
changing weights but I'm not clear on what that means
I thought I mentioned that the new raw output differs from the old raw output by the factor 83.51?
However don't even worry about it. If you implemented the first change everything should've worked. Your output capture is inconclusive. All I can tell is that all you analog outputs are changing, which is a good thing provided your are moving your IMU. All these changes would not affect your analog values. It is the raw output of your IMU. These changes affect how you interpret these values i.e. how you calculate your pitch, roll and yaw based on these values.
So just implement the first change . Leave #define PRINT_ANALOGS 0 and see what your Euler angles output looks like. The easiest way is to move one axis at a time to predetermined angles (30 deg, 45 deg, 60 deg) and then mark it on the output. Don't use 90 deg since it might be confusing. If I remember correctly more than 90 deg pitch will cause yaw and pitch jump 180 deg off (which is what is supposed to happen) If the output doesn't track with the actual IMU movements then you might have some other issues with your unit.
Just a sanity check - you have a unit with a purple PCB, right?
I think so. It's blue or purple. (I'm color blind)
I might play with this again tonight, but I'm rather disenfrachised by the whole idea now and will likely just use computer vision alone to get the data I need. I was hoping to augment that with IMU measurements, but, as I said, I'm less enthusiastic about that now.
I appreciate your assistance.
I think so. It's blue or purple. (I'm color blind)
Read the silkscreen on the back. Does it say ArduIMU V2 ArduIMU V3?
ya mine is purple one ...i will try to incorporate suggested changes once more.
any idea what changes do i need to make into the code if i want my gps to take readings periodically and switch it off for the remaining time..is it possible?
what does 1g/4g scale actually means?