Asked
— Edited
Has anyone had any luck getting a non EZ-Robot supplied MPU9150 to work with the EZbv4? I'm not able to get mine to work.
I'm using the 5.16.15 release of EZ-Builder
Added the MPU9150 control to my project
EZBv4
Interfacing the MPU9150 to one of the i2c ports
This is module I'm using: MPU9150
The board does power up.
Any suggestions on what I can try to get it to work?
Thank you!
I reviewed this thread: MPU6050
Which covered using a non EZ-Robot 6050 module and it was suggested to use the sample project from the cloud JD with the MPU6050. In that project I found I the script "Gryo Update", I took the code from it and applied to my project with the MPU9150 module. I renamed the variables and the command controls to match those of the MPU9150. It did not work at first - I got errors on the int command.
I started my project over, repeat the steps and it worked. I assume I had something named wrong in my "Gyro Update script". So the awesome news is that it works.
I guess part of what seems confusing to me about the control is it has an "Init" button on the control which seems like I could click it and bingo-bango data would come in from the sensor. But re-reading the ARC tutorial from the Learn section for the MPU9150 we are required to add an external script to call the Init of the MPU9150 control. Is that right? If we click on the "Init" button of the control we really are not doing anything are we?
And that is what I thought at first DJ, but I might have been overall confused on how to use and why I needed to use "Init" for the MPU9150 control when the Init button is on the control. I thought I could click the Init button.
Hi,
Do you get any consistent data output on your MPU9150. I get different outputs for the same heading/direction in my apt depending on where my robot is located. It seems very inconsistent. Is there a calibration process / a i2Cwrite that I am supposed to run before ?
THank you
The init button referenced in this thread initialized the module. Init means initialize - which is sending configuration data before it can return data. The module doesn't start sending data. That's not how i2c works. You are required to "query" data once it has been initialized. Initialize is done with the init button.
To query data, there is a ControlCommand() for it as seen in the examples.
I just received today the MPU9150 built by EZ robot. It worked great at first, then a couples minutes later started giving inconsistent data, keeping values around 140. I had that problem with my non-ezb MPU9150 later and now... well now this old one gives consistent data again and the new one doesn't. I have no idea what I'm doing wrong and, moreover, it makes me want throw my multi thousands dollars project over the balcony...
2) The speed of which the sensor is polled will also affect the data capture within the sensor itself. Ensure you have a slight > 10ms delay.
3) Are you using a /2 comm ez-b v4? This will assist with polling time
1) I'm referring to the compasheading value
2) delay is the one set in the tutorial, 100ms
3) it's on ic2 port on an EZB v4, but I'm not sure if that's what you meant in your third question.
It looks like something gets stuck somewhere at the software level. INdeed, after testing in an empty ezb project I got to recalibrate and get consistent data again then it went back to staying around 135 or 140 vlaues after a minute or so...
You must rotate the sensor across all 3 physical dimensions while rotating it.
This is a similar calibration procedure that pops up occasionally on mobile devices.
The reason the mpu sensor has been discontinued is due to the inherit troubles with the sensor itself. Also, the sensor lacks the ability internally to compensate for the angle during reading magnetic data. The magnetic sensor data from each axis runs through an equation in ARC to compensate on the physical angle of the sensor based on the accelerometer.
In short, the mpu is a terrible sensor - which is why the product has been discontinued and we're working on a new one by evaluating more robust sensors. The mpu is popular in the hobby space because it's cheap, but not reliable.
If you wish, the ARC mpu control displays the RAW data from sensors in the Variable Manager. As you will see, the data from the sensor becomes invalid - as it's not an ARC software issue.
The raw data is presented to anyone willing to use the raw sensor data from the magnetometer to calculate their own angular equations etc..
Also make sure you are using the INIT button or sending an Init to the sensor. The sensor requires one Init before operation.
you do not need need to send more than one init. If you send more than one init in a session, weird data will appear as well.
The question mark on the control will bring you to the manual page for the mpu device with example code.
I was calibrating while running the script... dough...
Thanks a lot @Dj. It works now.