LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Loop

I designed a rudder control system through Simulation Loop (CDSIM->Simulation), but now I wanna made my simulation in real-time. I know that I can use real-time with the Simulation Loop, also the sensors can be simulated by HIL or FPGA ( the issue is I'm new on LabVIEW and I don't know what are the requirements to do that. I meant if I have to download something to use HIL or I have to employ the CompactRIO to use the FPGA).

 

The question is: if I made my simulation in real-time with the Simulation Loop, Can I use the same code to see if it works and can be developed in the reality using subsystems or I have to make another code where I don't use the simulation loop?

0 Kudos
Message 1 of 4
(3,467 Views)

You have the option to do both things. For example, in this example:

C:\Program Files (x86)\National Instruments\LabVIEW 2016\examples\Control and Simulation\Case Studies\Mechatronics\Pendubot\Pendubot.vi

 

image.png

The controller is developed using LabVIEW while the model is using CDSIM. In this case, the "real-time" implementation will be using only the controller and the code has FPGA measurement and control:

https://www.youtube.com/watch?v=NBHqrBGJlLc

 

however, you can use the Subsystem outside the simulation loop and integrate as any other labVIEW code. See this tutorial here:

 

http://zone.ni.com/reference/en-XX/help/371894G-01/lvsimconcepts/sim_c_subsys/

http://digital.ni.com/public.nsf/allkb/33E5C3235C18A04E8625771800689B91

 

Then, for the "sensor" simulation, you need to use "Hardware-in-the-loop" technique to simulate the sensor. In other words, all you have to do is develop a model using LabVIEW for the sensors and mimic its "input" and "output" of it. Here are some other tutorials:

 

http://www.ni.com/white-paper/10343/en/

http://www.ni.com/white-paper/13778/en/

https://www.asam.net/fileadmin/Logos__Brochures__Presentations/Presentations/NKeel.pdf

 

You can also use "digital twin" concept where a model of the system and the system run side-by-side and you can see when the "real" and the "simulated" system differ from each other response. See page 18 on this document:

https://energy.gov/sites/prod/files/2016/11/f34/Panel%202_NI_MacCleery.pdf

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 4
(3,438 Views)

 So I have to use HIL to simulate the sensor and I can't choose other pathway like FPGA? Because for HIL I must install VeriStand and do other things 

0 Kudos
Message 3 of 4
(3,401 Views)

Although VeriStand can make your life easier, you can just use LabVIEW to do the necessary features to create your HIL system. We have several customer that only use LabVIEW for their HIL application.

 

The choice to use FPGA or not is dependent on the frequency you have to achieve on your simulation. In general, a RT system with a PXI controller can achieve 10 kHz sampling frequency (or more). This would be enough for the majority of the physical simulations. However, if you have to simulate the switching aspects of an Electrical Power Supply, then you can mix LabVIEW FPGA and LabVIEW RT to make your system to work properly. But the decision of going with LabVIEW FPGA means that you have to develop simulation code directly on FPGA. Unfortunately, LV CDSIM does not support FPGA targets at the moment, but allow you to support the "hybrid" simulation where you have the "lower" dynamics done by CDSIM and you can add the LV FPGA code to simulate together, like this:

 

fig6_20130225124741

If you really need to develop your simulation with LabVIEW, you should study the Power Electronics and the Floating-point toolkit:

https://forums.ni.com/t5/Power-Electronics-Development/Move-Any-Control-Algorithm-or-Simulation-Mode...

 

And look in here for more tutorials of this "hybrid" approach:

http://www.ni.com/white-paper/13663/en/

http://www.ni.com/white-paper/14468/en/

https://forums.ni.com/t5/Power-Electronics-Development/gp-p/grp-1891

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 4 of 4
(3,389 Views)