SlideShare a Scribd company logo
1 of 22
Download to read offline
QNET-010: DCMCT
Quanser Engineering Trainer
for NI-ELVIS
QNET DC Motor Control Trainer
Demo Guide
QNET-DCMCT Demo Guide
Table of Contents
1. INTRODUCTION..........................................................................................................................................1
2. DEMO OUTLINE........................................................................................................................................1
3. PREREQUISITES.........................................................................................................................................2
4. SETTING UP A QNET...............................................................................................................................2
5. DEMOS.....................................................................................................................................................3
5.1. Read Tachometer..............................................................................................................................3
5.1.1. Create Simulation Loop.........................................................................................................................3
5.1.2. Configure Simulation Parameters...........................................................................................................4
5.1.3. Setup to Read DC Motor Speed.............................................................................................................5
5.1.4. Read DC Motor Speed...........................................................................................................................6
5.2. Running DC Motor in Open-Loop....................................................................................................8
5.2.1. Feeding Voltage to Motor......................................................................................................................8
5.2.2. Run Open-Loop......................................................................................................................................9
5.3. Proportional Speed Control............................................................................................................10
5.3.1. Build Proportional Controller...............................................................................................................10
5.3.2. Running Proportional Speed Control...................................................................................................12
5.4. Proportional-Integral Speed Control...............................................................................................13
5.4.1. Build PI Control...................................................................................................................................13
5.4.2. Running PI Speed Control....................................................................................................................14
5.5. Using DAQmx Drivers...................................................................................................................15
5.5.1. Convert Analog Input Express VIs to DAQmx....................................................................................15
5.5.2. Convert Analog Output Express VIs to DAQmx.................................................................................17
5.5.3. DAQmx Configuration.........................................................................................................................19
Revision 1.1 ♦ Page i
QNET-DCMCT Demo Guide
1. Introduction
This manual outlines some procedures to demo the QNET DC Motor Control Trainer, shown in Figure
1, using LabVIEW. The DC Motor Control Trainer is used to teach motion control concepts such as
modeling and PID control.
Figure 1: QNET-DCMCT
2. Demo Outline
There are four demos:
● Demo 1: Read tachometer by moving around inertial wheel on DC motor.
● Demo 2: Run DC motor in open-loop, i.e. output voltage to motor and read speed from
tachometer.
● Demo 3: Build simple proportional compensator to control the motor speed.
● Demo 4: Build a proportional-integral compensator to control the motor speed.
● Demo 5 (optional): Convert Express VIs to DAQmx.
They introduce the following to the audience:
● Adding Simulation Loop.
● Configuring the simulation parameters.
● Basic Simulation Module blocks: Simulation Time Waveform, Summation, and Gain blocks.
● Express VI: These are used to output voltage to the amplifier and read from the tachometer
sensor.
Revision 1.1 ♦ Page 1
QNET-DCMCT Demo Guide
● LabVIEW front panel objects, e.g. knobs.
● Introduces DAQmx.
3. Prerequisites
In order to successfully carry out the demo you need the following equipment and software installed:
✔ PC equipped with an NI-ELVIS II
✔ QNET DC Motor Control Trainer
✔ LabVIEW 8.2.1, or later, with the following add-ons:
✔ DAQmx
✔ Express
✔ Control Design and Simulation Module
✔ ELVISmx
4. Setting up a QNET
One of the benefits of the QNET boards is its modularity. As depicted in Figure 2, any of these boards
can easily be connected to the NI ELVIS II system and give the student a new type of plant to work
with in minutes.
Figure 2: Modularity of QNETs.
Revision 1.1 ♦ Page 2
QNET-DCMCT Demo Guide
Follow these instructions to setup a QNET on an ELVIS II:
1. Make sure the NI ELVIS II is powered OFF.
2. Place the small opening on the front of the QNET over the mounting bracket on the front of the
NI ELVIS II workstation.
3. Slide the PCI connector of the QNET module end into the female connector on the NI ELVIS II.
Make sure it is connected properly.
4. Connect the ELVIS II power cable.
5. Connect the supplied QNET transformer to the bulk power jack on the QNET module.
Note: Not required for the QNET mechatronic sensors trainer.
6. Power the NI ELVIS II by turning ON the System Switch on the rear panel.
7. Turn ON the Prototyping Board Power switch.
CAUTION: Turn OFF the Prototyping Board Power switch if
(1) On the QNET-DCMCT, QNET-ROTPENT, or QNET-VTOL Trainer the DC motor
begins to turn, or
(2) On the QNET-HVACT the halogen light turns on brightly.
Take extra care when powering the QNET module to avoid causing any damage!
8. The Power and Ready LEDs of the NI ELVIS II unit should be lit.
9. Verify that the +15V,-15V, +5V, and +B LEDs on the QNET module are lit. They indicate that
the board has been properly connected to the ELVIS II unit.
Note: On the QNET Mechatronic Sensors and Myoelectric trainers, ensure the +15V,-15V, and
+5V LEDs are lit (no +B).
5. Demos
5.1. Read Tachometer
Demonstrates how to read from the tachometer by manually moving the inertial disc load mounted on
the QNET DC Motor.
5.1.1. Create Simulation Loop
The Simulation loop makes it easy to design and run simulations as well as control external hardware,
e.g. DC motor.
1. Open blank VI in LabVIEW.
2. Create a Simulation Loop in the block diagram, as shown in Figure 3.
Revision 1.1 ♦ Page 3
QNET-DCMCT Demo Guide
Figure 3: Simulation loop in block diagram.
5.1.2. Configure Simulation Parameters
We want to setup a simulation to run continuously at 100 Hz.
1. Access dialog box shown in Figure 4 by double-clicking the Input Node or by right-clicking the
border and selecting the Configure Simulation Parameters item from the shortcut menu.
Revision 1.1 ♦ Page 4
QNET-DCMCT Demo Guide
Figure 4: Configure simulation parameters.
2. Setup the Simulation Parameters as follows:
Final Time (s): Inf
ODE Solver: Runge-Kutta 1 (Euler)
Step Size (s): 0.01
3. Click on OK.
5.1.3. Setup to Read DC Motor Speed
Use the DAQ Assistant Express VI to read the QNET DC Motor tachometer. The tachometer is
connected to Analog Input Channel #4. Since we’re eventually doing control, we want to be reading
one sample of data for each Simulation loop iteration (i.e. On Demand).
Revision 1.1 ♦ Page 5
QNET-DCMCT Demo Guide
Remark: The QNET DC Motor has a digital tachometer. Its a on-board circuit that computes the
velocity from the encoder signals.
1. Go to Express  Input category and add DAQ Assist to the block diagram.
2. Select Acquire Signal  Analog Input  Voltage.
3. Choose ELVIS II Device  ai4.
4. As shown in Figure 5, setup with the following settings:
Acquisition Mode: 1 Sample (On Demand)
Figure 5: Configuring analog input channel in DAQ Assistant.
5.1.4. Read DC Motor Speed
Read the speed of the DC Motor in a chart.
1. Go to Graph Utilities and add a Simulation Time Waveform to the block diagram.
2. Connect output of DAQ Assistant to SimTime Waveform buffer, as shown in Figure 6.
Revision 1.1 ♦ Page 6
QNET-DCMCT Demo Guide
Figure 6: Add Simulation Time Waveform to block diagram.
3. Go to the front panel and show the Waveform Chart.
4. Change the time scale to [0,2].
5. Run the VI.
6. Move the inertial load back and forth. You should obtain a reading similarly as show in Figure
7.
Figure 7: Tachometer response when moving DC motor load back and forth.
Remark: This is the raw voltage from the tachometer. The voltage signal is proportional to the
speed of the motor shaft. To get the actual speed, use the calibration gain 2987 RPM/V.
Revision 1.1 ♦ Page 7
QNET-DCMCT Demo Guide
5.2. Running DC Motor in Open-Loop
Shows how to drive the motor while reading the corresponding motor speed.
5.2.1. Feeding Voltage to Motor
Using the DAQ Assistant Express VI to drive the QNET DC Motor. The motor is connected to Analog
Output Channel #0.
Add DAQ Assistant Express VI and setup with following settings:
1. Go to Express  Input menu and add DAQ Assist to the block diagram.
2. Select Generate Signal  Analog Input  Voltage.
3. Choose ELVIS II Device  ao0
4. As shown in Figure 8, configure the channel with the following:
Generation Mode: 1 Sample (On Demand)
Figure 8: Configuring analog output channel in DAQ Assistant.
Revision 1.1 ♦ Page 8
QNET-DCMCT Demo Guide
5.2.2. Run Open-Loop
Apply a voltage to the motor and observe the resulting speed response.
1. Add a Vertical Pointer Slide control called Input Voltage to the front panel and adjust its scale
from 0 to 2.
2. Wire the slider control to the data terminal of the DAQ Assistant block, as illustrated in Figure
9.
Figure 9: Block diagram setup for running DC motor in open-loop.
CAUTION: If you are using QNET-DCMCT rev 1, then add a -ve between the Input Voltage
control and the DAQ Assistant block. This ensures you read a positive speed when giving a
positive voltage.
3. Set the y-axis in the Waveform Chart to a fixed range of 0 to 0.5. Right-click on the y-axis of
the chart and ensure AutoScale Y is not selected.
4. Run the VI.
5. Adjust the slider control between 0 and 2 to vary the amount of voltage fed to the DC motor and
observe how the measured speed changes. A typical response is shown Figure 10.
CAUTION: Do not exceed +/-2V. This voltage is amplified by 2.3 V/V by the linear amplifier.
Remark: You need at least 1.0 V for the rotor to begin turning due to the friction from the
brushes. This demonstrates a common nonlinear phenomenon, i.e. deadband, that is seen in real
devices.
Revision 1.1 ♦ Page 9
QNET-DCMCT Demo Guide
Figure 10: Front panel when running DCMCT in open-loop.
6. Set the slider to 0 and stop the VI.
Remark: Make sure the input voltage is set to 0 before stopping the VI. Otherwise the DC
motor will continue spinning. The Express VI does not automatically reset the motor voltage to
zero when the VI terminates.
5.3. Proportional Speed Control
Design a simple proportional controller to regulate the speed of the DC motor.
5.3.1. Build Proportional Controller
Build the block diagram shown in Figure 12, as summarized by the steps below:
1. Add a Summation block from the Control Design and Simulation  Simulation category.
2. Rename input voltage slider control to setpoint.
3. Connect the setpoint control to the +ve terminal of the Summation block.
4. Connect the tachometer signal to the –ve terminal of the Summation block. This is the
feedback signal.
5. Add a Gain block.
Hint: For faster access to the Gain block, right-click on the Summation block and go to the
Signal Arithmetic Palette item in the shortcut menu.
6. Double-click on the Gain block and set the Parameter source to Terminal, as pictured in Figure
11.
Revision 1.1 ♦ Page 10
QNET-DCMCT Demo Guide
Figure 11: Configure gain to be changed externally.
7. Right-click on the terminal input of Gain and create a Numeric Control called kp.
8. Wire output of Summation to Gain block.
9. Connect output of Gain block to DC motor output.
Figure 12: Block diagram to run DC motor proportional speed control.
Revision 1.1 ♦ Page 11
QNET-DCMCT Demo Guide
5.3.2. Running Proportional Speed Control
This shows basic speed control response. Since this is a Type 0 system, there is steady-state error.
Increasing the proportional gain improves the error but we need an integrator to solve the problem.
1. As shown in Figure 13, in the front panel add a digital display to the existing setpoint slider
control.
Hint: Right-click on the Vertical Pointer Slide control and select Digital Display under
Visible Items.
2. Set the scale of the setpoint pointer slide control from 0 to 4.
3. Change the y-scale of chart from 0 to 1.
4. Run VI.
5. Vary the setpoint control and examine how the speed changes.
6. Set the setpoint to 1 and slowly increase the proportional gain, kp, to 10. As illustrated in Figure
13, examine how the measured speed approaches 0.5 as the gain is increased. However, there is
still steady-state error.
Figure 13: DC motor speed control.
7. Set the setpoint control to 0 and stop the VI.
Revision 1.1 ♦ Page 12
QNET-DCMCT Demo Guide
5.4. Proportional-Integral Speed
Control
Design a proportional-integral (PI) compensator to remove the steady-state error.
5.4.1. Build PI Control
Build the block diagram shown in Figure 15, as summarized by the following steps:
1. Add another Gain block.
Hint: Click-and-drag the existing Gain block, hold the CTRL key, and drop the copied Gain
block.
2. Right-click on the terminal input of the new Gain and create a Numeric Control called ki. This
the integrator Gain block.
3. Connect the error to the input of the integrator Gain.
4. Add an Integrator block from the Control Design and Simulation  Simulation  Continuous
Linear Systems menu.
5. Wire the output of the integral Gain to the input of the Integrator block.
6. Add another Summation block.
Hint: Right-click on existing Summation block, hold the CTRL key, and drop the copied
Summation block.
7. Double-click on the Summation block that was just added and change the “-ve” sign to a “+ve”
sign, as shown in Figure 14.
Figure 14: Configure summation block.
8. Connect the output of both Gain blocks to the two +ve terminals of the Summation.
9. Wire output of Summation block to DC motor output.
Revision 1.1 ♦ Page 13
QNET-DCMCT Demo Guide
Figure 15: Block diagram to run the PI DC motor speed control.
5.4.2. Running PI Speed Control
See the effects of adding integral action to the control. This guarantees that the measure speed gets to
the desired setpoint, i.e. removes steady-state error that was observed when using the proportional
control.
1. Run VI.
2. Set the setpoint control to 0.5.
CAUTION: Make sure the setpoint does not surpass +/- 1.
3. Set the integral gain, ki, to 10. The measured speed should reach the setpoint of 0.5, as
illustrated in Figure 16.
Revision 1.1 ♦ Page 14
QNET-DCMCT Demo Guide
Figure 16: Running PI speed control.
4. Set the setpoint to 0.
5. When the motor stops spinning, stop the VI.
5.5. Using DAQmx Drivers
Introduce DAQmx by converting the Express VIs to DAQmx code.
5.5.1. Convert Analog Input Express VIs to DAQmx
Convert the Analog Input Express VI to an DAQmx based VIs.
1. Right-click on the analog input DAQ Assistant block and select Generate NI-DAQmx Code.
Revision 1.1 ♦ Page 15
QNET-DCMCT Demo Guide
Figure 17: Generating DAQmx code from an Express VI.
2. This will add a DAQmx Read VI and a sub-VI that configures the analog input channel, as
illustrated in Figure 18.
Figure 18: Generated analog input DAQmx code.
3. In the Simulation Loop, we only need to read a single point of data in each iteration. Set the
DAQmx Read VI to Analog  Single Channel  Single Sample  DBL.
4. Place the configuration VI outside the Simulation loop, as shown in Figure 19.
Revision 1.1 ♦ Page 16
QNET-DCMCT Demo Guide
Figure 19: Setup AI DAQmx code.
5. Connect the task out of the configuration VI to the task/channels in of the DAQmx Read, as
shown in Figure 19.
6. Remove the data indicator and connect the data output terminal on the Analog DBL output to
the Waveform Chart, as illustrated in Figure 19 above.
7. Run the VI and the response should be similarly as shown in Figure 16, above.
5.5.2. Convert Analog Output Express VIs to DAQmx
Convert the Analog Output Express VI to DAQmx drivers.
1. Right-click on the analog output block, DAQ Assistant3, and select Generate NI DAQmx Code.
2. We don't need to use the special waveform timing. Click on OK on the message shown in
Figure 20.
Figure 20: Waveform Timing
3. This will add a DAQmx Write VI and a sub-VI that configures the analog output channel.
Revision 1.1 ♦ Page 17
QNET-DCMCT Demo Guide
Figure 21: Generated analog write DAQmx code.
4. In the Simulation Loop, we are only writing a single point of data in each iteration. Set the
DAQmx Write VI to Analog  Single Channel  Single Sample  DBL.
5. Place the configuration VI outside the Simulation loop, as shown in Figure 22.
Figure 22: Block diagram of speed controller using DAQmx.
6. Remove the signal generator block (not needed because of Simulation loop).
Revision 1.1 ♦ Page 18
QNET-DCMCT Demo Guide
7. Clean up the excess wiring by pressing the CTRL-B.
8. Wire the output of the PI controller, i.e. the Summation block, to the data terminal on the
DAQmx Write VI.
9. Connect the task out terminal from the analog output configuration VI to the task/channels in
terminal of the DAQmx Write VI, as shown in Figure 22.
10. Run the VI and the response should be similarly as shown in Figure 16, above.
5.5.3. DAQmx Configuration
Introduce how to configure analog input and output channels using DAQmx.
1. The block diagram of the analog input sub-VI is pictured in Figure 23. It features all the settings
that were chosen when setting up the Express VI to read the tachometer.
Figure 23: Configuring QNET analog input channel.
2. Similarly for the analog output channel, shown in Figure 24.
Revision 1.1 ♦ Page 19
QNET-DCMCT Demo Guide
3. Figure 24: Configuring QNET analog output channel.
Revision 1.1 ♦ Page 20

