Você está na página 1de 47

Circuit design of the PA 10 power amps:

R_G = R_feedback = 10 kOhm;


R_in+ = R_in- = R_CL+ = R_CL- =R_out = 0 Ohm;
E_CAP = E1_CAP = 100 uF;
S_CAP = S1_CAP = 0.1 uF
R_FO = 1 MOhm (can be assumed to be not connected in modeling);
C1 is not connected.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Lab 0

Assigned: Sept. 8, 2014


Due:
In checkos Thurs. Sept. 11, 2014

This lab provides an introduction to using the myRIO with Labview. We will evaluate your work
with a brief (510 minutes) checko on Thurs 9/11. No written lab report or other documentation
is required.
Specically, we ask you to:
1. Run the supplied Labview VI which emulates a rst-order continuous time lter, as driven
by an input on an A/D channel, and which outputs on a D/A channel. Examine the input
and output on the front panel displays in Labview and on the bench oscilloscopes in the lab.
Explore the eects of sampling visible in the signals on the oscilloscope. Try dierent sample
rates of the myRIO simulation loop. What interesting eects can you observe?
2. Now modify the supplied VI to simulate a second-order mass-spring-damper system in state
variable form as shown below.

Note that your simulation should use individual integrators which store the velocity and

position states. Program the front panel of the VI to allow you to adjust m, b, and k.

Simulate this second-order system for some interesting values of these parameters. What

eects can you see from the discrete-time implementation? Try varying the sample rate of

the simulation loop. What eects can you observe?

Checko on Thursday 9/11: We will post a signup sheet for checkos. You will need to demon
strate your working myRIO and associated signals on the oscilloscope for both models. Also plan
to show us any interesting eects you have observed.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Mechatronics
Pre-Lab 0: Controls Review
Assigned: 9/3/14
Due: 9/10/14 in class

Welcome to 2.737! The purpose of this pre-lab homework assignment is to get you thinking about
and reviewing controls. This material should be familiar to you from 2.14 or some other equivalent
controls course. If you get stuck, you can get help from your fellow students, but make sure that
what you turn in is your own work. You can also get help from the sta during oce hours which
are held in the lab, 1-004.

Problems
1. First-Order Response. For the system
H(s) =

10
0.05s + 1

(a) Sketch the response to a unit step input.


(b) Sketch the system Bode plot.

(c) Verify the step response and Bode plot in MATLAB.


2. Second-Order Response. For the system
H(s) =

1
s2
2
n

2s
n

+1

with n = 100 and = 0.1


(a) Sketch the step response to a unit step input.
(b) Sketch the system Bode plot.
(c) Verify the step response and Bode plot in MATLAB.
3. Doublet Response. For a system
H(s) =

s + 1
s + 1

(a) Sketch the Bode plot and show that for > 1 this is a lead network and for 0 < < 1
this is a lag network.
(b) Find an expression for the system response to a unit step input. Sketch representative
responses for the cases > 1 (lead) and 0 < < 1 (lag).

4. Block Diagram. (This problem is taken from Roberge, J.K., Operational Ampliers: Theory
and Practice, Wiley, 1976.) Figure 2.20 shows a block diagram for a linear feedback system.
Write a complete, independent set of equations for the relationships implied by this diagram.
Solve your set of equations to determine the input-to-output gain of the system.

John Wiley & Sons. All rights reserved. This content is excluded from our Creative Commons license.
For more information, see http://ocw.mit.edu/help/faq-fair-use/..

5. Nonlinear Feedback. (This problem is taken from Roberge, J.K., Operational Ampliers:
Theory and Practice, Wiley, 1976.) Plot the closed-loop transfer characteristics for the non
linear system shown in Fig. 2.22.

John Wiley & Sons. All rights reserved. This content is excluded from our Creative Commons license.
For more information, see http://ocw.mit.edu/help/faq-fair-use/..

6. Servomechanism with Disturbance. For the servomechanism of Fig. 1.18 let the parame
ters be
JT

= 105 kg m2

B = 103 N m s/rad
Km = 0.1 N m/A
Kt = 2 V/rad
Note that the amplier with gain Ka is a current-drive which determines the motor current
Im directly. Thus in this model, the motor back emf does not aect the dynamics. The motor
torque is given by Tm = Km Im .
This system can be represented by the block diagram as shown in Figure 1.19. (Note: There
should not be gaps near the summing junction and output in Figure 1.19.)
(a) Choose gain Ka to yield a system with a step-response peak overshoot of 20% for an
input Vi and output . What is the resulting damping ratio and natural frequency,
n ?
(b) Calculate the disturbance transfer function
fected by varying Ka ?

(s)
Td (s) .

How is the disturbance rejection af

(c) Sketch a root locus for this system as Ka varies between 0 and . How is stability
aected with increasing Ka ?
(d) Verify your root locus in MATLAB.
(e) For the value of Ka found in part (a), determine an analytical expression for the loop
return ratio transfer function. Make a sketch of the Bode plot for this return ratio. What
are the loop crossover frequency and phase margin? Be sure to indicate these values on
the Bode plot.
(f ) Conduct a Nyquist analysis and make a sketch of the Nyquist plot for this loop. Is the
loop stable? Why or why not? Show how the crossover frequency and phase margin are
represented on this loop.

7. Op amp circuit The circuit shown below purports to be an analog computer simulation of a
mass/spring/damper system. In this circuit, all ampliers are ideal, with innite gain.

a) Draw a block diagram which represents the circuit, and which includes the variables Vi , i1 , i2 ,
i3 , i4 , V1 , V2 , V3 , and V4 . Expressions in the blocks should be in terms of the given system
parameters.
b) Show that the system can be described by the dierential equation
aV1 + bV 1 + cV1 = dVi
where a, b, c, and d are scalar constants. Give expressions for these constants in terms of the
system parameters. Hint: V2 V 1 , and V3 V 2 V1

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Lab 1

Assigned: Sept. 10, 2014


Due:
In checkos Thurs. Sept. 18, 2014

