LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read a MPU 6050 through Labview.

How can i get the displacment or anglur displacment graphs plotted with real time in seconds ?

Thank you in Advance

0 Kudos
Message 31 of 47
(6,184 Views)

How can i get the displacment or anglur displacment graphs plotted with real time in seconds ?

Thank you in Advance

0 Kudos
Message 32 of 47
(6,184 Views)

Thank you for that posting but the code that is posted for LabView myRio does not have any connection info. I know what the connection info is for the Arduino but I assume this method we can do away with teh Arduino and connect direct to the myRio. So what connection goes where.

Vcc and Gnd are self evident but we also have

SCL

SDA

XDA

XCL

AOD

INT

which pins on the myRio do they connected to?

Message 33 of 47
(6,184 Views)

Check the spec sheet for MyRio. I don't remember off the top of my head but it should be explain there

0 Kudos
Message 34 of 47
(6,184 Views)

Hello,

 

Thank you for the code. I am trying to use MPU6050 GY521 Gyroscope with myRio. I tried your code and it worked fine until a certain period of time, it showed error. The error is shown in the image below.

 

 

Do you know what does this errors means? Is there any suggestion you could give to solve this?

0 Kudos
Message 35 of 47
(6,157 Views)

I changed the original posters code to stop the estimated angle from drifting. This example only has one degree of freedom - the tilt which I believe is roll. it is damned confusing to get proper information on this device even from the data sheet. However, this example uses a complementary filter to combine the gyro and accelerometer readings. This is because one works well at high frequencies and one at low!! So an integrator is no longer required, instead it is a low pass filter and high-pass combined into a simple recursion. It is a clever yet simple approach used by many Segway builders.

 

y(k)=0.8(y(k-1)+gyro_rate*dt)+0.2(acceleration_angle)

(dt is the sample interval which we are told is 1/1000. I am confused if this is the sample rate for the sensor or for the control loop - because I have 10kHz sample loop and it still works).

 

of course 0.8+0.2 adds to 1 and different combinations can be used. the alternative is a Kalman filter which isn't that difficult but I am led to believe there is little difference in the result. (don't take my word for it). The acceleration angle is found using arctan2 as acceleration is a vector. (that was the confusing part). You can do this for all three axis of course but I am only interested on one since my application at present is in Segways and balancing carts. Connections are as previously mentioned. I also added a trim for the gyro velocity.

3.3V --> VCC

GND --> GND

VIO --> GND

SDA --> 34

SCL --> 32

 

This is for the blue break out board (not the red one that is often shown), Read previous postings about it as it needs an extra 3.3v I believe. This will sit for a long time without drifting.

 

Message 36 of 47
(5,528 Views)

Hi! tomnz! Thanks for your share, it gives me a ot of help.

But I get strange results,the value is zero all the time. I don't why, it has confused me for a while. And I really want to tell you that in the code I get from other people, it can run very well for the first time, but later, even I just click the red stop button"abort execution" , and run it for the second time, it will also get all-zero results. This code is basically the same as yours, it is also changed from the gyroscope demo in the "Part II - NI myRIO Mechatronics Kit". So I want to ask why all the values zero. Thanks!

0 Kudos
Message 37 of 47
(5,467 Views)

Check your wiring. Also which break out board do you use? This is for the blue  one not the red one. The red one needs an extra connection. Other than that it should work so if it doesn't try changing the Gyro board.

Message 38 of 47
(5,462 Views)

Thanks for your replying. I don't know the color problem you talk about, I don't know which color my board is. Do you mean the color of  the MPU6050 module? I can show you in the following picture.

0 Kudos
Message 39 of 47
(5,450 Views)

Thanks for your replying. I don't know the color problem you talk about, I don't know which color my board is. Do you mean the color of  the MPU6050 module? I can show you in the following picture.

Download All
0 Kudos
Message 40 of 47
(5,450 Views)