Control and Simulation

Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Highlighted

support for control and simulation module running with cRIO inputs/outputs

Hello,

I am trying to run a model in the control and simulation loop but also
require inputs and outputs coming to and from my cRIO 9082, I am getting
project build errors with my attached .VI can I please get some support for
this application? the model is running in pu's where i believe my cRIO data
coming in is in the engineering units as displayed to my HMI. this could be why they are not getting along.

I need to take certain inputs from the cRIO and feed them into my model, my model will then output a value back to the cRIO.

Thanks for the assistance.

0 Kudos
Message 1 of 5
(3,401 Views)
4 REPLIES 4

Re: support for control and simulation module running with cRIO inputs/outputs

We have had simulations loops running in real-time interfaced to real signals (reading and outputting as you want), but running on the cRIO itself. Not sure what you mean by "the model is running in pu's", and it isn't clear if you are trying to run the simulation loop on a PC getting linked to the cRIO or on the cRIO itself. Anyway, given that you are trying to link a simulation loop to real time there are few very important things:

  1. You must be able to run your simulation loop in real-time or faster.
  2. Under the simulation loop properties Timing Parameters tab, you need to set enable synchronised timing
  3. You need to make the simulation loop run under a fixed step solver - essential if you are running the loop directly on the CD&SIM, and important if running on the PC so that you don't have simulation steps that change duration and so easily can't maintain sync with real-time.

I'm sure there are more subtle things that need to get right, but these are main ones.

Hope this helps,

Andy Clegg

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 2 of 5
(1,812 Views)

Re: support for control and simulation module running with cRIO inputs/outputs

Thanks Andy, much appreciated.

What I meant by pu’s is that the unit used for the signal within the model is in per unit. I will need to do some conversion between the interaction of the simulated signal and the real signals from the cRIO.

I will be building my project and uploading to the cRIO and launching the executable from the networked HMI.

My concern is how do i tie the inputs and outputs from the cRIO to the closed loop simulation.

Thanks for the help, it is much appreciated.

Garrett

0 Kudos
Message 3 of 5
(1,812 Views)

Re: support for control and simulation module running with cRIO inputs/outputs

Assuming your simulation loop is running on the cRIO itself (rather than on the network somewhere), accessing the inputs and outputs on that cRIO chassis and getting the timings right should be ok if you know LV RT. Try it with a simple model and simple I/O first just to make sure you have the basics working.

Some more comments:

  • your simulation model signals ideally should correspond to the real signals - scaling, units, etc - with no need to add in artificial conversions to get a match. Of course this can be ignored, but errors can creep in.
  • consider also being able to run the closed loop entirely in software (i.e. simulate the real system connnected to the cRIO) as that may make debugging problems easier - as you'll be able to trace if a problem is from interfacing, a software bug (timing) or a real closed loop issue (instability) as sometimes its hard to isolate. Having an open loop mode may also help.
  • remember that you will need to initialise your model to the coditions on the inputs AND outputs at start up, otherwise you'll get some bumps when you start up. This also applies if you want to switch between closed loop and open loop. This could be very important depending on your application.
Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 4 of 5
(1,812 Views)

Re: support for control and simulation module running with cRIO inputs/outputs

All of Andy Clegg's suggestions are excellent. Here is a pdf for a set of tutorials including one for the control and simulation loop integrated with an analog input. This tutorial starts on page 22 and should help you with your problem. It was written for a LabVIEW RIO evaluation hardware (based on Single-Board RIO) but the LabVIEW project and VI development are the same as with CompactRIO.

https://decibel.ni.com/content/docs/DOC-43130

Message 5 of 5
(1,812 Views)
Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.