Embedded Systems and Software. A Simple Introduction to Embedded Control Systems (PID Control)

Similar documents
Acknowledgements. Control System. Tracking. CS122A: Embedded System Design 4/24/2007. A Simple Introduction to Embedded Control Systems (PID Control)

LAPLACE TRANSFORM AND TRANSFER FUNCTION

Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

Some Basic Information about M-S-D Systems

Dynamic Effects of Feedback Control!

d 1 = c 1 b 2 - b 1 c 2 d 2 = c 1 b 3 - b 1 c 3

Math 333 Problem Set #2 Solution 14 February 2003

ECE 2100 Circuit Analysis

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

Linear Response Theory: The connection between QFT and experiments

R.#W.#Erickson# Department#of#Electrical,#Computer,#and#Energy#Engineering# University#of#Colorado,#Boulder#

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

Chapter 5 Digital PID control algorithm. Hesheng Wang Department of Automation,SJTU 2016,03

Chapter 2: Principles of steady-state converter analysis

Chapter 8 The Complete Response of RL and RC Circuits

Sub Module 2.6. Measurement of transient temperature

2.4 Cuk converter example

INDEX. Transient analysis 1 Initial Conditions 1

Open loop vs Closed Loop. Example: Open Loop. Example: Feedforward Control. Advanced Control I

Module 4: Time Response of discrete time systems Lecture Note 2

Sliding Mode Controller for Unstable Systems

( ) ( ) if t = t. It must satisfy the identity. So, bulkiness of the unit impulse (hyper)function is equal to 1. The defining characteristic is

Chapter 2. Models, Censoring, and Likelihood for Failure-Time Data

04. Kinetics of a second order reaction

A First Course on Kinetics and Reaction Engineering. Class 19 on Unit 18

EECE251. Circuit Analysis I. Set 4: Capacitors, Inductors, and First-Order Linear Circuits

Advanced Organic Chemistry

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 17

Solutions to Assignment 1

Solutions Problem Set 3 Macro II (14.452)

Electrical Circuits. 1. Circuit Laws. Tools Used in Lab 13 Series Circuits Damped Vibrations: Energy Van der Pol Circuit

EE 435. Lecture 31. Absolute and Relative Accuracy DAC Design. The String DAC

Chapter 10 INDUCTANCE Recommended Problems:

Robust and Learning Control for Complex Systems

Determination of the Sampling Period Required for a Fast Dynamic Response of DC-Motors

Predator - Prey Model Trajectories and the nonlinear conservation law

STATE-SPACE MODELLING. A mass balance across the tank gives:

ECE 2100 Circuit Analysis

Section 3.5 Nonhomogeneous Equations; Method of Undetermined Coefficients

CSE 3802 / ECE Numerical Methods in Scientific Computation. Jinbo Bi. Department of Computer Science & Engineering

2.9 Modeling: Electric Circuits

NEWTON S SECOND LAW OF MOTION

Chapter 7 Response of First-order RL and RC Circuits

Position, Velocity, and Acceleration

Y 0.4Y 0.45Y Y to a proper ARMA specification.

Math Week 14 April 16-20: sections first order systems of linear differential equations; 7.4 mass-spring systems.

INVERSE RESPONSE COMPENSATION BY ESTIMATING PARAMETERS OF A PROCESS COMPRISING OF TWO FIRST ORDER SYSTEMS

Modal identification of structures from roving input data by means of maximum likelihood estimation of the state space model