More Related Content

What's hot

An Introduction to the Finite Element Method
An Introduction to the Finite Element MethodAn Introduction to the Finite Element Method
An Introduction to the Finite Element MethodMohammad Tawfik
 
Stresses in a long cylindrical pressure vessel ansys lab v 12 30 2014
Stresses in a long cylindrical pressure vessel   ansys   lab v  12 30 2014Stresses in a long cylindrical pressure vessel   ansys   lab v  12 30 2014
Stresses in a long cylindrical pressure vessel ansys lab v 12 30 2014Charlton Inao
 
Finite Element Method
Finite Element MethodFinite Element Method
Finite Element MethodYatin Singh
 
Programmation des APIs.pdf
Programmation des APIs.pdfProgrammation des APIs.pdf
Programmation des APIs.pdfMENNANIZinedine
 
SPICE Model of Current Transformer
SPICE Model of Current TransformerSPICE Model of Current Transformer
SPICE Model of Current TransformerTsuyoshi Horigome
 
The Controller Design For Linear System: A State Space Approach
The Controller Design For Linear System: A State Space ApproachThe Controller Design For Linear System: A State Space Approach
The Controller Design For Linear System: A State Space ApproachYang Hong
 
Polycopié Electronique de puissance avec Matlab Simulink.pdf
Polycopié Electronique de puissance avec Matlab Simulink.pdfPolycopié Electronique de puissance avec Matlab Simulink.pdf
Polycopié Electronique de puissance avec Matlab Simulink.pdfYoussefOumhella
 
