- ============================
WARNING !! ====================================

**YOU MUST USE THE**__Project__R__EPORT__TEMPLATE__BELOW!__- A well-written report/paper is EXPECTED

- STRONGLY RECOMMEND that you read IEEE
authorship series: How to Write for Technical Periodicals
& Conferences

- ==============================================================================

- Design of state-variable observer and controller

NOTE: Use the Project Report Template and see below
for minimum required data content
your reports and demos.

IN NO CASE may code or files or data or pictures be exchanged
between student groups, there is to be NO COPYING of group
reports!

** Not required in 2021: **
Also, each student must be able to independently
answer any questions themselves during demos.

All students are expected to learn all aspects of every project.

Nevertheless, students are encouraged to collaborate (not copy) during the lab sessions.

Aspects of any project may be included on exams/quizzes.

**Technical notes:**- See textbook or class handouts for design procedures
- Maatlab may have effective design tools beyond the simple examples below

**Final report**: due by email on/before the start of the final class period**(see canvas for due date and total points)**, including:**Final Report ITEMS DUE:**

**Must be submitted through canvas:**

- upload to canvas a
**PDF****report**(see details and**template**below)

- You must use the project report template below

**Hardcopy is not required in 2023:**

**Hardcopy**due at beginning of class (used as basis of demonstration/reviews)**Final video presentation**: worth**25**__extra credit project points__.__MAKE SURE THAT YOU HAVE SOFTWARE TO CREATE AND VIEW MP4 VIDEOS__**Any student whose name does not appear on the first slide of their group's video will receive zero credit for both the video and the peer review****Students must BOTH submit a video and do all assigned peer reviews to receive any credit**

- Due (
**See canvas for updated/exact deadines**):

- it would be wise to upload videos MUCH earlier than the deadline
- Do
**not underestimate**the time required to upload a video to canvas

- Typically videos are due sometime before the final exam period (see canvas for exact due dates)

- Typically peer reviews must be done during the first 60-90 minutes of the final exam period (see canvas for exact due dates)

- ITEMS DUE:

**5 minute maximum video,**

**must be mp4 format****Students must BOTH submit a video and do all assigned peer reviews to receive any credit**- video of presentation must be uploaded on canvas for peer review
- The
"e4124lastnameFinalProj.mp4"**name of the video file must be**

- where lastname is the last name of one of the students
- Note: videos+narration can be exported from powerrpoint

- Minimum video requirements:
- IMPORTANT: Only upload one video per group, NOT one per student
- The name of the video file must be as noted above

- The first slide and beginning of video must show:
- names of all students on the first slide
- REQUIRED slides as a minimum
- Slide with presentation title and group member names

- Slide containing a block diagram of a QAM receiver such as in the handouts

- Slide containing qam receiver theory formula such as the handoutsi

- All plots that were included in your project report, except
**exclude all****of the plots for results generated by using the rectangular filter, only including plots of results generated by the Butterworth filter design**

- Note: videos+narration can be exported from powerrpoint