This lab gives an introduction to using the myRIO with Labview to implement closed-loop control
of an RC lter. We also ask you to experimentally investigate the eects of loading on some RC
lters, in order to understand that the measurement system can aect the measurement. As well,
the lab report must include answers to some circuit problems. These problems are taken from the
le archive.pdf which is available on the course web page. Note that the archive also includes
solutions to many of the problems.
The solutions to the assigned problems must be included with your lab report. The lab report should
also clearly document your experimental work, predictions, results, and a comparison between these,
with explanations of observed phenomena and discrepancies. Be sure to show us your understanding
of the lab and design experiences. No formal lab report structure is required.
We will evaluate your work with a 30 minute checko on Thurs 9/18. Be sure to come to lab
early enough that you have your experiments running and ready to show us. You will need to
demonstrate the loading eects in the RC circuits as well as the closed-loop control implemented
on the myRIO.
Lastly, be sure to start this work early, as there is a signicant time commitment, and it is not
likely to be well-solved at the last minute!
Readings: Please look online and get copies of: 1) the myDAQ users guide, 2) the myRIO users
guide, and 3) the NI application note on analog signals, available by going to ni.com/info and
entering the Info Code analogwiring. The myDAQ users guide has a useful section on how to work
with the dierential inputs. The myRIO users guide has some details on the myRIO conguration,
which includes the myDAQ input dierential ampliers on the myDAQ connectors. Note that
the other analog inputs are single-ended, so these may require you to make your own dierential
amplier for measuring any critical signals. The NI application note has much more information
which is very useful for interfacing with sensors and other signal sources.
Specically, we ask you to:
Archive Problem 8.3 Complete the solution of this problem and submit with your lab report.
Archive Problem 8.5 Complete the solution of this problem and submit with your lab report.
Archive Problem 9.2 Complete the solution of this problem and submit with your lab report.
Archive Problem 9.10 Complete the solution of this problem and submit with your lab report.

Lab exercise 1 Consider the circuit shown below:

For this circuit,


a) Sketch the response to a unit step input.
b) Construct the circuit on your protoboard, and drive it with the bench signal generator. We ask
you to measure the response three ways:
1) Connect the circuit output to the bench oscilloscope using a standard BNC cable, and
display the response on the scope.
2) Connect the circuit output to the bench oscilloscope using the scopes 10x probe, and
display the response on the scope.
3) Connect the circuit output directly to the dierential amplier input of the myRIO using
wires on your protoboard. Display the response in Labview at a suciently high sample
rate.
c) What do you observe with these three connection approaches? Include relevant waveforms/sketches
and measurements to document your observations. Can you explain the observed behavior?
What models might explain what you see? What have you learned about loading when
connecting to circuit signals?

Lab exercise 2 Consider the circuit shown below

For this circuit,


a) Sketch the response to a unit step input.
b) Construct the circuit on your protoboard, and drive it with the bench signal generator. We ask
you to measure the response three ways:
1) Connect the circuit output to the bench oscilloscope using a standard BNC cable, and
display the response on the scope.
2) Connect the circuit output to the bench oscilloscope using the scopes 10x probe, and
display the response on the scope.
3) Connect the circuit output directly to the dierential amplier input of the myRIO using
wires on your protoboard. Display the response in Labview at a suciently high sample
rate.
c) What do you observe with these three connection approaches? Include relevant waveforms/sketches
and measurements to document your observations. Can you explain the observed behavior?
What models might explain what you see? What have you learned about loading when
connecting to circuit signals?

Lab exercise 3 Consider the control system shown below

The second-order circuit shown is to be considered as the plant to be controlled by the myRIO.
Specically, the input to the plant is the D/A output voltage vc , and the output of the plant
is the voltage vo . That is, the control loop conguration is:

We ask you to do the following:

a) Calculate the exact transfer function Vo (s)/Vc (s). Use MATLAB to compute the plant pole
locations, step response, and Bode plot for this plant.
b) Assume that the second RC stage does not load the rst. That is, since 1 M >> 100 k, we
can assume that the two RC transfer functions may be computed independently. Under this
assumption, calculate the approximate transfer function Vo(s)/Vc(s). Use MATLAB to compute
the plant pole locations, step response, and Bode plot for this plant. Compare these results
with the exact results from a) above.
c) Design a continuous-time PID (lead/lag) controller of the form
Gc (s) = Kp 1 +

1
Ti (s)

s + 1
.
s + 1

Be sure to implement the integrator as a separate block with antiwindup included.


Design this controller to regulate the output voltage vo to equal the reference signal Vref
measured on another A/D channel and supplied by the bench signal generator. Choose the
controller parameters to give a crossover frequency c = 1000 rad/sec, with a phase margin
m = 45 using the exact plant transfer function.. Create an accurate hand-sketch of the
loop return ratio showing the design and the crossover and phase margin. Also use MATLAB
to conrm your design. What are the design values of Ti , , and ?
4

d) Implement this control loop inside the CD&Sim loop adapted from Lab 0. Record some in
teresting waveforms and compare with what would be predicted by theory. At a minimum,
compare the step responses in vc and vo with the responses predicted using MATLAB.
Checko on Thursday 9/18: We will post a signup sheet for checkos. You will need to demon
strate your working circuits and associated signals on the oscilloscope for the lab exercises. Also
plan to show us any interesting eects you have observed.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Lab 1 Addendum

Assigned: Sept. 22, 2014

Due:
There is no formal requirement to complete this addendum.

If you have time, check out the items listed herein, as you will learn important

ideas about controller design in the presence of limited quantization resolution.

You will likely have noticed that your controller in Lab 1 designed for 1000 rad/sec crossover had
a very strong oscillation in the control eort. This is due to the limited quantization levels of the
myRIO 12-bit converter. For the relatively high loop bandwidth, the quantization is not sucient
to support a linear control mode of operation. Also, the capacitors used in the lab have a large error
tolerance, and typically measure about 0.16 F rather than the nominal 0.1 F. We can create a
more accurate plant model on the basis of experimental measurements.
With the gain limitations, the loop crossover frequency needs to be reduced, or alternately, some
amount of gain needs to be taken in the analog domain.
Further, it is helpful to use a dynamic analyzer to measure the plant transfer function and loop
return ratio. We are providing a dynamic analyzer which runs in Labview to allow you to make
these measurements.
To understand these issues better:

a) Create a more accurate plant model, and verify experimentally.


b) Design a control loop for a crossover frequency of c = 100 rad/sec. Implement this loop
and carefully compare with predicted results. Also, measure the loop return ratio and plant
transfer functions using the dynamic analyzer. How do these compare with your design
values?
c) Another approach is to implement an analog gain stage at the input or output of the plant.
Try some gain value (10?) and implement using an op amp circuit. Can you close the loop
with the crossover frequency back up to c = 1000 rad/sec, and have acceptable dynamic
response? Can you measure the loop return ratio successfully with this high crossover?

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Mechatronics
Laboratory Assignment 2: Analog Feedback Systems
Assigned: 9/17/14
Pre-lab due: Thursday 9/25/14 online by 5pm
Reports due: Thursday/Friday 10/210/3/14 in checkos

Overview

