Sie sind auf Seite 1von 16

Quanser Motor Series

Open-Loop Motor Modeling

ENGR 410 - Control Systems and Automation

Last Revised 11 Nov 2018

Name:

Name:

Name:

1 Introduction and Objectives


After learning how to build the fundamental components in the past several weeks, it’s the time to con-
nect the dots and establish a complete close-loop control system. In the next several weeks, you are going
to accomplish precise position and speed control for a DC motor, the block diagram of which is presented
in Figure 1. Notice, we will be using a new set of Quanser manufactured hardware, including a DC motor
“Rotary Servo Base Unit SRV02”, an integrated power amplifier and signal conditioner “VoltPAQ-X1”,
and a new DAQ board “Quanser Q2-USB”. Besides, the LabVIEW code will also be adapted into a new
environment that is compatible with the Quanser devices.

Figure 1: The system block diagram of close-loop speed/position control in Quanser lab series, and its re-
lationship to this lab.

1
1.1 Reasoning of Plant Modeling

Designing the PID controller for a close-loop control system, such as Figure 1, is like solving an equation
for an unknown. Recall the knowledge you learned in Chapter 5 of [1], the transfer function of the close-
loop system can be calculated if the transfer functions of all subsystems are known. The customers’ re-
quirements determine the transfer function of the close-loop system, and the equation giving rise to the
close-loop system transfer function with the PID controller’s transfer function as the only unknown is solv-
able. With the physical structure of the plant predefined, the transfer function of it should be acquirable.
We need to obtain the transfer function of the plant, input it to a Matlab computational tool, with which
we then solve the equation for the transfer function of the PID controller.

1.2 Objective

The focus of this lab is to get the transfer function of the plant, i.e. the Quanser DC motor SRV02, as
shown in Figure 1. The objective of this lab is to:

1. Familiarize the hardware and software to be used for Quanser lab series.
2. Obtain and validate the transfer function of the Quanser DC motor SRV02 through experimental
approach.
3. Calculate the transfer function of the Quanser DC motor SRV02 theoretically using the provided
datasheets and system schematic.

The theoretical calculation and analysis in Section 5 of this document can be carried out without the help
of the hardware/software resources in the lab. You may opt to study Section 5 before and/or after the lab.

Note that you define how you explore the questions being posed in the procedure. In preparation for your
entry into the real world of engineering, this document is not intended to be a cookbook.

2 Prelab
See your lab website.

3 Lab Deliverables
A completed worksheet per group is required. Answer all questions in bold. Where indicated with an
[SS#], you should collect screen shots and submit them to your instructor. Your instructor can decide on
the format for submission of screenshots (e.g. direct printout, pasted into a Word document and uploaded
to Canvas, etc.)

Notice, a comprehensive individual lab report is required per student (not per group) after the entire Quanser
lab series are completed. You are suggested to make a wise use of the screenshots and answers to the ques-
tions in the work sheets to compose your individual report.

2
4 Procedure

The hardware setup and software configuration introduced here will be used throughout the Quanser lab
series, including position control and speed control.

4.1 Hardware Setup


1. Each SRV02 servomotor unit is equipped with three sensors, including an encoder, a potentiome-
ter, and a tachometer. The optical encoder and the analog tachometer will be used as the position
and speed sensor in the following labs. The 1024-aperture optical encoders installed on SRV02 offer
a high resolution of 4096 counts per revolution in quadrature mode. The tachometer will output a
voltage that is proportional to the shaft speed with a ratio of 1.50 V/krpm [2].
Please take a note of the series number on the bottom plate of your motor SRV02. You
will be using the same motor throughout the Quanser lab series.

2. The Quanser VoltPAQ-X1 combines two functions in one device, namely a voltage controlled power
amplifier and a signal conditioner. Make sure the Amplifier Gain is set as ‘1x’ to avoid damage to
the motor assembly.
A signal conditioner is commonly used in control system to process the analog signal outputted from
the sensor and make it ready to be sampled by the computer. Analog sensor output is inherently
combined with hostile noise, which can be filtered out by the low-pass filter enclosed in the signal
conditioner. You might want to look up signal conditioning online to obtain more knowledge about
it. Please take a note of the series number on the bottom of your amplifier/signal con-
ditioner set VoltPAQ-X1. You will be using the same VoltPAQ-X1 throughout the Quanser
lab series.

3. Complete the wiring diagram in Figure 2.


Notice, a) we are using the tachometer to measure the shaft speed for the modeling lab. b) ADC is
the acronym for analog-to-digital converter. The ADC is located in the DAQ board.
Let your instructor check your wiring diagram before you do the physical connection. Make sure
your amplifier is powered off throughout the entire wiring-up process. Let your instructor check
again, before turning on the power of the amplifier/conditioner.
You are not using the encoder for this lab, i.e. plant modeling, but you will be using it during the
next lab, i.e. position control. Is the measurement of the encoder a digital or analog signal?
Is the measurement of the tachometer a digital or analog signal?

