From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

PID VI for PWM Control in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Control Design and Simulation Module
  • LabVIEW

Code and Documents

Attachment

Description

 1. Overview

This VI is an example of using the PID VI for a PWM application. For a real application all that is needed is the PID VI and the Output to PWM Logic. Together these can be put in the while loop of a real application.

 

2. Description

Proportional-Integral-Derivative (PID) controllers are common feedback controllers. In PID control, you specify a process variable and a setpoint. The process variable is the system parameter you want to control, such as temperature, pressure, or flow rate, and the setpoint is the desired value for that system parameter. A PID controller determines a controller output value, for example the heater power or valve position, and applies the controller output value to the system to drive the process variable toward the setpoint value.

 

3. Requirements

  • NI LabVIEW Professional Development System 2012 or compatible,
  • PID and Fuzzy Logic Toolkit 2012 or compatible.

 

4. Steps to Implement or Execute Code

  1. Download and open the example "PID VI for PWM Control LabVIEW 2012 NIVerified.vi"
  2. Set the Setpoint and Start Process Variable.
  3. Configure the PID gains.
  4. Run the VI.

 

5. Additional Information or References

PID VI for PWM Control FP Screenshot 1.PNG

 

PID VI for PWM Control FP Screenshot 2.PNG

 

PID VI for PWM Control Screenshot.PNG

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
achrafone
Member
Member
on

how i can use PID for to control Motor DC with arduino in labview

tstahl
Member
Member
on

You would have to put the PID in the arduino code for anything but a very, very slow system (seconds).

betterthanyou
Member
Member
on

i want to control Dc motor with arduino interface labview but using PID control

xlx2013
Member
Member
on

what mean of PID.vi output?is a number!!