LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID tuning output makes an error

Highlighted

Hello, I am building a very simple PID for positioning control in the mechanical system driver by a piezoelectric actuator. The setpoint should be the 1Vsin(1Hz)+5V so the sine wave. For the process variable, it receives a signal from the capacitive displacement sensor. But I am having keeping error in DAQ assistant 2 for analog output. I set as a continuous sample and it kept giving me error 200802. I am so lost and I don't know even what it is saying... since I am new to LabVIEW. Could someone please help me to figure out this? I am using NI USB-6351 for the hardware. 

hchun_0-1593109023133.png

Also when I hit continue it shows an error in DAQ assistant 1 (process variable) showed different error. 

hchun_0-1593109594714.png

 

 

0 Kudos
Message 1 of 4
(324 Views)
Highlighted

Hi hchun,

 


@hchun wrote:

But I am having keeping error in DAQ assistant 2 for analog output. I set as a continuous sample and it kept giving me error 200802. I am so lost and I don't know even what it is saying... since I am new to LabVIEW. … Also when I hit continue it shows an error in DAQ assistant 1 (process variable) showed different error. 


So you used some wrong settings in those ExpressVIs. As you decided not to provide your code, but just images of some code parts, you need to debug on your own!

 

Generic advice for your generic question:

Using ExpressVIs most often will not give the desired results as they are typically limited to special purposes.

Use plain DAQmx functions for your task as they are really easy to use and come with lots of example VI in the LabVIEW example library!

 

As you are new to LabVIEW you really should take the Training resources as offered in the header of this LabVIEW board. Also keep an eye on those self-paced courses as NI provides them for free right now. There also is a DAQmx course…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 4
(264 Views)
Highlighted

Hello, thanks for answering. I actually planning to take a course but for now, it needs to be done fast. Could you please help me what am I doing wrong? I attached the vi that I have created but ... not sure what am I doing wrong.

 

 

0 Kudos
Message 3 of 4
(258 Views)
Highlighted

Hi hchun,

 


@hchun wrote:

Could you please help me what am I doing wrong? I attached the vi that I have created but ... not sure what am I doing wrong.


You are using ExpressVIs… 🙂

Other errors:

You are using wrong/unreasonable settings in your ExpressVIs.

You ignore the coercion dots at the PID function.

You are using default PID gains…

 

Again I recommend to replace the ExpressVIs by plain DAQmx functions!

(Until then you should use "1 sample on demand" for AI and AO and add a timing function to your loop…)

 


@hchun wrote:

Hello, thanks for answering. I actually planning to take a course but for now, it needs to be done fast.


You would be much faster by first learning the basics before starting to code.

Right now the self-paced courses are free until End of June, so I would rather first take those courses and then start with real programming!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 4
(254 Views)