Chapter 1
Chapter 1
Systems
1
LQ 1-1: Attempt review
Question 1
and
systems
Let's first understand the word system!
A system is something complex which consists of multiple components. These components work
Check your answer and read the feedback before you proceed to the next question!
2
LQ 1-1: Attempt review
Question 2
Integrate
Incorporate
Include
Implant
Implement
Exclude
3
LQ 1-1: Attempt review
Question 3
After understanding the meanings of the words system and embedded, let's return to the title of our course: embedded
systems!
Apparently, we will deal with systems which are embedded.
Two questions arise from this idea:
1. What type of system are we talking about?
2. Where is this system embedded?
From what you read in the online dictionary Lexico.com, an embedded system is a computing system .
A computing system is a general concept that refers to any system that has a processor, a memory, and I/O peripherals for
digital computation.
An embedded system is just a subclass of computing systems.
In this course you will learn the characteristics of an embedded system.
4
LQ 1-1: Attempt review
Question 4
Household devices, including TVs, washing machines, ovens, tooth brushes, etc.
Internet of Things
5
LQ 1-1: Attempt review
Question 5
Originally, computing refers to the execution of basic arithmetic operations such as addition, subtraction,
Nowadays, the concept of computing is much more general and refers to the processing of information .
6
LQ 1-1: Attempt review
Question 6
7
LQ 1-1: Attempt review
The list above is just a tiny set of all the information, today's embedded systems need to process in a car.
And this is why today's cars have tens and sometimes more than one hundred embedded computers.
8
LQ 1-1: Attempt review
Question 7
This is because computing systems are very strict in the way the information is represented.
Specifically, computing systems (processor + memory) can only work on digital data which are buffered in the
9
LQ 1-1: Attempt review
Question 8
Thus, the input information must be conditioned (i.e., converted and adjusted) before it can be processed by the
computing system.
Similarly, the output of the computing system must be conditioned before it can be sent to other system components.
A major learning outcome of any course on embedded systems is to understand how signal conditioning works.
An embedded system has usually the three components (input signal conditioning+computing+output signal
conditioning) on the same chip or board .
A chip that includes a computational core (processor+memory+busses) in addition to components for signal conditioning
is typically called a microcontroller .
10
LQ 1-1: Attempt review
Question 9
Digital-to-Analog converter
USB controller
Analog-to-Digital Converter
An digital to analog converter generates an analog signal. processors cannot process analog signals.
We will learn about all these in components in this course.
11
LQ 1-1: Attempt review
Question 10
Digital-to-Analog converter
USB controller
Analog-to-Digital Converter
Pulse-Wide-Modulation Controller
Bus controllers such as USB and Inter-Integrated Circuit Bus controller work in both directions. This is why they appear as
input and output.
PWM feeds devices which require power control. Example: The speed of a DC motor depends on the power it receives. So
with PWM we can control the speed of a DC motor.
12
Chapter 1: Introduction to Embedded
Systems
13
Question 1
A microcontroller
14
Chapter 1: Introduction to Embedded
Systems
LQ 1-2: How it comes to an embedded system?
15
LQ 1-2: Attempt review
Question 1
The anti-lock brake system (ABS) is an important safety function in cars and other vehicles.
Watch this video to understand how it works:
https://www.youtube.com/watch?v=mKiTAcXK6M4
In normal operation, small differences between wheel speeds and the car speed always occur to accelerate the car or to
brake it.
Without these difference we cannot speed up or down.
ABS only responds to major differences which indicate locking to avoid skidding.
16
LQ 1-2: Attempt review
Question 2
So, the ABS should only respond to significant differences between the car speed and the wheel speed.
Wheel locking depends on the car speed: The same brake pressure may lock the wheels or not depending on how fast we
are driving.
When we drive very fast on the highway and we apply brake pressure, a big difference between the car speed and the
wheel speed is generated but the wheel still runs.
The same difference may cause a lock at lower speeds.
This is why the ABS does NOT use the absolute difference between the car speed and the wheel speed.
Rather, it relates this difference to the car speed.
V c −V w
This ratio is called slip ratio λ =
Vc
17
LQ 1-2: Attempt review
Question 3
V c −V w
λ=
Vc
Typically the ABS tries to keep λ under a specific threshold value λ max .
λ max varies from car to car but typical values are around 35%.
Assume that λ max = 0.35 and V c = 100 kmh . At what wheel speed should the ABS respond?
65
kmh.
100−V w
0.35= ⇒ 35= 100−V w ⇒ V w = 65
100
18
LQ 1-2: Attempt review
Question 4
By closing an electric valve on the oil pipe from the pump to the brake pads at the wheel.
19
LQ 1-2: Attempt review
Question 5
Keeping the valve closed can be catastrophic because this would be like a car without brake.
Very short closing and then opening forever is also problematic because this would be like a car without ABS.
The right solution is as follows:
The ABS should close the valve for short time and then reopen it and observe how λ has changed.
If the new value of λ has become below λ max , no need to close the valve again. Otherwise the valve should be closed
again and the process is repeated.
20
LQ 1-2: Attempt review
Question 6
As you can see, we are going toward an algorithm, i.e., something that can be described by a sofware program that can
run on an embedded system.
But we still need to answer more questions.
How many iterations should be done per second?
In other words, how many times should we close and open the valve per second.
(Google it if you want!)
Question 7
So, now you know that the embedded system needs to execute the algorithm above 10 times per second. This is the
real-time requirement.
If the valve should be closed and opened 10 times per second, how long is the iteration or the control cycle?
100
millisecond.
23
LQ 1-2: Attempt review
Question 8
So, in each cycle (100 msec), the valve must be closed and then reopened.
But, how long should it stay closed and how long it should stay open?
When you get into your car in the summer you turn the AC to full power. Then you reduce cooling/fan power.
The ABS should work similarly, when λ is very large, the risk of locking is very high. So we have to give full power: Close
the valve for longest time possible within the control cycle.
Later when λ decreases, we reduce the closing time and increase the opening time.
24
LQ 1-2: Attempt review
Question 9
Based on the last point, the algorithm should be updated as follows (changes in blue):
From the control theory (and from our life), we know that proportional control alone is not good enough.
This is because proportional control just considers the current value of λ.
Rather, good control strategies should consider the present time, the history, and the future. So the control signal
should be:
1. Proportional to λ.
2. Proportional to the development of λ through the past, i.e., to its integration over time.
3. Proportional to the future change of λ, i.e., to its derivation with respect to time.
The PID controller is one of the most amazing and widely used controllers in the world.
The PD and PI controllers are simpler editions of the PID controller and are also used in practice.
25
LQ 1-2: Attempt review
Question 10
Now you can see the computational overhead of the ABS algorithm.
Remember that this algorithm must be executed for each wheel separately .
As you saw in the video, different wheels can have different level of locking.
For example, the left side of the road can have sand. So the left-side wheel are at higher risk to lock when you break.
Treating the wheels separately increased the control overhead significantly.
26
LQ 1-2: Attempt review
Question 11
The above is a mature presentation of the ABS controller for one wheel.
Now, let's look back at what we learned in LQ1-1.
We learned that an embedded system has three main components:
3. compute λ Computing
5. if λ ≤ λ max , go to 10 Computing
6. execute the PID algorithm to determine the closing time for the valve Δt. Computing
9. go to 1 Computing
Question 12
Computing λ needs
2
28
LQ 1-2: Attempt review
Question 13
This is a whole algorithm with multiple steps. The following box shows an Arduino code for one PID control cycle:
As you can see calculating the control value PID_value in one cycle takes
3
additions,
3
subtractions,
6
multiplications, and
2
29
LQ 1-2: Attempt review
Question 14
Perform some research and be thoughtful to give a convincing explanation of the integral part of the PID controller.
Write it below.
30
Chapter 1: Introduction to Embedded
Systems
RQ 1-2: How it comes to an embedded system?
31
RQ 1-2: Attempt review
Question 1
exit 10
execute the PID algorithm to determine the closing time for the valve Δt. 6
compute λ 3
if λ ≤ λ max , go to 10 5
go to 1 9
32