In this lab you will experiment with designing and stabilizing power op amp circuits. These devices
are used to drive loads requiring signicant power, such as motors, solenoids, deection coils,
speakers, etc. We will use two types of loads. The rst is just a power resistor driven directly
by the power op-amp. The second is an inductor driven in a closed-loop current-controlled mode.
This second design will be implemented by using a second low-level op-amp to serve as a current
controller by driving the power op-amp. You will need to model the system to design an appropriate
controller. Then you will test this connection in the lab to measure its performance. You will design
this low-level controller and build it on a section of the protoboard. This is a relatively challenging
lab experience, so be sure to start early!

Prelab and Lab Reports

Your prelab calculations are due in a prelab report to be submitted by 5pm on Thursday 9/25.
For the prelab, please complete all the requested modeling of the circuits, the prediction of the

requested step and frequency responses, 0$7/$% calculations, etc. You will need to make a copy to
give to us, and keep your original to support the lab portion of the assignment. You may submit
these online, or in the ling cabinet in the lab. It is not permitted to look at other students prelab
reports in the ling cabinet.
The lab report should clearly document your experimental work, predictions, results, and a com
parison between these, with explanations of observed phenomena and discrepancies. Be sure to
show us your understanding of the lab and design experiences. No formal lab report structure is
required. The lab report is due at the time of your checko. Please also include the prelab copy
with this report. These must be submitted in paper format at the checko.
You will also schedule a lab checko with the sta during 10/210/3. In this checko, you will
need to be able to discuss your design process, calculations, and experimental results. We are
particularly interested in how you have used the experimental results to understand the ways in
which the system matches predictions and the ways in which it departs from modeled behavior.
Come to lab well ahead of your checko time so that you can get set up and have your system
running at the start of checko.

Collaboration

You are welcome to collaborate freely with other students in the class, to discuss approaches and
solutions, and compare results. However, what you turn in for prelab and lab reports must represent
your individual understanding. We require that you fabricate your own circuits and controllers, and
do your own experimental lab work, as watching someone else is not very eective. The checkos
are one-on-one, and give you a chance to show us your own understanding of the material. If you
make use of insights from another student, good scholarship entails citing their contribution in your
report. It is always good form to acknowledge such assistance; it makes you a better scholar as well
as being fair.

Power Amplier Connections

Please read this section carefully before making any circuit connections, and before
applying any power to the circuit.
In this laboratory, we use a power op amp to drive loads requiring more current and voltage ranges
than is available from a low-level op-amp such as the 741 (which is limited to about 15 V and
10 mA maxiumum outputs). To this end you will work with an Apex PA-10 power operational
amplier mounted on a PC board which we have designed. This power amp board uses some of
the components available from Apex in their EK-21 evaluation kit. Data sheets for this amplier
and the circuit board are available on the course web page. Please read these data sheets in order
to familiarize yourself with the amplier characteristics.
The PA-10 ampliers have an absolute maximum of 50 volts. The lab bench supplies cannot
output voltages above 30 Volts, so the amplier is capable of running safely on the maximum
supply output. However, in order to limit the maximum amplier and load power dissipation, we
will run the supplies at 17 Volts.
The boards have two PA-10 ampliers, so that two loads can be driven independently. For this lab,
we will only use one channel. See the circuit board handout for more details.
Supply connections: In the following, we refer to the two 030 volt supplies available on the
Tektronix power supply. The unit also has a 5 volt supply which we do not use in this lab. The
supplies in the lab have been furnished with jumpers and connected for series operation. Please
keep the supply in this conguration throughout the laboratory. In this mode, the right-hand
voltage control sets the voltage output for both supplies. We operate the amplier with the power
supply set to 17 V. In this lab, do not operate at more than 17 V. As connected, the right-hand
supply provides +Vcc at its positive terminal, and the left-hand supply provides Vcc at its negative
terminal. Common is taken from the jumpered center connections (the negative terminal of the
right-hand supply and/or the positive terminal of the left-hand supply). Note: It is not always a
good idea to tie power supply common to earth ground at the supply chassis. In many cases, the
system earth connection should be located elsewhere. We will discuss this in more detail later in
the course.
2

Left-hand supply

Black

Right-hand supply

Bare
Wire
Common

Vcc

Red
+ Vcc

Figure 1: Amplier/supply connections


The current limits for each supply are set independently, and should be initially adjusted to about
the vertical position. If in testing the constant current (CC) light glows, this means that the current
limit is being reached. If there is not a fault condition, and you are doing testing which requires
the higher current, you may gradually increase the current limit setting on the supply until the CC
light goes out.
When you rst come into the lab, the supply should be o. Set the voltage control knob (right-hand
knob on the face of the supply) to zero, and then power up the supply. Then you can turn the
voltage control to increase the supply voltage to the desired value. When you want to turn o the
amplier, just turn down the voltage control knob to zero. This is much simpler than powering o
the supply, and easier on the supply circuitry, as it avoids turn-on/turn-o transients. Do be sure
to power-o the supply whenever you leave the bench for any signicant amount of time. The lab
supplies should never be left on when the lab is empty. Please check for this at other stations, and
turn o any supplies and scopes at stations which are not being used.
Whenever you are about to turn on the supply, rst adjust both voltage controls to zero. Set the
right-hand meter to monitor voltage. Set the left-hand meter to measure current. Then power up
the supply. At this point you may increase the supply voltage, and watch for any sudden increase
of the supply current. (Occasionally switch the right hand meter to monitor current in that leg
of the supply, then switch back to voltage as you increase the voltage setting.) Also, if in doubt,
connect an oscilloscope to the amplier output, and watch for any oscillations or latching behavior.
If everything looks OK, then you can increase the supply voltage up to the desired 17 volt level.
One nal note: The current loop will not work properly until the power amp supply approximately
exceeds the protoboard supply, due to common-mode limitations of the PA-10 amplier. Watch
out for this when you rst power up the amplier. The amplier should be wired to the supply as
shown in Fig. 1.

Assignments
1. Resistive load: Carefully connect the amplier to the supply as described above. Use a
10 , 25 W power resistor as the load in a non-inverting gain of two connection. The circuit
you build should appear as shown in Fig. 2. The 10k resistors shown are soldered-in on
the amplier board. We have also soldered in a pair of 1 M resistors to provide the input

current of the amplier under conditions where you have not connected its inputs. However
for present purposes, you can simply ignore these resistors. Connect the signal generator
through a BNC connector to the input of the power amplier. The power resistor is provided
for you on the amplier terminal strip.

PA-21
V1

10 k

10 , 25 W

Vs

10 k

