LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Steps to create vi file for PID control in 8.0 pro without specific PID addons.

Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 

 

To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  

 

Hopefully my question makes sense.  

0 Kudos
Message 1 of 7
(4,288 Views)

Hi,

 

What would this PID control system be used for? 

 

You're right that it will be much more work intensive to setup your own custom PID. 

 

You may have already been reading this article, but it explains pretty well what is involved: http://zone.ni.com/devzone/cda/tut/p/id/3782

 

 

So for a basic PID system, you would be calculating your error value (where you should be versus where you are), and, in addition, calculating the integral and the derivative of this error.  The sum of this would be your output.

 

I hope this helps. 

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 2 of 7
(4,257 Views)

asdfs wrote:

Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 

 

To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  

 

Hopefully my question makes sense.  


 

Take a look at the PID Control Toolkit User Manual . It clearly defines the math used and there is absolutely nothing stoping you from writing that code yourself.

What you will not get by doing it yourself is the auto-tuning as well as all of the supporting and helper sub-VI along with the polymorphic versions that will support arrays of PIDs.

 

If you write it yourself and it work good please post up your version for others to review or use.

 

Have fun,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 7
(4,253 Views)

Hi ben,

 

         how to develop PWM so that i can maintain the temperature in a particular setpoint.i am using crio-9004 controller.i have AI module(NI9201) and DIO module(NI 9401)in hand.i want to give DIO 0 as the output to the relay. 

          another one doubt i need to get clarified is ..

.--> is it possible to develop a PID controller without analog output module.the PID output is the control variable that should be delivered to the system right?according to my knowledge by making use of DO only a ON/OFF controller can be developed.

0 Kudos
Message 4 of 7
(4,017 Views)

Hi Temin,

 

Are you trying to use the PWM to simulate an analog output?  If so, this can be done, you just need to read that signal back in through your analog input and make sure that you smooth it so that it's an approximate analog signal instead of a series of digital pulses.

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(4,010 Views)

Hi,

 

Creating a PID controller is not that hard.

 

In big lines there are:

- Error = Input - Feedback

- the proportional, which is Error x Kp

- the derivate, which is (Error[n]-Error[n-1]) * Kd

- the integral, which is Sum(Error[n] .. Error[n-p]) * Ki

- feed forward order 1, 2 etc

 

You can start with a P controller, then add I and make it PI, then try a PD and finally a PID. If you want, you can add at the end Feed Forward (FF) capabilities to your controller. Anyhow, make it step by step and you'll see it's not that complicated.

 

What I don't know, is how well can one deal in LabView with timing. Doing it in a FPGA is pretty simple - there is a clock and everything is synchronous. If it is 100% software (like in LabView) I don't have a good feeling about delays and asynchrony. It can be done for sure but it gonna be inferior to a controller made in FPGA for example.

 

Paul

 

Message 6 of 7
(4,004 Views)

Hi Che.T,

      Iam not trying to simulate an analog signal by using pwm. I mean i want to design a on/off controller for temperature control. Iam giving the output of DIO 0 to the heat tape(by means of relay). I thought by varying the duty cycle of the pwm waveform at DIO 0. I can achieve a desired setpoint. since Iam a beginner i want know how to generate pwm waveform at DIO 0.i hope my question is clear..

 

One doubt i want to get clarified is

-> Is it possible to implement a PID controller without analog output module. i thought of implementing a PID controller for the above temperature control application. I dont have AO module in hand.

what led me to asking this doubt is ,even if i design a PID controller ,the output of the PID controller(control variable or manipulating variable) should be fed to the system right.without AO is it possible.

 

kindly reply

regards,

Temin 

 

 

0 Kudos
Message 7 of 7
(4,000 Views)