ECE 486 Control Systems Lab (Fall 2017)

[Back to Home]

Day 1 Day 2 Day 3 Day 4 Short labs, weekly
Day 5 Day 6 Day 8   Long labs, biweekly
Day 7 Day 9 Day 10 Day 11 Final project, weekly

Welcome to ECE 486 Lab

Lab Website

You may want to frequent our course website for detailed announcements and policies.

https://courses.engr.illinois.edu/ece486/lab.html

Lab Location

Our lab is located at 30771 ECE Building.

Meeting Times

Thu 12 p.m. – 3 p.m. for AB4 and Thu 3 p.m. – 6 p.m. for AB1

Instructor

Yün Han
Email: han82 AT illinois DOT edu
Sections: AB1 and AB4
Office hours: 3 p.m. – 5 p.m., Mondays, 3077 ECE Building

On Lab Day

Everybody should attend each lab on time and stay in lab until checked off by lab TA before leaving.

A Lab Manual2 is required and you should bring it with you each lab.

Card Access

Everyone has 24 hr card3 access unless theft is reported, in which case everyone loses access until we figure out who takes what out and recover the loss thereafter.

In the Fall, we also share 3077 with another class ECE 446. Their lab time is noon – 6pm, Fridays.

Lab 0 – Introduction to Matlab® and Equipment

The class will be divided into Groups A and B at the beginning of Day 1. Also everyone works with her/his partner in lab. As for lab pairing, I discovered a fun fact about ordering of lab partners’ names on our roster.

Matlab Part

Next, we will try some matlab code.

Help

There are three help name, doc name, and search in documentation directly.

  • help name
    It will print out documentation about name in command window.
  • doc name
    It will show you a help browser that displays information about name.

Navigation and File Operations

Basic shell commands are valid,

  • dir - list directory;
  • cd - change directory;
  • pwd - print working directory;
  • ls - list contents of current directory;
  • mkdir - create directory;
  • rmdir - delete directory;
  • copyfile - copy files;
  • movefile - move files, rename files;
  • delete - delete files.

Program Body

We will learn Matlab programming core language throughout this semester, so be patient!

For the impatient, read official documentation.

Visualization

A useful tool for debugging in C programming is printf(). Similarly in matlab programming, we can use whos to list variables in workspace and simply var_name in code to print its value. disp() is often useful to display a normal string/message in command window.

We will use plot() command extensively in this lab. Details of its usage can be found here.

Hardware Part

Follow quickly through the second part of Day 1 of lab manual. How to hook up lab equipment, what they do and how to interpret graphs on oscilloscope screen etc.

Always clean up before exiting.

Other Basics

As for Writing …

I highly recommend LaTeX. I have maintained a repository for the report template (and other tidbits of 486) on GitHub.

LaTeX is suitable for scientific writing, especially for high quality print. For a quick demonstration, the quoted paragraph uses in-line/display \(\LaTeX\) maths, equation labels/taggings and how to reference them in normal text.

Control theory relies on complex analysis which again is built upon Cauchy’s Integral Theorem, which says for any function \(f(z)\) over a simple piecewise continuous closed contour \(\gamma\) on whose interior \(D\) the function \(f(z)\) is analytic, we have

\[ \tag{1} \label{eqn:cauchy_thm} \int_{\gamma} f(z) \, dz = 0, \]

where \(z \in D \cap \CC\). Equation \eqref{eqn:cauchy_thm} can also be compared to Cauchy’s Integral Formula in \eqref{eqn:cauchy_int_form},

\[ \tag{*} \label{eqn:cauchy_int_form} f(z) = \frac{1}{2 \pi i} \int_{\gamma} \frac{f(\zeta)}{\zeta - z} \, d\zeta, \]

for \(\forall~ z \in D\).

I prepared a LaTeX + Emacs set-up for Windows® with which you may use on lab computers. It is available

N:\labs\ECE486\ece486_Emacs_LaTeX

Please read detailed instructions on GitHub.

I kept the lab LaTeX + Emacs set-up minimal so other interesting packages are not included. For example, if you want to try helm-mode on Emacs, you can include the following snippet in .emacs,

;;; ---- lines below are on top of lab emacs + LaTeX ----