Chapitre IV : Les machines synchrones
Chapitre IV : Les machines synchronesChapitre IV : Les machines synchrones
Chapitre IV : Les machines synchronesMohamed Khalfaoui
 
Choix coposant elec
Choix coposant elecChoix coposant elec
Choix coposant elecyouri59490
 
Modelisation systemes 1ddl
Modelisation systemes 1ddlModelisation systemes 1ddl
Modelisation systemes 1ddlMED MED
 
Les bases de la compréhension grafcet
Les bases de la compréhension grafcetLes bases de la compréhension grafcet
Les bases de la compréhension grafcetmorin moli
 
OpenSees dynamic_analysis
OpenSees dynamic_analysisOpenSees dynamic_analysis
OpenSees dynamic_analysisDhanaji Chavan
 
Chapitre_5_Machine_asynchrone.pdf
Chapitre_5_Machine_asynchrone.pdfChapitre_5_Machine_asynchrone.pdf
Chapitre_5_Machine_asynchrone.pdfismaoui
 
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th edition
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th editionLecture 1 Introduction to statics Engineering Mechanics hibbeler 14th edition
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th editionaxmedbaasaay
 
State space analysis shortcut rules
State space analysis shortcut rulesState space analysis shortcut rules
State space analysis shortcut rulesPrajakta Pardeshi
 
