digital control

loop shaping

inverted pendulum  two-link robot


The objective of this course is to provide students with the necessary knowledge to design, implement, and document a control engineering project.

The course has three components: lectures, prepared laboratories (in the form of a project that is the same for all students), and a design project (specific to each group of students).

The lectures and laboratories cover a range of special topics related to the practical implementation of control systems that are not covered in introductory control courses but that are likely to arise in the professional career of controls engineers. These include:

  • Model identification and parameter estimation (least-square identification of a auto-regressive model; nonparametric identification in the time domain; and nonparametric identification in the frequency domain)
  • Robust Control (Nyquist-plots, small-gain, and passivity)
  • Optimal control (LQR/LQG for state-space systems and time-optimal controller for the positioning of a mass using force actuation)
  • Nonlinear control (Lyapunov's stability method; feedback linearization controller for a fully actuated 2nd order mechanical system; backstepping for triangular nonlinear systems; actuator limitations)

The course is heavily project-oriented and the students will be required to design, implement, document, and present a significant control systems project, which requires them to address the issues covered in the lectures.

This course is part of an ECE design sequence with ECE147A.


ECE147A or ME155A or ME173 or equivalent. Open to all engineering majors.

Course's web page

All information relevant to the course will be continuously posted at the course's web page. The URL is


quick links




João P. Hespanha

phone: (805) 893-7042
office: Harold Frank Hall, 5157

Office hours: Please email or phone me in advance to schedule for an appointment.

Teaching Assistant

Justin Pearson


Office hours: Fri, 10am-12noon @ HFH 3120A (Attention: time and place updated on 4/15/2014)

Assessment format: ME106A (3 units)

  • 1-2 homework assignments (individual, needed for the laboratory) – 5 %
  • Laboratories (group mid-term report) – 40%
  • Final Project (includes a group end-of-term report and a group in-class presentation) – 55%

Assessment format: ECE147C (5 units)

  • 5-6 homework assignments (individual) – 25 %
  • Laboratories (group mid-term report) – 35%
  • Final Project (includes a group end-of-term report and a group in-class presentation) – 40%


The course will be based on the following notes: ECE147c-ME106a-LectureNotes


The second half of the laboratory time is devoted to the final project. Possible projects include

  • Identification and control of the seesaw system [in hardware]
  • Identification and control of an inverted pendulum [in hardware]
  • Identification and control of a flexible beam [in simulation]
  • Identification and control of an F-16 [in simulation, model available, e.g., here]
  • other … [in hardware or simulation]

The final project must make extensive use of two out of the four topics taught in the lectures, which are Model Identification, Robust Control, LQG/LQR, Nonlinear Control.

See due dates below




Description Due date

1-2 paragraph description of your proposed final project. Please make sure that you include the following information:

  • Which system do you plan to control?
  • What variables to you plan to control, which variables can you measure?
  • What type of closed-loop specifications make sense for that problem?
  • Do you plan to use simulation or experiments? In case you plan to use simulations, where will you get the model from? [We may be able to give you a hand here]
  • Which two out of the four topics taught in the lectures (Model Identification, Robust Control, LQG/LQR, Nonlinear Control) will the project make extensive use?

The report, must follow the template in the Laboratory section of the web page.

There is a strict limit on the page length: at most 10 pages, 10pt. This must include all figures, plots, abstract, introduction, discussion of results, conclusions, etc.

To fit everything in 10 pages, you must be very selective in which figures to include. You will also need to overlay several plots. E.g., you may show the identified process bode plots for several different inputs all in the same figure (remember to label everything so that it is clear which line corresponds to what!).

Your report must also include text (and equations) to explain the process model, to justify the choices that you made, and to discuss the results that you obtained. The main objective of the report is to support the claim that the model that you identified is accurate and that the controller that you designed is good. You should think of the report as a conference paper and not as a homework assignment.

A significant portion of the grade will be based on the quality of the report (length, completeness, how well it reads, etc.)

The presentations of the final project will take place in the laboratory and take 30 minutes.

For group projects all students should participate in the presentation. The presentation should use a computer projector.

The presentation should include:

  • presentation outline
  • description of the system to be controlled, sensors, and actuators (use pictures!)
  • description of the control objectives
  • identification method and summary of the identification results (if the project involves identification)
  • control design method and summary of the closed-loop performance achieved
  • simulation results
  • hardware results (if the project involves hardware)
  • hardware demo (if the project involves hardware)
  • conclusions and discussion of future work

This report should follow the same guidelines as the mid-term project report.

Please read all comments that you will receive regarding the mid-term project report and make sure that you follow any advice given when you prepare the final project report.

A significant portion of the grade will be based on the quality of the report (length, completeness, how well it reads, etc.)



Study Guide


The following is a tentative schedule for the course. If revisions are needed they will be posted on the course's web page. The third column of the schedule contains the recommended reading for the topics covered on each class. Students are strongly encouraged to read these materials prior to the class.

Class Contents References Laboratory

Lect #1


Course overview

Computer-controlled systems

  • Continuous-time systems
  • Discrete-time systems
  • Discrete- vs. continuous-time transfer functions

Chapter 1

Laboratory session enrollment

No laboratory class

Lect #2


Nonparametric identification

  • Time-domain identification
  • Frequency response identification
Chapter 2

Lect #3


Parametric identification using least-squares

  • Least-squares line fitting
  • vector least-squares
Chapter 3 Introduction to laboratory

Lect #4


Parametric Identification of an ARX Model

  • ARX model
  • Identification of an ARX model
  • Dealing with known parameters
Chapter 4

Lect #5


Practical consideration in parametric identification

  • Choice of inputs
  • Scaling
  • Choice of the sampling frequency
  • Choice of the model order
  • Combination of multiple experiments
  • Closed-loop identification
Chapter 5 Parametric identification of the two-cart system

Lect #6


Part II — Robust Control

Robust stability

  • Model uncertainty
  • Nyquist stability criterion
  • Small gain condition

Chapter 6

MATLAB script used to generate the plots in the notes

Simulink file for Noisy identification Exercise 2


No class   Parametric identification of the two-cart system (cont.)



No class  

Lect #7


Control design by loop-shaping

  • Open-loop vs. closed-loop specifications
  • Open-loop gain shaping
Chapter 7 Closed-loop control of the identified model
5/1 TBA  

Lect #8


Review of state-space models

  • Input-output relations
  • Realizations
  • Controllability and observability
  • Stability

Chapter 8

MATLAB script used to generate the plots in the notes

Closed-loop control of the identified model (cont.)

Lect #9


Linear Quadratic Regulation (LQR)

  • Feedback configuration
  • Optimal regulation
  • state-feedback LQR
  • Stability and robustness
  • Loop-shaping control using LQR
Chapter 9

Lect #10


LQG/LQR output feedback

  • output feedback
  • full-order observers
  • LQG estimation
  • LQG/LQR output feedback
  • Separation principle
  • Loop-gain recovery
Chapter 10

Closed-loop control of the identified model (cont.)


Final project

Lect #11


Set-point control

  • Nonzero equilibrium state and input
  • State feedback
  • Output feedback
Chapter 11

Lect #12


Part IV — Nonlinear Control

Feedback linearization controllers

  • Feedback linearization
  • Generalized model for mechanical systems
  • feedback linearization of mechanical systems
Chapter 12 Final project

Lect #13


Lyapunov stability
  • Lyapunov stability theorem
  • LaSalle's invariance principle
  • Lienard equation and generalizations
Chapter 13

Lect #14


Lyapunov-based designs

  • Lyapunov-based controllers
  • Application to mechanical systems
Chapter 14 Final project

Lect #15



Lect #16


TBA   Final project


No class  

Exam week

Final project presentations    

Exam week

Final project presentations  




Schedule & Location:

Schedule: Mon 5-8pm (weekly 3 hour laboratory session)

Location: 3120A Harold Frank Hall (HFH)


There will be weekly laboratory sessions to complement the material covered in the lectures. A portion of the laboratory should be prepared before the lab session.

Most laboratories will require the use of MATLAB/Simulink with the CONTROL SYSTEMS and IDENTIFICATION Toolboxes.

The first laboratory class will take place on the second week of classes. The TA will use this class to introduce students to the equipment. Please read and bring to class the following handouts: Introductory laboratory handout (ATTENTION: updated on 4/4/2014) and Hardware guide. You can find a few more "goodies" in Justin's web site, which include a couple of Simulink models that you can use to test the harware.

The following document provides a general description of what the students are expected to do before and during the lab and it also serves as a template for the final lab report that will be turn in the middle of the quarter. The final project report (due at the end of the quarter) should also follow this basic template: Laboratory project

See the Study Guide for an overview of the week-by-week laboratory activities.


Homework Assignments


Number Posted on Due date Exercises Relevant lectures



Download the exercise from here.

Exercises 2.1, 2.2 of the identification module.

Simulink file for Exercises 2.1 (step response) and 2.2 (correlation method)

This Simulink model expects some variables to be defined. Please use:

Ts = 0.01;
noise = 0.0001;
noiseOn = 0;
tfinal = 10000;

Note that in part 2 of Problem 2.1, you must set noiseOn = 1 to turn on the noise.

You will also need to define values for the height of the impulse and the height of the step through the variables:


For these variable, YOU select the appropriate values.

The MATLAB scripts for exercise 2.2 will be useful to perform nonparametric identification with the data collected in the lab

Solutions can be found here.

Chapters 1-2



Exercises 4.2, 5.1, 5.2, 5.3 of the identification module.

Data for Exercise 4.2 (selected parameters)

Simulink file and m-script for Exercise 5.1 (input magnitude)

Data for Model-order Exercise 5.2 (model order)

For the lab work, you will need to adapt exercise 5.1 to take into account that the system has an integrator (instead of a zero at a known location).

The MATLAB scripts for exercises 5.1, 5.2, 5.3 will be useful to perform parametric identification with the data collected in the lab

[If you are taking the course for 3 credit you do not need to turn in exercise 4.2]

Chapter 3-5
#3 3/31

Exercises 6.2, 6.3, 7.1 of the robust control module.

Simulink file for Exercise 6.2 (Noisy identification)

[If you are taking the course for 3 credit you do not need to turn in these assignments]

Chapters 6-7
#4 3/31

Exercises 9.2, 10.1 of the LQR/LQG module.

[If you are taking the course for 3 credit you do not need to turn in these assignments]

Chapters 8-10
#5 3/31

Exercises 12.2, 13.2, 13.3 of the nonlinear control module.

[If you are taking the course for 3 credit you do not need to turn in these assignments]

Chapters 12-13