Do you think the device VoltPAQ-X1 (combined amplifier and signal conditioner) will
be used between the encoder and the DAQ board? Why?

3
Figure 2: Connecting the SRV02 to a Single-Channel Amplifier and DAQ.

4.2 Software Configuration


1. Loop Environment: Control and Simulation Loop
The Control and Simulation Loop is the counterpart of the Timed While Loop in Quanser lab series.
It is also used in the solutions to lots of control-engineering related problems. Please follow Figure 3
to configure the loop environment.
You need to create a termination block called Halt Simulation and a control as shown in Figure 3 (c).
Halt Simulation block can be found in Control Design and Simulation palette, following the path of
Simulation → Utilities.

2. I/O interface for Quanser Q2 USB DAQ board.


We use Hardware-In-the-Loop (HIL) Initialize, HIL Read and HIL Write blocks to designate the
Quanser Q2 USB DAQ board, set up the input and output channel on it.
Go to Quanser Rapid Control Prototyping → HIL → HIL Initialize. Double click the HIL Initial-
ize block, and select ‘Q2 usb’ board. Go to Quanser Rapid Control Prototyping → HIL → Immedi-
ate I/O → HIL Read or HIL Write. Connect the three HIL blocks through the board in and board
out input/output terminals as shown in Figure 4. Double click the blocks to select the channels that
make sense for your application.

4.3 Experimental Modeling

In this laboratory, the tachometer is used to measure the rotary speed. According to the knowledge
you learnt in lecture, when having the rotary speed as output and driving voltage as input,
what’s the order of the transfer function of the DC motor system? What’s the general form
for the transfer function?

4
Figure 3: Configuration of ‘Control and Simulation Loop’.

As the tachometer is an analog sensor which will output a voltage proportional to the speed of the shaft it
is attached to, the transfer function achieved experimentally should be Gexp (s) = Vt (s)/Ea (s), where Vt (s)
is the voltage output of the tachometer.

In this laboratory, you are going to get the value of a and A experimentally. In the lecture, you have done
similar exercise to get the values of a and A by measuring the step response of a system. What key char-
acteristics of the step response should you measure to get the value of A and a respectively?

Write down the equations to calculate A and a from these key characteristics.

5
Figure 4: Setup of HIL Initialize, CL HIL Read and CL HIL Write blocks to complete an I/O task associ-
ated with the Quanser DAQ board.

Slightly different to what you did in lecture, square waveforms with a DC offset is used instead of step sig-
nal as input in this lab to conduct the so-called bump test. In the bump test, you are going to drive the
motor with a train of square waveforms having a DC offset.

What’s the benefit of using bump test, instead of step response test? (Hint: think about the
static friction.)

Now, you are ready to compose your code to complete the bump test on top of the LabVIEW code as
given in Figure 4. Please set the appropriate input and output channels of the DAQ board in the HIL
Read and HIL Write blocks. Below are the setups of some key components you will need in your bump
test code.

