LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using sb rio GPGA for gyroscope

Hallo, I am Andi and I am working on the DaNI robot.

I tried to attach a Gyroscope to the sb Rio on the dani robot. I connected the wires of the gyro to the board to get analog signals. It works fine.

I choose to programm a Fpga sub VI and implement this in a Gyroscope main vi to calculate the angular rate and finally the angular position of the gyroscope.

In the gyroscope Vi this both works fine for me!

Now I wanted to use the gyroscope vi as a sub VI in my main programm. It should give me only the information of the angle, so I specified the connector pane like this.

I programmed a very simple main vi to see if i get the required information, but it seems that it is not working. The Fpga does not execute in the sub- Gyroscope vi. And I do not know WHY!!!

 

Does someone hase got experience with this and can help me?

 

 

Download All
0 Kudos
Message 1 of 22
(5,273 Views)

Hi toft,

 

Thanks for joining the forums!

 

It would be a good idea to attach your project so that we can see exactly what you have running on your FPGA, and what you have on the real-time side.  It looks as though you are not passing your FPGA reference to the Gyro SubVI, which makes me wonder how you are reading back from the FPGA.

 

One quick thing to try would be to use an FPGA Invoke Method wired outside of your loop in the main VI, to programmatically Run' the FPGA code.

 

FPGAInvoke.png


Regards,

Peter D

0 Kudos
Message 2 of 22
(5,262 Views)

Hello Peter D!

 

Thanks for your quick response!

I really need hepl here cause i am working on my desertation.

 

I applied the project as an image where you can see all the different files.

The marked files are the FPGA sub vi for the Gyroscope VI and the Turn VI which I would like to habe as a main VI.

 

Can you specify this statement?

"It looks as though you are not passing your FPGA reference to the Gyro SubVI, which makes me wonder how you are reading back from the FPGA."

 

Cause I open a FPGA reference in the Gyro sub vi right? Do I have to do do something else to get the gyro FPGA running?

 

I also tried to put an invoke after the FPGA reference with no success, still the same, the FPGA does not execute. (attached a picture as well)

Download All
0 Kudos
Message 3 of 22
(5,244 Views)

If I just open my Gyroscope Vi I get readings without a problem.

 

0 Kudos
Message 4 of 22
(5,241 Views)

It looks as though you are opening an FPGA reference in your MAIN.vi as well as in the SubVI - you should only do this once.  The error you are getting mirrors this:

 

61202.png


Regards,

Peter D

0 Kudos
Message 5 of 22
(5,230 Views)

Thanks for your answer peter!

 

I am a bit confused, so I am not allowed to open the reference to the robotics starter kit if I want to use the FPGA for my gyroscope VI?

I am getting exactly the error you told if I am opening the gyroFPGA VI to have a look if it is running, while the main Vi runs.

What is your suggestion, how can I fix that problem? Is there an other way to get the Gyroscope readings from the Pins in the sb Rio?

 

 

Kind Regards

Andreas

0 Kudos
Message 6 of 22
(5,224 Views)

Hi Andreas,

 

The Open FPGA VI Reference opens a reference to the VI or bitfile to be run on your FPGA.  Quoting the linked help file:

 


You can download and run only one FPGA VI at a time on a single FPGA target.


 

Typically you will have one FPGA VI, which can have SubVIs.  You will then open a reference to this code and pass the reference through a tunnel to your SubVI in MAIN.vi - so you will have to add your Gyro FPGA code to the DaNI FPGA code.

 

If you would like some more information (a lot more actually Smiley Happy) I would recommend having a look at the CompactRIO Developer's Guide.


Regards,

Peter D

0 Kudos
Message 7 of 22
(5,218 Views)

So in other words is there no chance to run the FPGA reference with the Starterkit bitfile and the gyro FPGA in one programm at the same time?

Cause I will need to have the reading from the Gyroscope and for example from the encoders in the same programm.

This must be possible in a way. Can I not make the gyro FPGA vi  kind of choosable in the read/write control or so? I need the readins from MOD A/AI0

 

 

Regards

Andreas

0 Kudos
Message 8 of 22
(5,206 Views)

You can only run one bitfile/FPGA VI at a time.  However you just need to add to the code in the DaNI example to perform the functionality.  The Starter Kit bitfile has been compiled from a VI - edit this VI to include the read from your AI0 alongside the other DaNI code.  You can then recompile this code (by clicking the run button) - after compilation this edited FPGA VI can then be called from your RT Host.

 

- You will then be able to read/write to the additional IO.

 

Let me know if there's anything here you would like me to expand on.


Regards,

Peter D

0 Kudos
Message 9 of 22
(5,203 Views)

Yes I am sorry but since this problem is only a bit of my project I would like to ask you for more help to do this.

I do not know how to include that into the starterkit bitfile and never came accross something like it.

 

Kind Regards

Andreas

 

0 Kudos
Message 10 of 22
(5,195 Views)