NI VeriStand Add-Ons Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VeriStand Add-on: PID Models

NI VeriStand Add-on: PID Models

Overview

The PID Models add-on allows users to use simple PID features in NI-VeriStand. This functionality is commonly used for Control Application.

4 variants are available:

  1. 1 PID Channel Controller. It's a single Channel PID controller. It allows user to specify "output range", different "PID coefficients" (proportional, integral and derivative).
  2. 4 PID Channels Controller. It's a 4 Channels version of the PID controller.
  3. 1 PID Channel Controller with Gain Scheduling. It's a single Channel PID controller with support of Gain Scheduling feature.
  4. Plant Model. It's here for illustration purpose (and/or for demo). It's a simulation of a basic plant. It can be used with PID models.

Models Interface

1 PID Channel Controller.

------ Inputs Details ------

    setpoint

Specifies the setpoint value, or desired value, of the process variable being controlled.

    process variable

Specifies the measured value of the process variable being controlled. This value is equal to the feedback value of the feedback control loop.

------  Parameters details ------

    PID gains

Specifies the proportional gain, integral time, and derivative time parameters of the controller. Default values are: kc=20, Ti=0.08 and Td=0.001.

    dt (s)

Specifies the interval, in seconds, at which this model is called. If "dt (s)" is less than or equal to zero, this model calculates the time since it was last called using an internal timer with a one millisecond resolution. The default is -1.

    output range

Specifies the range to which to coerce the control output. The default range is -100 to 100.

------  Outputs Details ------

    output

Returns the control output of the PID algorithm that is applied to the controlled process. If this model receives an invalid input, "output" returns NaN.

    dt out (s)

Returns the actual time interval in seconds. "dt out (s)" returns either the value of "'dt (s)" or the computed interval if you set "dt (s)" to -1.

4 PID Channels Controller

------ Inputs Details ------

   setpoint

Specifies the setpoint value, or desired value, of the process variable being controlled.

    process variable

Specifies the measured value of the process variable being controlled. This value is equal to the feedback value of the feedback control loop.

------  Parameters details ------

    PID gains

Specifies the proportional gain, integral time, and derivative time parameters of the controller. Default values are: kc=20, Ti=0.08 and Td=0.001.

    dt (s)

Specifies the interval, in seconds, at which this model is called. If "dt (s)" is less than or equal to zero, this model calculates the time since it was last called using an internal timer with a one millisecond resolution. The default is -1.

   output range

Specifies the range to which to coerce the control output. The default range is -100 to 100.

------  Outputs Details ------

    output

Returns the control output of the PID algorithm that is applied to the controlled process. If this model receives an invalid input, "output" returns NaN.

    dt out (s)

Returns the actual time interval in seconds. "dt out (s)" returns either the value of "'dt (s)" or the computed interval if you set "dt (s)" to -1.

1 PID Channel Controller with Gain Scheduling

------ Inputs Details ------

   setpoint

Specifies the setpoint value, or desired value, of the process variable being controlled.

    process variable

Specifies the measured value of the process variable being controlled. This value is equal to the feedback value of the feedback control loop.

------  Parameters details ------

    PID gains

Specifies the proportional gain, integral time, and derivative time parameters of the controller. Default values are: kc=20, Ti=0.08 and Td=0.001.

    dt (s)

Specifies the interval, in seconds, at which this model is called. If "dt (s)" is less than or equal to zero, this model calculates the time since it was last called using an internal timer with a one millisecond resolution. The default is -1.

    output range

Specifies the range to which to coerce the control output. The default range is -100 to 100.

------  Outputs Details ------

   output

Returns the control output of the PID algorithm that is applied to the controlled process. If this model receives an invalid input, "output" returns NaN.

   dt out (s)

Returns the actual time interval in seconds. "dt out (s)" returns either the value of "'dt (s)" or the computed interval if you set "dt (s)" to -1.

Plant Model

------ Inputs Details ------

    Plant Input

Controller output in percent, which would drive a valve or heating element if this were a real plant.

------  Parameters details ------

    output saturation range

“output range” specifies the range to which to coerce the control output. The default range is -100 to 100, which corresponds to values specified in terms of percentage of full scale.

   dt (s)

Specifies the interval, in seconds, at which this model is called. If "dt (s)" is less than or equal to zero, this model calculates the time since it was last called using an internal timer with a one millisecond resolution. The default is -1.

    process parameters

static gain.

Lag (s). Process lag time in seconds.

Deadtime (s). A true deadtime, in multiples of the loop cycle time.

  1. Load.
  2. Deadband. Adds deadband to simulate an ornery valve positioner.

Sensor noise.

Initial PV.

Plant noise.

------  Outputs Details ------

    Plant Output

  Process variable in percent, the measurement you get from the plant; the value you are trying to regulate.

Instructions for Use

To use the PID Models add-on, create a new NI-VeriStand project, open System-Explorer, add instances of the models.

Model.png

Installing the PID Models

To use the PID Models add-on, unzip the add-on files and place them close to your NI-VeriStand project files.

Please note that the 4 PID Channels Controller has a dependency (described in file 4 PID Channels Controller.depvs file and stored in Data sub-folder). The 3 files should be kept together and organized the same way.

Add-on Requirements to Run the PID Models

Software

These Models were created for use with NI VeriStand 2013 SP1.  To use them you must have the following software installed:

  • NI-VeriStand 2013 SP1.

Hardware

This add-on requires the following hardware.

  • NI-VeriStand target running the engine (Windows or PharLap). Please note that targets running Vx-Works are not supported.

Known Issues

  1. LabVIEW 2014 doesn’t find the Plant System.vi automatically.
    Select it manualy at: ...\National Instruments\LabVIEW 2014\examples\control\PID\subVIs\Plant System.vi

Version History

1.0.0

  • Released

Add-on Requirements to Modify the PID Models.

  • The PID Models are based on LabVIEW Code with PID and Fuzzy Toolkit. In addition to toolkit, you need to have NI-VeriStand installed on the machine used to compile the code.

Support and Contact

This add-on is provided as open-source software.  If it does not meet your exact specification, you are encouraged to modify the source code to meet your needs.  It is not officially supported by National Instruments.

If you encounter a problem with this add-on, or if you have suggestions for a future revision, please post to the forum for this add-on PID Models Feedback forum.  You must use this feedback forum for support. Do not call National Instruments for support for this add-on.

National Instruments does not support this code or guarantee its quality in any way. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).

Contributors