LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW, myDAQ, Bode plot

Solved!
Go to solution

Hi!

 

I'm trying to plot a PID's Bode plot connected with my NI myDAQ in LabView 8.5. Does anybody know how to connect the myDAQ's ports in the program? 

I'm not able to use NI ELVISmx Instrument Launcher.

 

Thanks!

 

Sincerelly,

Petra

0 Kudos
Message 1 of 24
(6,154 Views)

You could use the DAQmx functions for data acquisition if I understood what you want. First, you need to specify what kind of signals you want to measure (number of channels, sampling rate, etc.). Second, you need to pyhsically connect your signal wires to the myDAQ hardware. The manual of the device can help you to do that, or the best to use MAX so you can manually test whether you get the signal as expected.

Third, you can program your DAQ VI using DAQmx functions.

 

If you specify your hardware requirements (number of channels, Analogue voltage?, sampling rate, etc), I can give you examples.

 

edit: what is the reason you use the LabView 8.5, which is a very old version? I guess you are a student, if so, you are eligible to use a new LabVIEW version with Student licence for free.

http://www.ni.com/labviewse/

0 Kudos
Message 2 of 24
(6,120 Views)

I wrote a program and I used the DAQmx functions but it isn't working.

I have attached photos.

Download All
0 Kudos
Message 3 of 24
(6,112 Views)
You should attach VIs, and not screenshots. "Isn't working" can mean lots of things. Do you see any error msg? Is the myDAQ visible in MAX (Measurement & Automation Explorer)?
0 Kudos
Message 4 of 24
(6,103 Views)
Ok, now I see the error in the jpg file. I will have some time after lunch, I will have a look.
0 Kudos
Message 5 of 24
(6,100 Views)

I never worked with the System Identification Toolkit, but your VI does not make too much sense to me. You specify an AO task, but then you do not do anything with it inside the While loop.

The first error msg corresponds to the model estimation function, the error describes that the stimulus and response signal have different sizes. You should really attach your VI, since I cannot see important values using only your screenshots. I just guess, but maybe you wanted to create the stimulus signal and generate this signal physically by the AO task? But why you do not use a DAQmx Write function then?

 

The other error says you did not specify the physical channel for te AO task. To me it looks like you started to modify an existing example VI? If so, can you show the original one?

Anyway, attaching your VI and describing what you exactly want your code do could help further to us to help...

 

edit: so describe what you want actually to measure? Why do you have an AO task if you do not use it? Do you need to generate physical signal, or only read? Why you talk about PID, when you do not have any PID function in your VI? Do you want to measure the Process Value and the Output of an existing PID controller? But then you need to use two AI tasks...

0 Kudos
Message 6 of 24
(6,079 Views)

I try to describe my project better. 😄

 

I have a PID controller and I connected it to the MyDAQ. And I have to write a program to see the charachteristics of a PID controller. (Bode, Nyquist plot)

In theory the PID works well I just need to connect it to the MyDAQ and let it read the voltage from the PID then let it write the Bode and Nyquist plot.

 

I didn't modify an existing example VI,  I just searched examples on the web and I built the program. The Bode plot part of the program is existing, I copied it from the Ni Example Finder, from Model Presentation.vi. I have attached a photo about the MyDAQ wiring and the vi too.

Download All
0 Kudos
Message 7 of 24
(6,063 Views)

So you need to measure two analogue voltage channels, one is the Process Value, the other one is the Output of the PID controller, right? I assume both are voltage signals, and fall into the specified ranges (+- 5 Volts) ? You have to be careful, you can physically damage your myDAQ Analogue inputs if you connect something like high voltage...

 

As I see you changed the top DAQmx Task from AO to AI. But it still does not make sense, since you do not do anything with that task inside the While loop. Also, you generate a signal in the while loop, why? This signal should be the other DAQmx Read data, not?

Please clarify what is this PID controller, and whether it is used to control a real process, like a temperature chamber???

 

I would also use a Producer/Consumer patern, where you DAQ the two channels in the top Producer loop, and you do the data evaluation in the Consumer loop. In this way you do not disturbe the DAQ part. I will put together an example.

 

Based on what I see in your picture, you do your wiring wrong. You should make a clear electrical circuit diagram explaining the connections of the external PID controller, and how you want to connect them to your myDAQ. You should ask for help from your teachers if you are not sure how to deal with electrical connections. I have no idea why you have wires connected to the AO ports of the myDAQ??? As I understood you want to measure two analogue voltage signals, so use the ports only:

  • AI 0+/0- for one signal
  • AI 1+/1- for the other signal

 

EDIT1: I wonder that you might want to measure the characteristics of the PID controller by generating a signal with the myDAQ, and measure the PID controller's response? In this case you need an Analogue Output task, and an Analogue Input... Clarify what you actually want?

0 Kudos
Message 8 of 24
(6,055 Views)

I have attached a photo about the circuit of the PID measurement. 

 

The yellow and the purple cable (A0 0) is the unitstep, the red cable is response function.

 

What settings have to use? Which MyDAQmx elements is necessary?

 

Any advice or example? I'm lost. 😄

0 Kudos
Message 9 of 24
(6,040 Views)

Sorry, I got even more confused about your hardware elements and wiring. Lets wait for a more experienced programmer who is more familiar with electronics and wiring than me.

0 Kudos
Message 10 of 24
(6,035 Views)