Software Eng. 4AO3  Design of RealTime
Systems and Computerized Control Systems
INSTRUCTOR:
Dr. Mark Lawford
Office: ITB/160
Email: lawford@mcmaster.ca
Office Hours: Friday 14:3016:30 
Teaching Assistants:
Cen Song & TBA
Email: songc3@cas.mcmaster.ca
Offices: ITB/224

LECTURES:
 Location: ABB/136
 Time: Mon, Thurs 12:3013:20,
Tues 13:3014:20 
LAB:
 Location: ITB/238&239
 Time: Mon 14:3017:20

MISSION:
The mission of this course is to teach students how to build computer systems that can be trusted in
situations where the system’s response to external events must be both timely and accurate. An important
class of such systems are systems intended to control physical processes. Students will be taught how
conventional (analog) control systems can be implemented (simulated) by software running
on digital computers. They will also be taught how finite state controllers can be used to
control systems with discrete states or operating modes. Students must understand how analog
and digital systems can interact and cooperate. They must also understand how to design
systems for use in safetycritical situations, especially how to design systems that fail safe . This
course assumes that the students understand the basics of conventional (analog) control system
and teaches them how the newer digital technology that can extend the capability of such
systems.
GRADING:
Two marking schemes are provided. In order to have your assignments count in your final mark (Scheme
A), you must pass (obtain > 50%) on the combination of your midterm and final (Scheme
B). Provided you pass by Scheme B *AND* you completed all of the labs, your final mark
will be the max(Scheme A, Scheme B). Otherwise your mark will be min(Scheme A, Scheme
B).
Scheme A





Midterm exam (2 hours)  25% 
Assignments/Labs  25% 
Final exam (3 hours)  50% 



or Scheme B





Midterm exam (2 hours)  30% 
Assignments/Labs  0% 
Final exam (3 hours)  70% 



NOTE: In order to pass the course you must pass the combination of the midterm and final.
TEXTS:
 Phillip A. Laplante, RealTime Systems Design and Analysis (3rd Edition), John Wiley &
Sons Inc., 2004. ISBN 0471228559
 SFWR ENG 4A03 Course Pack (Available at the bookstore).
ADDITIONAL REFERENCES:
 Course Webpage: http://www.cas.mcmaster.ca/~lawford/4A03/
 A. Shaw, RealTime Systems and Software, John Wiley & Sons Inc., 2001. ISBN 0471354902
 G.F. Franklin, J.D. Powell and M. Workman, Digital Control of Dynamic Systems (3rd
Edition), Addison Wesley Longman, 1998.
 N.S. Nise, Control Systems Engineering (3rd Edition), John Wiley & Sons Inc., 2000. ISBN
0471366013
DETAILED COURSE OUTLINE:

Introduction:
 (slides: intro.pdf)
 What constitutes a realtime system? (hard vs. soft realtime)
 How realtime system development differs from traditional application development.
 Overview of course organization

Digital Control Theory:

 Review of continuous control (slides: review.pdf)
 Review of digital control (slides: digital1.pdf)
 Discrete transfer functions and the Z transform
 Sampleddata systems analysis and design by:
 (i) discrete equivalent
 (ii) direct design

Data Acquisition Details:

 analogdigital conversion
 Quantization effects  analysis of roundoff error due to quantization and parameter
roundoff
 The Sampling Theorem and its limits
 Sample rate selection
 Measurement noise and antialiasing filters
 D/A conversion and Pulse Width Modulation

Design & Implementation of Digital Control Systems:
 (slides: implement.pdf)
 When it is appropriate to implement realtime behaviour by: (a) faking it by being fast,
(b) using a standalone (single loop) program or interrupts, (c) using an existing realtime
operating system, (d) writing a realtime kernel
 Hardware for realtime control systems
 Design decomposition of digital control software

Realtime Operating Systems:

 Properties of realtime operating systems
 Example RTOSes and their use

Specification & Design of RealTime Systems:

 Modeling of realtime systems dynamics (discrete, continuous)
 The 4variable model
 States, modes, mode classes
 Data Flow Diagrams (DFD)
 Specification of timing requirements

Concurrent Systems: The Task Model

 Periodic vs. aperiodic tasks
 Task switching overhead
 Classification of safetycritical tasks and their priorities
 Interrupts: handling, latency, masking, priorities
 Resource allocation and mutual exclusion
 Avoiding priority inversion
 Interdependent tasks  synchronization & communication
 I/O: synchronization & timing

Scheduling of Tasks:

 Runtime vs. preruntime scheduling
 Priority vs. deadline based scheduling
 Round robin, Rate Monotonic (RM) and Earliest Deadline First (EDF) scheduling
 Example: Implementation of a scheduler

Fault Tolerant and FailSafe Design:

 Designing for reliability and safety
 Failsafe design: redundancy, voting, error detection

Performance Evaluation of RealTime Systems:

 Overview
 Performance measures for realtime systems
 Estimating program run times
 I/O: overhead, processing limitations

Introduction to State Space Methods:

 State Space Representation and relation to Transfer function representation
 Controllability and Observability
 Controller Design, Estimator Design and the Separation Principle
 Multivariable and Decentralized Control
 Supervisory Control Theory and other generalizations of Controllability and
Observability
NOTES:
Discrimination
“The Faculty of Engineering is concerned with ensuring an environment that is free of all adverse
discrimination. If there is a problem that cannot be resolved by discussion among the persons concerned
individuals are reminded that they should contact there Chair, the Sexual Harassment Office or the
Human Rights Consultant, as soon as possible.”
Academic Dishonesty
“Academic dishonesty consists of misrepresentation by deception or by other fraudulent
means and can result in serious consequences, e.g. the grade of zero on an assignment, loss of
credit with a notation on the transcript (notation reads: ‘Grade of F assigned for academic
dishonesty’), and/or suspension or expulsion from the university. It is your responsibility to
understand what constitutes academic dishonesty. For information on the various kinds of
academic dishonesty please refer to the Academic Integrity Policy, specifically Appendix 3, located
at
http://www.mcmaster.ca/senate/academic/ac\_integrity.htm
The following illustrates only three forms of academic dishonesty:
 Plagiarism, e.g. the submission of work that is not one’s own or for which other credit has
been obtained. An example is copying all or part of someone’s assignment and handing it in
as your own.
 Improper collaboration in group work.
 Copying or using unauthorized aids in tests and examinations.”
Bonus Marks
At the discretion of the instructor, a student will receive 1 to 2 “bonus marks” on their latest
assignment for being the first person to point out a technical error in the lecture slides or other course
related handout.