STATE-SPACE AVERAGING METHOD
STATE-SPACE AVERAGING METHOD STATE-SPACE AVERAGING METHOD
STATE-SPACE AVERAGING METHOD Slobodan Cuk
 
La méthode ziegler nichols pour la détermination des paramètres d un controle...
La méthode ziegler nichols pour la détermination des paramètres d un controle...La méthode ziegler nichols pour la détermination des paramètres d un controle...
La méthode ziegler nichols pour la détermination des paramètres d un controle...osmalilwano
 

What's hot (20)

An Introduction to the Finite Element Method
An Introduction to the Finite Element MethodAn Introduction to the Finite Element Method
An Introduction to the Finite Element Method
 
Stresses in a long cylindrical pressure vessel ansys lab v 12 30 2014
Stresses in a long cylindrical pressure vessel   ansys   lab v  12 30 2014Stresses in a long cylindrical pressure vessel   ansys   lab v  12 30 2014
Stresses in a long cylindrical pressure vessel ansys lab v 12 30 2014
 
6.7 airy
6.7 airy6.7 airy
6.7 airy
 
Finite Element Method
Finite Element MethodFinite Element Method
Finite Element Method
 
Finite Element Method
Finite Element MethodFinite Element Method
Finite Element Method
 
Programmation des APIs.pdf
Programmation des APIs.pdfProgrammation des APIs.pdf
Programmation des APIs.pdf
 
SPICE Model of Current Transformer
SPICE Model of Current TransformerSPICE Model of Current Transformer
SPICE Model of Current Transformer
 
The Controller Design For Linear System: A State Space Approach
The Controller Design For Linear System: A State Space ApproachThe Controller Design For Linear System: A State Space Approach
The Controller Design For Linear System: A State Space Approach
 
Polycopié Electronique de puissance avec Matlab Simulink.pdf
Polycopié Electronique de puissance avec Matlab Simulink.pdfPolycopié Electronique de puissance avec Matlab Simulink.pdf
Polycopié Electronique de puissance avec Matlab Simulink.pdf
 
Chapitre IV : Les machines synchrones
Chapitre IV : Les machines synchronesChapitre IV : Les machines synchrones
Chapitre IV : Les machines synchrones
 
ED7201 FEMMD_notes
ED7201 FEMMD_notesED7201 FEMMD_notes
ED7201 FEMMD_notes
 
Choix coposant elec
Choix coposant elecChoix coposant elec
Choix coposant elec
 
Modelisation systemes 1ddl
Modelisation systemes 1ddlModelisation systemes 1ddl
Modelisation systemes 1ddl
 
Les bases de la compréhension grafcet
Les bases de la compréhension grafcetLes bases de la compréhension grafcet
Les bases de la compréhension grafcet
 
OpenSees dynamic_analysis
OpenSees dynamic_analysisOpenSees dynamic_analysis
OpenSees dynamic_analysis
 