= ( ) ) or a system of differential equations with continuous parametrization (T = R

dy dx = xey (a) y(0) = 2 (b) y(1) = 2.5 SOLUTION: See next page

Matlab and Python programming: how to get started

Dead-time Induced Oscillations in Inverter-fed Induction Motor Drives

Basic Circuit Elements Professor J R Lucas November 2001

h[n] is the impulse response of the discrete-time system:

Problem Set on Differential Equations

RC, RL and RLC circuits

Physical Limitations of Logic Gates Week 10a

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

Laplace transfom: t-translation rule , Haynes Miller and Jeremy Orloff

EE 315 Notes. Gürdal Arslan CLASS 1. (Sections ) What is a signal?

Problemas das Aulas Práticas

Experimental Buck Converter

Non Linear Op Amp Circuits.

EE100 Lab 3 Experiment Guide: RC Circuits

Two Coupled Oscillators / Normal Modes

( ) a system of differential equations with continuous parametrization ( T = R + These look like, respectively:

Università degli Studi di Roma Tor Vergata Dipartimento di Ingegneria Elettronica. Analogue Electronics. Paolo Colantonio A.A.

A Dynamic Model of Economic Fluctuations

10. State Space Methods

CHAPTER 10 VALIDATION OF TEST WITH ARTIFICAL NEURAL NETWORK

CSE/NB 528 Lecture 14: From Supervised to Reinforcement Learning (Chapter 9) R. Rao, 528: Lecture 14

6.01: Introduction to EECS I Lecture 8 March 29, 2011

Numerical Dispersion

23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

2.7. Some common engineering functions. Introduction. Prerequisites. Learning Outcomes

Lab 10: RC, RL, and RLC Circuits

Inductor Energy Storage

Math Final Exam Solutions

LabQuest 24. Capacitors

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Homework-8(1) P8.3-1, 3, 8, 10, 17, 21, 24, 28,29 P8.4-1, 2, 5

Phys1112: DC and RC circuits

Chapter 15: Phenomena. Chapter 15 Chemical Kinetics. Reaction Rates. Reaction Rates R P. Reaction Rates. Rate Laws

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

Linear Time-invariant systems, Convolution, and Cross-correlation

CHBE320 LECTURE IV MATHEMATICAL MODELING OF CHEMICAL PROCESS. Professor Dae Ryook Yang

Challenge Problems. DIS 203 and 210. March 6, (e 2) k. k(k + 2). k=1. f(x) = k(k + 2) = 1 x k

Robust Learning Control with Application to HVAC Systems

Chapter 3 Boundary Value Problem

Math 10B: Mock Mid II. April 13, 2016

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

KEY. Math 334 Midterm I Fall 2008 sections 001 and 003 Instructor: Scott Glasgow

Vehicle Arrival Models : Headway

Fishing limits and the Logistic Equation. 1

This document was generated at 1:04 PM, 09/10/13 Copyright 2013 Richard T. Woodward. 4. End points and transversality conditions AGEC

2.160 System Identification, Estimation, and Learning. Lecture Notes No. 8. March 6, 2006

Inventory Control of Perishable Items in a Two-Echelon Supply Chain

Econ107 Applied Econometrics Topic 7: Multicollinearity (Studenmund, Chapter 8)

Notes on Kalman Filtering

Transcription:

Embedded Sysems and Sofware A Simple Inroducion o Embedded Conrol Sysems (PID Conrol) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 1

Acknowledgemens The maerial in his lecure is adaped from: F. Vahid and T. Givargis, Embedded Sysem Design A Unified Hardware/Sofware Inroducion, John Wiley & Sons, 2002 (Chaper 9) T. Wesco, PID Wihou a PhD hp://www.embedded.com/2000/0010/0010fea3.hm Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 2

Conrol Sysem Terminology Conrol physical sysem (plan) oupu By seing plan inpu Examples Cruise conrol, hermosa, disk drive, chemical processes Difficuly due o Disurbance: wind, road, ire, brake; opening/closing door Human inerface: feel good, feel righ Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 3

Conrol Sysem Tracking Reference Inpu a.k.a. Se Poin where we wan he oupu o be This how he sysem racks he reference inpu or se poin For example, here he user urned up he hermosa Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 4

Conrol Sysem Tracking Reference Inpu a.k.a. Se Poin where we wan he oupu o be This how he sysem racks he reference inpu or se poin For example, here he user urned up he hermosa Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 5

Open-Loop Conrol Sysems Plan Physical sysem o be conrolled: car, plane, disk, heaer, Acuaor Device o conrol he plan: hrole, wing flap, disk moor, Conroller Designed produc o conrol he plan Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 6

Open-Loop Conrol Sysems Oupu (v ) Wha we are ineresed in: speed, disk locaion, emperaure Reference Inpu / Se Poin (r ) Desired oupu: speed, desired locaion, desired emperaure Disurbance (w ) Unconrollable inpu o he plan imposed by environmen Wind, bumping he disk drive, door opening 7 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 7

Characerisics of Open Loop Conrol Feed-forward conrol Delay in acual change of he oupu Conroller doesn know how well hings are going Simple Bes use for predicable sysems Examples? Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 8

Closed Loop Conrol Sysem Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = F e u Plan Model v Conroller Plan Sensor Conrol Law: Plan Model Sysem Model u = F e v +1 = F(v, u, w ) v +1 = F(v, u, w ) Goal: minimize racking error e Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 9

Example Closed Loop Conrol Sysem Conrol Law u P r v Plan Model v 0.7 v 0. 1 5 u w Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = F e u Plan Model v Conroller Plan Sensor Sysem Model v 1 0.7v 0.5P( r 0. 7 0. 5Pv 0. 5Pr w v ) w Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 10

Model of he Plan Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = F e u Plan Model v Conroller Plan Sensor Couner-inuiively, i may no necessary o (accuraely) model he plan However, even a simple model can be very helpful Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 11

Example Model he car speed a + 1 as a linear combinaion of he speed a (i.e., v ) and he hrole a (i.e., u ) v +1 = Av + Bu Nex, experimenally deermine he model parameers A and B. On fla surface a 50 mph, open he hrole o 40 degrees. Then measure he speed afer one ime uni. Assume he speed is 55 mph. Then 55 = 50A + 40B Repea he experimen, bu now sar a 65 mph and wih he hrole a 50 degrees. Assume he resuling speed afer one ime uni is 70.5 mph. Then 70.5 = 65A + 50B One can now solve hese wo equaions for he wo unknowns A and B, o find A = 0.7 and B = 0.5. One can repea he experimen many imes and deermine, say, average values for A and B. (There are more opimum echniques for dealing wih muliple As and Bs). Regardless, we now have model for he car (plan). v +1 = 0.7v + 0.5u Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 12

v v 1 5 1 0.7 v 0.7v 0. u 0.5P( r w 0. 7 0. 5Pv 0. 5Pr w Closed-Loop Conrol v ) w Plan model u P r v Conrol Law (feedback) v 0. 7 0. 5Pv 0. Pr0 w0 1 5 Consider fixed se poin and fixed disurbance A 0.7 0.5P, B 0.5Pr0 w0 v 1 Av B v 1 Av0 B v 2 2 Av B B A v AB B Av1 B A 0 0 v 3 Av 2 B 2 3 2 AB B B A v A B AB B A A v n n1 n2 vn A v0 A A 1B v n 0 n n1 n2 0.7 0.5P v 0.7 0.5P 0.7 0.5P 1 0. Pr w 0 5 0 0 0 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 13

Tuning Performance: Finding Proper P Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = P e u Plan Model v Conroller Plan Sensor v n v 1 0. 7 0. 5Pv 0. 5Pr0 w0 u Pr0 v 45 n n1 n2 0.7 0.5P v 0.7 0.5P 0.7 0.5P 1 0. Pr w To obain convergence requires 0.7 0.5 1 To avoid oscillaion requires 0.7 0.5 0 0 5 P 0.6 P 3. 4 P P 1. 4 Reduce he effec of iniial condiions (v 0 ), make (0.7-0.5P) as small as possible P 1. 4 0 0 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 14

Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = P e u Plan Model v Conroller Plan Sensor v n v 1 0. 7 0. 5Pv 0. 5Pr0 w0 u Pr0 v 45 n n1 n2 0.7 0.5P v 0.7 0.5P 0.7 0.5P 1 0. Pr w 0 5 0 0 v 0. 7 0. 5P v 0. 5Pr w Seady sae means v ss = v + 1 = v ss ss 0 0 v 0.5P w0 r ss 0 0.3 0.5P 0.3 0. 5 P To ge v ss as close as possible o r 0, (perfec racking) le P Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 15

Tuning Performance: Finding Proper P Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = P e u Plan Model v Conroller Plan Sensor To obain convergence requires 1 To avoid oscillaion requires 0 0.7 0.5P 0.6 P 3. 4 0.7 0.5P P 1. 4 Reduce he effec of iniial condiions (v 0 ), make (0.7-0.5P) as small as possible P 1. 4 To ge v ss as close as possible o r 0, (perfec racking) le P Finally, pick P 3. 3 sable, fas, good racking, bu some oscillaion Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 16

v v v 70 Analyze Conroller Performance 20mph, r 50 mph, w0 0 0. 7 0. 5Pv 0. Pr0 0. 7 0. 5(3.3) v 0. 5(3.3 r0 1 5 1 ) v 0.95 v u 1 82.5 Pr0 u 3.350 v v 0 P 3.3 Valid range for conroller is 0-45 o. Thus, wih his P, he acuaor sauraes. Speed (mph) 60 50 40 30 20 10 Tracking error ~ 8 mph Significan oscillaion 0 0 10 20 30 40 50 60 Conrol Poin (i.e., ime) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 17

Analyze Conroller Performance Se P = 1 o avoid oscillaion Valid range for conroller is 0-45 o. Thus, wih his P=1, he acuaor does no saurae. 70 Speed (mph) 60 50 40 30 20 10 No oscillaion Tracking error ~ 20 mph 0 0 10 20 30 40 50 60 Conrol Poin (i.e., ime) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 18

Analyzing he Conroller 70 Se poin (where we wan o be) 60 Speed (mph) 50 40 30 20 10 P = 1.0 P = 2.5 P = 3.3 0 0 10 20 30 40 50 60 Conrol Poin (i.e., ime) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 19

v v v v 20 mph, r0 50 mph, w0 0 Closed-Loop Performance 0. 7 0. 5Pv 0. Pr0 0. 7 0. 5(3.3) v 0. 5(3.3 r0 1 5 1 ) 1.95 v 82. 5 0 w 0 0 Speed (mph) 70 60 50 40 30 P = 3.3, W = - 5 Change is 5 mph compared o 66-33 = 33 mph for open-loop conrol 20 P = 3.3, W =+5 P = 3.3, W =0 10 0 0 10 20 30 40 50 60 Conrol Poin (i.e., ime) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 20

General Conrol Sysem Objecive Causing oupu o rack a reference even in he presence of Measuremen noise Model error Disurbances Merics Sabiliy Oupu remains bounded Performance How well an oupu racks he reference Disurbance rejecion Robusness Abiliy o olerae modeling error of he plan Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 21

Performance (generally speaking) Rise ime Time i akes from 10% o 90% Peak ime Overshoo Percenage by which Peak exceed final value Seling ime Time i akes o reach 1% of final value Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 22

Difficul May need o be done firs Plan is usually on coninuous ime No discree ime. For example, car speed coninuously reacs o hrole posiion, no a discree inerval Sampling period mus be chosen carefully o ensure nohing ineresing happens in beween sampling inervals Plan is usually non-linear Plan Modeling For example, shock absorber response may need o be 8 h order differenial equaion Ieraive developmen of he plan model and conroller Have a plan model ha is good enough Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 23

Conroller Design: P Error (e = r v ) Disurbance (w ) Se Poin (r ) + Σ u = P e u Plan Model v Conroller Plan Sensor Proporional conrol - muliplies he racking error wih a consan P u P r0 v Closed-loop model wih linear plan v 0. 7 0. 5Pv 0. Pr0 w0 1 5 P affecs Sabiliy Tracking Disurbance rejecion Large P can lead o overshoo and oscillaion Make P large o reduce racking error Make P large o improve disurbance rejecion Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 24

Conroller Design: PD Proporional and Derivaive conrol u u - P conrol, and also consider error over ime v D r v r 1 v1 De e P r Pe Inuiively Wan o push more if error is no reducing fas enough Wan o push less if error is reducing really fas 1 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 25

v u v v 1 0.7 v 0. 5u w Plan model Pe PD Conroller De e 1 e r v Conrol Law (feedback) 0.7 v 0. Pr v Dr v r 1 v w 0.7 v 0. 5P Dv 0.5Dv 1 0.5P Dr 0. Dr w 1 5 1 1 5 1 Seady sae means v ss = v + 1 = v Assume reference inpu and disurbance are consan, hen he seady-sae speed is v ss 0.5P r 1 0.7 0.5P 0 Does no depend on D P can be se for bes racking and disurbance conrol Then D can be se o conrol ransien behavior Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 26

PD Conrol Example Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 27

Proporional and Inegral conrol Inuiively u u Conroller Design: PI Sum (inegrae) error over ime, and use his o push P conrol, and also inegrae (sum) error v Ir v r 1 v 1 Ie e e P r Pe 1 2 Ensure ha sysem reaches desired seady sae, evenually P conrols disurbance, I conrols seady sae convergence and convergence rae Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 28

Conroller Design: PID Proporional, Inegral and Derivaive conrol u u P r Pe - use all 3 ypes of conrol v Ir v r 1 v 1 Dr v r 1 v 1 Ie e e De e 1 2 1 Inuiively P considers curren error, conrols disurbance I conrols long-erm error, conrols seady sae convergence and convergence rae D considers how error is changing, conrols ransien response Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 29

Examples Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 30

Applicaion of PID Conrol More han 90% of all conrollers used in process indusries are PID conrollers. A ypical chemical plan has 100s or more PID conrollers. PID conrollers are widely used in: Chemical plans Oil refineries Pharmaceuical indusries Food indusries Paper mills Elecronic equipmens Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 31

Off-The-Shelf PID Conrollers There are many off-he-shelf PID conrollers available Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 32

Block Diagram View of PID Conroller Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 33

Anoher Block Diagram View of PID Conroller Se desired inpu Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 34

Anoher Block Diagram View of PID Conroller Compare acual oupu agains se poin Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 35

Anoher Block Diagram View of PID Conroller Use par of he error signal Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 36

Anoher Block Diagram View of PID Conroller Use sum of he previous errors Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 37

Anoher Block Diagram View of PID Conroller Use rae of change of errors Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 38

Anoher Block Diagram View of PID Conroller Updae he process, and repea Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 39

Sidebar: Analog PID Conroller Inegral Proporional Summer Derivaive Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 40

PID Pseudo Code previous_error = 0 inegral = 0 sar: ge acual_posiion error = sepoin - acual_posiion inegral = inegral + error*d derivaive = (error - previous_error)/d oupu = P*error + I*inegral + D*derivaive previous_error = error wai(d) goo sar Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 41

Sofware Coding Main funcion loops forever, during each ieraion Read plan oupu sensor (may require ADC) Read curren desired reference inpu (se poin) Call a rouine PidUpdae, o deermine acuaor value Se acuaor value (may require DAC) Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 42

Sofware Coding u Pe I e e e De e 1 2 1 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 43

Compuaion u Pe I e e e De e 1 2 1 Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 44

Analyically deriving P, I, D may no be possible E.g., plan no is no available, or o cosly o obain Ad hoc mehod for geing reasonable P, I, D Sar wih a small P, I = D = 0 PID Tuning Increase D, unil seeing oscillaion, hen reduce D a bi Increase P, unil seeing oscillaion, hen D a bi Increase I, unil seeing oscillaion Ierae unil one can change anyhing wihou excessive oscillaion Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 45

Pracical Issues wih Compuer-Based Conrol Quanizaion Overflow Aliasing Compuaion Delay Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 46

Quanizaion & Overflow Quanizaion E.g., can sore 0.36 as 4-bi fracional number Can only sore 0.75, 0.59, 0.25, 0.00, -0.25, -050,-0.75, -1.00 Choose 0.25 Resuls in quanizaion error of 0.11 Sources of quanizaion error Operaions, e.g., 0.50*0.25=0.125 Can use more bis unil inpu/oupu o he environmen/memory ADC resoluion Overflow Can sore 0.75 + 0.50 = 1.25 as 4-bi fracional number Soluions Use fix-poin represenaion/operaions carefully Time-consuming Use floaing-poin co-processor Cosly Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 47

Volage Aliasing Example The poins below are he samples from a sine wave Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 48

Volage Reconsrucion of he sine wave Aliasing Example Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 49

Volage Bu why no his reconsrucion? Aliasing Example Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 50

Volage Aliasing Example Boh (an many ohers) are valid reconsrucions if we don exclude higher frequencies In oher words, if we don eliminae (filer ou) high frequencies, heir samples become undisinguishable from low frequency samples. The high frequencies alias as low frequency signals. Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 51

Aliasing Example Sampling a 2.5 Hz (period = 0.4 s) he following signals are indisinguishable y( ) sin 6 y( ) sin Frequency f = 3 Hz Frequency f = 0.5 Hz In fac, wih sampling frequency of 2.5 Hz one can only correcly sample signal below he Nyquis frequency 2.5/2 = 1.25 Hz. Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 52

Inheren delay in processing Acuaion occurs laer han expeced Need o characerize implemenaion delay o make sure i is negligible Hardware delay is usually easy o characerize Synchronous design Sofware delay is harder o predic Should organize code carefully so delay is predicable and minimized Wrie sofware wih predicable iming behavior (be like hardware) Time Trigger Archiecure Compuaion Delay Synchronous Sofware Language and/or RTOS Embedded Sysems and Sofware, ECE:3360. The Universiy of Iowa, 2016 Slide 53