1. Driving voltage of SRV02


In this lab, a square waveform will be used as the driving voltage source.
(a) Bring in a Signal Generator block from the palette of Control Design and Simulation, further
via Simulation → Signal Generation.
(b) Set the Signal Generator parameters to be the following values:
ˆ Wave form: square
ˆ Amplitude: 1.5 V
ˆ Offset: 4.0 V
ˆ Frequency: 0.4 Hz
Double click the Signal Generator block, in the Signal Generator Configuration window, you may
want to check Terminal in the dropdown menu of Parameter source for each parameter. Thus you
can change the value of each parameter directly on the front panel.
Try to change the values of the parameters Amplitude, Offset and Frequency of the square wave-
form, and see how that is going to affect the motor’s response. You may want to adjust the frequency
to give the motor adequate settling time.

6
2. Data Collection Using XY Graph
One way compatible to Control and Simulation Loop is recommended and introduced below:
(a) Bring in the Collector from Control Design & Simulation → Simulation → Utilities. The Col-
lector will temporally store all the data sent to the Collector in a buffer throughout the running
period of the program.
(b) Bring in a XY Graph in the front panel, put it outside of the loop in the block diagram. Con-
nect the output of the Collector with the input of the XY Graph. Set up the Minimum and
Maximum value of the X Scale in the Properties of the XY Graph to make sure that the data
to be displayed contain the entire dynamic process from the lower speed to the higher speed.
3. Data Measurement
Below is the method of using a Cursor to measure the time response displayed in the XY Graph:
(a) Right click the graph in the front panel, and select Visible Items → Cursor Legend from the
shortcut menu.
(b) Right click anywhere in the cursor legend, select Create Cursor, and select a cursor mode from
the shortcut menu. Free Cursor is recommended.
(c) The cursor is very hard to see at this point, as by default it has very similar color as the grid.
You may want to turn off the grid, or change the color of either the grid or the cursor to make
the cursors more visible. This modification can be made in the Properties panel by right click-
ing anywhere of the graph.
(d) Now you can move the cursors to appropriate places to measure the key characteristics. Show
the screenshot of your measurement in XY graph[SS1]. Write down your measure-
ment process and results. From your measurement, derive the values of A and a in
your transfer function Gexp (s) = Vt (s)/Ea (s) and write down the transfer function
with values plugged in.

(e) Plot the response and attach it to your report [3]


To export the image, right click on the XY Chart and select Export → Export Simplified Im-
age. Select the Bitmap (*.bmp) and Export to clipboard options to save the image to the clip-
board, and then you can paste it onto a word file directly or save it using a graphics software.
Figure 5 is an example of the exported .bmp file pasted on a word file. Alternatively, you can
also export the data into an Excel file and generate the plot in the spreadsheet.

4.4 Experimental Validation

Schematic of the experimental modeling validation is presented in Figure 6. You are going to use a Trans-
fer Function block in LabVIEW to simulate the motor SRV02. Driven by the same voltage source, the
transfer function model and the SRV02 should generate the same response if the model is accurate. You

7
Figure 5: An example of the .bmp file exported from the XY Graph.

Figure 6: Schematic of the modelling and validation process of this laboratory.

will increase the accuracy of the model by tweaking the values of A and a until the same responses are dis-
played, as seen in Figure 7(b).

1. Build the simulation model of your motor using Transfer Function block.
Go to Control Design and Simulation → Simulation → Continuous Linear Systems → Transfer Func-
tion. Double click the Transfer Function block, inside the Transfer Function Configuration window,
change the Parameter source to Terminal. Now move your mouse on the left edge of the Transfer
Function block, you will find an input port also called Transfer Function at the bottom left of the
block. This input accepts the combination of numerator and denominator coefficients of the transfer
function.
Both the numerator and denominator polynomial coefficients need to be given in Array data type.

