Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Using FPGA and CRIO as a hybrid controller

Howdy!

I am interested in developing an application where some control logic is implemented on both cRIO real time controller and the FOGA.
Most of the applications I have came across use the cRIO mainly for data-logging and/or monitoring, while the control logic lies on the FPGA alone.
Can we have control implemented in such a way that the continuous contorl part is handled by the cRIO and the discrete control is implemented on the FPGA.

Please let me know if anyone is working on this type of implementation or has any information on the same.

Thanks,
Gayatri
0 Kudos
Message 1 of 8
(4,599 Views)
Hi Gayatri,
It is most certainly possible to develope an application where the control logic is split between the cRIO real time controller and the FPGA.  You mentioned that you would like to have the discrete control handled by the FPGA and the continuous control handled by the cRIO.  You could do this but archetecturing your FPGA code would have to be done with some forthought and consideration to keep it small.  The reason that you find people implementing the continuous control logic on the FPGA is because it is hardware timed and can hence be executed quite fast.  Then the event driven or discrete part of the control system can be executed on the real time controller with very deterministic timing yet not as fast as the FPGA.  Additionally, with LabVIEW RT you have an event structure available in the structures function pallet.  There is not an event structure in LabVIEW FPGA so the programming of an event driven control system on the FPGA would require some considerable forethought and creativity.  Thanks! 
Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 2 of 8
(4,567 Views)

Hello,

Thanks for your reply.

Let me specify my exact requirement. I want to implement some differential algebraic equations on the cRIO and a state-chart diagram on the FPGA.

Can you provide me with some similar examples? Or may be some examples which implement control (any kind of) on both RT controller and FPGA too.

 

Thanks,

Gayatri

 

0 Kudos
Message 3 of 8
(4,517 Views)

Hi Gayatri,

I would suggest two things to start off.  First, open LabVIEW and from the file menu select Help » Find Examples.  This will open the LabVIEW example finder.  Use the search tab and search for "Statechart".  There is a full statechart tutorial that you might want to go through.  This will help you understand how to use the statechart module and save you lots of time when you start writing your code.  Secondly, use the browse tab of the example finder and select Hardware Input and Output » CompatcRIO.  In the FPGA Fundamentals folder there is a folder with Analysis and Control example projects and in the Module Specific folder there is a folder with Motion Control examples.  This is a starting point, in the mean time I will see if I can find anything more specific to what you are trying to do.  Thanks and have a great day.

 

Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 4 of 8
(4,479 Views)
Hello,
I've already gone through the Statechart toolkit. Also I saw a couople of examples you suggested. Those are really good, but the control still lies on the FPGA!

Please let me know ASAP if you get any information.

Thanks,
Gayatri
0 Kudos
Message 5 of 8
(4,462 Views)

Gayatri,

I'll see what else I can find.  Thanks and have a great day!

 

Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 6 of 8
(4,436 Views)

Hi here what I can think of if you want to do control using Statechart on the CRIO.

You have 2 statechart 1 on the FPGA and 1 on the RT. The communication between them can use the FPGA Host Interface so you make an indicator (Enum most likely) that tells the current control state of the FPGA Statechart. The RT side will be polling this FPGA indicator and decide what the next command to send down through the FPGA, again you can use the host interface that the FPGA code poll.

I seen this work for several application so essentially both side poll for a command stream from RT & FPGA.

Thanks,

oga

0 Kudos
Message 7 of 8
(4,397 Views)
Hello,

Thanks for your reply.
I was thinking on the same lines. Now that you've said it is a good way to do that, I'll try it and keep you posted!

Thanks again,
Gayatri
0 Kudos
Message 8 of 8
(4,393 Views)