Figure 2: Amplier with resistive load. The 10k resistors shown are soldered-in on the amplier
board. The ground connections are made on the terminal strip.
As a rst step, suppose that the PA-10 operates as an ideal innite gain op amp. Further,
suppose that the input in Fig. 2 is a 5V amplitude sine wave at 1000 rad/sec Vs = 5 sin 1000t.
Further assume that the PA-10 is operating from 17 V supplies. In this case, calculate
the voltage V1 (t) and the resulting current Is (t) through the 10 sense resistor Rs . Also
calculate the average power dissipated in the PA-10 and in Rs . How do these values compare
with the rated dissipation of the two devices? Note that your answers will not depend upon
frequency, given the ideal innite gain op amp assumption. Show your calculations.
Next, we want to explore the circuit operation with the model including the PA-10 internal
dynamics, and to predict and measure the closed-loop dynamic response of the amplier as
connected in Fig. 2. Use the data sheet for the PA-10 to determine an appropriate model for
the amplier which matches the data sheet in magnitude and phase as a function of frequency.
Show and explain how your determined this model. Use your model in a block diagram for
the connection to predict the loop crossover frequency, phase margin, and closed-loop stepand frequency-responses. Use 0$7/$% to simulate your system, and plot the expected step
response.
Now in the lab, measure the closed-loop step and frequency responses. Try to explain any
discrepancies between what you predict and what you measure in the lab. In this and sub
sequent sections, be sure that your measurements are small-signal in that the amplier is
responding linearly. In order to test whether you are in this regime, decrease the input signal
amplitude until the output scales linearly with the input. What departures from linearity
can you observe with both step and sine inputs? As one specic, can you observe the eects
of the amplier slew-rate limit? How does this compare with the data-sheet value?
2. Inductive load, voltage drive: Now we will use the amplier to drive an inductive load in
voltage mode as shown in Fig. 3. Each station has an inductor which has been constructed
from a small power transformer. Please keep each device at its original station. Do not move
4

these around between stations! For the greatest consistency, you may want to use the same
station for all your critical tests, but since the inductors are nominally identical, you are free
to use other stations and assume the inductors are matched. The purpose of this portion

PA-21
+

Inductor
V2

V1

10 k

10 , 25 W

Vs

10 k

Figure 3: Amplier with inductive load.


of the lab is to develop an electrical model for the inductor which can be used to design a
closed-loop current-controlled system. Specically, in this section, we would like to measure
the transfer function from V1 to V2 as a function of frequency. This transfer function is then
embedded in the current-controlled loop described in the next section.
The inductors we are using are made by cutting the excess leads o some small power trans
formers. Since these transformers have an iron core with no air gaps, they thus provide a large
inductance in a relatively small volume. However, they also thus begin to show saturation
eects at relatively low currents. To stay in the linear mode of operation, you will need to
keep the currents on the order of 0.1 A maximum. However, the nonlinear behavior of these
devices at high currents allows us to observe the eect of nonlinear elements on the stability
of a feedback loop. It is quite common to encounter such nonlinear devices in practice.
At higher current levels, the steel in the transformer core begins to saturate, and thus the
incremental inductance of the device drops at higher bias currents. We will ask you to measure
this eect at a bias current of 0.5 A and at a bias current of 0 A.
As a start, use the multimeter to measure the coil resistance of your inductor. Also measure
the resistance of the 25W power resistor you used in the previous section. These resistances
become part of a model for the coil shown in Fig. 3. To complete the model, we need to
measure the coil inductance. This can be done by measuring the step response from V1 to V2 .
The time constant of this response, in combination with the resistances measured earlier
yields an estimate of the coil inductance L. Measure the step response for a 0.1 A step on top
of a 0 A bias and on top of a 0.5 A bias. Use the DC oset control on the signal generator
to set the bias current level to the desired value. What estimate of L do you get at the two
bias levels?
Another way to model the system is to measure the transfer function from V1 to V2 as a
function of frequency. Please measure this transfer function at about 30 points between 10
Hz and 1 MHz, at both 0 A and 0.5 A bias currents. You can greatly ease this measurement
by using the automated amplitude and phase measurements on the scope. Just be careful
that the scope has a clean enough waveform that the data is meaningful! That is, adjust
5

2
3

+15 V
7 0.1 uf

LM741
+
4

PA-21
+

Inductor
V2

V1

0.1 uf

-15 V

Vs

L
10 k

R
15 , 25 W
or
10 , 25 W

10 k

Figure 4: Closed-loop current controlled amplier.


the vertical amplier gain and horizontal time base to expand the relevant portion of the
waveform to use a large fraction of the screen. The scope is only accurate when the wave
form is scaled properly. (It is also quite helpful here to trigger the scope on the wavegen, via
the trigger source menu. Also, you should use averaging mode to reduce the measurement
noise in order to get a more solid measurement.) Does this transfer function look like what
you would predict on the basis of the simple model developed above? How does the model
vary with bias level? What discrepancies do you note? Try to explain these.
3. Current controlled amplier: In this section, we combine the power op amp with a 741
amplier to yield a closed-loop control system which controls the voltage on the 25 W power
resistor, and thus controls the current through the load inductance (to the extent that the
resistor is ideal). The topology of the circuit is shown in Fig. 4. Here the 741 is to be built on
the protoboard and powered from the 15 V protoboard supplies. The supply connections
are shown on the circuit diagram. Be sure to include bypass capacitors on each supply pin in
close proximity to the op amp chip.
Use the model of the inductor that you developed in the previous section at 0 A bias to
choose components of the control amplier to ll in the boxes in Fig. 4. Specically for your
measured inductance, design the control amplier to stabilize the loop with a 1000 rad/sec
crossover frequency and at least 60 degrees of phase margin. Design your amplier so that 10
volts input yields 0.7 amps coil current at low frequencies. The controller must also include
an integral term so as to have high accuracy at low frequencies. Include in your report a
block diagram showing the transfer functions of the key dynamic elements in the loop. For
your design, sketch a root-locus plot showing how the closed-loop poles move as the control
amplier gain is varied. Also, sketch Bode plots of the negative of the loop transmission, and
indicate on these the loop crossover frequency, phase margin, and gain margin. Although
you are welcome to use 0$7/$% for these calculations, please rst sketch the plots by hand.
(Hint: With respect to the practical world, in order to prevent high-frequency oscillations,

be sure that the control amplier gain falls o at least as 1/ at high frequencies, i.e. for
frequencies well above crossover. Whenever you power up a new circuit, always use a scope
to check for the presence of such oscillations, and be sure to eliminate them before proceding
with the measurements in this lab. An oscillating amplier will yield aky results at best,
and may smoke itself and/or your load at worst.)
Choose your design values for the 0 A bias condition. Then, in the lab, verify the performance
at 0 A bias. Predict and measure the closed-loop step and frequency responses.
Then also use the model you developed earlier to predict the step and frequency responses at
0.5 A bias. Then measure these in the lab. How does saturation of the magnetics aect the
stability of your feedback loop?
In making the measurements above, it is important that the system is again behaving in a
small-signal fashion. Specically, make sure that the steps are small enough that neither
of the amplier outputs is hitting the supply rails. What happens when the ampliers are
allowed to saturate? Also, note that the 741 control amplier output is the control eort,
which his usually an important signal to monitor in all control loops.

