Hi I'm trying to figure out how to use the MPU-6000, I'm reading your source code and I don't see anything about using the DMP
I've also looked at the ArduPilotMega 2.0 repo, found the code for the MPU-6000, but it also does not do anything with the DMP
I understand there's a supposed to be a bit of code that loads a block of instructions into memory banks inside the MPU-60x0, and then the FIFO outputs quaternion data. I do not see any of these elements in "ArduIMU328_V3" or "AP_InertialSensor_MPU6000.cpp"
Can I please see the code to use the DMP?
Nevermind. I see it's in the .zip. I just don't see it in the file list in the trunk.
Ok i have now looked into it a little bit.
I have changed the code (example code ftom the APM2 reposetory) to comply with HappyKillmores ArduIMU2 test program (http://diydrones.com/profiles/blogs/arduimu-v2-test-application) by adding the lines below. This basically encodes the euler angles to binary for the test program.
First thing i noticed was that pitch and roll was switched and these had to be switched.
I don't know exactly how the test program works but the two 3D models: Yellow plane and cube behaves differently.
With the ArduIMU2 demo you had to choose the Yellow plane to get a correct display of the board orientation but with this example you need to use the cube.
Does anyone know how this program interpret the angles to get the correct display?
Euler to binary:
Serial.print("DIYd"); // This is the message preamble
IMU_buffer = 0x02;
tempint=ToDeg(roll)*100; //Roll (degrees) * 100 in 2 bytes
tempint=ToDeg(pitch)*100; //Pitch (degrees) * 100 in 2 bytes
templong=ToDeg(yaw)*100; //Yaw (degrees) * 100 in 2 bytes
if(templong>18000) templong -=36000;
if(templong<-18000) templong +=36000;
tempint = templong;
for (int i=0;i<ck+2;i++) Serial.print (IMU_buffer[i]);
for (int i=0;i<ck+2;i++)
IMU_ck_a+=IMU_buffer[i]; //Calculates checksums
The problem is that this code (DMP code taken from repository) was designed for APM2 and in adition to the hardware differences (CS and INT pins) both sensors MPU6000 and HMC5883 are mounted in diferent positions so the output from this library is not valid for ArduIMU v3. We have this library updated to work with ArduIMU v3 but as Chris said, until we get a proper licence from Invensense we are not going to release it (sorry for that, I hope it will be soon...)
Meanwhile you can test the code from ardu-imu repository . This test is based on old ArduIMU v2 code with DCM algorithm updated to use the new sensores (MPU6000 and HMC5883).
Any updates on the licensing issues?
Yes, what is the status on obtaining the license from Invensense? I purchased one of these with the hope that I could use the fusion code to create a 2D mouse pointer for a glove. Could that be still possible without obtaining the "fusion code" from Invensense? What sensors does the current code support?
Thank you for your help.
All sensors work now Just your arduino must do more of the processing right now, rather then using the DMP sensor fusion.
Yes, well I bought this based on the advertising material on the DIYDrones store site. Specifically the below statement...
"Digital Motion Processing™ (DMP™) engine offloads complex MotionFusion, sensor timing synchronization and gesture detection with supported software (not yet currently supported in DIY Drones code)"
...although when I bought the board, the site did not have the comment about not being supported in the code. I don't mean to sound ungrateful, it's a great little board, but I do find it a little disappointing not to be able to use a feature that was advertised to me. Do you have any updates on the licensing?
Meaning we have to come up with our own algorithms to correct the drift and reset the sensors?
Do you know what update rate I can expect with the arduino doing the processing? I believe Invensense claims 200hz update rate using their sensor fusion algorithm and processor.
I pushed some code to 200 Hz and my code stopped outputting stuff (it was supposed to output stuff once per second but only if the FIFO was processed), but it works at 100 Hz. This might take more investigation.
We run the APM at 250hz, and it's running at the same clock speed as ArduIMU so that should be easily possible.
Using the DMP makes the ArduIMU V3 a sexy little board with loads of power left in the MEGA328p to run quite complex systems (i'm sure even a simple auto pilot).
It is nice that the ArduIMU firmware is being updated to support V3 but I would really like if a clean MPU6000(using DMP and magnetometer) library could be maintained as well.
Being able to implement a full featured IMU into your project by just clicking "sketch->import library->MPU6000" is really-really ... well sexy.
I have been evaluating the modified library based on the one stolen from APM2 and it perform surprisingly well even without the magnetometer.
I know that all you developer people are busy but I'm sure that all here appreciate your work greatly.
(I for one have shown my appreciation by buying 9 ArduIMU V3 boards :) )