- Due (
**Peer reviews of video presentations**:**25**__extra credit project points__- Typically canvas randomly assigns peer reviews within the first 5 minuted of the final exam period
- Do not worry if you are assigned your own project to review, just skip that review

- Peer review is due during the first 60-90 minutes of scheduled final exam period (see canvas for exact due dates)

**Online peer reviews to be completed during first 60-90 minutes of scheduled final exam time period**- Online peer review time window will only be open during first 60-90 minutes of exam period
**Students who do not participate in BOTH the peer review and the video submission****will not receive any credit**

**Students who do not submit videos receive no credit for peer review**

**Students must BOTH submit a video and do all assigned peer reviews to receive any credit**

- Each group will be provided a plant function Gp(s) for the system below:

- Group assignments for Gp(s)
- z

- The overall goal of the project is to
**design**to meet design goals below within the design constraints below__two different digital controllers__

- The
**first system design**has the block diagram in Fig. 1 above, where D(z) is the**classical digital compensator (****either a digital PID or digital lag-lead)**

- The
**second system design**is state variable, as shown below in Fig. 2, using**state-variable observer+controller compensation**

**Design constraints:**- Sampling time
To=0.01 seconds

- Each group must use their
**assigned system Gp(s)** :**Each group must complete both system designs**

- Classical
design (PID or lag-lead) as illustrated above

- State variable
observer+controller (K and
L) design

**Block diagrams and required design approaches**

**For the Classical**compensator design (Fig. 1 above)- Must use configuration of Fig. 1
above with H(s)=1 and ZOH as shown

- Must be either a digital PID or digital lag-lead compensator
**For the State-variable observer+controller**digital compensator design (Fig. 2 above)

**YOU MUST TEST THE FOLLOWING EVERY YEAR IN EVERY VERSION OF MAATLAB**

- you Must convert Gp(s) of Fig. 1 to
equivalent
G(z)

- You must use the command: c2d(Gps, Ts, 'zoh') where Gps is plant function Gp(s)
- This form includes ZOH in conversion
**MAKE SURE THAT YOU FIRST CHECK THIS EXAMPLE (in case of new maatlab bugs):**

- Ts=0.1; Gps=tf([1],[1 3]); Gpz=c2d(Gps, Ts, 'zoh')
- should yield
**correct/desired**result of

- 0.086 / (z-0.74) as on p. 77 and 78 of my amazon book

- Must convert G(z) to
state-variable form A, B, C, D as in Fig. 2
above

- Hint:

- try [A,B,C,D] = tf2ss(Gpz.Numerator{1},Gpz.Denominator{1});
- also try statevarsys=ss(A,B,C,D,Ts)

- It would be wise to check
controllability/observablity Hint:
see ctrb(A,B) or obsv(A,C)

- Once you have A, B, C, D you can proceed to design
- Your design must include an
**observer**design (matrix or vector L)**and a controller**design (matrix or vector K) as illustrated above

- Note: the lecture notes use L where the text uses G
for state-variable controller

- Other hints: see

- place(A,B,pd),

- and
place(A',C',pd2),

- and
reg(svsys,K,L'),

- and feedback(statevarsys,reg,1)
- Note: as for the controller in
class, your observer+controller
**requires****gain compensation**

- Note: see eq 9-51 for
insight

**Design Goals**

- Design goals for both the classical
and the state-variable designs:

**Settling time**to within +/- 10% < 0.1 seconds for a step input

**Steady state error**< 5%

**Peak o****vershoot**< 5 %

**Rise time**< 0.1 seconds**Closed-loop bandwidth**> 2.0 Hz

- ============================
WARNING !! ====================================

- **** WARNING ****
**YOU MUST USE THE**__PROJECT__R__EPORT__TEMPLATE__Below__: - See the Project Report Template

- A well-written report/paper is
EXPECTED

- STRONGLY RECOMMEND that you read IEEE authorship series: How to Write for Technical Periodicals & Conferences
- Clearly describe everything, including:
- variables in block diagrams
- variables in formulas
- units of variables kHz, pF, nH, m, s,

- all traces on plots
- all curves on plots
- all results in any tables

- Minimum
**required data content**for your report and demos **Required equations and equation numbers**

**Classical**system design section

- (1) the equation for Gcs(s)=Gp(s)ZOH(s) being transfer function of plant+zero-order-hold,

- where the plant is the one that was assigned to your group by the instructor
- (2) Gcz(z) corresponding to
Gcs(s) for the appropriate sample rate of your system

- (3) classical D(z)
equations showing
of of your final classical design**both generic D(z) and final-value forms**

**State-variable**system design section- (4) state equations
- (5) formulas and values for
**A, B, C, and D**showingof your final state-variable design**both formula and final-value forms** - (6) equation showing pole
placement polynomial p(z),
__and__pole locations of p(z),__and__the resulting K - (7) equation showing
observer poles polynomial
p2(z),
__and__pole locations of p2(z),__and__the resulting L

- Appendix
- Your appendix must include a single self-contained
matlab script that

- simulates both your classical design
and your state-varable design,

- and automatically
generates all plots included in your final report

**Required figures**:**and figure numbers**- (1) Classical control system
block diagram like Fig. 1 above, showing D(z) and Gc(s) and
**H(s)=1**with input R(s) and output C(s)

- (2) a single plot over 5 decades frequency ending near 1/Ts Hz showing open-loop frequency response for
|GOL(z)|=|D(z)Gcz(z)| and phase ∠GOL(z) in solid magenta color,**classical design**compensated

**along with uncompensated**|GOL(z)| and phase ∠GOL(z) in dashed blue color,

- and
**along with**|D(z)| and phase ∠D(z) in dotted green color,**classical design**compensator **Use arrows**to point to corresponding curves in the plot,**do not just use a legen**d (see template Fig 2 for example)

- (3) a single plot over 5 decades frequency fending near 1/Ts Hz showing
**Closed**-loop frequency response for**classical design****compensated**|GCL(z)| and phase ∠GCL(z) in solid magenta color,**Open**-loop frequency response for|GOL(z)|=|D(z)G(z)| and phase ∠GOL(z) in dashed blue color,**classical design**compensated- (4) closed-loop
**step response**transient for**classical design compensated**

- (5) State-variable control system block diagram as in Fig, 2 above
- (6) a single plot over 5 decades frequency from ending at 1/Ts Hz showing
**Closed**-loop frequency response for**state-variable****design****compensated**magnitude and phase in solid magenta color**Closed**-loop frequency response for**classical design****compensated**|GCL(z)| and phase ∠GCL(z) in dashed blue color,- (7) a single
plot of closed-loop
**step response for**

- closed-loop step response transient for
in solid magenta color**state-variable****design**compensated - closed-loop step response transient for
**classical design compensated**in dashed blue color, **Required tabular data content**:**Three-column table**for**classical system design**with :

- In first column: parameter names: Open-loop
**z-plane poles**, closed-loop**z-plane poles** - In second
column: the
for all**complex value****z-plane poles**, one pole per line

- In third
column
for all**: the magnitude of the complex value****z-plane poles**, one corresponding pole per line **Three-column table**with**classical design results**:

- In first column: parameter names: Settling time, Steady state error,
Peak overshoot, Rise time, closed-loop 3 dB bandwidh
Hz

- In second
column: the
**design goals**

- In third
column
**: final measured/simulation**

- In first column: parameter names: Settling time, Steady state error,
Peak overshoot, Rise time, closed-loop 3 dB bandwidh
Hz
**Three-column table**for**state-variable system design**with :

- In first column: parameter names: closed-loop
**z-plane poles** - In second
column: the
for all**complex value****z-plane poles**, one pole per line

- In third
column
for all**: the magnitude of the complex value****z-plane poles**, one corresponding pole per line **Four-column table**with**classical design**__and__**state-variable**results:- In first column: parameter names: Settling time, Steady state error, Peak overshoot, Rise time, closed-loop 3 dB bandwidh Hz
- In second
column: the
**design goals** - In third
column
**: final measured/simulation for classical design**

- In fourth
column
**: final measured/simulation for state-varable design**

- See above project description for required report data content.
- You
**MUST use**the project report template

- Do not add extraneous pages or put explanations on separate pages unless specifically directed to do so. The instructor will not read extraneous pages!
- YOU
**MUST ADD CAPTIONS AND FIGURE NUMBERS**TO ALL FIGURES!!

Copyright 2021 T. Weldon

Freescale, Kinetis are registered trademarks of Freescale
Semiconductor, Inc. Texas Instruments, TI, C2000, and
Code Composer Studio are a registered trademarks of Texas
Instruments Incorporated. Adafruit is a registered
TradeMark of Limor Fried. ARM, Cortex and Keil are
registered trademarks of ARM Limited (or its subsidiaries).
Apple, Yosemite, Mac OS, iPhone, iPad, MacBook, Mac, iTunes, and
Xcode are trademarks of Apple inc. All other product or service
names are the property of their respective owners. Arduino
is a registered trademark of Arduino. MATLAB and Simulink
are registered trademarks of The MathWorks, Inc.