8
Figure 7: Sample screenshots of the waveform chart seen in Figure 6. Scenario of (a) happens when the
parameters of the transfer function, i.e. A and a, are inaccurate. Scenario of (b) happens when the model
is accurate enough so that the measurement matches the simulation.

A Build Array block in Array palette is needed to build either the numerator or denominator array.
The coefficients of the numerator or denominator polynomial, from the lowest to the highest order,
are inputted from the top to the bottom element of the Build Array block. Make sure the numerator
and denominator polynomial coefficients are formed with a and A, and you are able to change the
values of A and a via Controls on the Front Panel.
The numerator and denominator array will then be bundled together by a Bundle block in Cluster,
Class and Variant palette. The output of the Bundle block will then be sent to the Transfer Func-
tion block as the Transfer Function input.

2. Tweak the values of a and A of your transfer function model


In order to find the most accurate transfer function model of SRV02, you are going to compare the
responses of actual motor and the Transfer Function block in LabVIEW. The Output of the Transfer
Function block should then be bundled together with the response of your real motor with a Bun-
dle block. The output of this Bundle block can then be sent to a Waveform Chart, as shown in the
schematic in Figure 6. You should see both responses in the Waveform Chart as shown in Figure 7.
Finely adjust the value of a and A while program running, until the two above-mentioned responses
almost overlap with each other, as shown in Figure 7(b). Due to static friction, you may need to
subtract a small constant value at the output of the transfer function to get the best match to the
tachometer output voltage.
Show the screenshot of your response comparison, which should be similar to Figure 7 (b)
[SS2]. Write down the values of A and a, as well as the transfer function Gexp (s) = Vt (s)/Ea (s)
after the validation process.

How does doing bump test instead of step response test facilitate the validation pro-
cess?

9
5 Theoretical Modeling and Validation

The physical structure of the motor SRV02 is shown in Figure 8, with the component names listed in Ta-
ble 1. Notice, the motor will be running in high-gear mode, as shown in Figure 8. The theoretical trans-

Figure 8: SRV02 motor components [2] in high-hear mode.

Table 1: Nomenclature of the SRV02 components displayed in Figure 8 [2].

fer function of a DC rotary motor can be derived from the electrical and the mechanical equations. Then
the students are required to evaluate all the parameters comprising the transfer function, with the spec-
ification sheet provided by the manufacturer, as shown in Table 2 and 3. Furthermore, the theoretically
calculated transfer function and the experimentally obtained transfer function will be compared.

10
Figure 9: Simplified schematic of SRV02 plant. The corresponding real devices and components are dis-
played in Figure 8.

Table 2: Main SRV02 specifications [2].

5.1 Deriving the transfer function

Slightly different than the approach used in [1], the mechanical equation will be built on the load shaft, as
the only damping coefficient Dle given by the manufacturer, as shown in Table2, is the equivalent damping
coefficient seen on the load shaft. Furthermore, in order to be more realistic, the motor’s efficiency ηm and
the gearbox’s efficiency ηg are both taken into account.

11
Table 3: SRV02 gearhead specifications [2].

The schematic of the motor is depicted in Figure 9. According to the Kirchhoff’s voltage law, the voltage
drop on each component of the circuit can be summarized by the following equation:

Ra Ia (s) + La sIa (s) + Vb (s) = Ea (s) (1)

The armature inductor La is negligible, and the back emf voltage Vb (s) = Kb Ωm (s), therefore (1) can be
simplified as:
Ra Ia (s) + Kb Ωm (s) = Ea (s). (2)
According to Newton’s second law, the torque felt on the load shaft can be summarized by the following
equation:
(Jle s2 + Dle s)θl (s) = Tl (s) (3)
where Tl is the torque exerted on the load shaft, which is transmitted from the torque generated on the
armature shaft, Tm , through two gearboxes, as can be seen from Figure 9. More quantitatively,
  
N2 N4
Tl (s) = Tm (s) ηg ηg , (4)
N1 N3

