From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C comms using IMU and FPGA on sbRIO

Hi,

 

I'm new to the I2C protocol (and any digital comms) and am currently working on a project which uses a MPU-9250 IMU. To get some basic knowledge, I've taken a look at the shipped FPGA examples and examples people have posted on here. I now have a basic working system, which seems to be reading data, however I would however appreciate some help with some tweaks to getting the system working as I would like.

  

I'm running the FPGA Host example which I've compiled and run on my sbRIO-9627. I've attached a screen shot of the modifed built-in example host VI, where I'm using a For Loop on the VI to write individual addresses and then read the data bite one address at a time. The RT loop is currently reading at 100hz which should be ok for my purposes. However, the major issue I have is that the signals I can see on the sbrio graphs are updating about 2-3secs after i move the IMU. 

 

I've tried using different clock rates and anything slower than 100kHz seems will slow down host RT loop rate. Can anyone provide some pointers to 1) identify a better method to get data from the IMU 2) what I can do to ensure the data is not lagging from input to screen update.

 

Ideally I'd like to have the system running at 1kHz but that's the next step!

 

Using LV2015SP1, RT2015SP1, FPGA,

 

Register map sheet for IMU is here: https://cdn.sparkfun.com/assets/learn_tutorials/5/5/0/MPU-9250-Register-Map.pdf

 

Thanks,
Dave

 

 

Download All
0 Kudos
Message 1 of 5
(2,950 Views)

Hi Dava, 

 

Thank you for sharing the information. Could I first check, are the accel g's and gyro array indicators updating with a delay or are they updating before the charts? Could I also check that you are using charts and not graphs for accel and gyro? 

 

Besides that, I cannot see anything in the code that could be causing a delay. Would it be possible to send the project so that it is easier to examine the VI you sent? 

 

Also, we have resources on the website and forums that might be relevant to your project if you haven't come across them already: 

Many Thanks, 

 

Riley Ilieva

Applications Engineer

National Instruments 

 

 

0 Kudos
Message 2 of 5
(2,892 Views)

Hi Riley,

 

It seems like some "magic" has occurred and we are now reading data in real-time with no delays between the input and data updating in the indicators and charts. I'm not sure what has changed to be honest, but will continue to monitor the system to see if anything changes. 


Regards,
Dave

0 Kudos
Message 3 of 5
(2,887 Views)

I have now the same issue of slow readings also sometimes the sensor didn't output any data .. can you tell me please what you have done to overcome this problem and it will be generous for you to upload your code for help 

Thanks in advance 

0 Kudos
Message 4 of 5
(597 Views)

Please do not "hijack" a three-year-old Post.  If you have a LabVIEW topic to discuss, start your own discussion, and provide the Forum with enough information to be able to help you.  Your new Post should include:

  1. Specifically what you are trying to do.  .What have you tried, what works, and what doesn't work?
  2. Tell us about your LabVIEW installation.  What version (Year and whether 32- or 64-bit) LabVIEW you are using?  What NI hardware are you using?
  3. What have you tried?  If you have generated code (especially if you have a LabVIEW Project), attach the LabVIEW code (not "pictures of code", but something we can open, edit, and execute).
    1. Please "Save for Previous Version", going at least back to 2021, as many of us do not update our LabVIEW systems every year. 
    2. Best is to include the entire Project, after compressing the Project Folder (right-click Folder, "Send to:", "Compressed (zipped) folder").

Bob Schor

 

0 Kudos
Message 5 of 5
(586 Views)