The practical journal

advertisement
MECHATRONICS
PRACTICAL WORKBOOK
1ST TERM FINAL YEAR
11 ME SEC. B
MECHATRONICS LABORATORY
DEPARTMENT OF MECHANICAL
ENGINEERING
Subject Teacher: Dr. Jawaid Daudpoto
Mehran University of Engineering and Technology Jamshoro, Sindh
CERTIFICATE
This is to certify that Mr._________________________
b e a r i n g Roll No. 11ME
(Sec.B ) of 1ST Term Final
Year has carried out the necessary practical work as per
course studies for the year 2014.
Subject Teacher: Dr. Jawaid Daudpoto
Dated: ______________
TABLE OF CONTENTS
PRACTICAL
NO.
OBJECT
PAGE
NO.
1
Introduction to NI ELVIS II Workstation
1
2
To measure the Component Values
3
3
To Build a Voltage Divider Circuit on the NI ELVIS II
Protoboard
5
4
Measurement of Current using the DMM
7
5
Understanding Thermistor
8
6
Operating the Variable Power Supply
9
7
Introduction to NI ELVIS Mechatronics Board
11
8
Measurement of Strain Using Strain Gage with Flexible
Link
13
9
Measurement of Pressure
17
10
Study of Vibration Using Piezo Sensor
20
11
Calibration of Rotary Potentiometer
22
12
Position Measurement Using Infrared Sensor
25
13
Position Measurement Using Magnetic Field Transducer
29
14
Using Encoder for Measurement of Angular Displacement
32
15
Use of Thermistor for Temperature Sensing
34
16
Modeling of DC Motor
38
17
Model Validation of DC Motor
42
18
Speed Control of DC Motor
44
19
Understanding Effect of Set Point Weight on DC Motor
Speed Control
46
20
Speed Control of DC Motor With Triangular Input
47
21
Position Control of DC Motor
48
Practical No. 1
Object: Introduction to NI ELVIS II Workstation.
Objective of the Experiment
The main objective of this experiment is to gain familiarity with the NI-ELVIS II unit. Having
a good understanding of the associated prototyping board will allow for good performance on
the next series of experiments in this course.
Introduction:
The National Instruments Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) is
a hands-on design and prototyping platform that integrates the 12 most commonly used
instruments - including oscilloscope, digital multimeter, function generator, bode analyzer,
and more - into a compact form ideal for the lab or classroom. It connects to your PC through
USB connection, providing quick and easy acquisition and display of measurements. NI
ELVIS eliminates the need for bulky equipment in the lab. It also allows for the design of
customized instrumentation that can be used and reused for specific projects. Based on NI
LabVIEW graphical system design software, NI ELVIS offers the flexibility of virtual
instrumentation and the ability of customizing your application. NI ELVIS is also an integral
part of the NI electronics education platform.
Setting up device
Throughout this course the NI ELVIS hardware platform is often referred to as Dev3 in the
Device field on instruments and physical channel name. This naming convention to identify
the device is given to NI hardware and often defaults to Dev1. Be mindful of this; select the
correct Device name that corresponds to your connected instrument when using NI ELVIS
with Soft Front Panels, LabVIEW.
Here is a set of instructions to change the device identifier:
1. Open Measurement & Automation Explorer (MAX).
2. Under My System, expand Devices and Interfaces.
3. Expand NI-DAQmx Devices.
4. Select the device name referring to your NI ELVIS workstation and right-clicking
the device and selecting Rename from menu.
5. Type in the name that you would like, Dev3, Dev1 or MyELVIS for example, press
enter when complete.
6. Close MAX.
You have just renamed your device!
1
NI ELVIS II Workspace Environment
This lab introduces the NI Educational Laboratory Virtual Instrumentation Suite (NI ELVIS)
II by showing how you can use the workstation to measure electronic component properties.
Then you can build circuits on the protoboard and later analyze them with the NI ELVIS II
suite of SFP instruments.
NI ELVIS II Workstation
The NI ELVIS II environment consists of the following components:
Hardware workspace for building circuits and interfacing experiments NI ELVIS II software
(created in NI LabVIEW software), which includes the following:



