0% found this document useful (0 votes)
2 views31 pages

Chapter 1

Chapter 1 introduces embedded systems, defining them as computing systems that integrate various components to perform specific functions. It discusses the ubiquity of embedded systems in modern technology, particularly in vehicles, and emphasizes the importance of processing information for safety and efficiency. The chapter also outlines the functionality of embedded systems, such as the anti-lock brake system (ABS), and the need for real-time processing and control algorithms.

Uploaded by

trafiq088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views31 pages

Chapter 1

Chapter 1 introduces embedded systems, defining them as computing systems that integrate various components to perform specific functions. It discusses the ubiquity of embedded systems in modern technology, particularly in vehicles, and emphasizes the importance of processing information for safety and efficiency. The chapter also outlines the functionality of embedded systems, such as the anti-lock brake system (ABS), and the need for real-time processing and control algorithms.

Uploaded by

trafiq088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Chapter 1: Introduction to Embedded

Systems

LQ 1-1: What is an embedded system?

1
LQ 1-1: Attempt review

Question 1

This course is about embedded systems.


So, the course title has two words:
embedded

 and
systems


Let's first understand the word system!

A system is something complex  which consists of multiple components. These components work

together  to perform a specific function.

A system always has some interface with the outside world  .

Check your answer and read the feedback before you proceed to the next question!

2
LQ 1-1: Attempt review

Question 2

Now let's look at the word embedded!


This word stems from the verb embed.

Search for the meanings of this verb on LEXICO.com!


Which meanings are correct?

Integrate 

Incorporate 

Include 

Implant 

Implement

Exclude

The correct answers are: Integrate, Incorporate, Include, Implant

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?

Let's answer Question 1!


What type of system are we talking about?

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

Now let's throw some light on the second question.


Where do we embed an embedded system?

Vehicles including cars, planes, trains, ships, drones, etc. 

Space industry including satellites, space shuttles, space rockets, etc. 

Industrial production machines for foods, plastic, medicine, etc. 

Industrial and non-industrial robots 

Household devices, including TVs, washing machines, ovens, tooth brushes, etc. 

Internet of Things 

Toys such as remote-controlled cars, play stations, etc. 

Communication systems including mobile devices, smart phones, etc. 

Medical instruments and devices including for RMI, X-Rays, etc. 

Defense industry including tanks, missiles, etc. 

Embedded embedded systems are everywhere.


A modern car can have more than one hundred embedded systems.

5
LQ 1-1: Attempt review

Question 5

So, embedded systems are everywhere. But why?


Why do we need computing systems everywhere?

Why is computation ubiquitous?

Originally, computing refers to the execution of basic  arithmetic operations such as addition, subtraction,

multiplication and division, which are used to manipulate numbers  .

Nowadays, the concept of computing is much more general and refers to the processing of information  .

6
LQ 1-1: Attempt review

Question 6

So, embedded systems are everywhere because information is everywhere.

We are in the information age!


With respect to cars, what of the following is information?

The temperature of the engine 

The oil pressure in the engine 

The oxygen level in the exhaust 

The speed of each wheel 

The rotational position of the engine 

Whether the gas pedal is pressed 

Whether the petrol pedal is pressed 

The gear position in the car: D, R, N, or P 

The set value of the cabin temperature 

The actual value of the cabin temperature 

The fan speed of the AC 

Whether the AC is on or off 

Whether the navigation system is on or off 

Whether the cruise control is activated 

The number of car doors 

Which doors are open and which are closed 

The number of passengers in the car 

Whether a seat belt is fastened 

Whether the car key is in close proximity 

Whether the car engine is on 

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.

You should be aware that everything is information:


You are an information.
Your name is an information.
Your age is another information.
Your gender, your height, your weight, your eye color, your......
Your thoughts, your beliefs, your feelings, .....

The speed you want to drive your car at.


The distance you need to cross.
The route you want to go through.
The level of comfort you need in your car.
The level of safety.
All these are information.

We are in the information age!

8
LQ 1-1: Attempt review

Question 7

We process information because we want to change our lives.


For example, we want to make driving safer, easier, more comfortable, more efficient, etc.
For this, we
1. get information from the car, the driver, the road, the GPS, the environment, etc.
2. process this information
3. generate new information which is used by other system components: by the engine to accelerate the car, by
the navigation system to provide the current location, by brake system to slow down the car, etc.
m
r o l x
These three generic steps are practically ve y c pe  .

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

memory in a binary  form.

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

Which of the following components performs input signal conditioning?

Digital-to-Analog converter

USB controller 

Inter-Integrated Circuit Bus 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

Which of the following components performs output signal conditioning?

Digital-to-Analog converter 

USB controller 

Inter-Integrated Circuit Bus 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

RQ 1-1: What is an embedded system?

13
Question 1

To compute we at least need a microprocessor and a memory  .

A microprocessor  cannot deal with analog signals.

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

The ABS intervenes when


there is a significant difference between the car speed and the wheel speed. 

Read the feedback!

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.

But, this difference should be related to the car speed  .

Like always, read the feedback!

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?

It should respond when V w ≤

65

 kmh.

100−V w
0.35= ⇒ 35= 100−V w ⇒ V w = 65
100

18
LQ 1-2: Attempt review

Question 4

So, now you know that the ABS must:

1. measure or read the car speed,


2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max , and
5. respond to reduce λ .

But how should it respond?

By closing an electric valve on the oil pipe from the pump to the brake pads at the wheel. 

This is how braking works:


1. Usually when we press the brake pedal, a pump is activated.
2. The pump increases oil pressure in the pipe (turquoise).
3. The oil presses the piston (red).
4. The piston carries a brake pad (blue)
5. The brake pas presses the wheel rotor (gray)
6. The Wheel decelerates.

This is when the ABS is activated:


1. The ABS closes the electrical valve (red).
2. The oil pressure does not reach the pads. This acts as if the driver would release the pedal

19
LQ 1-2: Attempt review

Question 5

So, now we can update the ABS tasks. It must:


1. measure or read the car speed,
2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max , and
5. apply a signal to the valve to reduce λ (i.e., close the valve).

After closing the valve, what next?

The ABS should reopen the valve and observe λ again. 

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

Re-observing λ makes a nice closed-loop control system:

So, now we can update the ABS function as follows:


1. measure or read the car speed,
2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 9
6. close the valve
7. reopen the valve
8. go to 1
9. exit

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!)

Around 10 times per second. 

It depends on the car model and size.


Different values can be found in the internet.
But 10 iterations per second is a good number.
We will use this one. 21
LQ 1-2: Attempt review

Question 7

1. measure or read the car speed,


2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 9
6. close the valve
7. reopen the valve
8. go to 1
9. exit

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.

1/10 = 0.1 sec = 100 millisecond

23
LQ 1-2: Attempt review

Question 8

1. measure or read the car speed,


2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 9
6. close the valve
7. reopen the valve
8. go to 1
9. exit

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?

The period of closure should depend on λ. 

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):

1. measure or read the car speed,


2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 9
6. close the valve for a time proportional to λ
7. reopen the valve for the rest of the cycle
8. go to 1
9. exit

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.

A controller with these abilities is called a PID Controller  .

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

1. measure or read the car speed,


2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 9
6. close the valve for a time proportional to λ
7. reopen the valve for the rest of the cycle
8. go to 1
9. exit

The PID controller can be implemented using analog circuits.


Also, by using numeric approaches for the integration and differentiation, the PID can be implemented as an algorithm
that runs on a computer or embedded system.
Recall that the task of the PID algorithm would be just to determine the time for closing the valve.
Based on this, the ABS algorithm should be updated as follows (changes in blue):
1. measure or read the car speed,
2. measure or read the wheel speed,
3. compute λ,
4. compare λ with λ max ,
5. if λ ≤ λ max , go to 10
6. Execute the PID algorithm to determine the closing time for the valve Δt.
7. close the valve for Δt
8. reopen the valve for 100 msec-Δt.
9. go to 1
10. exit

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

1. measure or read the car speed


2. measure or read the wheel speed
3. compute λ
4. compare λ with λ max
5. if λ ≤ λ max , go to 10
6. execute the PID algorithm to determine the closing time for the valve Δt
7. close the valve for Δt
8. reopen the valve for 100 msec-Δt
9. go to 1
10. exit

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:

Map each step of the ABS controller to the ES components:

1. measure or read the car speed Input signal conditioning 

2. measure or read the wheel speed Input signal conditioning 

3. compute λ Computing 

4. compare λ with λ max Computing 

5. if λ ≤ λ max , go to 10 Computing 

6. execute the PID algorithm to determine the closing time for the valve Δt. Computing 

7. close the valve for Δt Output signal conditioning 

8. reopen the valve for 100 msec-Δt Output signal conditioning 

9. go to 1 Computing 

10. exit Computing 

Measuring the wheel/car speeds occurs through sensors.


In the core, sensors provide analog signals or pulses.
These signal must be conditioned to digital values that can be processed by the microprocessor within the microcontroller.
On the other hand, the PID controller generates a digital value that must be translated into a power signal that controls
the valve. This is why we need output signal conditioning.
All other steps are computational steps. That means that they can be executed by the computational system (processor +
memory) and additional components like a timer.
27
LQ 1-2: Attempt review

Question 12

1. measure or read the car speed


2. measure or read the wheel speed
3. compute λ
4. compare λ with λ max
5. if λ ≤ λ max , go to 10
6. execute the PID algorithm to determine the closing time for the valve Δt
7. close the valve for Δt
8. reopen the valve for 100 msec-Δt
9. go to 1
10. exit

Let's consider step 3.

Computing λ needs
2

 arithmetic calculations (Write a number!)

One subtraction and one division:


V c −V w
λ=
Vc

28
LQ 1-2: Attempt review

Question 13

1. measure or read the car speed


2. measure or read the wheel speed
3. compute λ
4. compare λ with λ max
5. if λ ≤ λ max , go to 10
6. execute the PID algorithm to determine the closing time for the valve Δt
7. close the valve for Δt
8. reopen the valve for 100 msec-Δt
9. go to 1
10. exit

Let's consider step 6.

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

 divisions (write numbers only!).

29
LQ 1-2: Attempt review

Question 14

Though mathematically simple, the PID algorithm is very difficult to understand!


The most difficult aspect is why we need the integral part (third line).
I know how many textbooks and YouTube videos explain this. But they are all not convincing.

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

Put the steps of the ABS controller in order!

measure or read the car speed 1 or 2 

measure or read the wheel speed 1 or 2 

close the valve for Δt 7 

exit 10 

execute the PID algorithm to determine the closing time for the valve Δt. 6 

compute λ 3 

reopen the valve for 100 msec-Δt 8 

if λ ≤ λ max , go to 10 5 

compare λ with λ max 4 

go to 1 9 

32

You might also like