CCE 62204
Embedded System
Fakultas Ilmu Komputer Universitas Brawijaya
Agenda kuliah
• Introduction + Overview
• Design flow, spesifikasi dan model komputasi
• State chart dan UML
• Interfacing dengan environment
• Hardware
• Data Communication in Embedded System
• Programming & Embedded OS
• -----------------------------------UTS-------------------------------------
• Scheduling
• Reliability dan fault tolerance
• Evaluasi dan Validasi
• Optimisasi
• Testing Embedded system
• Presentasi Project 1
• Presentasi Project 2
• -----------------------------------UAS-------------------------------------
4 March 2024 Slide 2
Previously …
• Unified Modeling Language (UML)
• Use case diagram
• Sequence chart
• Statecharts
• Hierarchy:
• Basic states
• Sub states
• OR (XOR) super states
• AND super states
• Default state
• History State
• Timers
4 March 2024 Slide 3
Embedded System Hardware
Embedded system hardware is frequently used in a loop (“hardware in a loop“):
▪ Open loop system
▪ Closed loop system
Sensors
Processing of physical data starts with capturing data.
Part that converts from non-electrical unit/physical phenomenon into
electrical unit is called sensor
Sensors can be designed for virtually every physical and chemical
quantity, including
▪ weight, acceleration, electrical current, voltage, temperatures
▪ chemical compounds
▪ …
▪ Limit switch
▪ microphone
▪ Camera
Input Digital & Analog
Digital:
• ON and OFF
• Binary sensor
Analog:
• Physical environment ===========➔ Need Analog to Digital Converters
Ex: LM35, microphone
4 March 2024 Slide 6
Example of other sensors:
Thermal sensor (analog)
Humidity (digital)
4 March 2024 Slide 7
Example:
Accelerometer (analog)
Gyroscope:
4 March 2024 Slide 8
Signals
Sensors generate signals
Definition:
a signal s is a mapping from the time domain DT to a value domain DV :
s : DT → DV
DT : continuous or discrete time domain
DV : continuous or discrete value domain.
Aliasing
Sample rate is the frequency at which the ADC converts the analog input waveform to digital data.
2 t 2 t
e3 (t ) = sin + 0.5 sin
8 4
2 t 2 t 2 t
e4 (t ) = sin + 0.5 sin + 0.5 sin
8 4 1
Indistinguishable if sampled at integer times, ps=1
Matlab demo
Aliasing
4 March 2024 Slide 11
sampling
Reconstruction impossible, if not sampling frequently enough
How frequently do we have to sample?
Nyquist criterion (sampling theory):
the sample rate fs must be greater than twice the highest frequency component
of interest in the measured signal.
fN is called the Nyquist frequency, fs is the sampling rate.
See e.g. [Oppenheim/Schafer, 2009]
sampling
4 March 2024 Slide 13
Discretization of values: A/D-converters
Digital computers require digital form of physical values
s: DT → DV
Discrete value domain
A/D-conversion.
Encoding of voltage intervals
“11“
“10“
“01“
“00“
Vref /4 Vref /2 3Vref /4 Vref h(t)
Resolution
❖ Resolution (in bits): number of bits produced
❖ Resolution Q (in volts): difference between two input voltages causing the
output to be incremented by 1
VFSR Q: resolution in volts per step
Q= with VFSR: difference between largest
n and smallest voltage
n: number of voltage intervals
Example:
Q = Vref /4
The higher the resolution of an
instrument, the greater the
precision
Signal conditioning
Example of signal conditioning:
▪ Amplifying
▪ Filtering
4 March 2024 Slide 17
Amplifier
4 March 2024 Slide 18
Filtering
Frequency domain
Low pass filtered
original
Frequency domain
original
High pass filtered
4 March 2024 Slide 19
Actuator
Actuator convert electrical signal into motion unit
Actuator is classified into electric and pneumatic. Pneumatic is only used in
big-torque
Digital output & Analog output:
Digital Output:
• ON and OFF ------→ relay, LED, logic controlled valve
Analog output:
• Not only 2 condition -------→ motor, heater, linier controlled valve
DC motor
PWM=
Pulse Width Modulation
H bridge motor driver
4 March 2024 Slide 21
DC SERVO motor
The general concept is to simply
send an ordinary logic square
wave to your servo at a specific
wave length, and your servo
goes to a particular angle (or
velocity if your servo is modified).
The wavelength directly maps to
servo angle.
4 March 2024 Slide 22
Pneumatic & Hydrolic
4 March 2024 Slide 23
Pneumatic & Hydrolic
4 March 2024 Slide 24
Diagram for I/O
4 March 2024 Slide 25
Interpreting block diagrams
• Block diagram is a shorthand, graphical representation of a physical system,
illustrating the functional relationships among its components.
• The simplest form of the block diagram is the single block, with one input
and one output.
• The interior of the rectangle representing the block usually contains a
description of or the name of the element, or the symbol for the
mathematical operation to be performed on the input to yield the output.
• The arrows represent the direction of information or signal flow.
x y
Variables
Variables are represented by arrows in block diagrams
Variables correspond to a physical and measurable quantity
❖ Example: suppose you’re modeling a process for displaying temperature
❖ You must have a way of quantifying the temperature
Variables must have physical units
❖ Actual speed units are MPH or km/hr
Processes
Processes are represented by the blocks in block diagrams:
Process
variable variable
Processes must have at least one input variable and at least one output
variable
Processes
Most processes transform units:
Pulse Width Engine
Modulation (%) speed (rpm)
Motor
Speed (m/s)
PWM (%)
Speed
steep (deg) adjustment
Measurement Processes
• Processes that measure inputs are called sensors
• Input is physical property (MPH, mg/dl, etc.)
• Output is electrical or mechanical signal
• Typically model output to have units of input
Actual Measured
speed Speedo- speed
meter
example
4 March 2024 Slide 30
Feedback Control Systems
• Many systems measure their output and use this measurement to control
system behavior
• This is known as feedback control – the output is “fed back” into the
system
• The summing junction is a special process that compares the input and the
feedback
• Inputs to summing junction must have same units!
input process output
sensor
Toilet Flush Example
• Float height determines desired water level
• Flush empties tank, float is lowered and valve opens
• Open valve allows water to enter tank
• Float returns to desired level and valve closes
flush
desired water actual
float valve
level tank level
float
Diagram for input
Explanation of special
communication protocol
should be exist
Number of
wire/interconnection in bus
2
SRF08
Ultrasonic Range Intel Galileo
Finder
I2C / TWI
Diagram for output
Physical pin
interconnection
should be shown
Explanation of special
communication protocol
should be exist
Number of
wire/interconnection in bus
3
Intel Galileo / Arduino Servo Motor
PWM
Next:
Hardware & information processing
4 March 2024 Slide 35