Sondre Posted May 26, 2014 Report Share Posted May 26, 2014 All documentation on how to use the DMP is now freely available from InvenSense here. This means you can either rewrite this library so it works with all aspects of the DMP, or you can use the documentation and sample code written by InvenSense, to make the DMP work without this library. This information has been released for over two years... I hope you finally get to fully appreciate the DMP, instead using this half working library made by hacking an evaluation board. (To the creator: Your work has been to great help for many people, and now finally we get to use the DMP fully. Hadn't this been released, I would have been very grateful for your work.) Quote Link to comment Share on other sites More sharing options...
robjames66 Posted May 28, 2014 Report Share Posted May 28, 2014 I've ported by application from the I2CDevLib MPU6050 libraries to the official Invensense libs and I get very poor DMP behaviour. The reported orientation does not always return to the original value when there us yaw rotation one way and back. This is not drift - it's a sudden step change in the yaw and it sucks. The I2CDevLibs behave much better for me. Invensense forums are a wast of time (full of spam) and very little response to queries. Rob J. Quote Link to comment Share on other sites More sharing options...
Sondre Posted May 28, 2014 Author Report Share Posted May 28, 2014 I've ported by application from the I2CDevLib MPU6050 libraries to the official Invensense libs and I get very poor DMP behaviour. The reported orientation does not always return to the original value when there us yaw rotation one way and back. This is not drift - it's a sudden step change in the yaw and it sucks. The I2CDevLibs behave much better for me. Invensense forums are a wast of time (full of spam) and very little response to queries. Rob J. Well that sounds very peculiar. Did you implement the DMP communiction yourself? Or did you just implement the I2C-functions yourself, using the provided implementation from InvenSense? Quote Link to comment Share on other sites More sharing options...
robjames66 Posted May 28, 2014 Report Share Posted May 28, 2014 Well that sounds very peculiar. Did you implement the DMP communiction yourself? Or did you just implement the I2C-functions yourself, using the provided implementation from InvenSense? I used the Motion Driver 5.1.2 core libs and wrote a test sketch using the the motion driver test example code. Quote Link to comment Share on other sites More sharing options...
Sondre Posted May 28, 2014 Author Report Share Posted May 28, 2014 I used the Motion Driver 5.1.2 core libs and wrote a test sketch using the the motion driver test example code. And so you just replaced the I2C functions with the Wire ones? Are you sure you did configure the DMP correctly? It would be peculiar if the creators themselves would make something that doesn't work. After all, they made the evaluation board the I2CDevLib is based on. Quote Link to comment Share on other sites More sharing options...
luca Posted May 31, 2014 Report Share Posted May 31, 2014 Hello Sondre! I have read your post, but follow your link the resource isn't available, after press the agree button! Please, can you help me to find this documentation? Quote Link to comment Share on other sites More sharing options...
Sondre Posted May 31, 2014 Author Report Share Posted May 31, 2014 Hello Sondre! I have read your post, but follow your link the resource isn't available, after press the agree button! Please, can you help me to find this documentation? Hi! Have you created an account and logged in before clicking the link? Register here, and make sure you are logged in. Then you can click the link I supplied! The "Embedded Motion Driver" is the example code provided. The three PDF documents provide a documentation for the code and DMP. Quote Link to comment Share on other sites More sharing options...
Sondre Posted May 31, 2014 Author Report Share Posted May 31, 2014 I'm making an octocopter, which means I need a library that will handle the DMP, raw acceleration and the compass on the 9150. I'll make a robust library for it, so you can download if you want. I'm attending university in a month, so I'll probably be a bit busy. I'm working on this with a friend who's leaving for the military for one year. So if you write a library before me, I'd be very happy if you shared it with us! Quote Link to comment Share on other sites More sharing options...
luca Posted June 1, 2014 Report Share Posted June 1, 2014 Hello Sondre! I have an account, but maybe isn't good! The answer of the invensense site for my request is: " Your current registration status does not permit access to this file. If you have any questions or would like to re-validate your account by registering with your corporate email address, please fill out the form provided on the support page." I'm registred with my email, i haven't a corporate email address!! Any advice on how to access at this documents whitout corporate email?? I'm a university student and i make a quadcopter for university purpose. At this moment, my "library" is very simple! Now i'm able to comunicate with I2C protocol, and using I2C, i'm able to comunicate with the MPU9150, so i'm able to read raw values from this device. I'm not using an Arduino, i use an AVR STK500, and my code is in ANSI C (maybe!! ). What do you do with MPU9150? Make a "Robust libray" isn't simple, and for control purpose the raw data are useless without a filter.. Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 Hello Sondre! I have an account, but maybe isn't good! The answer of the invensense site for my request is: "Your current registration status does not permit access to this file. If you have any questions or would like to re-validate your account by registering with your corporate email address, please fill out the form provided on the support page." I'm registred with my email, i haven't a corporate email address!! Any advice on how to access at this documents whitout corporate email?? I'm a university student and i make a quadcopter for university purpose. At this moment, my "library" is very simple! Now i'm able to comunicate with I2C protocol, and using I2C, i'm able to comunicate with the MPU9150, so i'm able to read raw values from this device. I'm not using an Arduino, i use an AVR STK500, and my code is in ANSI C (maybe!! ). What do you do with MPU9150? Make a "Robust libray" isn't simple, and for control purpose the raw data are useless without a filter.. I signed up as a hobbyist using just my private email address. If you still cannot get the files, I can upload them to you. I don't know what your background is, and how long you've been attending university. I'm 19 years old and attending university in about one month. However, I've been programming since I was 11-12 years old. So I know my programming. What I need is more maths and physics, which is why I've applied for cybernetics. After 8 years of programming, I've learned how to make a robust API. In fact, I always try to abstract away as much of the code as possible, so that it's easy to reuse later on. That's why I make a library out of the MPU communication. Additionally I'll make a library that will know everything about the orientation etc. about the device. Thus, using a different chip without a DMP, will just be a matter of reimplementing the API. No big code rewrites necessary. So to me, a robust library makes the code easier and more simple to write.. I'm using the MPU9150 to make an octocopter (quadcopter with eight rotors). It's a pretty heavy duty one capable of lifting a 1.5 kg DSLR. So I really want this code to be robust. The octocopter will be controlled by a PS3 controller, or by an autopilot. The autopilot "route maker program" is written in HTML5 and ported to the iPad. Thus you'll be able to set up the autopilot in the field over WiFi. So as you might think, this is a huge project. We're hoping that this thing is flying in a few months, and that it is completely done in about a year, although this is probably going to take a bit more time... As my friend has never programmed before, and I have never done bare metal programming before, I'm really excited to see how your project goes along. It would be interesting to see a few updates from you. Since you're doing this at the university, you have a deadline, which means you have to start right away. So I suppose we have to make the library at the same time... Well, that's how it is. I hope you get the quadcopter up running quickly! Quote Link to comment Share on other sites More sharing options...
luca Posted June 1, 2014 Report Share Posted June 1, 2014 I signed up as a hobbyist using just my private email address. If you still cannot get the files, I can upload them to you. I don't know what your background is, and how long you've been attending university. I'm 19 years old and attending university in about one month. However, I've been programming since I was 11-12 years old. So I know my programming. What I need is more maths and physics, which is why I've applied for cybernetics. After 8 years of programming, I've learned how to make a robust API. In fact, I always try to abstract away as much of the code as possible, so that it's easy to reuse later on. That's why I make a library out of the MPU communication. Additionally I'll make a library that will know everything about the orientation etc. about the device. Thus, using a different chip without a DMP, will just be a matter of reimplementing the API. No big code rewrites necessary. So to me, a robust library makes the code easier and more simple to write.. The problem isn't your ability to programming, but how use your library in real time application!!! After some years at university you will understand!! If you're not interested in creating real time applications, then many problems you can not see them!!! Java or C++ or Objective-C are hight level language! This languages are "simple" to use to make a robust library... However, i'm not interested in this kind of problem, i'm an automation engineering and my objective isn't to make a library, but i will design a control system to control my quadcopter. In this case my quadcopter isn't a drone (i not control it with any device such a PS3 joypad or iPad) but is a robot! This is a bit different!! I'm not using the I2CDevLib because this kind of library it's a part of my work (my exam is on the use of the microcontroller), so i writed my personal "library" to interface with I2C protocol. I think that for this kind of problem (interface with I2C protocol), the I2cDevLib work very well. The problem is that the MPU9150 have a proprietary library that help to use the proprietary DMP (Digital Motion Processor). My problem, now is how to use the DMP functionality of the MPU9150 to obtain a signal (Euler angles) without noise! For do this i need to know how use the Invensense library to obtain the signal without noise! This kind of problem are different than your!! I'm not sure that you understand all that i write! Maybe we will talk about, after some years!! Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 The problem isn't your ability to programming, but how use your library in real time application!!! After some years at university you will understand!! If you're not interested in creating real time applications, then many problems you can not see them!!! Java or C++ or Objective-C are hight level language! This languages are "simple" to use to make a robust library... However, i'm not interested in this kind of problem, i'm an automation engineering and my objective isn't to make a library, but i will design a control system to control my quadcopter. In this case my quadcopter isn't a drone (i not control it with any device such a PS3 joypad or iPad) but is a robot! This is a bit different!! I'm not using the I2CDevLib because this kind of library it's a part of my work (my exam is on the use of the microcontroller), so i writed my personal "library" to interface with I2C protocol. I think that for this kind of problem (interface with I2C protocol), the I2cDevLib work very well. The problem is that the MPU9150 have a proprietary library that help to use the proprietary DMP (Digital Motion Processor). My problem, now is how to use the DMP functionality of the MPU9150 to obtain a signal (Euler angles) without noise! For do this i need to know how use the Invensense library to obtain the signal without noise! This kind of problem are different than your!! I'm not sure that you understand all that i write! Maybe we will talk about, after some years!! Ahh, I understand. Well, the accelerometer is very noisy. It can only correct for the long term drift of the gyroscope. So the closest you can get, really is by processing the gyroscope data. As I'm making an octocopter, I also need as little noise as possible when implementing a PID controller of some sort. But we haven't really spent much time yet, so I don't know whether or not the MPU can do this by itself. It's a very small chip, that of course has limited processing power. In the worst case scenario, you'd have to implement a Kalman-filter, or at least a complementary filter yourself. And maybe smooth the gyroscope data by using median and average calculations. I would appreciate if you had left a comment on how you achieved your goal when you're done! All I know is you can download the sample library from InvenSense. Did you get it downloaded, or do you want me to upload it here? Quote Link to comment Share on other sites More sharing options...
luca Posted June 1, 2014 Report Share Posted June 1, 2014 I would appreciate if you had left a comment on how you achieved your goal when you're done! This is not a problem!! However you run a bit! It's not simple to implement a control system for real world application. In this case, the quadcopter dynamics is very non linear and unstable in open loop, so the design of control system it's difficult! There are a lot of problem, that is impossible to describe here now!! I'm not sure (this is that i will try to do now!!) but if you use the functionalities of the DMP of the MPU9150, probabily the output of the IMU (Euler angles, or quaternion) is very clear (i hope!!). Note that the output of IMU (Euler angles) can be obtain without use a DMP features! In this case you take the raw data, elaborate it and finally filter it, not using the MPU9150, but using your microcontroller! In this way you spend a lot of microcontroller resources and this is a problem!! The advantage of the use of the DMP is to save the microcontroller resources! However i'm sorry but i'm not able to download this document. I'm create another account, but nothing! Please can you upload it here? Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 This is not a problem!! However you run a bit! It's not simple to implement a control system for real world application. In this case, the quadcopter dynamics is very non linear and unstable in open loop, so the design of control system it's difficult! There are a lot of problem, that is impossible to describe here now!! I'm not sure (this is that i will try to do now!!) but if you use the functionalities of the DMP of the MPU9150, probabily the output of the IMU (Euler angles, or quaternion) is very clear (i hope!!). Note that the output of IMU (Euler angles) can be obtain without use a DMP features! In this case you take the raw data, elaborate it and finally filter it, not using the MPU9150, but using your microcontroller! In this way you spend a lot of microcontroller resources and this is a problem!! The advantage of the use of the DMP is to save the microcontroller resources! However i'm sorry but i'm not able to download this document. I'm create another account, but nothing! Please can you upload it here? Lots of exclamation marks there.. I know implementing a control system is challenging. That's the sole reason why we started this project. We want to be challenged and learn from it. It is simply a short term hobby, sort of. What I'm saying is that if the DMP has noise, you have to implement everything yourself. For my friend and me, this is not a problem as we use an ATSAM running at 84MHz, but since you're running an AVR it's probably a bigger concern as you say. I'll upload it, just wait a minute. Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 Here are the DMP files. Quote Link to comment Share on other sites More sharing options...
luca Posted June 1, 2014 Report Share Posted June 1, 2014 Lots of exclamation marks there.. I know implementing a control system is challenging. That's the sole reason why we started this project. We want to be challenged and learn from it. It is simply a short term hobby, sort of. What I'm saying is that if the DMP has noise, you have to implement everything yourself. For my friend and me, this is not a problem as we use an ATSAM running at 84MHz, but since you're running an AVR it's probably a bigger concern as you say. I'll upload it, just wait a minute. Sondre, thank you so much for sharing this file! You help me a lot!! If you like the challenge then you are in the right way! My advice is to study a lot because this kind of project is multidisciplinar. From my point of view you should have a good skill in mathematics, mechanics and electronics, obviously you should be able to programming the microprocessor. I'm started my project, reading first this thesis: https://fenix.tecnico.ulisboa.pt/downloadFile/395139421058/Tese_de_Mestrado.pdf and this is only the start!!! Good luck! Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 Sondre, thank you so much for sharing this file! You help me a lot!! If you like the challenge then you are in the right way! My advice is to study a lot because this kind of project is multidisciplinar. From my point of view you should have a good skill in mathematics, mechanics and electronics, obviously you should be able to programming the microprocessor. I'm started my project, reading first this thesis: https://fenix.tecnico.ulisboa.pt/downloadFile/395139421058/Tese_de_Mestrado.pdf and this is only the start!!! Good luck! I would recommend taking a look at AeroQuad. It is a very good open source platform, that will probably help you in the right direction if you're stuck. Good luck to you too! Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted June 1, 2014 Report Share Posted June 1, 2014 I use MPU6050's 6 axis DMP to control quadrotors. It works fine as long as the sensor is well placed in the quad. The noise depends on the FIFO's frequency (200Hz has more noise than 100Hz), but it is almost neglectable in both cases (around 0.2º, search my other posts to find more info). I have also tried raw values + Kalman, and it works also fine, but I believe DMP is enough and easier. I have tested its measures versus a Microstrain 3DM-GX2 (2000 euros a few years ago), and it is almost identical. Good luck with your proyects! Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 1, 2014 Author Report Share Posted June 1, 2014 I use MPU6050's 6 axis DMP to control quadrotors. It works fine as long as the sensor is well placed in the quad. The noise depends on the FIFO's frequency (200Hz has more noise than 100Hz), but it is almost neglectable in both cases (around 0.2º, search my other posts to find more info). I have also tried raw values + Kalman, and it works also fine, but I believe DMP is enough and easier. I have tested its measures versus a Microstrain 3DM-GX2 (2000 euros a few years ago), and it is almost identical. Good luck with your proyects! Hi! Did you use Arduino? In that case, do you still have the code for communicating with the DMP? Quote Link to comment Share on other sites More sharing options...
rodolf0ac Posted June 2, 2014 Report Share Posted June 2, 2014 Hey everyone! I've been working with this device for a year and a half using the great development by Jeff Rowberg, and I'm still tryna figure out if this board could help me out to do what I need to. I'm developing an autonomous mobile robot, and initially planned to develop an inertial navigation system; at that time I didn't know what I was getting into. The thing is I managed to get my DMP working using Jeff libraries and sketches, and get to see the 3D demo. But I just need to get position (x, y) and orientation (theta: yaw). I just want to determine the position/spatial coordinates instantly in order to store those values for an algorithm of dead reckoning and use them to redirect my bot after avoiding the obstacle (bug2 algorithm). Btw at this moment I can't afford myself to do any hardware modification such as wheel encoders, I have a deadline, which is in ten days! But I could consider using a magnetometer and I don't know if it can provide me with what I need (x, y, theta), specially the HMC6352 2-Axis Compass http://playground.arduino.cc/Learning/Hmc6352 I'll appreciate any comments on this Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 2, 2014 Author Report Share Posted June 2, 2014 Hey everyone! I've been working with this device for a year and a half using the great development by Jeff Rowberg, and I'm still tryna figure out if this board could help me out to do what I need to. I'm developing an autonomous mobile robot, and initially planned to develop an inertial navigation system; at that time I didn't know what I was getting into. The thing is I managed to get my DMP working using Jeff libraries and sketches, and get to see the 3D demo. But I just need to get position (x, y) and orientation (theta: yaw). I just want to determine the position/spatial coordinates instantly in order to store those values for an algorithm of dead reckoning and use them to redirect my bot after avoiding the obstacle (bug2 algorithm). Btw at this moment I can't afford myself to do any hardware modification such as wheel encoders, I have a deadline, which is in ten days! But I could consider using a magnetometer and I don't know if it can provide me with what I need (x, y, theta), specially the HMC6352 2-Axis Compass http://playground.arduino.cc/Learning/Hmc6352 I'll appreciate any comments on this Thanks in advance. Well, you could integrate the acceleration twice, but this will amplify both the error and the noise, such that the precision will be poor. Quote Link to comment Share on other sites More sharing options...
luca Posted June 2, 2014 Report Share Posted June 2, 2014 Hey everyone! I've been working with this device for a year and a half using the great development by Jeff Rowberg, and I'm still tryna figure out if this board could help me out to do what I need to. I'm developing an autonomous mobile robot, and initially planned to develop an inertial navigation system; at that time I didn't know what I was getting into. The thing is I managed to get my DMP working using Jeff libraries and sketches, and get to see the 3D demo. But I just need to get position (x, y) and orientation (theta: yaw). I just want to determine the position/spatial coordinates instantly in order to store those values for an algorithm of dead reckoning and use them to redirect my bot after avoiding the obstacle (bug2 algorithm). Btw at this moment I can't afford myself to do any hardware modification such as wheel encoders, I have a deadline, which is in ten days! But I could consider using a magnetometer and I don't know if it can provide me with what I need (x, y, theta), specially the HMC6352 2-Axis Compass http://playground.arduino.cc/Learning/Hmc6352 I'll appreciate any comments on this Thanks in advance. rodolf0ac, maybe i understand your problem... My point of view is that you try to find a pose (x,y and yaw) in inertial frame using measure take in body frame. This is a kinematics problem, my advice is to use the measure in body frame and use this measure in input a kalmann filter for estimate the pose (x,y,yaw). In reality you need other kind of sensor like exteroceptive sensors (like ultrasound) to measure the pose of the robot in inertial frame. Good luck! I use MPU6050's 6 axis DMP to control quadrotors. It works fine as long as the sensor is well placed in the quad. The noise depends on the FIFO's frequency (200Hz has more noise than 100Hz), but it is almost neglectable in both cases (around 0.2º, search my other posts to find more info). I have also tried raw values + Kalman, and it works also fine, but I believe DMP is enough and easier. I have tested its measures versus a Microstrain 3DM-GX2 (2000 euros a few years ago), and it is almost identical. Good luck with your proyects! Thank you so much luisrodenas! Your post make me happy!!! I think so that the DMP functionalities is easier than implement a kalman filter!! Quote Link to comment Share on other sites More sharing options...
rodolf0ac Posted June 2, 2014 Report Share Posted June 2, 2014 Well, you could integrate the acceleration twice, but this will amplify both the error and the noise, such that the precision will be poor. Thank you Sondre, heard that before but I refused to believe that this mr-know-it-all device will not work for my purposes, I'll still have accumulated error if the yaw drifts, though a compass might help with that. rodolf0ac, maybe i understand your problem... My point of view is that you try to find a pose (x,y and yaw) in inertial frame using measure take in body frame. This is a kinematics problem, my advice is to use the measure in body frame and use this measure in input a kalmann filter for estimate the pose (x,y,yaw). In reality you need other kind of sensor like exteroceptive sensors (like ultrasound) to measure the pose of the robot in inertial frame. Good luck! Thank you so much luisrodenas! Your post make me happy!!! I think so that the DMP functionalities is easier than implement a kalman filter!! Thanks a lot luca, I was sceptic about this "limitation" with the MPU, but given the circumstances I'll need to take a look at another dead reckoning technique. By now I have measured v & w from the wheels, and I kind of think that applying simple odometry equations and substituting these values (measurements) could give me a good estimation of the mobile robot pose. Do you think Honeywell HMC6352 will do that for my purposes? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Sondre Posted June 2, 2014 Author Report Share Posted June 2, 2014 Thank you Sondre, heard that before but I refused to believe that this mr-know-it-all device will not work for my purposes, I'll still have accumulated error if the yaw drifts, though a compass might help with that. Well, I've tried it myself, and I've seen others trying this. It works for a few seconds, before the velocity makes the position "run" away. What I'd try if I had needed this, is to use some other way of measuring the speed/position to correct the position in the long term. If you make this work using only the MPU, please tell us! Quote Link to comment Share on other sites More sharing options...
rodolf0ac Posted June 3, 2014 Report Share Posted June 3, 2014 Well, I've tried it myself, and I've seen others trying this. It works for a few seconds, before the velocity makes the position "run" away. What I'd try if I had needed this, is to use some other way of measuring the speed/position to correct the position in the long term. If you make this work using only the MPU, please tell us! Hope I could do that! Deadline is in 10 days from now. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.