Simulacion de Un Motor DC en Labview
Simulacion de Un Motor DC en Labview
Simulacion de Un Motor DC en Labview
com/tutorial/6931/en/
sing the LabVIEW PID Control Toolkit with the LabVIEW Control Design and Simulation Module
Publish Date: Sep 04, 2009 | 15 Ratings | 4.27 out of 5 | Print | 2 Customer Reviews | Submit your review
Overview
Proportional Integral Derivative (PID) is one of the most commonly used control algorithms due its ease of use and minimal required knowledge of the system or plant to be
controlled. National Instruments provides ready-to-run, advanced (PID) control algorithms with the NI LabVIEW PID Control Toolkit. Combined with the LabVIEW Control
Design & Simulation Module, the LabVIEW PID Control Toolkit can help you simulate and tune your PID controllers without implementing them in real-world systems, thus
avoiding possible problems such as instability during application development. In this tutorial, learn how to use the LabVIEW PID Control Toolkit with the LabVIEW Control
Design & Simulation Module and design the PID gains for the position controller of a DC motor in a Real-Time system.
Table of Contents
1. DC Motor modelling
2. Fine-Tune the Simulation
3. PID Tuning
4. Conclusion
1. DC Motor modelling
In this tutorial, we will design the velocity controller for a DC motor. For the sake of simplicity consider a basic transfer function for a DC motor where effects such as friction and
disturbances are being considered:
Where
Ф(s) is the angular velocity (rad/sec)
V(s) is applied voltage (V)
J is the rotor inertia (9.64E-6)
R is the rotor resistance (3.3 Ώ)
K is the torque constant (0.028 N-m\A)
L is the Inductance ( 4.64E-3 H)
B is the Friction Torque Constant (1.8E-6 N-m-s)
If you replace the numeric values, you get the following transfer function:
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).
Start by opening the LabVIEW Development Environment and navigating to the Block Diagram. On the Functions Palette, select Control Design & Simulation->Simulation-
>Control & Simulation Loop then click and drag to size and create a Control & Simulation Loop.
Figure 3. PID subVI configuration for timing inside the Control & Simulation Loop.
The “D” that appears on the PID VI indicates that it is being handled as a discrete system.
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). Right-click and
select Create->Control. This creates a control on the Front Panel that you can use to change the PID gains interactively. Finally, right-click on the dt(s) terminal and create a
constant. This should be the same as the digital period you created previously, 0.001 seconds.
To create an input signal, use a step signal. From Control Design & Simulation->Simulation->Signal Generation, select Step Signal and drop it into the simulation loop. Leave
parameters as they are configured by default.
[+] Enlarge Image
Figure 4. Create an input signal using a step signal.
Now create the components necessary to view the simulation results. First bundle the input (Step Signal) with the output from the motor transfer function into a Build
Array node, which you can find on the Programming->Arrays subpalette. Collect these signals and plot them on a graph on the Front Panel. To do so, select Control Design &
Simulation->Simulation->Utilities then select and drop Collector. On the Front Panel, create an XY Graph to display the simulation results. Connect all the signals as shown in
Figure 5.
[+] Enlarge Image
Back to Top
3. PID Tuning
You now can run the VI continuously and change the PID gains until you are satisfied with the results.
A typical procedure to tune a PID controller would be
1. Kc to 1 and Ti, Td to zero. Keep increasing/decreasing Kc until the response has some overshoot
2. Modify Td to make the system faster and compensate the overshoot
3. Modify Ti to remove any steady-state error on the step response
See KnowledgeBase 4AD9N5P9: A Simple Method for Servo Motor Tuning for more information on tuning a PID controller.
[+] Enlarge Image
Figure 8. Simulation results with Kc=0.38, Ti=0.00026, and Td=0.0001.
Back to Top
4. Conclusion
You now know how to simulate a discrete-based PID controller with the continuous dynamic system behavior of a DC motor. You can apply this technique to any kind of hybrid
system where continuous and discrete behavior is mixed. One of the benefits of the procedure shown is that the control algorithm you used is exactly the same as the one you
would use in a Real-Time implementation, and you can take advantage of many of its features, such as integral anti windup.