Chapitre_5_Machine_asynchrone.pdf
Chapitre_5_Machine_asynchrone.pdfChapitre_5_Machine_asynchrone.pdf
Chapitre_5_Machine_asynchrone.pdf
 
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th edition
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th editionLecture 1 Introduction to statics Engineering Mechanics hibbeler 14th edition
Lecture 1 Introduction to statics Engineering Mechanics hibbeler 14th edition
 
State space analysis shortcut rules
State space analysis shortcut rulesState space analysis shortcut rules
State space analysis shortcut rules
 
STATE-SPACE AVERAGING METHOD
STATE-SPACE AVERAGING METHOD STATE-SPACE AVERAGING METHOD
STATE-SPACE AVERAGING METHOD
 
La méthode ziegler nichols pour la détermination des paramètres d un controle...
La méthode ziegler nichols pour la détermination des paramètres d un controle...La méthode ziegler nichols pour la détermination des paramètres d un controle...
La méthode ziegler nichols pour la détermination des paramètres d un controle...
 

Similar to Qnet dc motor control demo guide

Applied motion products txm24 c brochure
Applied motion products txm24 c brochureApplied motion products txm24 c brochure
Applied motion products txm24 c brochureElectromate
 
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...Edward Setec
 
Electric_Drives_FinalProj
Electric_Drives_FinalProjElectric_Drives_FinalProj
Electric_Drives_FinalProjSpencer Minder
 
EEP301: Ca06 sample
EEP301: Ca06 sampleEEP301: Ca06 sample
EEP301: Ca06 sampleUmang Gupta
 
IRJET- PLC based Washing Machine
IRJET- PLC based Washing MachineIRJET- PLC based Washing Machine
IRJET- PLC based Washing MachineIRJET Journal
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERJournal For Research
 
Basic PLC Programming program The Fundamental Knowledge of PLC.pdf
Basic PLC Programming program The Fundamental Knowledge of PLC.pdfBasic PLC Programming program The Fundamental Knowledge of PLC.pdf
Basic PLC Programming program The Fundamental Knowledge of PLC.pdfLuisDavidCajavilcaCu1
 
Stepper Motor Control System
Stepper Motor Control SystemStepper Motor Control System
Stepper Motor Control SystemWanita Long
 
DigSILENT PF - 06 irena additional exercises
DigSILENT PF - 06 irena  additional exercisesDigSILENT PF - 06 irena  additional exercises
DigSILENT PF - 06 irena additional exercisesHimmelstern
 
Design and Implementation of an Electrical Lift Controlled using PLC
Design and Implementation of an Electrical Lift Controlled using PLC Design and Implementation of an Electrical Lift Controlled using PLC
Design and Implementation of an Electrical Lift Controlled using PLC IJECEIAES
 
Time Controlled DC Power Supply Using 555 Timer
Time Controlled DC Power Supply Using 555 TimerTime Controlled DC Power Supply Using 555 Timer
Time Controlled DC Power Supply Using 555 TimerIRJET Journal
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_ReportVansh Kumar
 
Basic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech LtdBasic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech LtdMarsus Marsus
 
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docx
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docxExercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docx
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docxnealwaters20034
 

Similar to Qnet dc motor control demo guide (20)

Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Applied motion products txm24 c brochure
Applied motion products txm24 c brochureApplied motion products txm24 c brochure
Applied motion products txm24 c brochure
 
En mtac 01_um_b
En mtac 01_um_bEn mtac 01_um_b
En mtac 01_um_b
 
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...
Set48 220 1 klc user manual, High frequency DC 48v to AC 220v inverter for Te...
 
Electric_Drives_FinalProj
Electric_Drives_FinalProjElectric_Drives_FinalProj
Electric_Drives_FinalProj
 
EEP301: Ca06 sample
EEP301: Ca06 sampleEEP301: Ca06 sample
EEP301: Ca06 sample
 
IRJET- PLC based Washing Machine
IRJET- PLC based Washing MachineIRJET- PLC based Washing Machine
IRJET- PLC based Washing Machine
 
Plc & Scada report 3
Plc & Scada report 3Plc & Scada report 3
Plc & Scada report 3
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
 
Basic PLC Programming program The Fundamental Knowledge of PLC.pdf
Basic PLC Programming program The Fundamental Knowledge of PLC.pdfBasic PLC Programming program The Fundamental Knowledge of PLC.pdf
Basic PLC Programming program The Fundamental Knowledge of PLC.pdf
 
Stepper Motor Control System
Stepper Motor Control SystemStepper Motor Control System
Stepper Motor Control System
 
DigSILENT PF - 06 irena additional exercises
DigSILENT PF - 06 irena  additional exercisesDigSILENT PF - 06 irena  additional exercises
DigSILENT PF - 06 irena additional exercises
 
Dc40 d mk3
Dc40 d mk3Dc40 d mk3
Dc40 d mk3
 
Design and Implementation of an Electrical Lift Controlled using PLC
Design and Implementation of an Electrical Lift Controlled using PLC Design and Implementation of an Electrical Lift Controlled using PLC
Design and Implementation of an Electrical Lift Controlled using PLC
 
Time Controlled DC Power Supply Using 555 Timer
Time Controlled DC Power Supply Using 555 TimerTime Controlled DC Power Supply Using 555 Timer
Time Controlled DC Power Supply Using 555 Timer
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_Report
 
Abb technical guide book en rev_g
Abb technical guide book en rev_gAbb technical guide book en rev_g
Abb technical guide book en rev_g
 
Basic plc-programming
Basic plc-programmingBasic plc-programming
Basic plc-programming
 
Basic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech LtdBasic plc-programming-e book_Reliance High Tech Ltd
Basic plc-programming-e book_Reliance High Tech Ltd
 
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docx
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docxExercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docx
Exercise 1 – DOL Starters and Soft Starters  Procedure Outlin.docx
 