Soft Front Panel (SFP) instruments
LabVIEW APIs (Application Programmatic interface)
Multisim APIs
With the APIs, you can achieve custom control of and access to NI ELVIS II workstation
features using LabVIEW programs and simulation programs written within Multisim.
CAUTION: It is imperative that students exercise care when handling the ELVIS unit. Make
sure all connections are correctly made. When in doubt, check with your instructor to verify
proper circuit connections.
2
Practical No. 2
Object: To measure the Component Values
Equipment
i.
ii.
NI ELVIS II
Prototyping board
Procedure
1. Connect the NI ELVIS II workstation to your computer using the supplied USB cable. The
box USB end goes to the NI ELVIS II workstation and the rectangular USB end goes to the
computer. Turn on your computer and power up NI ELVIS II (switch on the back of the
workstation). The USB ACTIVE (orange) LED turns ON. Then the ACTIVATE LED turns
OFF and the USB READY (orange) LED turns ON.
2. On your computer screen, click on the NI-ELVISmx Instrument Launcher icon or shortcut.
A strip of NI ELVIS II instruments appears on the screen. You are now ready to make
measurements.
Instrument Launcher Icon Strip
3. Connect two banana-type leads to the digital multimeter (DMM) inputs (VA►├ ) and
(COM) on the left side of the workstation. Connect the other ends to one of the resistors.
4. Click on the DMM icon within the Launcher strip to select the digital multimeter.
Digital Multimeter, Ohmmeter Configuration
3
You can use the DMM SFP for a variety of operations such as voltage, current, resistance,
and capacitance measurements. Use the notation DMM[X] to signify the X operation.
The proper lead connections for this measurement are shown on the DMM front panel.
5. Click on the Ohm button [Ω] to use the digital ohmmeter function, DMM[Ω]. Click on the
green arrow [Run] box to start the measurement acquisition. Measure the three resistors R 1,
R2, and R3.
Results:
Fill in the following data:
R1 ___________ (1.0 kΩ nominal)
R2 ___________ (2.2 kΩ nominal)
R3 ___________ (1.0 MΩ nominal)
To stop the acquisition, click on the red square [Stop] box.
4
Practical No. 3
Object: To Build a Voltage Divider Circuit on the NI ELVIS II Protoboard
Equipment / Parts Required
i. NI Elvis II
ii. Prototyping board
iii. Two Resistors (R1 and R2) having nominal resistances of 1 k and 2.2 k.
Procedure:
1. Using the two resistors, R1 and R2, assemble the following circuit on the NI ELVIS II
protoboard.
Voltage Divider Circuit
2. Connect the input voltage, Vo, to the [+5 V] pin socket.
3. Connect the common to the [GROUND] pin socket.
4. Connect the external leads to the DMM voltage inputs (VW►├. ) and (COM) on the side
of the NI ELVIS workstation and the other ends across the input voltage, V o, to make the
first measurement.
5. Check the circuit and then apply power to the protoboard by pushing the prototyping board
power switch to the upper position [-]. The three power indicator LEDs, +15 V, -15 V, and
+5 V, should now be lit and green in color.
Power LED Indicators on NI ELVIS II Protoboard
5
Note: If any of these LEDS are yellow while the others are green, the resettable fuse for that
power line has flipped off. To reset the fuse, turn off the power to the protoboard. Check
your circuit for a short. Turn the power back on to the protoboard. The LED flipped should
now be green.
Results
1.
Measure the input voltage, Vo, using the DMM [V] function. Press [Run] to acquire
the voltage data.
V0 (measured) ________________
According to circuit theory, the output voltage, V2 across R2, is as follows:
V2 = R2/(R1+R2) * Vo.
2.
Using the previous measured values for R1, R2 and Vo, calculate V2.
Next, use the DMM[V] to measure the actual voltage V2.
V2 (calculated) ____________
V2 (measured) ____________
3.
How well does the measured value match your calculated value?
6
Practical No. 4
Object: Measurement of Current using the DMM
Equipment / Parts Required
i. NI Elvis II
ii. Prototyping board
iii. Two Resistors (R1 and R2) having nominal resistance
Procedure
1.
2.
3.
According to Ohm’s law, the current (I) flowing in the previous circuit is equal to V2/R2.
Using the measured values of V2 and R2 from previous practical, calculate this current.
Perform a direct current measurement by moving the external lead connected to
(VΩ►├) to the current input socket (A). Connect the other ends to the circuit as shown
below.
Circuit Modification to Measure Current
3. Select the function DMM [A] and measure the current.
I (calculated) _____________
I (measured) _____________
4. How well does the measured value match your calculated value?
7
Practical No. 5
Object: Understanding Thermistor
Theory
A thermistor is a two-wire device manufactured from a semiconductor material. It has a
nonlinear response curve and a negative temperature coefficient. Thermistors make ideal
sensors for measuring temperature over a wide dynamic range and are useful in temperature
alarm circuits.
Equipment / Parts Required:
i. NI Elvis II
ii. Prototyping board
iii. Thermistor
Procedure
1. Launch NI ELVISmx Instrument Launcher.
2. Select digital multimeter (DMM) from the SFP strip of instruments.
3. Click on the Ohm button.
4. Connect the test leads to DMM (V, Ω, ►├. ) and (COM) side sockets.
5. Measure the 10 kΩ resistors and then the thermistor.
6. Fill in the following chart:
Thermistor
_______________
Ohms
7. With the thermistor still connected, place the thermistor between your finger tips to heat it
up and watch the resistance changes. It is especially interesting to watch the changes on the
display bar scale (%FS).
The fact that the resistance decreases with increasing temperature (negative temperature
coefficient) is one of the key characteristics of a thermistor. Thermistors are manufactured
from semiconductor material whose resistivity depends exponentially on ambient temperature
and results in a nonlinear response. Compare the thermistor response with an RTD (100 Ω
platinum resistance temperature device) shown in the following figure.
Resistance-Temperature Curve of a Thermistor and an RTD
8
Practical No. 6
Object: Operating the Variable Power Supply
Equipment / Parts Required
i.
ii.
NI Elvis II
Prototyping board
Procedure
Complete the following steps to set a voltage level on one or both of the variable power
supplies.
1. From the strip menu of SFPs, select the [VPS] icon. There are two controllable power
supplies with NI ELVIS II, 0 to -12 V and 0 to +12 V, each with a 500 ma current limit.
Virtual SFP for Variable Power Supplies
In the default mode, you can control the VPS with the virtual panel shown above. Set the
output voltage on the virtual knob and click on the [Run] box. The output voltage is shown
9
(blue in color) in the display area above your chosen power supply. When you click on the
stop button, the output voltage is reset to zero on the protoboard.
NOTE: To sweep the output voltage through a range of voltages, make sure that you have
clicked the [Stop] button. Select the Supply Source (+ or -), Start Voltage, Stop Voltage, Step
Size, and Step Interval, and click on [Sweep].
For manual operation:
1. Click on the Manual box and use the knobs on the right side of the NI ELVIS II
workstation to set the output voltages. To view the output voltage in the display area, click on
the white box now appearing next to the LabVIEW label.
2. Connect the leads from the protoboard strip connector sockets labeled Variable Power
Supplies [Supply +] and [Ground] to the DMM voltage inputs.
3. Select DMM [V] and click on RUN. Select VPS front panel and click on RUN.
4. Rotate the virtual VPS control for Supply + and observe the voltage changes on the DMM
[V] display.
Note: You can use the [RESET] button to quickly reset the voltage back to zero.
5. Click on the Manual box to activate the real controls on the right side of the workstation.
The virtual controls are grayed out. Observe that the green LED Manual Mode on the NI
ELVIS II Workstation is now lit.
6. Rotate the + voltage supply knob and observe the changes on the DMM.
NOTE: VPS- works in a similar fashion except the output voltage is negative.
10
Practical No. 7
Object : Introduction to NI WLVIS Mechatronics Board
Introduction:
The mechatronics sensors (QNET-MECHKIT) trainer board is shown in Figure 1. The board
is used with NI ELVIS workstation. It has ten types of sensors, two types of switches, a push
button, and two LEDS. This board can be used to teach the physical properties of most
sensors used today, and the techniques and limitations of their application.
Here is a list of the components on the QNET-MECHKIT:
● Strain gauge to measure deflection
● Piezo film sensor to measure vibration
● Rotary potentiometer to measure position
● Pressure and thermistor sensors
● Long range sensors: sonar and infrared
● Short range sensors: magnetic field and optical
● Micro switch, push button, and optical switch
● Two light emitting diodes (LEDs)
● Encoder
Figure 1
11
ID #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Description
ID #
16
Piezo Sensor
Flexible link (connected to
17
strain gage)
18
Flexible link ruler
Temperature sensor gain
19
potentiometer
Temperature sensor offset
20
potentiometer
21
Thermistor
22
Push button
23
Micro switch
24
Optical switch
Infrared
sensor
on/off
25
switch
26
Infrared sensor on/off LED
27
Infrared sensor
28
Sonar sensor
29
Encoder knob
30
Enc A LED
Description
Enc B LED
Enc Index LED
Optical position sensor knob
Magnetic field sensor knob
AD0 Jumper
AD1 Jumper
AD2 Jumper
AD5 Jumper
Potentiometer
DO 1 LED
DO 0 LED
Plunger (connected to pressure sensor)
Pressure sensor
Plunger ruler
PCI connector to NI ELVIS: for interfacing
QNET module with DAC.
12
Practical No. 8
Object: Measurement of Strain Using Strain Gage with Flexible Link
Equipment / Parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
A strain gage measures strain, or deflection, of an object. In the QNET mechatronic sensors
trainer a strain gage is used to measure the deflection of a flexible link. As the link bends, the
resistance of the strain gage changes. Strain gages have many applications. They can be used
to measure strains in objects subjected to stress.
PROCEDURE
1. Ensure Jumper J7 is set to Strain Gage.
2. Open the QNET_MECHKIT_Flexgage.vi.
3. Ensure the correct Device is chosen, as shown in Figure below:
Figure 1
4. Run the QNET_MECHKIT_Flexgage.vi, as shown in Figure 2.
Figure 2
13
5. Move the flexible link to -1 cm.
6. Enter the strain gage voltage reading in the Sensor Measurement (V) array (indicated in
Figure 2).
7. Repeat for -0.5 cm, 0 cm, 0.5 cm, and 1.0 cm. A linear curve is automatically fitted to the
data being entered and its slope and intercept are generated.
Results/Measurements
1. Enter the measured voltages in Table 1 and capture the Sensor Readings scope. Click on
Stop button to stop the VI.
Table 1
2. Select the Calibrate Sensor tab and enter the slope and intercept obtained in collect data tab.
into the Calibration Gain and Offset controls shown in Figure 3. When the link is moved,
the slider indicator in the VI should match up with the actual location of the flexible link on
the QNET module.
Figure 3
14
3. Enter the gain and offset obtained in Table 2 and Click on Stop button to stop the VI.
Table 2
The response captured
Link position (cm) v/s Sensor Measurement (V)
4. Manually perturb the flexible link and stop the VI when it stops resonating (after about 5
seconds). The spectrum should then load in the chart, as shown in Figure below 4 (note,
however, that the value shown in incorrect).
Figure 4
15
5. Enter natural frequency found and capture the resulting power spectrum response.
Hint: You can use the cursor to take measurements off the graph.
16
Practical No. 9
Object: Measurement of Pressure
Equipment/parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
A pressure sensor is attached to the plunger on the QNET mechatronic board. This is a gage
pressure sensor and its measurements are relative to the atmospheric pressure. The voltage
signal generated is proportional to the amount of pressure in the vessel of the plunger. So as
the plunger is pushed further, the air inside the vessel becomes more compressed and the
reading increases.
Procedure
1. Ensure J9 is set to Pressure.
2. Run the QNET_MECHKIT_Pressure_Sensor.vi.
3. Important: Completely remove the plunger from the tube and re-insert it. This will ensure
the chamber is pressurized enough.
4. Push the plunger up to the 6 cm marked on the MECHKIT board and measure the
resulting voltage using the Pressure (V) scope (or the digital display).
5. Enter the result in the Sensor Measurement (V) array, as indicated in Figure 1.
Figure 1
17
6. Repeat for when the plunger is at 5.0 cm, 4.0 cm, 3.0 cm, 2.0 cm, 1.0 cm, and 0 cm. The
pressure sensor is quadratic. The coefficients for the second-order polynomial are
generated and the fitted curve is automatically plotted.
Result/Measurement
1. Enter collected results in Table 1 and capture the Sensor Readings scope.
Table 1 : Data collected from Pressure sensor.
Plunger position (cm) v/s Sensor Measurement (V) Graph
2. In the Calibrate Sensor tab, enter the polynomial coefficients, as illustrated in Figure 2, to
measure correct position of the plunger. Verify that the sensor is reading properly, e.g.
display should read 0.5 cm when plunger is placed at 0.5 cm.
3. Enter the a, b, and c, parameters used in Table 2.
Table 2
18
Figure 2
19
Practical No. 10
Object: Study of Vibration Using Piezo Sensor
Equipment/parts Required
i. NI Elvis II
ii. Mechatronics Sensor Trainer Board
Theory
Piezo sensors measure vibration. The piezo sensor on the QNET-MECHKIT trainer is
connected to a plastic band that has a brass disc weight at the end.
Procedure
1. Ensure J8 is set to Piezo.
2. Run the QNET_MECHKIT_Piezo.vi.
Result / Measurement
1. Manually perturb the plastic band that is attached to the piezo sensor by flicking it and
examine the response in the Piezo (V) scope.
2. Grab the end of the plastic band and move it slowly up and down. Examine the
response.
3. From these two tests, what does the Piezo sensor measure? How is this different
then a strain gage measurement?
20
Plot of the power spectrum of piezo
21
Practical No. 11
Object: Calibration of Rotary Potentiometer
Equipment/parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
Rotary potentiometers are absolute analog sensors used to measure angular position, such as a
load shaft of a motor. They are great to obtain a unique position measurement. However,
caution must be used as their signal is discontinuous. That is, after a few revolutions
potentiometers will reset their signal back to zero.
Procedure
1.
2.
3.
4.
5.
Ensure J10 is set to POT.
Run the QNET_MECHKIT_Potentiometer VI.
Rotate the arrowhead of the potentiometer to a certain position, e.g. 45 degrees.
Enter the position in the Pot Angle (deg) array, as indicated in Figure 1.
Enter corresponding measured sensor voltage in Sensor Measurement (V) array (shown in
Figure 1).
Figure 1
22
6. Fill out table with appropriate amount of data points. Notice that as the measured
potentiometer readings are entered, a curve is automatically generated to fit the data.
7. The slope and intercept of this line is generated as well.
Result/Measurement
1. Enter the collected data in Table 1 and capture the Sensor Reading chart.
Table 1
Plot Sensor Reading Curve
23
2. In the Calibrate Sensor tab, set the Gain and Offset controls, as indicated in Figure 2,
to values such that the potentiometer measures the correct angle. Verify that the sensor
is reading properly, e.g. when pot arrow is turned to 45.0 deg, the Display:
Potentiometer (deg) knob indicator should read 45.0 deg..
Figure 2
3. Enter Gain and Offset values used in Table 2.
Table 2 : Calibrated data
24
Practical No. 12
Object: Position Measurement Using Infrared Sensor
Equipment/parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
Infrared (IR) sensors are widely used in robots, automotive systems, and various other
applications that require an accurate, medium-range non-contact position measurement. An IR
sensor is typically composed of an infrared emitting diode (IRED), a position sensing detector
(PSD), and a signal processing circuit. It outputs a voltage the correlates to the distance of the
remote target.
Procedure
1. Ensure J10 is set to Infrared.
2. Run the QNET_MECHKIT_Infrared VI.
3. Turn ON the IR switch to enable the Infrared sensor. The IR ON LED should be lit bright
red.
4. Important: Make sure you turn OFF the IR switch when the experiment is over. When
active, the infrared sensor tends to generate noise in other sensor measurements.
5. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm2 with a
reflective colour like white or yellow.
6. Begin with the target close to the IR sensor and slowly move it away.
7. Once its range of operation is found, enter the distance between the target and the IR
sensor in the Target Range (cm) array, as shown in Figure 1.
8. Enter the corresponding measured voltage from the IR sensor in the Sensor Measurement
(V) array, as shown in Figure 1.
9. Repeat for different target positions. The IR sensor is quadratic. As the measurements are
entered, the coefficients for the second-order polynomial are generated and the fitted curve
is automatically plotted.
25
Figure 1
Result/Measurement
1. Record your distance and voltage observations in Table 1 and capture the
corresponding Sensor Readings scope.
Table 1
26
Target Range (cm) v/s Sensor Measurement Curve
2. In the Calibrate Sensor tab as shown in figure 2, enter the polynomial coefficients to
correctly measure the distance of the target. Make it is measuring correctly, e.g. when target
is 25.0 cm away then display should read 25.0 cm.
Figure 2
27
3. Enter a, b, and c, parameters used in Table 2
Table 2
Question:
What did you notice when the target is close to the IR sensor? That is, did the behaviour of
the sensor change when the target was in close proximity as opposed to being further way?
28
Practical No. 13
Object: Position Measurement Using Magnetic Field Transducer
Equipment/parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
A magnetic field transducer outputs a voltage proportional to the magnetic field that is
applied to the target. It applies a magnetic field perpendicular to the flat screw head. The
position of the screw head is changed by rotating the knob. This magnetic field transducer
has a similar range to the optical position sensor.
Procedure
1. Ensure J8 is set to Magnetic Field.
2. Run the QNET_MECHKIT_Magnetic_Field VI.
3. Gently turn the knob of the magnetic field sensor clockwise until it is at its limit. Then,
rotate the knob slightly counter-clockwise so the 0 mark on the knob faces up. This will be
reference 0 cm target position. Enter this in the Target Range (cm) array, shown in Figure 1.
4. Enter the voltage measured from the magnetic field position sensor for the reference 0 cm
position in the Sensor Measurement (V) array. The array is indicated in Figure 1.
Figure 1
29
5. Turn the knob counter-clockwise one rotation to move the target further from the sensor.
The target moves 1-inch for every 20 turns. Enter the position the target has moved from
the reference in the Target Range (cm) array.
6. Record the measured sensor voltage in the Sensor Measurement (V) array.
7. Take samples for the entire range of the target (i.e. until the knob cannot be rotated CCW
anymore). The magnetic field sensor is exponential. The parameters of the exponential
function are outputted and the fitted curve is automatically plotted as data is entered.
Result / Measurement
1. Enter the range and measured sensor voltage in Table 1 and capture the Sensor Readings
scope.
Table 1
Magnetic Field Response ( Target Range vs Sensor Measurement)
30
2. In the Calibrate Sensor Tab. Show in figure 2. Enter Gain and Damping exponential
function parameters to correctly measure the distance of the target. For instance, when
target is at 0.10-inch from the reference then the display should read 0.10-inch.
Figure 2
3. Record Gain and Damping parameters used for correct measurement in Table 2.
Table 2
31
Practical No. 14
Object: Using Encoder for Measurement of Angular Displacement
Equipment/parts Required
i. NI Elvis II
ii. Mechatronics Sensor Trainer Board
Theory
Procedure
1. Ensure jumpers J7 is set to Enc A, J8 to Enc B, and J10 to Enc I.
2. Run the QNET_MECHKIT_Encoder VI. Shown in figure 1.
Result/Measurement
1. Turn the encoder knob clockwise and examine the response of the A and B signals.
Note that the signals are offset by 2.5 V for display purposes. Enter your observation in
Table 1. Similarly, turn the encoder knob counter-clockwise and enter your observation.
Figure 1
32
Table 1
2. Using the 16-bit Position (counts) indicator on the VI, as shown in Figure 1, rotate the
knob and determine how many counts there are per revolution. Enter your result in the
Counts per rev box in the VI. Rotate the knob and confirm that the Angle (deg) indicator
is displaying an accurate angle.
3. Turn the knob such that the 0 is in the upward position and reset the counter by clicking on
the Reset button.
4. Enable the index by clicking on the Enable Index button.
5. Rotate the knob a full CW turn until the index is triggered. Keep turning the knob until
the 0 mark on the knob is pointing upwards. What do you notice about the 16-bit
Position (counts) and the Angle (deg) indicator values?
6. Adjust the Reload Value such that Angle (deg) measures 0 degrees when the 0 mark of the
knob is pointing up. Confirm this by moving the knob CW.
7. Enter the Count per rev and the Reload Value values used for a calibrated measurement in
Table 2.
Table 2
8. When is the index pulse triggered? What can this be used for?
9. Position the knob such that its 0 label is pointing upwards again. The Counts per rev and
Angle (deg) should both be reading 0. Rotate the knob in the CCW fashion one full
rotation. Is Angle (deg) reading 0 degrees? Discuss why or why not.
33
Practical No. 15
Object: Use of Thermistor for Temperature Sensing
Equipment/parts Required
i.
ii.
NI Elvis II
Mechatronics Sensor Trainer Board
Theory
There are several different types of transducers available to measure temperature: the
thermocouple, the resistance temperature detector (RTD), the thermistor, and the integrated
circuit (IC). Each have their own advantages and disadvantages. The Thermocouple has a
wide temperature range and is easy to use but is the least stable and sensitive. The RTD, on
the other hand, is most stable and accurate of the sensors but is slow and relatively more
expensive. The IC is the only linear transducer, has the highest output, but is slow. The
thermistor responds very quickly but has a limited temperature range.
Procedure
1. Ensure J9 is set to Temperature.
2. Run the QNET_MECHKIT_Temperature VI.
3. The thermistor is part of a circuit and the output voltage can be varied using the Gain and
Offset potentiometers on the QNET mechatronic sensors board. Rotate the Gain knob on
the counter-clockwise until it hits its limit.
4. Adjust the Offset knob such that the Temperature Sensor (V) scope reads 0 V. This is the
voltage measured at room temperature, T0 = 298 K.
5. Note: For this step, assume your room is at 25.0 degrees Celsius (deg C) even though it's
probably warmer or cooler.
Result/Measurement
1. Gently place your fingertip on the temperature sensor and examine the response in the
Temperature Sensor (V) scope. The surface temperature of the fingertip is approximately
32.00C. Enter the voltage read at room temperature and with the fingertip in Table 1.
Hint 1: The thermistor is very sensitive. Do not press down too hard on the sensor with
your finger when taking measurements. Otherwise, the measurement will not be consistent.
Hint 2: After releasing the sensor it takes a while for the temperature reading to settle back
to 0 V. You can bring the temperature down faster by gently blowing on the sensor.
Table 1
34
Figure 1
2. The voltage being measured on the QNET MECHKIT is the output voltage, vo, of the
circuit. Using the circuit and its corresponding equations, derive the formula that can
be used to find the thermistor resistance from the output voltage of the circuit, R.
3. Find the thermistor resistance at room temperature, R0, and at the fingertip, R. Enter
your results in Table 2.
Table 2
35
4. Use the following equation to find the exponential parameter, B
B=
5. Enter the B parameter as shown in Figure below. Place your fingertip on the sensor
and capture the obtained response in Temperature Sensor (deg C) scope.
Figure 2
36
Plot of response of temperature sensor
37
Practical No. 16
Object: Modeling of DC Motor
Equipment:
i.
ii.
NI ELVIS
DC Motor Control Trainer
Introduction to DC Motor Control Trainer
The DC Motor Control Trainer is system consists of a direct-current motor with an encoder
and an inertia wheel on the motor shaft. The motor is driven us- ing a pulse-width
modulated (PWM) power amplifier. The power to the amplifier is de- livered using the
QNET power cable from a wall transformer and the encoder is powered by the ELVIS unit.
Signals to and from the system are available on a header and on standard connectors for
control via a Data Acquisition (DAQ) card. The control variable is the voltage to the
drive amplifier of the system and the output is either the wheel speed or the angle of the
wheel. Disturbances can be introduced manually by manipulating the wheel or digitally
through LabVIEW.
Procedure
1. Open the QNET_DCMCT_Modeling.vi.
2. Ensure the correct Device is chosen, as shown in Figure 1
Figure 1
3. For Bumptest, Run the QNET_DCMCT_Modeling.vi. The DC motor should begin
spinning and the scopes
4. on the VI should appear similarity as shown in Figure 2. In the Signal Generator section
set:
Amplitude = 2.0 V
Frequency = 0.40 Hz
Offset = 3.0 V
5. Once you have collected a step response, click on the Stop button to stop running the VI.
38
Figure 2
Results/Measurements
1. Attach the responses in the Speed (rad/s) and Voltage (V) graphs.
39
2. Select the Measurement Graphs tab to view the measured response, similarly as depicted in
Figure 3.
Figure 3
3. Use the responses in the Speed (rad/s) and Voltage (V) graphs to compute the steady-state
gain of the DC motor. Make sure you fill out Table 1. See the Bumptest Method section in
the QNET Practical Control Guide for details on how to find the steady-state gain from a
step response. Finally, you can use the Graph Palette for zooming functions and the
Cursor Palette to measure data. See the LabVIEW help for more information on these
tools.
Table 1
4. Based on the bumptest method, find the time constant. Make sure you complete Table 2
and see the Bumptest Method section in the QNET Practical Control Guide for
information on how to find the time constant of the step response.
40
Table 2
5. Enter the steady-state gain and time constant values found in this section in Table 3. These
are called the bump test model parameters.
Table 3
41
Practical No. 17
Object: Model Validation of DC motor
Equipment:
i.
ii.
NI ELVIS
DC Motor Control Trainer
Procedure
1. Open the QNET_DCMCT_Modeling.vi.
2. Ensure the correct Device is chosen, as shown in Figure 1
Figure 1
3. Run the QNET_DCMCT_Modeling.vi. You should hear the DC motor begin running and
the scopes on the VI should appear similarity as shown in Figure 2.
Figure 2
42
4. For model validation, In the Signal Generator section set:
Amplitude = 2.0 V
Frequency = 0.40 Hz
Offset = 3.0 V
5. In the Model Parameters section of the VI, enter the bumptest model parameters, K and τ,
that were found in Bumptest. The blue simulation should match the red measured motor
speed more closely.
Results/Measurements
1. Attach the Speed (rad/s) and Voltage (V) chart responses from the Scopes tab. How
well does your model represent the actual system? If they do not match, name one
possible source for this discrepancy.
2. Tune the steady-state gain, K, and time constant, tau, in the Model Parameters section so the
simulation matches the actual system better. Enter both the bumptest and tuned model
parameters in Table 3.
Table 3
43
Practical No. 18
Object: Speed Control of DC motor.
Equipment:
i.
ii.
NI ELVIS
DC Motor Control Trainer
Procedure
1. Open the QNET_DCMCT_Speed_Control.vi.
2. Ensure the correct Device is chosen.
3. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating and the
scopes should look similar as shown in Figure 1.
4. In the Signal Generator section set:
Signal Type = 'square wave'
Amplitude = 25.0 rad/s
Frequency = 0.40 Hz
Offset =100.0 rad/s
5. In the Control Parameters section set:
kp = 0.0500 V.s/rad
ki = 1.00 V/rad
bsp = 0.00
Figure 1
44
Results/Measurements
1. Examine the behavior of the measured speed, shown in red, with respect to the
reference speed, shown in blue, in the Speed (rad/s) scope. Explain what is
happening.
2. Increment and decrement kp by steps of 0.005 V.s/rad.
3. Look at the changes in the measured signal with respect to the reference signal. Explain the
performance difference of changing kp.
4. Set kp to 0 V.s/rad and ki to 0 V/rad. The motor should stop spinning.
5. Increment the integral gain, ki, by steps of 0.05 V/rad. Vary the integral gain between
0.05V/rad and 1.00 V/rad.
6. Examine the response of the measured speed in the Speed (rad/s) scope and compare
the result when ki is set low to when it is set high.
7. Stop the VI by clicking on the Stop button.
8. Using the equations outlined in the Peak Time and Overshoot section of the
QNET Practical Control Guide, calculate the expected peak time(tp) and percentage
overshoot(PO) in table 1, given the following Speed Lab Design (SLD) specifications:
zeta = 0.75
w0= 16.0 rad/s
Optional: You can also design a VI that simulates the DC motor first-order model with a PI
control and have it calculate the peak time and overshoot.
Table 1
w
45
Practical No. 19
Object : Understanding effect of set point weight on DC motor Speed Control
Equipment:
i. NI ELVIS
ii. DC Motor Control Trainer
Procedure
1. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating.
2. In the Signal Generator section set:
Signal Type = 'square wave'
Amplitude = 25.0 rad/s
Frequency = 0.40 Hz
Offset = 100.0 rad/s
3. In the Control Parameters section set:
kp = 0.050 V.s/rad
ki = 1.50 V/rad
bsp= 0.00
4. Increment the set-point weight parameter bsp in steps of 0.05. Vary the parameter between 0
and 1.
Results/Measurement
1. Examine the effect that raising bsp has on the shape of the measured speed signal in the
Speed (rad/s) scope. Explain what the set-point weight parameter is doing.
Stop the VI by clicking on the Stop button.
46
Practical No. 20
Object: Speed Control of DC Motor with triangular input
Equipment:
i.
ii.
NI ELVIS
DC Motor Control Trainer
Procedure
1. Run the QNET_DCMCT_Speed_Control.vi. The motor should begin rotating.
2. In Signal Generator set:
Signal Type = 'triangular wave'
Amplitude = 50.0 rad/s
Frequency = 0.40 Hz
Offset = 100.0 rad/s
3. In the Control Parameters section set:
kp = 0.20 V.s/rad
ki = 0.00 V/rad
bsp = 1.00
Results/Measurement
1. Compare the measured speed and the reference speed. Explain why there is a
tracking error.Increase ki to 0.1 V/rad and examine the response. Vary ki between 0.1 V/rad
and 1.0 V/rad.
2. What effect does increasing ki have on the tracking ability of the measured signal? Explain
using the observed behaviour in the scope.Stop the VI by clicking on the Stop button.
47
Practical No. 21
Object: Position Control of DC Motor
Equipment:
i.
ii.
NI ELVIS
DC Motor Control Trainer
Procedure
1. Open the QNET_DCMCT_Position_Control.vi.
2. Ensure the correct Device is chosen.
3. Run the QNET_DCMCT_Position_Control.vi. The DC motor should be rotating back
and forth and the scopes on the VI should appear similarity as shown in Figure 1.
Figure 1
4. In the Signal Generator section set:
Amplitude = 2.00 rad
Frequency = 0.40 Hz
Offset = 0.00 rad
5. In the Control Parameters section set:
kp = 2.00 V/rad
ki = 0.00 V/rad
kd = 0.00 V.s/rad
48
6. Change the proportional gain, kp, by steps of 0.25 V/rad. Try the following gains: kp = 0.5,
1,2, and 4 V/rad.
Results/Measurement
1. Examine the behaviour of the measured position (red line) with respect to the reference
position (blue line) in the Position (rad) scope. Explain what is happening.
2. Describe the steady-state error to a step input.
3. Increment the derivative gain, kd, by steps of 0.01 V.s/rad.
4. Look at the changes in the measured position with respect to the desired position. Explain
what is happening.
5. Using the equations outlined in the Peak Time and Overshoot section of the QNET
Practical Control Guide, calculate the expected peak time, tp, and percentage overshoot,
PO, given the following specifications:
zeta = 0.75
w0= 16.0 rad/s
Optional: You can also design a VI that simulates the DC motor first-order model with a PI
control and have it calculate the peak time and overshoot.
Table 1
49
APPENDIX
(The following is a selected portion of practical control guide available on Lab. PCs)
50
51
52
53
54
55
Download