DAQ and Graph problem

Signal acquisition, processing and output
Ответить
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

DAQ and Graph problem

Сообщение Rakone »

Hello,

I am a student doing a project at my university.
I need to make a simple PID controler which takes information (process variable) from an outside source (a NI's DAC connected through the USB port ) which is acomplished using NI-DAQ as an input, and the PID's output goes to the second NI-DAQ which is also connected using DAC to an actuator which in my case regulates the air pressure. (I have attached two .vi files of the two versions of the project)


My problem is the following.

Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.

-If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.

-If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).

The timing settings for the DAQ's N samples, 100 samples to read at the rate of 1k (I also tried with Continuous samples and many different combinations of Samples to Read an Rate but without success).

Should I wire them with the same dt(s)?

The other thing I need to do (I'm also writing it here in order not to open new topics) is show the following 3 signals on a Graph (process variable (dynamic data type)(range 4mA - 20mA), PID output (double)(range 4mA - 20mA), and the Set Point (double)(range 0 to inf))

Firstly, is it possible to show the first two on a scale from 0 to 100 without changing the PID's output which needs to be 4-20mA?

Secondly, which graph should I use if I have different data types? (I tried the Waveform Chart, and succeeded in showing the first two; the third just messes everything up because of the range)

I would also have to make a legend explaining which signal is which (I see that this is possible with the Mixed Signal Graph).


I know this is probably too much to ask, but I'd be grateful for any help

Thank you in advance!
Вложения
PID while.vi
(99.07 КБ) 314 скачиваний
Untitled 1.vi
(98.21 КБ) 316 скачиваний
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

Re: DAQ and Graph problem

Сообщение Rakone »

had to add this one :help:
:D
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: DAQ and Graph problem

Сообщение mzu2006 »

Yes, you'd better wire dt to the PID and rate to the output DAQExpress. But before doing that you have to develop a clear understanding of what kind of measurment rate you need. Same for the control variable update rate. It does not make any sense to update an output value every 1ms if your device has a responce time of 1min.
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

Re: DAQ and Graph problem

Сообщение Rakone »

So you think that's the problem? I didn't wire them because when I did, nothing worked. So I thought that it was redundant because the DAQs have an option for setting the sample rate, so I set it there..
Well I don't know what's the response of the PID, I thought it processes the information as it arrives..Where can I adjust that?
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: DAQ and Graph problem

Сообщение mzu2006 »

Yes, You need to let the PID :vi: know the time scale the data arrives.

I am making this point: while you can acquire the data fast, doing the feedback that fast may not be necessary. What is the typical time constant of your system?
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

Re: DAQ and Graph problem

Сообщение Rakone »

well I'm not sure, but if you're referring to the sample rate of the input AD conversion, I've set it in the DAQ to be 1kHz.
Then, should I put them all in the same loop or..?
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: DAQ and Graph problem

Сообщение mzu2006 »

No, Rakone, I am asking about the system you're driving. Time constant - is the measure of how fast your system responds to the change in the actuator voltage. 1min, 1sec, 1ms? This will determine the settings for the first expressVI as well as application architecture (whether they go to the same loop or not).
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

Re: DAQ and Graph problem

Сообщение Rakone »

Ok, I understand. I'll have to check that tomorrow at the faculty and will post it here.
Thanks
Rakone
interested
interested
Сообщения: 6
Зарегистрирован: 23 фев 2010, 20:06
Версия LabVIEW: 9.0f3
Откуда: Serbia
Контактная информация:

Re: DAQ and Graph problem

Сообщение Rakone »

OK. In order for the system to work properly, the PID must take samples at least every 100ms, which basically means that the sample rate must be <=100ms
Andband
assistant
assistant
Сообщения: 132
Зарегистрирован: 26 окт 2009, 23:05
Версия LabVIEW: 7.1
Контактная информация:

Re: DAQ and Graph problem

Сообщение Andband »

If you are sampling with 1k and read 100 in your loop, then this means that your loop runs with 10 Hz.
This is 100ms. So just put something like that in your DAQ Loop:
analogoutput.PNG
analogoutput.PNG (4.82 КБ) 10939 просмотров
Firstly, is it possible to show the first two on a scale from 0 to 100 without changing the PID's output which needs to be 4-20mA?
Sure, normalize your input using the numerical functions before you wire it to the graph
Secondly, which graph should I use if I have different data types? (I tried the Waveform Chart, and succeeded in showing the first two; the third just messes everything up because of the range)
Again: normalize it to the maximum occurring value.
I would also have to make a legend explaining which signal is which (I see that this is possible with the Mixed Signal Graph).
Right-click on your graph and select in the properties -> "show plot legend" and how much plots you want to show in your legend
Аватара пользователя
mzu2006

Professionalism Tutorials Black
doctor
doctor
Сообщения: 2456
Зарегистрирован: 16 авг 2008, 02:12
Награды: 3
Версия LabVIEW: 7.1 10 11 12
Откуда: St-Petersburg (RU), Phila, Boston, Washington DC
Контактная информация:

Re: DAQ and Graph problem

Сообщение mzu2006 »

Andband писал(а):So just put something like that in your DAQ Loop:
instead of the second express VI
Andband
assistant
assistant
Сообщения: 132
Зарегистрирован: 26 окт 2009, 23:05
Версия LabVIEW: 7.1
Контактная информация:

Re: DAQ and Graph problem

Сообщение Andband »

ye, maybe :) - I have no idea about his vi, cant open it :D
Ответить
  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Signal processing»