LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID control without NI-DAQ device

Hello,

 

I am trying to build a vi using the PID toolkit, to control the temperature of an element in my experiment by giving an input power through a programmable power supply (Hameg HM7044). I have a keysight LXI 34972A data aquisition device which helps me to read the temperature rise with respect to a Ktype thermocouple in the instrument. I have the drivers of both instruments (LXI daq, and power supply) installed and recognizable on my pc. I have gone through some videos on ni website to explain the PID control of a thermocouple, and they all use the NI-Daq hardware, but i do not have this with me. I have already installed the PID toolkit.

 

Can i build a vi for temperature control using pid toolkit without this ni-daq hardware? if so, could someone please help me with any example VIs of this which don't use this daq assistant?

 

Thankyou in advance

    

0 Kudos
Message 1 of 17
(1,997 Views)

Hi vsci,

 


@vsci16 wrote:

Can i build a vi for temperature control using pid toolkit without this ni-daq hardware?


Yes!

 


@vsci16 wrote:

in my experiment by giving an input power through a programmable power supply (Hameg HM7044). I have a keysight LXI 34972A data aquisition device which helps me to read the temperature rise with respect to a Ktype thermocouple in the instrument. I have the drivers of both instruments (LXI daq, and power supply) installed and recognizable on my pc.

if so, could someone please help me with any example VIs of this which don't use this daq assistant?


Use the PID examples coming with LabVIEW: replace the DAQmx code by the VIs of your device drivers!

(Replace the AI DAQmx task with the Keysight VIs to read the temperature and the AO DAQmx task with your Hameg VIs to output the voltage/current values…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(1,960 Views)

I did something similar using a California Instruments programmable AC source and a strip heater.

 

The output of the PID VI's is a number between 0 and 100 (%Throttle)

 

I was using a 120 volt strip heater, so I took the PID output multiplied it by 1.2 and used that as the set point for the AC source output voltage VI.

 

The source output 0-120VAC corresponding to %0-%100 throttle.

 

PIDCapture.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 17
(1,948 Views)

Hi,

 


@RTSLVU wrote:

The output of the PID VI's is a number between 0 and 100 (%Throttle)

I was using a 120 volt strip heater, so I took the PID output multiplied it by 1.2


Only when you use the default values!

I would set the output range to [0, 120] and adapt the PID gains for that output range: no need for scaling after the PID…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(1,942 Views)

@GerdW wrote:

Hi,

 


@RTSLVU wrote:

The output of the PID VI's is a number between 0 and 100 (%Throttle)

I was using a 120 volt strip heater, so I took the PID output multiplied it by 1.2


Only when you use the default values!

I would set the output range to [0, 120] and adapt the PID gains for that output range: no need for scaling after the PID…

 


Sure, I get that... But then my Throttle display goes from %0 to %120 throttle, that confuses and enrages people.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 17
(1,927 Views)

Hi RTSLVU,

 


@RTSLVU wrote:


But then my Throttle display goes from %0 to %120 throttle, that confuses and enrages people.


You should rename it to "Voltage" and use "V" as unit string… 😄

(After all it's a voltage power supply and not a throttle.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(1,892 Views)

If Throttle value is above 100, add a status string informing the user they are in the "Super boost mode", like this:

boost.png

Message 7 of 17
(1,887 Views)

Hi  ,

 

Thankyou for your reply. I tried to implement what you told, could you please take a look at the VI attached. the first part of the program runs normally but the it stops at the point where temp has to be read by the agilent temperature VI. it does not give me an error, but the VI freezes (i.e it seems to continue to run, as indicated by the run button which shows running, so when I click on the highlight mode with the bulb icon, I see that the data flow has stopped, and I see an error symbol on my agilent hardware screen. I don't know what that means though, or how I could rectify it.

 

please let me know what I should change or where my mistakes are.

 

Thanks for your time

 

0 Kudos
Message 8 of 17
(1,874 Views)

Hi vsci,

 

several comments:

  • any initialization routine belongs before your loop!
  • why do you need to convert the temperature reading into an array? Why do you need an ExpressVI to do so?
  • why do you need to calculate the mean of an array containing just one element???
  • I prefer to set the output range of the PID to suit the range of the output channel: in your case I would change the range to [0, 1000] and delete that PIDPercentageToEGU. You need to change the PID gains when doing so…
  • I also prefer when you would use AutoCleanup or cleanup the wiring by yourself!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 17
(1,865 Views)

@GerdW wrote:

Hi RTSLVU,

 


@RTSLVU wrote:


But then my Throttle display goes from %0 to %120 throttle, that confuses and enrages people.


You should rename it to "Voltage" and use "V" as unit string… 😄

(After all it's a voltage power supply and not a throttle.)


It's displaying the PID Throttle just like every thermal chamber my company owns does.

 

(We have Thermotron, Weiss, Tenny, and Test Equity thermal chambers in our lab, every one of them shows PID Throttle on its main display)

 

Nobody cares about seeing the voltage the heaters are being run at. That does not tell you at a glance how hard the heating/cooling system is working.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 17
(1,862 Views)