Recently uploaded

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Recently uploaded (20)

fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Qnet dc motor control demo guide

  • 1. QNET-010: DCMCT Quanser Engineering Trainer for NI-ELVIS QNET DC Motor Control Trainer Demo Guide
  • 2. QNET-DCMCT Demo Guide Table of Contents 1. INTRODUCTION..........................................................................................................................................1 2. DEMO OUTLINE........................................................................................................................................1 3. PREREQUISITES.........................................................................................................................................2 4. SETTING UP A QNET...............................................................................................................................2 5. DEMOS.....................................................................................................................................................3 5.1. Read Tachometer..............................................................................................................................3 5.1.1. Create Simulation Loop.........................................................................................................................3 5.1.2. Configure Simulation Parameters...........................................................................................................4 5.1.3. Setup to Read DC Motor Speed.............................................................................................................5 5.1.4. Read DC Motor Speed...........................................................................................................................6 5.2. Running DC Motor in Open-Loop....................................................................................................8 5.2.1. Feeding Voltage to Motor......................................................................................................................8 5.2.2. Run Open-Loop......................................................................................................................................9 5.3. Proportional Speed Control............................................................................................................10 5.3.1. Build Proportional Controller...............................................................................................................10 5.3.2. Running Proportional Speed Control...................................................................................................12 5.4. Proportional-Integral Speed Control...............................................................................................13 5.4.1. Build PI Control...................................................................................................................................13 5.4.2. Running PI Speed Control....................................................................................................................14 5.5. Using DAQmx Drivers...................................................................................................................15 5.5.1. Convert Analog Input Express VIs to DAQmx....................................................................................15 5.5.2. Convert Analog Output Express VIs to DAQmx.................................................................................17 5.5.3. DAQmx Configuration.........................................................................................................................19 Revision 1.1 ♦ Page i
  • 3. QNET-DCMCT Demo Guide 1. Introduction This manual outlines some procedures to demo the QNET DC Motor Control Trainer, shown in Figure 1, using LabVIEW. The DC Motor Control Trainer is used to teach motion control concepts such as modeling and PID control. Figure 1: QNET-DCMCT 2. Demo Outline There are four demos: ● Demo 1: Read tachometer by moving around inertial wheel on DC motor. ● Demo 2: Run DC motor in open-loop, i.e. output voltage to motor and read speed from tachometer. ● Demo 3: Build simple proportional compensator to control the motor speed. ● Demo 4: Build a proportional-integral compensator to control the motor speed. ● Demo 5 (optional): Convert Express VIs to DAQmx. They introduce the following to the audience: ● Adding Simulation Loop. ● Configuring the simulation parameters. ● Basic Simulation Module blocks: Simulation Time Waveform, Summation, and Gain blocks. ● Express VI: These are used to output voltage to the amplifier and read from the tachometer sensor. Revision 1.1 ♦ Page 1
  • 4. QNET-DCMCT Demo Guide ● LabVIEW front panel objects, e.g. knobs. ● Introduces DAQmx. 3. Prerequisites In order to successfully carry out the demo you need the following equipment and software installed: ✔ PC equipped with an NI-ELVIS II ✔ QNET DC Motor Control Trainer ✔ LabVIEW 8.2.1, or later, with the following add-ons: ✔ DAQmx ✔ Express ✔ Control Design and Simulation Module ✔ ELVISmx 4. Setting up a QNET One of the benefits of the QNET boards is its modularity. As depicted in Figure 2, any of these boards can easily be connected to the NI ELVIS II system and give the student a new type of plant to work with in minutes. Figure 2: Modularity of QNETs. Revision 1.1 ♦ Page 2
  • 5. QNET-DCMCT Demo Guide Follow these instructions to setup a QNET on an ELVIS II: 1. Make sure the NI ELVIS II is powered OFF. 2. Place the small opening on the front of the QNET over the mounting bracket on the front of the NI ELVIS II workstation. 3. Slide the PCI connector of the QNET module end into the female connector on the NI ELVIS II. Make sure it is connected properly. 4. Connect the ELVIS II power cable. 5. Connect the supplied QNET transformer to the bulk power jack on the QNET module. Note: Not required for the QNET mechatronic sensors trainer. 6. Power the NI ELVIS II by turning ON the System Switch on the rear panel. 7. Turn ON the Prototyping Board Power switch. CAUTION: Turn OFF the Prototyping Board Power switch if (1) On the QNET-DCMCT, QNET-ROTPENT, or QNET-VTOL Trainer the DC motor begins to turn, or (2) On the QNET-HVACT the halogen light turns on brightly. Take extra care when powering the QNET module to avoid causing any damage! 8. The Power and Ready LEDs of the NI ELVIS II unit should be lit. 9. Verify that the +15V,-15V, +5V, and +B LEDs on the QNET module are lit. They indicate that the board has been properly connected to the ELVIS II unit. Note: On the QNET Mechatronic Sensors and Myoelectric trainers, ensure the +15V,-15V, and +5V LEDs are lit (no +B). 5. Demos 5.1. Read Tachometer Demonstrates how to read from the tachometer by manually moving the inertial disc load mounted on the QNET DC Motor. 5.1.1. Create Simulation Loop The Simulation loop makes it easy to design and run simulations as well as control external hardware, e.g. DC motor. 1. Open blank VI in LabVIEW. 2. Create a Simulation Loop in the block diagram, as shown in Figure 3. Revision 1.1 ♦ Page 3
  • 6. QNET-DCMCT Demo Guide Figure 3: Simulation loop in block diagram. 5.1.2. Configure Simulation Parameters We want to setup a simulation to run continuously at 100 Hz. 1. Access dialog box shown in Figure 4 by double-clicking the Input Node or by right-clicking the border and selecting the Configure Simulation Parameters item from the shortcut menu. Revision 1.1 ♦ Page 4
  • 7. QNET-DCMCT Demo Guide Figure 4: Configure simulation parameters. 2. Setup the Simulation Parameters as follows: Final Time (s): Inf ODE Solver: Runge-Kutta 1 (Euler) Step Size (s): 0.01 3. Click on OK. 5.1.3. Setup to Read DC Motor Speed Use the DAQ Assistant Express VI to read the QNET DC Motor tachometer. The tachometer is connected to Analog Input Channel #4. Since we’re eventually doing control, we want to be reading one sample of data for each Simulation loop iteration (i.e. On Demand). Revision 1.1 ♦ Page 5
  • 8. QNET-DCMCT Demo Guide Remark: The QNET DC Motor has a digital tachometer. Its a on-board circuit that computes the velocity from the encoder signals. 1. Go to Express Input category and add DAQ Assist to the block diagram. 2. Select Acquire Signal Analog Input Voltage. 3. Choose ELVIS II Device ai4. 4. As shown in Figure 5, setup with the following settings: Acquisition Mode: 1 Sample (On Demand) Figure 5: Configuring analog input channel in DAQ Assistant. 5.1.4. Read DC Motor Speed Read the speed of the DC Motor in a chart. 1. Go to Graph Utilities and add a Simulation Time Waveform to the block diagram. 2. Connect output of DAQ Assistant to SimTime Waveform buffer, as shown in Figure 6. Revision 1.1 ♦ Page 6
  • 9. QNET-DCMCT Demo Guide Figure 6: Add Simulation Time Waveform to block diagram. 3. Go to the front panel and show the Waveform Chart. 4. Change the time scale to [0,2]. 5. Run the VI. 6. Move the inertial load back and forth. You should obtain a reading similarly as show in Figure 7. Figure 7: Tachometer response when moving DC motor load back and forth. Remark: This is the raw voltage from the tachometer. The voltage signal is proportional to the speed of the motor shaft. To get the actual speed, use the calibration gain 2987 RPM/V. Revision 1.1 ♦ Page 7
  • 10. QNET-DCMCT Demo Guide 5.2. Running DC Motor in Open-Loop Shows how to drive the motor while reading the corresponding motor speed. 5.2.1. Feeding Voltage to Motor Using the DAQ Assistant Express VI to drive the QNET DC Motor. The motor is connected to Analog Output Channel #0. Add DAQ Assistant Express VI and setup with following settings: 1. Go to Express Input menu and add DAQ Assist to the block diagram. 2. Select Generate Signal Analog Input Voltage. 3. Choose ELVIS II Device ao0 4. As shown in Figure 8, configure the channel with the following: Generation Mode: 1 Sample (On Demand) Figure 8: Configuring analog output channel in DAQ Assistant. Revision 1.1 ♦ Page 8
  • 11. QNET-DCMCT Demo Guide 5.2.2. Run Open-Loop Apply a voltage to the motor and observe the resulting speed response. 1. Add a Vertical Pointer Slide control called Input Voltage to the front panel and adjust its scale from 0 to 2. 2. Wire the slider control to the data terminal of the DAQ Assistant block, as illustrated in Figure 9. Figure 9: Block diagram setup for running DC motor in open-loop. CAUTION: If you are using QNET-DCMCT rev 1, then add a -ve between the Input Voltage control and the DAQ Assistant block. This ensures you read a positive speed when giving a positive voltage. 3. Set the y-axis in the Waveform Chart to a fixed range of 0 to 0.5. Right-click on the y-axis of the chart and ensure AutoScale Y is not selected. 4. Run the VI. 5. Adjust the slider control between 0 and 2 to vary the amount of voltage fed to the DC motor and observe how the measured speed changes. A typical response is shown Figure 10. CAUTION: Do not exceed +/-2V. This voltage is amplified by 2.3 V/V by the linear amplifier. Remark: You need at least 1.0 V for the rotor to begin turning due to the friction from the brushes. This demonstrates a common nonlinear phenomenon, i.e. deadband, that is seen in real devices. Revision 1.1 ♦ Page 9
  • 12. QNET-DCMCT Demo Guide Figure 10: Front panel when running DCMCT in open-loop. 6. Set the slider to 0 and stop the VI. Remark: Make sure the input voltage is set to 0 before stopping the VI. Otherwise the DC motor will continue spinning. The Express VI does not automatically reset the motor voltage to zero when the VI terminates. 5.3. Proportional Speed Control Design a simple proportional controller to regulate the speed of the DC motor. 5.3.1. Build Proportional Controller Build the block diagram shown in Figure 12, as summarized by the steps below: 1. Add a Summation block from the Control Design and Simulation Simulation category. 2. Rename input voltage slider control to setpoint. 3. Connect the setpoint control to the +ve terminal of the Summation block. 4. Connect the tachometer signal to the –ve terminal of the Summation block. This is the feedback signal. 5. Add a Gain block. Hint: For faster access to the Gain block, right-click on the Summation block and go to the Signal Arithmetic Palette item in the shortcut menu. 6. Double-click on the Gain block and set the Parameter source to Terminal, as pictured in Figure 11. Revision 1.1 ♦ Page 10
  • 13. QNET-DCMCT Demo Guide Figure 11: Configure gain to be changed externally. 7. Right-click on the terminal input of Gain and create a Numeric Control called kp. 8. Wire output of Summation to Gain block. 9. Connect output of Gain block to DC motor output. Figure 12: Block diagram to run DC motor proportional speed control. Revision 1.1 ♦ Page 11
  • 14. QNET-DCMCT Demo Guide 5.3.2. Running Proportional Speed Control This shows basic speed control response. Since this is a Type 0 system, there is steady-state error. Increasing the proportional gain improves the error but we need an integrator to solve the problem. 1. As shown in Figure 13, in the front panel add a digital display to the existing setpoint slider control. Hint: Right-click on the Vertical Pointer Slide control and select Digital Display under Visible Items. 2. Set the scale of the setpoint pointer slide control from 0 to 4. 3. Change the y-scale of chart from 0 to 1. 4. Run VI. 5. Vary the setpoint control and examine how the speed changes. 6. Set the setpoint to 1 and slowly increase the proportional gain, kp, to 10. As illustrated in Figure 13, examine how the measured speed approaches 0.5 as the gain is increased. However, there is still steady-state error. Figure 13: DC motor speed control. 7. Set the setpoint control to 0 and stop the VI. Revision 1.1 ♦ Page 12
  • 15. QNET-DCMCT Demo Guide 5.4. Proportional-Integral Speed Control Design a proportional-integral (PI) compensator to remove the steady-state error. 5.4.1. Build PI Control Build the block diagram shown in Figure 15, as summarized by the following steps: 1. Add another Gain block. Hint: Click-and-drag the existing Gain block, hold the CTRL key, and drop the copied Gain block. 2. Right-click on the terminal input of the new Gain and create a Numeric Control called ki. This the integrator Gain block. 3. Connect the error to the input of the integrator Gain. 4. Add an Integrator block from the Control Design and Simulation Simulation Continuous Linear Systems menu. 5. Wire the output of the integral Gain to the input of the Integrator block. 6. Add another Summation block. Hint: Right-click on existing Summation block, hold the CTRL key, and drop the copied Summation block. 7. Double-click on the Summation block that was just added and change the “-ve” sign to a “+ve” sign, as shown in Figure 14. Figure 14: Configure summation block. 8. Connect the output of both Gain blocks to the two +ve terminals of the Summation. 9. Wire output of Summation block to DC motor output. Revision 1.1 ♦ Page 13
  • 16. QNET-DCMCT Demo Guide Figure 15: Block diagram to run the PI DC motor speed control. 5.4.2. Running PI Speed Control See the effects of adding integral action to the control. This guarantees that the measure speed gets to the desired setpoint, i.e. removes steady-state error that was observed when using the proportional control. 1. Run VI. 2. Set the setpoint control to 0.5. CAUTION: Make sure the setpoint does not surpass +/- 1. 3. Set the integral gain, ki, to 10. The measured speed should reach the setpoint of 0.5, as illustrated in Figure 16. Revision 1.1 ♦ Page 14
  • 17. QNET-DCMCT Demo Guide Figure 16: Running PI speed control. 4. Set the setpoint to 0. 5. When the motor stops spinning, stop the VI. 5.5. Using DAQmx Drivers Introduce DAQmx by converting the Express VIs to DAQmx code. 5.5.1. Convert Analog Input Express VIs to DAQmx Convert the Analog Input Express VI to an DAQmx based VIs. 1. Right-click on the analog input DAQ Assistant block and select Generate NI-DAQmx Code. Revision 1.1 ♦ Page 15
  • 18. QNET-DCMCT Demo Guide Figure 17: Generating DAQmx code from an Express VI. 2. This will add a DAQmx Read VI and a sub-VI that configures the analog input channel, as illustrated in Figure 18. Figure 18: Generated analog input DAQmx code. 3. In the Simulation Loop, we only need to read a single point of data in each iteration. Set the DAQmx Read VI to Analog Single Channel Single Sample DBL. 4. Place the configuration VI outside the Simulation loop, as shown in Figure 19. Revision 1.1 ♦ Page 16
  • 19. QNET-DCMCT Demo Guide Figure 19: Setup AI DAQmx code. 5. Connect the task out of the configuration VI to the task/channels in of the DAQmx Read, as shown in Figure 19. 6. Remove the data indicator and connect the data output terminal on the Analog DBL output to the Waveform Chart, as illustrated in Figure 19 above. 7. Run the VI and the response should be similarly as shown in Figure 16, above. 5.5.2. Convert Analog Output Express VIs to DAQmx Convert the Analog Output Express VI to DAQmx drivers. 1. Right-click on the analog output block, DAQ Assistant3, and select Generate NI DAQmx Code. 2. We don't need to use the special waveform timing. Click on OK on the message shown in Figure 20. Figure 20: Waveform Timing 3. This will add a DAQmx Write VI and a sub-VI that configures the analog output channel. Revision 1.1 ♦ Page 17
  • 20. QNET-DCMCT Demo Guide Figure 21: Generated analog write DAQmx code. 4. In the Simulation Loop, we are only writing a single point of data in each iteration. Set the DAQmx Write VI to Analog Single Channel Single Sample DBL. 5. Place the configuration VI outside the Simulation loop, as shown in Figure 22. Figure 22: Block diagram of speed controller using DAQmx. 6. Remove the signal generator block (not needed because of Simulation loop). Revision 1.1 ♦ Page 18
  • 21. QNET-DCMCT Demo Guide 7. Clean up the excess wiring by pressing the CTRL-B. 8. Wire the output of the PI controller, i.e. the Summation block, to the data terminal on the DAQmx Write VI. 9. Connect the task out terminal from the analog output configuration VI to the task/channels in terminal of the DAQmx Write VI, as shown in Figure 22. 10. Run the VI and the response should be similarly as shown in Figure 16, above. 5.5.3. DAQmx Configuration Introduce how to configure analog input and output channels using DAQmx. 1. The block diagram of the analog input sub-VI is pictured in Figure 23. It features all the settings that were chosen when setting up the Express VI to read the tachometer. Figure 23: Configuring QNET analog input channel. 2. Similarly for the analog output channel, shown in Figure 24. Revision 1.1 ♦ Page 19
  • 22. QNET-DCMCT Demo Guide 3. Figure 24: Configuring QNET analog output channel. Revision 1.1 ♦ Page 20