For all of the above measurements, store interesting data from the scope output, and include in
your report.
Extra Credit: Absolutely not required, but if you have the time, assume that the closed-loop
current control system of Fig. 4 is driven with a 5V amplitude sine wave at 1000 rad/sec as
Vs = 5 sin 1000t. Further assume that the PA-10 is operating from 17 V supplies. In this case,
calculate the voltages V1 (t), V2 (t), and the resulting current Is (t) through the 10 sense resistor
Rs . Also calculate the average power dissipated in the PA-10 and in Rs . You should note that the
inductive load causes more dissipation in the power amplier than when driving a purely resistive
load. This issue should be addressed as part of determining compliance with the safe operating
area specications of the power amplier. See the data sheet for further discussion.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Mechatronics
Laboratory Assignment 3: Electronic Scale
Assigned: 10/14/14
Pre-lab due: Friday 10/17/14 online by 5pm
Reports due: Thursday/Friday 10/2310/24/14 in checkos

Overview

In this lab you will design and implement circuitry for interfacing with an electronic scale using
an instrumentation amplier and precision voltage reference. The scale is based upon a beam with
bonded foil strain gages in a full-bridge conguration. The instrumentation amplier is used to
amplify the millivolt range bridge output voltages up to the range of volts for interfacing with
the myRIO A/D convertor. You will also look at the measurement of signals in the presence of
common-mode voltage disturbances.

Prelab and Lab Reports

Your prelab calculations are due in a prelab report to be submitted by 5pm on Friday 10/17. For
the prelab, please complete all the requested modeling, preliminary measurements, circuit design
parameter choices, etc. You will need to make a copy to give to us, and keep your original to support
the lab portion of the assignment. You may submit these online, or in the ling cabinet in the lab.
It is not permitted to look at other students prelab reports in the ling cabinet.
The lab report should clearly document your experimental work, predictions, results, and a com
parison between these, with explanations of observed phenomena and discrepancies. Be sure to
show us your understanding of the lab and design experiences. No formal lab report structure is
required. The lab report is due at the time of your checko. Please also include the prelab copy
with this report. These must be submitted in paper format at the checko.
You will also schedule a lab checko with the sta during 11/2324. In this checko, you will
need to be able to discuss your design process, calculations, and experimental results. We are
particularly interested in how you have used the experimental results to understand the ways in
which the system matches predictions and the ways in which it departs from modeled behavior.
Come to lab well ahead of your checko time so that you can get set up and have your system
running at the start of checko.

Scale Interface Circuit

The scale mechanism uses a full-bridge strain gage circuit attached to a beam which supports the
scale weighing platform. The circuit used for interfacing with the electronic scale is shown below
in Fig. 1. Note that in this circuit, we use the letter S to indicate the myRIO board common,
and the letter B to indicate the common for the strain gage bridge. This bridge common is driven
by the signal generator to create an articial common-mode disturbance, which is reected in the
common-mode of the bridge output voltages.
The scale is rated for about 3 kg maximum load. Do not apply any loads higher than 3 kg as they
may damage the scale mechanism.
The full-bridge circuit uses four active strain gages congured as shown below in Fig. 2. The change
in resistance is given by R = R G.F. E, where R is the nominal no-strain gage resistance, E is the
strain, and G.F. is the gage factor. For metal foil strain gages, the gage factor is typically in the
range of 25. Since our strain gage beam is taken from a commercial electronic scale, we are not
given the gage factor or the gage resistance. We also do not know the relationship between strain
and weight on the scale. We will experimentally determine the relationship between weight and
bridge output voltage. Note also that in this simple model we are ignoring the eect of temperature
on the gage resistance.
Note that the reference voltage is applied between terminals A and B, and the bridge output voltage
is taken between terminals C and D, as indicated in the gure.

Prelab
1. Bridge resistance: Assume zero strain, and thus R = 0. In this condition, calculate the
value of resistance measured: 1) between terminals A and C, 2) between terminals A and D?
In the lab, use a multimeter to measure the resistance between these terminals. What is the
nominal bridge resistance R?
2. Bridge output voltage: Write an expression for the bridge output voltage vb given a 10
volt reference input, and assuming that the gage factor G.F. is and unknown variable This
expression should also be in terms of the nominal bridge resistance R and strain E.
3. Measured circuit output: Now build just the reference voltage portion of the circuit, and
ground the disturbance input terminal, i.e. dont connect the signal generator. Attach the
scale cable to your circuit board and wire the reference circuit to the scale. Use the multimeter
to measure the bridge voltage as a function of weight on the scale for several weights varying
from zero to 2 kg. Write an expression for a linear model relationship between weight and
output voltage.
4. Dierential amplier design: Using your measurements above, choose Rg so as to give
9 V output from the LT1167 to the A/D convertor for 2 kg load on the scale. Show your
calculations.

Common Mode
Disturbance
Signal
Generator

+15 V

50k

+15 V

-15 V

50k

10k
25 turns

1k
47

LT 1021

Reference
Voltage

S
-15 V

741

.1uF

.1uF

B (bridge common)

red

.1 uF

green

LT 1167

-15 V

Offset Adjustment

Rg

white

Figure 1: Scale interface circuitry

.1uF

+15 V

+
10V
-

black

+15 V

.1uF

.1uF

R1

C1

Is bridge common, as
disturbed by signal
generator

Is board common

A/D

Figure 2: Full bridge circuit conguration.


5. Low pass lter: Design the low pass lter to have a breakpoint at about 50 Hz. Choose
practical values of R1 and C1 .
6. Common-mode rejection: Assume the nominal LT1167 Common-Mode Rejection Ratio
(CMRR) versus frequency frequency response plot shown at the top of page 9 of the data
sheet. Note that you will need to pick a curve appropriate to the gain value selected above.
With respect to the scale circuit of Fig. 1, further assume that the signal generator input is a
10 volt square wave. What is the predicted output versus time of the LT1167 amplier under
these conditions? You may assume that the 10 V reference has perfect power supply rejection
ratio. That is, you may assume that the 10 V reference maintains exactly 10 V despite the
common mode disturbance driven by the signal generator. What we are looking for here is
the predicted step response of the amplier circuit to the common-mode disturbance. Note
that you will need to t a dynamic model using the data given in the data sheet. Also note
that the common-mode rejection ratio drops with increasing frequency, that is, the rejection
is worse at higher frequencies. Your dynamic model will need to take this into account. Show
your thinking and relevant calculations.

