

Create an input signal using a step signal. Leave parameters as they are configured by default.įigure 4. From Control Design & Simulation->Simulation->Signal Generation, select Step Signal and drop it into the simulation loop. To create an input signal, use a step signal.

This should be the same as the digital period you created previously, 0.001 seconds. Finally, right-click on the dt(s) terminal and create a constant. This creates a control on the Front Panel that you can use to change the PID gains interactively. Run the cursor over the PID VI until you are on top of the PID Gains Terminal (you might type CTRL+H to Show Context Help if you cannot find it). The “D” that appears on the PID VI indicates that it is being handled as a discrete system. PID subVI configuration for timing inside the Control & Simulation Loop.

Assume the controller is going to run at a 1000 Hz loop rate, so select discrete with a period value of 0.001 seconds.įigure 3. You can use this window to configure the simulation loop to handle timing with this particular VI. to bring up a configuration dialog window. Because the PID algorithm is going to run on a Real-Time based operating system with a fixed loop rate, right-click on the PID.vi and select SubVI Node Setup…. On the function palette, select the Control Design & Simulation->PID subpalette and drag and drop the PID.vi into the Control & Simulation Loop. Now double-click on the Transfer Function block to input the transfer function parameters.įigure 3. This places a Transfer Function block inside the Control & Simulation Loop. Create a Control & Simulation Loop.Īgain on the Simulation subpalette, select Continuous Linear Systems and click once on Transfer Function and once inside the Control & Simulation Loop you created previously. On the Functions Palette, select Control Design & Simulation->Simulation->Control & Simulation Loop then click and drag to size and create a Control & Simulation Loop.įigure 1. Start by opening the LabVIEW Development Environment and navigating to the Block Diagram. Your goal is to implement a PID algorithm that is going to run on a Real-Time controller with a loop rate of 1000 Hz (0.001 second period). If you replace the numeric values, you get the following transfer function: For the sake of simplicity consider a basic transfer function for a DC motor where effects such as friction and disturbances are being considered:ī is the Friction Torque Constant (1.8E-6 N-m-s) In this tutorial, we will design the velocity controller for a DC motor.