where N2 /N1 = Kgi and N4 /N3 = Kge are the internal and external gear ratio, ηg is the gearbox effi-
ciency. The values of all of them can be obtained from Table 1 and 2. ηg = 0.9 means that only 90% of
the torque can be transmitted from the driving shaft to the driven shaft through the meshing gears con-
necting the two shafts, and 10% of the torque is lost in the gearbox. While the external gearboxes are visi-
ble as Component 19 and 20 from the outside of the SRV02 motor fixture; the internal gearbox is not visi-
ble from outside but hidden inside the metal tube Component 19 enclosing both Shaft 0 and Shaft 1.

As can be seen from Table 1, ηm = 0.69 indicates that only 69% of the theoretically-calculated torque
can be actually delivered to drive the shaft. Therefore, the torque generated by the motor on the armature
shaft can be formulated as:
Tm (s) = Kt Ia (s)ηm , (5)
where Kt and Ia are the motor’s torque-current constant and the current flowing through the armature
circuit. Notice in (2), Ωm (s) = Ωl (s)Kg , where Kg is the total gear ratio from the armature shaft to the
load shaft, and Kg = Kgi Kge . By manipulating (2)∼(5), you should eventually yield the theoretical trans-
fer function of the plant as:

Ωl (s) (Kt ηm Kg ηg2 )/Ra


Gthe (s) = = . (6)
Ea (s) Jle s + (Dle + Kb Kt ηm Kg2 ηg2 )/Ra

12
Show the process of deriving the transfer function in (6) from (2)∼(5).

5.2 Evaluating the parameters

While all the other parameters in (6) can be found in Table 2 and 3, the equivalent moment of inertia seen
on the load shaft Jle needs to be calculated. Following the system schematic depicted in Figure 9, the mo-
ments of inertia of some major gears cannot be ignored, and it should be calculated as:
1 2
J= mr , (7)
2
where m and r are the mass and radius of a specific gear disc, which can be found in Table 3.

Based on the system schematic in Figure 9, complete and formula below by filling out the
correct gear ratio. Then using the values in Table 2 and 3, calculate the equivalent load in-
ertia Jle . Notice, inertias of the internal gearbox and the encoder are ignored.
 2  2  2
Jle = (J1 + Jmotor + Jtach ) · + (J2 + J3 ) · + (J4 + J5 ) + J6 ·
=

13
Plug in the values of all the parameters in the transfer function shown in (6) and get Gthe (s).

14
5.3 Comparison between Experimental and Theoretical Model

Recall your experimentally obtained transfer function of the motor: Gexp (s) = Vt (s)/Ea (s) that has the
tachometer voltage Vt (s) as the output. The voltage Vt should be proportional to the speed of the shaft
the tachometer is attached to. Check Figure 9 to see where the tachometer is mounted. The ratio of the
voltage and the rotary speed it is measuring is the tachometer sensitivity, which is 1.5 V/krpm according
to the user manual [2].

On the other hand, the theoretical transfer function you calculated Gthe (s) = Ωl (s)/Ea (s) has the load
shaft speed in SI unit as output. Please convert the experimentally obtained transfer function
Gexp (s) to Gexp,l,sp (s), which has load shaft speed in SI unit as output. (Hint: you should use
the appropriate gear ratios found in Figure 9 and Table 3, as well as the tachometer sensi-
tivity 1.5 V/krpm to do the conversion.)

Compare Gexp,l,sp (s) and Gthe (s), are they close to each other? Why?

Between theoretical and experimental modeling methods, which do you think it’s more ac-
curate? Why?

Discuss the cause of similarity and discrepancy between the process and results of theoreti-
cal and experimental modeling.

15
References
[1] Norman S. Nise, Control Systems Engineering (6 edition), John Wiley & Sons, Inc.
[2] SRV02 User Manual, Quanser Inc., 2011.

[3] Jacob Apkarian, Michel Levis and Hakan Gurocak, SRV02 Instruction Book of User Manual, Quanser
Inc. 2012.

16

Das könnte Ihnen auch gefallen