Click on the files
link to get started browsing the most recent manifest. The "raw"
links let you download a revision of each file rather than viewing
it on-line.

Use one of the bz2,
zip,
or gz
links to download an archive of the most recent revision of the
source.

You can use Mercurial
to "clone" the entire repository onto your own machine. You can
"pull" updates later as they are posted.

You can subscribe to the RSS or
Atom
feeds to be notified of changes that are made.

LICENSING AND REUSE: Unless
otherwise expressly stated, all original material of whatever nature
created by Theodore P. Pavlic and included in this website and
any related pages, including its archives, is protected by copyright
and licensed under a Creative Commons
Attribution-Noncommercial 3.0 United States License ("CCPL"). Use
of this website is expressly conditioned upon the user’s
acceptance of the terms and provisions of the CCPL. Use of this site
and any of the materials thereon constitutes acceptance of the CCPL
by the user.

ECE557_Lab1.zip –
Contains the "Black Box" from class
If you use it at home, make sure all contents are in the same
directory as your own files. Also make sure that directory is
MATLAB’s current working directory. In
particular:

Unzip its contents into your MATLAB working
directory.

Type simulink to start Simulink.

If the contents are in the working directory, Simulink
should show an ECE557 in its library browser.

Drag the "Black Box" block onto your own Simulink
models for testing (e.g., find the "Scope" in the "Sinks"
menu).

It’s critical that you use a "Fixed-step"
duration in your Simulation/Configuration parameters (i.e.,
follow setup instructions from book).

The book likes to do a lot of copying. There is
no need to copy the whole file structure into v if
you don’t want to. Additionally, those
getfield calls are not necessary because
Data is a simple field name. So an alternative is:

Initial and Final Value Theorems (includes
straightforward proofs) – The maximum control
effort (i.e., initial value of the
r-to-u system under the desired input
signal r) and steady-state error (i.e., the
final value of the r-to-e
system under the desired input signal r) can be
found using these theorems. For a step inputs of size
A (i.e., r(t) = Au(t) and r(s) =
A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e.,
the steady-state error formula) only holds if the
time-domain limit exists (i.e., if all
closed-loop poles are either on the left-hand
side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step
inputs in the lab, the initial u(0) observed in
our experiments will be zero because the input looks more
like a steeply sloped ramp than a step.

Initial and Final Value Theorems (includes
straightforward proofs) – The maximum control
effort (i.e., initial value of the
r-to-u system under the desired input
signal r) and steady-state error (i.e., the
final value of the r-to-e
system under the desired input signal r) can be
found using these theorems. For a step inputs of size
A (i.e., r(t) = Au(t) and r(s) =
A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e.,
the steady-state error formula) only holds if the
time-domain limit exists (i.e., if all
closed-loop poles are either on the left-hand
side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step
inputs in the lab, the initial u(0) observed in
our experiments will be zero because the input looks more
like a steeply sloped ramp than a step.

ECE 209: Operational
Amplifier Basics – Shows how operational
amplifier’s magic results from high-gain negative
feedback. In reality, operational amplifier acts like
high-gain integrator with at least two other very high
frequency poles. As a consequence, internal or external lag
compensation is often required.

cl_bode_plots.m –
This MATLAB script is not used to generate any of
the graphics in the document. It was used as a prototype
for some of the PSTricks-generated
graphics. It shows closed-loop Bode plots, impulse
responses, and step responses for different open-loop
gains. The code could be simplified (e.g., using
loglog, abs, impulse, etc.), but
its implementation was meant to mirror the implementation
used within the document’s source. Additionally, its
"rawness" should hopefully help verify the mathematics to
the student.

Initial and Final Value Theorems (includes
straightforward proofs) – The maximum control
effort (i.e., initial value of the
r-to-u system under the desired input
signal r) and steady-state error (i.e., the
final value of the r-to-e
system under the desired input signal r) can be
found using these theorems. For a step inputs of size
A (i.e., r(t) = Au(t) and r(s) =
A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e.,
the steady-state error formula) only holds if the
time-domain limit exists (i.e., if all
closed-loop poles are either on the left-hand
side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step
inputs in the lab, the initial u(0) observed in
our experiments will be zero because the input looks more
like a steeply sloped ramp than a step.

The Simulink diagram we used in our implementation in
class is significantly different than what you
used in your pre-lab. In your post-lab analysis, it is a
good idea to replace your pre-lab PID implementation with
the implementation we used in class (i.e., add the
derivative filter and take the derivative’s input
from the output and not the error).

Alternatively, as long as you kept K_p ≤
5, you can use the SISO tools. In the
following, change plant_num and
plant_den so that plant matches the
model (try using both the book’s model and my
slower model and see which one matches better).

Initial and Final Value Theorems (includes
straightforward proofs) – The maximum control
effort (i.e., initial value of the
r-to-u system under the desired input
signal r) and steady-state error (i.e., the
final value of the r-to-e
system under the desired input signal r) can be
found using these theorems. For a step inputs of size
A (i.e., r(t) = Au(t) and r(s) =
A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e.,
the steady-state error formula) only holds if the
time-domain limit exists (i.e., if all
closed-loop poles are either on the left-hand
side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step
inputs in the lab, the initial u(0) observed in
our experiments will be zero because the input looks more
like a steeply sloped ramp than a step.

Initial and Final Value Theorems (includes
straightforward proofs) – The maximum control
effort (i.e., initial value of the
r-to-u system under the desired input
signal r) and steady-state error (i.e., the
final value of the r-to-e
system under the desired input signal r) can be
found using these theorems. For a step inputs of size
A (i.e., r(t) = Au(t) and r(s) =
A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e.,
the steady-state error formula) only holds if the
time-domain limit exists (i.e., if all
closed-loop poles are either on the left-hand
side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step
inputs in the lab, the initial u(0) observed in
our experiments will be zero because the input looks more
like a steeply sloped ramp than a step.

Initial and Final Value Theorems (includes straightforward
proofs) – The maximum control effort (i.e.,
initial value of the r-to-u system
under the desired input signal r) and steady-state error
(i.e., the final value of the r-to-e
system under the desired input signal r) can be found
using these theorems. For a step inputs of size A (i.e.,
r(t) = Au(t) and
r(s) = A/s), the initial

u(0) = AGcompensator(∞)/(1+Gcompensator(∞)
Gplant(∞)),

and the steady-state error

ess = e(∞) =
A/(1+Gcompensator(0)
Gplant(0)).

Remember that the final value theorem (i.e., the
steady-state error formula) only holds if the time-domain limit
exists (i.e., if all closed-loop poles are either on the
left-hand side of the plane or are at s = 0). Also note
that because we use a rate limiter on the step inputs in
the lab, the initial u(0) observed in our experiments
will be zero because the input looks more like a steeply sloped
ramp than a step.

Engineers are not scientists in the
traditional sense. Scientists generate knowledge about the
natural world
by observing natural phenomena (in fact, the word
"science" comes from the Latin for "knowledge" or "knowing").
Engineers use that
knowledge to generate new technologies that aid in human
activities, but they are rarely concerned with generating new
knowledge about the natural world. Instead, engineers
generate knowledge about their own creations. While the
subject matter is different, the method behind the
generation of knowledge is identical. That is, engineers are
"technoscientists"; they use the scientific
method to generate knowledge about technology.

In the engineering laboratory, you should
practice all of the steps of the scientific
method. In particular,

Define the question (e.g., "How does a certain filter
respond to a generic input signal?")

Interpret data and draw conclusions that serve as starting
point for new hypothesis (e.g., compare measured and expected
responses and draw the conclusion that the theoretical model
matches the qualitative low-pass behavior of the
system but matches poorly in the neighborhood of the corner
frequency. Suggest that cable resistance or component
tolerances may have changed the effective corner frequency.
Suggest a new experiment that measures cable resistance and
repeats trials over several components with tight
tolerances)

Publish results (e.g., submit your lab report)

Retest (e.g., assume that others will read and respond to
your published report by following your suggestions for future
work)

These steps should influence everything you do in
the lab and everything you write in your
report.

Conclusions – explanation of measured results
and suggestions for future work

Interpret the data to show how it responds to the
relevant questions of the experience – use the
data to test your hypothesis.

Suggest starting points for new hypotheses
that explain the observed differences from
the theoretical results – if possible, suggest
new experiments to test these new hypotheses.

Alternatively, the conclusions section could be called an
"Analysis" section and a new "Conclusions" section could be added
that summarizes the report. The section structure you choose
should help reinforce the message you are communicating in your
report; keep the steps of the scientific
method in mind.

For the lab reports you submit to me, you do
not need an abstract nor any appendices. All
material should be in-line with the text of the
document.

Regardless of your section choices, be sure to pay attention
to the course policies on lab
reports (e.g., include a cover page with
table number, group member names, my name, section, etc.).

Technical Details

Here are some other general rules that you should consider
when writing lab reports for me.

An excerpt from the ECE 327 lab text applies to all
laboratory reports as well.

Reports should be written from the following point of
view: the reader is knowledgeable on the subject of
electronics but knows little of your project. You must,
therefore, explain your project in the most organized,
economical fashion possible. This is good practice as
this will, most likely, be the point of view for your
monthly/quarterly/yearly reports in industry. This
neatness and readability of your report is a significant
factor as well as the actual contents. You should try to
explain to the reader how the different parts of this
circuit work in a clear and organized fashion.

Lab reports should be
computer-generated. Look below for
information on obtaining digital images you can use in your
report.

Pages should be
numbered.

You may use first-person active voice or third-person
passive voice, but you should be consistent.

DO NOT refer to the

"class"

"instructor"

"instructions"

"students"

etc.

Likewise, DO NOT discuss how you were
"instructed" to do something. Your submissions are
technical reports reflecting your own
experimentation with using electronic devices. You should
write them as if you were submitting them to a boss or a
journal.

In particular, take a look at the TABLES &
FIGURES section of
the first link. Word will make sure that your figure
captions stay tied to your figures and will
automatically number them properly for you. Additionally,
later you can have Word manage your cross references so you
never have to type a figure reference. Of course, it is
always better to use TeX.

Borrowing Class Images

Recent versions of Adobe
Acrobat Reader have a "Snapshot Tool"
that allows you to copy any image out of a PDF. To use images
I’ve put in the supplementary text handouts, copy and
paste them into your report.

If you are using LaTeX, you
will need images to be stored in separate
files to be included in your source code (i.e.,
you will not be able to simply "paste" them into your
document).

The ECE computer labs have the full
Adobe Acrobat installed (i.e., not just
the reader), and so you can use the
File->Create PDF->From
clipboard feature to create PDF versions of
your copied snapshots.

While viewing the PDF snapshots, you can use the
File->Save As feature to
convert them to a better format.

For myriad reasons, professional technical documents are rarely
produced with popular programs like Microsoft Word.
In areas that are highly influenced by mathematics (e.g.,
engineering), the freeTeX typesetting system
dominates. Many TeX (pronounced "tech") users prefer the LaTeX suite
of macros to simplify common typesetting tasks.

TeX documents, like the source code for computer programs, start
as text files that are later "compiled" into their final document
form. A typical TeX workflow is

Edit document source
code in a standard or specialized text
editor. For example, a text file called
"mydocument.tex" could contain the LaTeX code:

"Compile" source code to produce printable document. The
"mydocument.tex" file would produce a "mydocument.pdf" that
would contain the bold text:

Hello world!

A good editor will typically
provide a quick way (e.g., a "LaTeX" button on the graphical
user interface) to compile your code.

If you want to compile your code manually,
you can use PDFLaTeX with the command

pdflatex mydocument.tex

or you can use LaTeX with the commands

latex mydocument.tex
dvips mydocument.dvi
ps2pdf mydocument.ps

The difference between these two methods has an
impact on what type of figures you can
include (i.e., EPS files versus PDF, GIF, JPG, or PNG files).
See below for details.

View printable document and repeat process to make changes
(e.g., you could change the \textbf{Hello world!} line
to be simply Hello world! to get rid of the
bold).

Thus, many people feel that TeX typesetting is more like
programming than it is like using standard word
processing tools. So it’s not surprising that you’ll
need a "compiler", editor, and
viewer (note: the ECE computer labs are
already equipped with everything you need to get started).

If you want to submit lab reports or pre-lab homework
assignments using TeX, you will need one of
the free TeX
distributions. These distributions contain TeX
and the popular LaTeX macros.

TeXworks is a
free and minimal LaTeX editor and
auto-refreshing PDF previewer (based on TeXShop)
that is still in development for
Windows, Mac OS X, and
Unix. It is available for download. It is
based on Qt and Poppler.

Kile is a popular
free LaTeX editor for KDE (i.e., for
Windows, Mac OS X, and
Unix).

You will probably also want a good
PDF viewer. Some of the editors above include
decent PDF previewers, but others depend on you to find one.

Members of the Adobe Acrobat
family (including the free reader) are
sufficient so long as your editor knows how to kick them
whenever your PDF is regenerated. Unfortunately, they are big
and bloated and have a stagnant feature set.

Mac users should check out the freeSkim, which supports
auto-refreshing and lots of other helpful features.

Windows users might want to check out the
freeSumatra
PDF, which is a minimal PDF viewer that supports
auto-refreshing and has some other nice features.

You will often want to include figures in your
documents. To make this process easier, make sure you
have these two lines in your LaTeX preamble:

\usepackage{caption}
\usepackage{graphicx}

Then, in the main part of your document, you can
choose whether to include your graphics as
"floats" or not. Most figures in books are
"floats." That is, they do not appear exactly where they are
mentioned in the text. Instead, they "float" to a convenient
place (e.g., the top of the next page). In lab reports, people
sometimes prefer that their graphics do not float.

That is, replace the figure
environment with a center environment and
replace the \caption line with a
\captionof{figure} line.

A similar procedure exists for tables (i.e., tables can be
included as floats as well).

In the \includegraphics lines above,
a "width" parameter is set to half of the column width
(i.e., 0.5\columnwidth). You can change this to an
absolute dimension as well (e.g., [width=3in] for a
three inch width). You can even use height instead
(e.g., [height=3in] for three inch height). In either
case, the image is scaled so it maintains the correct
height:width ratio.

In the example above, a PNG file was included.

If you want to include PNG, GIF, JPG, or
PDF files, you must use
PDFLaTeX.

If you want to include EPS files, you
must use LaTeX.

So when you export files from MATLAB, make sure
you choose an appropriate file format.

At the beginning of each lab, the Laboratory
Preparation section from the book for that lab should be
submitted for a grade.

Most of the theoretical work for each lab is completed
here, and so you should keep a copy of your results to assist
you in class.

Pre-lab reports should be completed
INDIVIDUALLY by EACH
STUDENT. Pre-lab submissions are
NOT group assignments.

Final Exam (instructor policy takes precedence):

The final exam will be given during the last day of
regularly schedule class.

It will have a purely theoretical section as well as a
practical laboratory component.

It will be completed individually, and
so all students should be familiar with both the software and
hardware used in the lab.

Labs (instructor policy takes precedence):

Students are required to attend all labs.

Students will work in groups of two.

Disk space has been prepared at each bench for storing
laboratory results. However, for their lab reports,
students should save their results either over the ECE
network or on some other portable storage device.

Lab reports are due at the beginning of the
next lab session and will be penalized 10% per day
late.

Lab reports must be typed and pages
must be numbered.

Tables and figures should be numbered
and have descriptive captions. Because
these items naturally float to the best location
on the page, they should be referred to by their
name and not be their relative position
(e.g., refer to "Table 1" and not "the table below").

Lab report grading (instructor policy takes
precedence):

Lab work (30%) – evidence of having
successfully completed the lab tasks.

Figures/Tables/Equations (20%) – the
main technical details of the report

Discussion (50%) – usually divided
(depending on lab) into:

Purpose – the purpose of the
lab

Procedures – how the lab was
done

Theoretical results – expected
results (you should not re-do your laboratory
preparation work on your lab report; instead, just
use those results, but be sure to interpret them as
expectations of experimental outcomes)

Students must attend all labs. If a lab needs
to be missed, arrangements should be made with the instructor
at least 24 hours prior to the lab so that the lab work can be
made up. The instructor reserves the right to determine when
make-up work is allowed. Students are responsible for all
assignments, change of assignments, announcements, and other
course-related materials.

Late policy (instructor policy takes
precedence):

Late lab reports will not be accepted unless prior (i.e., at
least 24 hours in advance) arrangements have been made with the
instructor.

Honor code:

While groups may work together outside of class when
deciphering their results, all handed-in material must be
unique. That is, each group should actually compose their lab
reports separately.

Likewise, students may help each other outside of class when
completing the pre-lab assignments, but the assignment
submissions should reflect individual work and
not any sort of collaboration.

Any written material turned in to me (lab reports, pre-labs,
exams, etc.) falls under the purview of the University and the
ECE Honor System rules. If a lab report does not represent a
group’s understanding of the material or a pre-lab or
exam does not represent an individual’s understanding of
the material, I will consider it to be an honor code violation.
In these cases, I must report the incident to the ECE
department.

Disability services:

Students with disabilities that have been certified by the
Office for Disability Services will be appropriately
accommodated and should inform the instructor as soon as
possible of their needs.