Lab exercises
1. Circuit construction: Build the circuit with the values selected in the prelab. Interface to
the myRIO using the provided VI. Adjust the oset potentiometer so that the LT1167 output
voltage is zero with no load. How close is your selected LT1167 gain value from the prelab,
i.e., how close is the LT1167 output to 9 V for 2 kg load? Adjust the scale factor in the VI
so that the measured weight is accurately displayed. With this calibration, check the output
versus weight for a number of dierent weights between 0 and 2 kg. What is the maximum
percent deviation from linearity of your scale system?
2. Scale dynamics: Display the LT1167 output on the scope, i.e., the voltage before low pass
ltering. Conduct experiments to determine the natural frequency of the scale/weight system
4

as a function of the weight on the scale platform. Note that you will need to be careful to
conduct the experiments so that the relevant mode is clearly seen, as there are many other
possible modes. We have found it helpful to use a soft hammer like a rubber eraser block
on the end of a pencil so that high frequencies are not inordinately excited. On the basis of
your experiments, determine: 1) the scale platform stiness [N/m], and 2) the scale platform
no-load mass [kg]. Include relevant measured responses and show your thinking.
3. Common-mode rejection using scope: Connect two 10x scope probes to the bridge
terminals C and D. Connect the signal generator to drive the common-mode disturbance
input. Use a 5 V square wave from the signal generator to drive the resistive voltage divider
which drives the bridge common. How large a disturbance does this induce on the bridge
common? How is this reected into the scope measured voltages on C and D? Congure the
scope to subtract the two probe voltages. Can you see the eect of weight on dierential
scope voltage? With what resolution?
4. Common-mode rejection using LT1167: Connect a 1x scope probe (i.e., BNC cable) to
the output of the LT1167. Now drive the common-mode bridge voltage using a 5 V square
wave from the signal generator as before. What is the response observed at the output of the
LT1167? How does this response compare with what you predicted in the prelab? Note that
you will need to use the actual common mode voltage at the output of the resistive divider
to compare with the rejection of the LT1167. How are the frequency-dependent dynamics
reected in this response?
5. Minimum resolution: What is the smallest weight dierence that you can measure? Show
us your approach and explain how you got the results.
6. Optional: Completely optional: Note that as congured we are only using the positive
voltage range of the myRIO A/D converter. This throws away half the A/D resolution, since
the negative range is unused. If you have time, recongure your circuit to use the full 10 V
range of the A/D converter. Explain your approach and show us relevant results.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

2.737 Mechatronics
Laboratory Assignment 4: AC-Driven and Demodulated Electronic
Scale
Assigned: 10/28/14
Pre-lab due: No prelab
Reports due: Monday 11/3 in checkos; no lecture that day

Overview

In this lab you will implement an electronic scale using AC excitation and demodulation. That
is, you will use the myRIO to generate a sine wave which provides the reference voltage for the
strain gage bridge. With this sinusoidal drive, the bridge common-mode and dierential voltages
are also sinusoidal; the bridge imbalance which represents weight is then reected in the sinusoidal
dierential bridge output voltage. The conguration for this experiment is shown below in Fig. 1.
As shown in the gure, the myRIO is used to generate a sinusoidal drive at about 50 Hz and outputs
this sine wave through a D/A converter to drive the bridge reference voltage. A 741 op amp is
used as a buer to drive the bridge current. Note that no precision DC reference is required, since
the bridge is directly driven by the D/A, which provides the AC signal. Note that all the circuit
elements are referenced to a single common S; there is no common disturbance in this circuit as
there was in Lab 3.
As before, an LT1167 dierential amplier is used to amplify the sinusoidal bridge output. You
may optionally design an oset adjustment circuit to null this imbalance in the modulated domain.
The amplied bridge output is input to the myRIO A/D converter to yield a measurement in
the modulated domain. This measurement is then demodulated to yield estimates of the signal
, the signal phase , and the corresponding weight W
.
magnitude M

Prelab and Lab Reports

Note that no prelab is required. The lab report is due at the time of your checkos on Monday
11/3. This lab is not tightly specied as to how you solve the demodulation problem. Also, you will
need to write your own Labview code to implement the required functions. Be sure to document
your approach, including relevant calculations.

Lab exercises
1. System operating theory: Construct a model for the propagation of signals through the
system. Use any relevant results from Lab 3 to help with this analysis. Choose A such that
the bridge is driven with a 10 V sine wave. What gain do you select for the dierential
amplier? Why? This model should represent the bridge as a resistive imbalance which
1

Figure 1: AC-driven and demodulated electronic scale circuit conguration.


depends upon the applied weight. Show how this imbalance propagates into the measured
signal M cos(t + ). Stray circuit elements and the eect of sampling will result in a non
zero phase shift . You will not be able to predict this value ahead of time, but will need to
be able to accommodate such a phase shift, which will be determined experimentally. Also
recognize that each scale has a dierent amount of imbalance at zero weight. You will need
to include this imbalance in your model. Note that this imbalance results in a non-zero
sinusoidal component of the output at zero weight.
2. Oset correction circuit (optional): You may optionally design a circuit to allow ad
justment of the scale zero-weight oset. That is, come up with a circuit connection which
allows nulling of the zero-weight oset while still in the modulated domain. That is, you will
need to null the sinusoidal output associated with zero weight. Explain your approach and
present an analysis of how it operates. Plan to demonstrate for the sta that you can adjust
the oset to positive and negative values around zero, and to explain your approach. If you
choose not to design this nulling circuit, you will at least need to subtract the scale oset
2

with an adjustment within Labview in the demodulated domain.


3. Demodulation and Estimates: Design a demodulation algorithm to be implemented on
, the signal phase , and
the myRIO, and which yields estimates of the signal magnitude M

the corresponding weight W . Create an analysis which explains the theory for how this
demodulation works, and how you develop the relevant estimates. Show how the weight
reects through the bridge imbalance into the estimates, and how you will make the weight
estimate accurate. Note that you may not assume that = 0, but must handle the general
case where = 0. You must also provide an adjustable weight oset to allow nulling of the
zero-load weight estimate (tare).
4. Experimental Implementation: Create a Labview VI to run on the myRIO and which
implements the AC system. We suggest that you run at a carrier frequency of 50 Hz, and
a sampling rate as high as allowed by the numerical capability of the myRIO. You are free
to try other frequencies to see the eect on the circuit operation. Your VI should include
graphical displays of interesting relevant waveforms including the three estimates, as well as
numerical displays of the three estimates. Run this system in the lab, and measure the scale
output for a number of dierent weights. What is the linearity of your measurement? Note
that linearity is dened in terms of the error as a percent of full-scale reading.
5. Challenge question: Can your system measure the scale dynamic resonant response as we
did in Lab 3? Why or why not? How could this be measured?

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Laboratory Assignment 5
Digital Velocity and Position control of a D.C. motor
2.737 Mechatronics
Dept. of Mechanical Engineering
Massachusetts Institute of Technology
Cambridge, MA-02139