;;; Helm mode
(require 'helm-config)

;;; And other useful packages
;;; ...

As for Programming …

  • Matlab tutorial is here (old but useful).
    • Also check out the snippet below and
    • It is also available on GitHub.
%% MATLAB function tutorial
% multiple functions in a single file
%%

% 2015-09-03
% Y\"un Han
% ECE 486 Lab 

%% outer loop function

% keyword function, keyword FUNCTION_NAME are necessary
function dummyFunction 
% dummy outer function calls another function within the same file. This
% immediate documentation line after function FUNCTION_NAME will be shown 
% as preview in file explorer

clear % clear var values in workspace
clc   % clear messages in command window

% call another function in the same file
[m, n] = dummyFunction2

end % you can comment it out 

%% nested function

% () were omitted in dummyFunction since there are no input arguments, []
% can also be omitted if there are no output arguments

function [a, b] = dummyFunction2() 
    a = 1;
    b = 2;
    disp('hello from a dummy function2') 
end % you can comment it out

% Problem 1: run this file, why 'hello from a dummy function2' comes BEFORE
% m, n values displayed in command window?

% Problem 2: go to PUBLISH tab and try 'publish' button with this snippet.
% Can you format the code with proper table of contents, headlines and 
% titles/subtitles? (hint: see PUBLISH MARKUP in matlab documentation)

Follow-up

Comments

  • All print-outs during lab time (not necessary if not otherwise stated in my sections) and QAs in lab are for check-off points. But you are strongly recommended to save all the data you get during each lab. For lab report, sometimes you may need your code and data in lab to complete the report; Make sure you follow the official template (on the course website) for each lab report; no handwriting is allowed in lab reports, they should all be typeset; And from Lab 1 on, it is also recommended that you use the .tex template because I wrote the TeX version and I am not maintaining the M$ Word® version of lab report template.
  • “Clean bench table and restore chairs” before you leave: it may or may not be an easy thing. You may want to sort out different cables (put wires back to rack type by type and color by color; form a loop for short wires then restore them back to drawer), flip the power switch for the bench table, etc. When you leave, the table should look like what they looked like before you get started in each lab. I always appreciate orderly things and I will be very grateful if you can follow the same route.
  • Next week, your prelab 1 is due by 5pm in the dropbox (physical dropbox in 3077) on Mon, Sep 11. Please make sure you have card access if you are officially signed up for 486 so you can drop off your prelab/work in lab. (Please refer to footnote 3 for details.) There are no official templates for prelabs. But if your prelab is a handwritten one, I prefer a legible handwritten prelab with intelligible ideas; you can even typeset it if you have time. Your lab report 0 is due at the beginning of lab 1 when we meet for lab 1 (Sep 14); Group A meets the first 90min and Group B meets the last 90min. (Group B students can come to the lab at 1:30pm for Section AB4 or 4:30pm for Section AB1.)
  • As for the lab report 0, not only do you have to turn in your annotated figure and report title page, you also need to print out and attach your code to your lab report. If you do not attach your code, we assume you don’t know how to generate the plot.4

Note the code (StepResponseMetrics.m, once completed) working with older versions of Matlab might not behave the same way as with Matlab® R2017a (the one we installed in lab). Do you know how to fix the oddities in the plot? (Hint: Try placing legend() code block somewhere else.)

Proofread your plot before attaching it to your report. Does labeling all make sense? How about the metrics shown in the legend box?

Due Date

Lab 0 Report is due at the beginning of Lab 1 (Sep 14). Prelab 1 is due on Monday by 5pm of the week of Lab 1 (Sep 11). Handwritten prelab is acceptable; typesetting is recommended.

Questions

You are always very welcome to stop by office hours on Mondays. Emailing questions is another way. You can always include [ECE486]blah in the title of your question emails.

Thinking Lab 0 is too easy for you? Try something new. Spot any typos? Email me at once. You will earn up to +5 points for each typo/technical error reported.

Footnotes:

1
On Day 1, some of you will be moved to room 3075 next to our lab since on a usual lab day there are only eight students at a time however 16 on Day 1. The lab set-up in 3075 is almost the same as 3077 except we upgraded hard drives of workstations in 3077 to SSD’s and installed new wide screen monitors this past summer!
2
In case you are still looking for one, you can get the manual in 1031 ECEB, ECE Store on the first floor.
3
If you are registered, you should have card access to lab room, 3077 ECEB by now. In case you don’t, please make sure you have a prox card instead of a “normal” iCard; A prox card looks almost the same as a normal iCard except that there are numbers around the top left corner on the flip side. Prox cards are issued by Illini Union Bookstore and you may need department approval for getting one. After you get your prox card, you can let your TA know your NetID and UIN. That request for lab access will be forwarded to Lab Manager Dan Block. Don’t contact Dan Block before letting your TA know your situations first.
4
Please, please do not copy others' lab. You're strongly encouraged to collaborate on lab work but it does not mean you can copy others' data or analysis. It is left as an exercise for you to realize what a waste of time it is to transcribe others' work without understanding. That said, everybody turns in her/his own copy of prelab and lab report individually unless otherwise stated.

Author: Yün Han

Last updated: 2017-09-07 Thu 19:58