0% found this document useful (0 votes)
2 views

Topic 7-Control

IBDP CS HL Control

Uploaded by

priyanka.sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Topic 7-Control

IBDP CS HL Control

Uploaded by

priyanka.sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Topic 7: Control

HL Extension

© Justin Robertson 2017. All rights reserved.


The term for a device that
converts one type of energy

Overview
to another is transducer. Both
sensors and actuators are
transducers.

Inputs Outputs
Sensors capture Processing The system affects the
analog data, such as The microcontroller outside world in some
temperature, or CPU makes a way, e.g. turning on a
heater, moving a robot
pressure, light. This decision on the
arm, adjusting the
is converted to basis of the data speed of a motor. The
digital by a AD input. If some generic term for the
(analog-to-digital) threshold is mechanism by which a
converter, so that it reached, then some control system acts on
can be processed action is taken. its environment is an
by a computer. actuator.

© Justin Robertson 2017. All rights reserved.


Examples of control systems
The following are cited by the IB as examples
of control systems. You should make sure that
you can describe each one of them in terms of
inputs, processing and outputs.
• Automatic doors • Process control
• Heating systems • Device drivers
• Taxi meters • Domestic robots
• Elevators • GPS systems
• Washing machines • Traffic lights

© Justin Robertson 2017. All rights reserved.


Automatic Doors
Inputs
• Optical motion sensors emit infrared or microwave radiation and detect it
rebounding off an approaching person. The amount of radiation detected is
converted to a digital value by an AD converter.
Processing
• If the value corresponding to the amount of radiation reflected back into the
sensor exceeds some pre-set threshold, a command is issued by the
microcontroller to open the doors.
Outputs
• Motors attached either to a hydraulic arm, belt or cable pull or slide the doors
open. After some pre-set delay, the doors close again.

© Justin Robertson 2017. All rights reserved.


Heating Systems
Inputs
• Temperature sensors detect ambient temperature and convert the analog data
into digital so that it can be interpreted by the microcontroller. (There are lots of
ways to measure temperature but a common one is a thermistor, whose
resistance changes with temperature.)
Processing
• If the temperature value is above or below some pre-set threshold, then a signal
is sent to the appropriate temperature control device.
Outputs
• Turning a fan on/off
• Turning a heater on/off
• Turning an air conditioner on/off
• Opening/closing windows

© Justin Robertson 2017. All rights reserved.


Taxi Meters
Inputs
• Sensors attached to the transmission of the car measure the distance travelled.
This is converted into a digital value by an AD converter.
• A timer measures the journey time elapsed.
Processing
• If the taxi travels a preset distance, then an amount is added to the fare total.
• If the taxi waits for a preset period, then an amount is added to the fare total.
• In practice, the microcontroller will use some algorithm to determine, from the
combination of distance travelled and time elapsed, when to increase the fare
total.
Outputs
• An amount is added to the fare total and a small digital display shows the
running total.

© Justin Robertson 2017. All rights reserved.


Elevators
Inputs
• Passengers press buttons to call the elevator.
• Passengers press buttons to tell the elevator where to go.
• A load sensor converts the current weight of the occupants of the elevator, converts it to a
digital value using an AD converter, and sends this value to the microcontroller.
Processing
• The microcontroller calculates where to go and in what order according to three pieces of
information:
– Where passengers are waiting
– Where passengers want to go
– Where the elevator is currently
• If the load value exceeds a pre-set threshold, the microcontroller produces some sort of
appropriate output.
Outputs
• The elevator is moved using either a hydraulic ram or a steel rope on a motor-driven pulley.
• The doors are opened using cables on a motorized pulley that slide the doors on rollers.
• A warning or alarm may sound in the event of excessive load, and the elevator may cease to
function until the load is reduced.

© Justin Robertson 2017. All rights reserved.


Washing Machines
Inputs
• The programme number is entered by the user through buttons
• The amount of water in the drum is water level sensor.
• The weight of the load is measured by a weight sensor.
• The temperature of the water can be measured.
• Time
Processing
• The microcontroller responds to the programme choice by activating the appropriate cycle.
• When the amount of water reaches a pre-set level, the microcontroller issues a command to shut
off the water supply.
• If the water temperature is too low, the water heater is turned on.
• If the time is reached, the motor is turned off.
Outputs
• The water supply on/off
• Water heater on/off
• Motor: drum turning / drum speed
• Lights and beeps

