07-29-2010 02:05 AM
I am trying to implement a transfer function or state space based controller in an experiment. I am reading the signal that I need to send to my controller (a state space or transfer function block hopefully) from a DAQ board. I then need to send the output of the state space/ transfer function block (my controller) to the DAQ as an analog out.
Is there a block that I can use to do this easily?
I am not sure if the transfer function block in the simulation section will work.
07-29-2010 06:02 PM
Hi,
First, what type of DAQ board are you using? Does it connect through USB or PCI? How fast are you expecting to sample and then respond?
The reason that I ask, is that usually using the USB bus introduces too much lag for a system to be responsive. However, PCI could work.
I'd recommend starting in the example finder under Toolkits and Modules>Control Design and Simulation.
Cheers,
07-29-2010 07:05 PM
Hello craunm,
You can do something like this, where AI and AO are essentially your DAQmx Read/Write.
07-29-2010 08:17 PM
I have a PCI nased DAQ. As far as how fast I will be be sampling... The faster the better I suppose. Maybe about .01 or .001 seconds.
07-29-2010 08:33 PM - edited 07-29-2010 08:35 PM
To Andy C,
I like your idea. I was thinking of doing just that. I am only concerned that the simulation solver will not be able to provide me with an output fast enough. I suppose I will just have to try and see. If I may ask, is there any reason that you used the array index block other than for adding a reference signal?
07-29-2010 08:39 PM
The loop rate that you wants to run at (0.01 or 0.001 sec) is not too demanding. Another option would be to use Simulation Loop instead and configure the timing parameter to match your need.
12-07-2018 01:29 PM
Hi, were you able to do the state space control?
I am working on something similar. So, it would be really helpful if you could share the code for reference. The difference is that I am using DAQ NI USB 6211.
Thank You.
Suraj