1 Topics
Motor modeling
Proportional, PI velocity control
Implementation of Anti-Windup
Proportional position control
Lead-Lag compensation
Velocity minor loop / Position major loop

2 Equipment
PC 486 with ATMIO-16 card
Oscilloscope
Function generator
D.C. motor
Power amplier
Protoboard

3 Introduction
In this laboratory, digital control of a D.C. motor will be studied. Each station is equipped with a
D.C. motor (with an integral tachometer to measure angular velocity), a single turn potentiometer
to measure angular position and a power amplier to drive the motor. First, we will develop a model
for the motor. This model will then be used to perform velocity and position control experiments
on the motor. For the purpose of this lab, controller design will be done using continuous time
methods. Discrete time controllers will be obtained from these by using either backward difference
or ZOH equivalents.
Initial experiments will focus on velocity control. A proportional controller will be implemented
rst. Resulting steady state errors are observed and the effect of increasing gain on steady state
error is seen. This is followed by implementation of a PI controller to remove steady state errors in
response to a step input. Problems with integral windup are observed and an anti-windup scheme
is implemented. Next, step and frequency response specications are met by designing a controller

in MATLAB and implementing it.


Next, position control of a D.C. motor will be studied. Initially, a proportional controller will be
implemented. The effect of increased gain on servo stiffness is observed. Lead-Lag compensators
are designed using MATLAB and implemented on the actual hardware and the performance studied.
Finally, a velocity minor loop/position major loop controller will be implemented. Proportional
gains for both loops are selected based on frequency domain criteria. Note that the structure of the
controller is much like that in state feedback control with velocity and position as state variables.

4 D.C. Motor model


Each station has a D.C. motor and a power amplier. Please follow a few precautions before
powering up your setup. The power supply to the power amplier is from the same Tektronix
supply that you used in lab 4. Make sure that the power supply is operated in series as in lab 4 and
that the current limit on both supplies (both positive and negative) is set to the maximum. Also, the
voltage rails to the power amplier should not exceed 17 volts. A good practice would be to turn
the master voltage knob all the way to zero before switching the power supply on and then slowly
bring it up to 15 volts. Note that as in lab 4, exceeding the voltage rails specied could damage the
power amplier. Please exercise caution.
The D.C. motor has a tachometer to measure velocity and a potentiometer to measure angular
position. The motor parameters are :

R
L
) e
KT
J
Ktach
Kpot

7:5
5:55mH

L 0:7ms
R
0:024Nm/A
1:5 10;5 Kgm2 (referred to motor shaft)
0:023V/rad/sec
0:53V/rad (of motor)
2

36
216
6
JR 200ms
) m
KT2
1
!m
)
Vm
KT (m s + 1)

No. of teeth on pinion


No. of teeth on driven gear
Gearing ratio, N

(1)

An appropriate connection of the motor setup is shown in Figure 1. For the purposes of this lab,
the reference signal r will be generated by the function generator in some sections. Connect the
function generator to AD channel 0, the tachometer signal to AD channel 1 ,and the potentiometer
signal to AD channel 2. Also, compute the control output u and send it out on DA channel 0 to the
input of the power amplifer.
Please make sure the potentiometer is wired correctly to operate at 10 Volts. To do this, we
will use the 15 Volt power source from the protoboard, and use a pair of resistors to reduce the
voltage to 10 Volts. The typical value of the potentiometer resistance is about 4:7k, the pair of
additional resistors can be chosen as 1:2k . (Be very careful, dont connect the wiper to any other
voltage source or ground, the short circuit between the wiper and 10 Volts during wrap-around
will damage the potentiometer permanently.)

DA ch0

power amplifier

10k

10k

pinion

tachometer

AD ch1

CCW
1.2k
wiper

AD ch2
+15V
AD ch0

DC motor

-15V

flywheel

1.2k

CW

function
generator

potentiometer
built-in resistor

Figure 1: The connection for the DC motor setup

gear

5 Velocity control
We will use the motor model developed in the previous section for implementing velocity control
of the D.C. motor. The tachometer output is used to implement feedback. Remember to include the
amplier and tachometer gain when designing the controller. First, we will implement the simplest
controller, i.e., Proportional control. We will observe the effects of gain and sampling time on the
step response of the motor.
Next, we will implement PI control which removes the steady state errors (to a step input)
that were present with a proportional controller. The block diagram of the motor-controller setup
implementing a PI controller is given in Figure 2.

Ti s + 1
p

Ka

Kt

Ti s

1
ms + 1

y
K tach

Figure 2: PI velocity control of the DC motor

5.1

Controller Design

A proportional controller is given by

D(s) Kp

while a PI controller is given by

D(s) Kp

Kp

1+

(2)

Ts

T s +i 1
i

Tis

(3)

The proportional gain Kp and the integral or reset time Ti are chosen to meet specications on
the response. For the purpose of this lab, we will design controllers based on step and frequency
response specications. Also, we will implement all controllers with a sampling interval of 1 ms
which is fast enough for implementation of digital controllers by emulating analog designs for the
D.C. motor under consideration.

5.2

Controller Implementation

The command signal for a PI controller using a backward difference scheme is given by

u(k) Kpe(k) + S2 (k ; 1) + KTpTs e(k)

where

Kp
Ti
Ts
S2(k)
C

(4)

Proportional gain
Reset time
Sampling interval
S2 (k ; 1) + Ce(k)
KTpTs
i

Collecting terms,

u(k) Ae(k) + S2 (k ; 1)

(5)

where

A Kp + KTpTs :
i

The values A and C can be precomputed. A code fragment to implement the controller in an
interrupt service routine is then given by
ad = adin (1);
error = ref - ad;
command = A*error + sum;
daout (0, command);
sum += C*error;
The above code fragment implements the basic PI scheme without any anti-windup measures.
Note that you can also use the ZOH equivalent to implement the digital controller. To nd the ZOH
equivalent of the controller, use the c2dm (num, den, ts, zoh) command in MATLAB.
This will give you the polynomial to implement the difference equation for your controller.
Note that the presence of an integrator in your control law can lead to Integrator windup. This
can be noticed if you cause the error to accumulate in spite of saturation of the actuators. The
integrating action of the controller keeps accumulating the error and leads to large overshoots. You
can observe this by doing PI control of the motor and holding the ywheel with your hand. Be
careful not to get yourself hurt while doing this (i.e., Keep your ngers out of the gear mesh). When
you nally release the ywheel, you should be able to see a rather large overshoot. For the purpose
of observing windup, generate the step reference at the computer itself rather than using the signal
generator. Look at the program expt5_1.c for an example. Note that the size of the overshoot is
dependent on the time for which you hold the ywheel stationary ! You can implement anti-windup
measures very easily by turning off the integrator when the actuators saturate (in our case - when
the control output exceeds the 10 volts range). Please add anti-windup to your controller and
show us the difference with and without this term.
5