© Justin Robertson 2017. All rights reserved.


Device Drivers
Inputs
• Requests issued by the operating system or application software
Processing
• Translation of the request into low-level instructions understood by the
hardware
Outputs
• The hardware reacts appropriately

© Justin Robertson 2017. All rights reserved.


Domestic Robots
Few models exist yet. Examples are:
• Vacuum cleaners
• Lawn mowers
• Pool cleaners
• Security patrollers
Inputs
• Vacuum cleaners, lawn mowers and pool cleaners all sense the perimeter of the
area in which they are to work. They do this with a combination of cameras and
pressure sensors.
• Security robots also detect movement and/or heat.
Processing
• Domestic robots build a map of their surroundings from their sensory input.
They use this information to decide where to move and how to act.
Outputs
• Motors controls wheels and cleaning/mowing equipment.
• Security robots can also take video of suspicious activity or alert a human.

© Justin Robertson 2017. All rights reserved.


Global Positioning Systems
Inputs
• High-frequency, low-power radio waves are sent to and received from at least
three geostationary satellites.
Processing
• The amount of time taken for the signal to come back from each satellite allows
the handheld unit to calculate its own position.
Outputs
• The basic information provided by a GPS is your location, but some can also
calculate speed and journey duration, together with a route travelled.

© Justin Robertson 2017. All rights reserved.


Traffic Lights
There are different types of traffic lights, some for traffic only, some
for pedestrians to cross.
Inputs
• A button is pressed by a pedestrian when they want to cross the road.
• Some traffic lights can sense when a car is waiting.
• Some traffic lights can be overridden by humans who are watching the traffic through
cameras.
• Some traffic lights just work on timers.
Processing
• The system receives a signal from its sensory input requesting that it initiate its
sequence. The system calculates how long since it last changed. If this time was
sufficiently long ago, it initiates its sequence.
Outputs
• The lights change according to a pre-set sequence.
• A sound alerts visually-impaired pedestrians.

© Justin Robertson 2017. All rights reserved.


Process Control (Generic)
This is a generic term for all control systems that perform some task in a way that is regulated by the conditions of
the system. Use this example to help you describe a system you have not encountered in the examples provided.

Inputs
• The system gathers data about the current state of the system from sensors that
convert analog data to digital data so that it can be read and understood by the CPU or
microcontroller (AD conversion).
• Examples are heat, light, pressure, gas concentrations, movement, distance, pH,
salinity, saturation, etc.
Processing
• The microcontroller compares the current state information with pre-programmed
thresholds and acts accordingly.
• Rules and thresholds are stored in ROM memory.
• For example if it is too cold, then a heater is turned on, if it movement is detected, an
alarm goes off, etc.
Outputs
• The digital signal from the microcontroller causes some effect in the physical world
through an actuator (digital-to-analog or DA conversion). The effect of the actuator is
to regulate the state of the system.

© Justin Robertson 2017. All rights reserved.


Microprocessor versus Microcontroller
• A microcontroller is made up of a microprocessor (the CPU), plus
some ROM and RAM, plus I/O ports, all integrated into a single
chip.
• Essentially it is a small CPU with a program written into its ROM
• It is often part of an embedded system (a dedicated, single-
purpose computer system forming part of a larger mechanical
device)
• The role of a microcontroller is to make decisions about how a
system is to behave based on the inputs it receives and the logic
that is programmed into it.
• Microcontrollers are found in all of the examples in this topic.
They are responsible for the processing part of the control
system.
© Justin Robertson 2017. All rights reserved.
Feedback

Input Processing Output


(Sensor) (CPU) (Actuator)

FEEDBACK

• Feedback occurs when a system changes the value that it senses. For example, a
central heating system senses temperature but also changes the temperature.
• The aim of a feedback system is to keep some value, e.g. temperature, within some
range.
• Explain the role of feedback in a household electric oven [4 marks]
© Justin Robertson 2017. All rights reserved.
Hardware associated with control systems