6 Position control
Position control is in some sense more difcult than velocity control, because you can cause the
system to go unstable rather easily due to the presence of the additional integrator in the transfer
function. To implement position control, feedback is from the potentiometer. The potentiometer
is a one-turn potentiometer with its output varying from ;10 to +10 volts. There is a wrap around
at either end of the range. What happens if you try to run through this wrap-around?
Remember to include the speed reducer gain in your model for the position control problem.
Note that the motor angle is ;6 times the potentiometer angle, which is what you measure. In your
model, please refer all elements to the motor shaft.

6.1

Controller Design

A proportional controller is given by

D(s) Kp

(6)

and is implemented in the same manner as for velocity control.


Lead lag compensators are designed and implemented to provide better control. A lead compensator is given by
+ za ; p > z
(7)
D(s) Klead ss +
pa a a
A lag compensator is given by

+ zb ; p < z
D(s) Klag ss +
p b b

(8)

A lead-lag compensator is then given by


2
+ zb )s + za zb
D(s) Klead Klag ss2 ++ ((pza +
p )s + p p

a b

(9)

Compensator parameters are chosen to satisfy the system requirements. And the corresponding
discrete-time controller can obtained using the methods described earlier. Note that the pole pb is
sometimes placed at s 0 to perform as an integrator.

6.2

Controller Implementation

The controller is implemented in a similar way as for velocity control. Notice the effect of increasing
gain on the servo stiffness. Also, notice the effect of the integral term when you implement the
lead-lag compensator. Do you see chatter ?

7 State feedback
Having implemented both position and velocity feedback, we can now combine both to implement
state feedback. We consider the problem of controlling the position of the motor shaft with both
position and velocity feedback as shown in Figure 3. We saw that proportional control by itself led to
6

very poor performance due to the negligible amount of damping in the system. Lead compensation
was used to add damping to the system - adding derivative control has the same effect. In fact, PD
control can be seen as an extreme form of lead compensation. However, we observed chatter (on
some of the setups at least) when performing lead and lead-lag compensation.

+
-

K pos

Ka
-

K vel

s
Kt m + 1

K tach

K pot

Figure 3: Velocity minor loop Position major loop


With velocity feedback however, we use the tachometer to obtain the derivative of the position,
i.e., velocity instead of physically differentiating the output position. Note that differentiation
amplies noise effects. The presence of backlash in the gears leads to chatter. Velocity feedback
however, leads to an increased damping ratio without affecting the undamped natural frequency of
the system and hence leads to better control performance. A similar controller can also be designed
using pole placement techniques (see the MATLAB functions ackerand place) for a state variable
model.
We will implement this with a velocity minor loop and a position major loop. The velocity
minor loop is usually designed with a crossover on the order of 3 to 10 times higher in frequency
than the position loop.

8 Laboratory procedure
1. Some programs for use in this lab are in the directory c:\courses\2.737\lab5.
Change to this directory and run the program expt5_1.c. This implements proportional
velocity control of the D.C. motor. The program accepts a proportional gain input by the
user. Run the program for different value of proportional gain and observe the effects on
steady state error. Use a sampling interval of 1 ms. Suggested proportional gain values range
from 1 to 20.
2. Design a proportional controller for closed loop system time constant  = 50 ms in
MATLAB (Be sure to include the power amplier gain in your model) and implement it.
Collect step response data and compare it with the predicted step response in MATLAB.
Use the program expt5_1.c to implement your controller. Note that the tachometer
voltage has a lot of
7

ripple on it which is not predicted by MATLAB. These are not oscillations due to your
controller, they are due to the tachometer itself !
3. Design a PI controller for
 0:5
!n 30
Again, compare with MATLAB. Initially write your program and make your hardware connections such that the program generates a reference voltage on the same lines of expt5_1.c.
It might help to make a copy of the program expt5_1.c in your directory and modify it.
Hold the ywheel with your hand and notice the large overshoots when you release it. Implement anti-windup measures as suggested and run the program. Again, hold the ywheel
with your hand. Notice the greatly improved performance. Explain the difference.
4. Design a PI controller for
Mp < 30%
!n 50
Write your program and make your hardware connections such that the reference is generated
by the function generator rather than by the computer. Collect step response data and compare
with MATLAB predictions. Measure the rise time. Does this match your predictions ?
5. Run the program expt5_2.c. This implements proportional position control of the D.C.
motor. Use a step reference of 1 volt. Suggested values of gain range from 0.5 to 5 and
sample intervals range from 1 to 5 milliseconds. Note the effect of increasing gain on
the stiffness of the potentiometer shaft. Also, note the large overshoot that you get with
pure proportional control. Remember that the inclusion of another integral in your position
transfer function dropped your phase by 90 degrees and increasing gain leads to decreased
phase margin leading to increased overshoots ! Note when the servo becomes unstable. Be
sure not to confuse wrap-around of the potentiometer with stability of the servo.
6. We see that pure proportional control leads to poor control performance of the motor due
to the large overshoots. Hence, lead compensation is called for. First design a proportional
controller to obtain 45 degrees of phase margin. Notice that the proportional gain to implement such a controller comes out to be very low. Implementation of the controller reveals
that there is virtually no response from the motor. Why ? Consider nonlinearities such as
friction, stick-slip etc.
Now, consider using a lead compensator. Design a lead compensator to obtain a crossover
frequency of 30 rad/s and a phase margin of 45 degrees. Implement this controller and
record the step response. Compare the performance of this compensator with that of a pure
proportional controller.
7. We would like to drive the error to zero in the presence of steady torque disturbances. This
can be accomplished by using a lead-lag compensator. Design a lead-lag compensator (set
the lag pole at zero to obtain an integrator) to obtain a crossover frequency of 30 rad/s and
a phase margin of 45 degrees. Try rotating the potentiometer shaft away from the reference
point manually. Notice the restoring torque of the servo increase with time. This is caused by
the integrating action of the compensator. Record the step response. Can you see the rather
8

large overshoots caused by integral windup ? Implement anti-windup measures as discussed


for PI velocity control and record step responses. Comment on the differences.
8. Design a velocity minor loop with a crossover of 300 rad/s and a positon major loop with a
crossover of 60 rad/s. Find out the gains Kpos and Kvel to implement the controller. Again
compare with MATLAB and record step response.

MIT OpenCourseWare
http://ocw.mit.edu

2.737 Mechatronics
Fall 2014

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Você também pode gostar