• Input
– Sensors
– AD Converters
• Processing
– Microcontroller/Microprocessor
• Output
– Actuators
– Transducers
– Fan, sprinkler, alarm, etc
© Justin Robertson 2017. All rights reserved.
Related topics
• Given a description of a control system, you may
be asked to:
– Construct a flowchart (even though the guide says
you won't)
– Write an algorithm in pseudocode

© Justin Robertson 2017. All rights reserved.


Example questions
An air conditioning system is activated when the room temperature exceeds 24
degrees Celsius. It is deactivated when the room temperature falls below 22
degrees Celsius.
1. Explain the role of feedback in this system. [3 marks]
2. Explain why an analog-to-digital converter is required. [3 marks]
3. Identify three hardware devices that the system might use. [3 marks]
4. Draw a flowchart to model the system. [4 marks]
5. Construct pseudocode for the algorithm described above. [4 marks]
6. Explain why there is a difference between the temperatures at which the system
is activated and deactivated. [3 marks]

© Justin Robertson 2017. All rights reserved.


Social and ethical issues of embedded systems

• Tagging prisoners
– ☺ Fewer parole violations
– ☹ Invasion of privacy
• Surveillance and CCTV
– ☺ Reduction in crime
– ☺ Invasion of privacy
– ☹ Information can be misused (e.g. blackmail, discrimination, marketing)
• Safety systems
– ☺ Greater levels of safety
– ☹ Overreliance
– ☹ Threat from hackers

© Justin Robertson 2017. All rights reserved.


Distributed computing
• A distributed system is made up of separate
autonomous computers that communicate and
coordinate their actions using messages such
that they appear to the user to be a single
integrated computing facility.
• An example is a distributed database, which
doesn't reside on one computer but is housed on
several computers which update each other
asynchronously.

© Justin Robertson 2017. All rights reserved.


Comparison
Centralised Distributed
• One component with non- • Multiple autonomous
autonomous parts components
• Components are not shared
• Component shared by users by all users
all the time • Resources may not be
• All resources accessible accessible
• Software runs in a single • Software runs in concurrent
process processes on different
processors
• Single Point of control • Multiple Points of control
• Single Point of failure • Multiple Points of failure

© Justin Robertson 2017. All rights reserved.


Autonomous Agents
• A self-governing computer program that is part of a larger environment These characteristics featured in
that it senses and reacts to. the 2014 exam mark scheme:
• Autonomous agents sometimes cooperate to achieve their aims.
• They usually run in their own thread of execution. Autonomy
• They have these characteristics (Mills & Stufflebeam, 2005): Agents activate alone for a task and
– Environment (this must be a dynamic description, that is, a
description of a state of affairs that changes over time as real life are not invoked for a task;
situations do). Agents can select the task
– Sensing capabilities (this depends on the sensor equipment; it themselves (based on priorities or
determines the sort of data the agent is capable of receiving as
input).
goal-directed search) without human
– Actions (this would be a change in the environment brought about intervention;
by the agent, requiring the agent to update its model of the world,
which in turn may cause the agent to change its immediate Reactive behavior
intention).
– Desires (these are the overall policies or goals of the agent).
Agent senses the environment in
– Action Selection Architecture (the agent decides what to do which it is, and decides what to do
next by consulting both its internal state, the state of the world, reacting on its perceptions;
and its current goal; then it uses decision-making procedures to
select an action).
Concurrency/sociality
Examples of autonomous agents: Agents can interact with other
• A robotic vacuum-cleaner. agents through communication, in
• Programs that track stock market activity and try to predict trends. different modes: coordination,
• Distributed military defence systems. cooperation, competition;
• NPCs in MMORPGs.
• Monitoring network traffic and routing traffic in order to balance load. Persistence
The code describing an agent runs
continuously like a process, and is
not executed on demand;
© Justin Robertson 2017. All rights reserved.
© Justin Robertson 2017. All rights reserved.
© Justin Robertson 2017. All rights reserved.

You might also like