control system. - Excellence Gateway
Download
Report
Transcript control system. - Excellence Gateway
Know how data
represented in
control systems
Sayande Adekoye
College of North West London
Topic
Control Systems Using IT – An Introduction
Aims
To teach IT
Introduction to Control Systems, Types of Control Systems, Analogue & Digital, Analogue
and Digital Signals
Give students a Task to complete during the PowerPoint presentation, can either work in
pairs/individual or groups
Level
Level 3
Method
All Slide Show, Various tasks throughout the presentation, can be used as a group discussion,
or as individual/pairs task. Can be handed to students at the end of the lesson for revision
purposes.
Equipment
Laptop
Projector
Printer
Notepad/Pens/Pencils
Duration
1 Hour
Sensors and
Actuators
• Sensors and Actuators are amazing little things that help us
through day to day life that we often overlook.
• We often utilise many sensors and actuators suited to the certain
situations.
Sensors
•
A normal PC has no way of knowing what is happening in the real world
around it. It doesn’t know if it is light or dark, hot or cold, quiet or noisy. How
do we know what is happening around us? We use our eyes, our ears, our
mouth, our nose and our skin - our senses.
•
A normal PC has no senses, but we can give it some: We can connect
sensors to it...
•
A sensor is a device that converts a real-world property (e.g. temperature) into
data that a computer can process.
The role of sensors in control
•
Sensors are used to measure physical quantities such as temperature, light,
pressure, sound, and humidity. They send signals to the processor. For
example:
–
–
–
–
A security alarm system may have an infrared sensor which sends a signal
when the beam is broken.
A heat sensitive sensor in the corner of a room may detect the presence of a
person.
Temperature sensors could be used to control the heating in a large building.
Magnetic sensors are used to detect metal and can be placed in roads to
monitor traffic flow.
Sensors
•
Examples of sensors and the properties they detect are...
Sensor
Temperature
Light
Pressure
Moisture
Water-level
Movement
Proximity
Switch or button
What it Detects
Temperature
Light / dark
Pressure (e.g. someone standing on it)
Dampness / dryness
How full / empty a container is
Movement nearby
How close / far something is
If something is touching / pressing it
•
A sensor measures a specific property data and sends a signal to the
computer. Usually this is an analogue signal so it needs to be
converted into digital data for the computer to process. This is done
using by an Analogue-to-Digital Converter (ADC).
•
Sensors are used extensively in monitoring / measuring / data logging
systems, and also in computer control systems.
Actuators
•
An actuator is often part of a computer control system.
•
The actuator is a mechanical device or motor which carries out the action or
decision made by the control system.
For example the lens of this digital camera moves in and
out according to how much zoom is wanted.
This movement is controlled by an 'actuator'. In this case
it is a tiny electric motor that is controlled by a computer
control system within the camera.
•
So an actuator can be absolutely tiny or it can be truly massive such as the
devices that open and shut the Thames flood barrier gates.
•
But they all do the same thing, namely allow a computer to control movement or
action.
Actuators
• Examples of actuators, and what they can do are...
•
Actuator
What it Can Do
Light bulb or LED
Creates light
Heater
Increases temperature
Cooling Unit
Decreases temperature
Motor
Spins things around
Pump
Pushes water / air through pipes
Buzzer / Bell / Siren Creates noise
Sensors, Digital
Inputs and Outputs
•
Sensors are usually ‘analogue’ devices. For example, a temperature sensor. This type of sensor usually ‘warms’
up slowly and cools down slowly. The change is constantly increasing or decreasing. A digital input or output is
either ‘on’ or ‘off’. For example, a switch is either pressed or not pressed, an LED is either emitting light or not
emitting light.
The LED is a good
example of a
digital output
because it is either
‘on’ or ‘off’
Connecting
Sensors & Actuators
•
There are different types and makes of interface but they are all used to convert a program so
that a device can be controlled. Interfaces come in different shapes and sizes.
COMPUTER
INTERFACE
ROBOT
The computer is connected to the
The interface converts the program into A robot is usually made up of motors
interface. The program is written on the movement of the robot. A robot cannot and sensors. It is always connected to
computer and this controls the robot - be connected straight to a computer. an interface which converts the
through the interface.
program into instructions for switching
on and off each motor and sensor.
Task
•
Write about all of the following topics:
–
–
–
–
•
How you choose the sensors and the type of sensors available
The electrical characteristics of sensors (e.g. it measures analogue signals then
converts to digital)
Output devices including LCD displays
Interfacing the output devices to a Raspberry Pi (via an interface also known as
expansion/ break-out board)
You need to:
–
–
–
Write about 10 sentences explaining each of the topics above or minimum 1 ¼ pages
Note down references (e.g. web addresses, books etc.)
Make sure the paragraphs are in your own words
Assessment
& Criteria
• Illustrate the operation of different sensors and output devices –
P3
• While covering the following topics:
–Sensors:
• Choosing sensors
• Sensor type e.g. temperature, light, linear position, shaft position/rotation speed,
switch
• Electrical characteristics of sensors
–Output devices:
• LCD displays
• Other output devices e.g. lamps, relays, motors, solenoids
• Interfacing to controller
The Need for
Signal Conversion
•
Digital data is easier and faster to communicate between computers because it is already in
a format that can be processed.
•
Analogue data cannot be processed by a computer so it must be converted into digital data
by an interface. This is called digitising the data.
•
Many sensors produce analogue signals (usually a changing voltage) and must be
connected to an interface which is then connected to the computer. The interface therefore
converts the analogue signal into digital data which can be understood by a computer.
•
The interface may also protect the computer from high voltages and if it is protected it can be
placed in locations that could damage a computer.
The Need for
Signal Conversion
EXAMPLE:
•
A modem is an (old) example of an interface, the purpose of a modem is to convert between the analogue
signals used in telephone cables and the digital signals used by a computer.
•
A computer can only process digital data and phone lines can only transmit analogue data so there is a
need to convert between the two using a modem if a computer needs to access the Internet, email, videoconferencing or fax communications.
•
A modem works as an input and an output device because for outgoing signals it converts the digital signal
into an analogue signal (modulation) and for incoming signals it works in the reverse way (demodulation).
•
A modem transmitting and receiving at a speed of 33,600 bps (bits per second) can communicate about one
page of text every second (4200 bytes or characters a second).
Task
• Write about the following topics:
– Explain why signal conversion is needed e.g. analogue to digital or digital to
analogue
• You need to:
– Write a minimum of 1 page (of writing)
– Note down references (e.g. web addresses, books etc.)
– Make sure the paragraphs are in your own words
Assessment &
Criteria
•
Explain the need for signal conversion.
•
You will be expected to demonstrate clear comprehension of signal conversion
theory
Coding
•
You have used software packages on a computer which handle text (word processing), numbers (spread
sheets) and graphics (photo editing and drawing). You may even have used packages which manipulate and
store sound and video data.
•
In computing, data is the term given to the numbers, text, graphics, sound & video that computers process. In
order to process it, data must be in a form that computers can understand.
•
Computers work by switching circuits (transistors) on and off very quickly. All the data in a computer is stored
and processed using these switches.
As a switch can only be on or off, computers
are known as two-state machines. The
numbers 1 and 0 are used to represent the
on and off positions of the switches.
Everything that the computer has to do and
all the data that it works with and stores is
represented using a two digit number system
- 1’s and 0’s. These are called Binary
digITS (or BITS for short).
Coding
•
Binary numbers are closely related to digital electronics. With digital electronics a ‘1’ means that current /
electricity is present and a ‘0’ means it is not present. The different parts of a computer communicate through
pulses of current (1s and 0s).
•
Machine code is the computer's own language. As we all know, computers can calculate complex equations
and perform complex mathematics at lightening speed. Calculating using only 1s and 0s is called the BINARY
SYSTEM. Although, a computer will only process 1s and 0s there comes a point when the 1s and 0s have to
be converted into our usual decimal numbers - that we are familiar with.
We tend to use the DECIMAL SYSTEM when
attempting maths. This system deals with
numbers that we are using on a daily basis:
1,2,3,4,5,6,7,8,9, 10s, 100s, 1000s etc..... As
the BINARY system is composed of only two
numbers (1s and 0s) you may be wandering
how it is possible to count beyond one. The
table below will help you understand how this
is done.
Coding
•
Look at the row that represents the decimal number 10 (diagram below). The table can be used to convert
this decimal number to a binary number. The table shows that DECIMAL 10 is composed of one number 8
and one number 2. Zeros are used to fill the blank spaces which gives 1010 as the binary equivalent of
decimal 10.
•
Next look at the way decimal 60 is converted to its binary equivalent. 60 is composed of one 32, one 16, one
8, and one 4. The blanks are filled with zeros giving 111100 as the binary equivalent of decimal 60.
•
The important point to remember is that when converting from decimal to binary OR from binary to decimal,
you must write down the top section of the table (seen in yellow above) and underneath enter the binary
number.
Coding
•
Each character on the keyboard has a special one byte (8-bits) code to represent it. A standard for
representing these characters is the ASCII set. ASCII stands for the American Standard Code for Information
Interchange. Characters like letters a to z and A to Z and the digits 0 to 9 are each given a standard code
which is the same on all computer systems.
•
A table showing different representations of a list of characters in binary, and decimal.
•
The whole range of characters recognised by a computer system is known as the character set of that
computer.
Logical Operators
•
Most modern electronic devices such as mobile telephones and computers depend on digital electronics. In
fact, most electronics about the home and in industry depend on digital electronics to work.
•
Digital electronics normally based on ‘logic circuits’. These circuits depend on pulses of electricity to make the
circuit work. For instance, if current is present - this is represented as ‘1’. If current is not present, this is
represented as ‘0’. Digital electronics is based on a series of 1s and 0s.
A good example of a digital electronic system is a mobile phone. As you speak into
the phone, the digital electronic circuits it contains converts your voice into a series of
electronic pulses (or 1s and 0s). These are transmitted and the receiving mobile
phone then converts the digital pulses back into your voice. Digital circuits are used
because they are efficient and work well, also, digital signals are easier to transmit
than actual sound (for example a persons voice).
The various parts of a computer communicate through the use of electronic pulses (1s
and 0s). Consequently digital logic circuits are ideal for the internal electronics. The
main part of the computer is the motherboard. This is a complex piece of electronics
that processes all the important data. For instance, when word processing, it is very
important to display letters and words on the monitor. The motherboard generates the
individual letters on the monitor by sending a series of 1s and 0s to the screen.
When the computer operator presses the letter ‘H’ on the keyboard, the motherboard
converts this into a digital signal composed of 1s and 0s. The ‘H’ in the form of 1s and
0s is displayed on the monitor.
•
When you word-process a paragraph of writing all the letters/words are displayed on the monitor in a similar
way. In reality the letters are not composed of 1s and 0s but as black or white pixels.
Logical Operators
•
LOGIC circuits are normally composed of ‘gates’. A combination of gates make up a circuit and some digital
circuits can be extremely complex. It is the logic gates that produce pulses of electrical current (1s and 0s). At
school level, digital logic circuits are relatively simple. Below are simple drawings that help explain the two
most popular logic gates - the AND gate and the OR gate.
The simplified OR gate shown above has two inputs,
switch A and switch B. The bulb Q will light if either
switch A or B are closed. This will allow current to
flow through the bulb, illuminating the filament.
•
The simplified AND gate shown above has two
inputs, switch A and switch B. The bulb Q will only
light if both switches are closed. This will allow
current to flow through the bulb, illuminating the
filament.
When the bulb lights this represents a ‘1’ as current is running through the filament. If current is not running
through the filament the bulb will not light and this represents a ‘0’ (zero).
Logical Operators
•
There are different types of logic gate, depending upon what the gate is needed to do.
OR gates
AND gates
NOT gates
An OR gate will give a high output
if any of the inputs is high. For
example, in a simple lighting circuit
with two switches in parallel the lamp
will light if either switch is pressed.
An AND gate will give a high output
only if all of the inputs are high.
For example, in a simple lighting
circuit with two switches in series the
lamp will light only if both switches
are pressed.
A NOT gate is slightly different
because it has just one input. It will
give a high output if the input is low.
This could be represented by a
simple lighting circuit with a push-tobreak switch: if the switch is pressed
then the lamp will turn off. NOT
gates are often used in emergencystop buttons on machine tools.
The relationship between the inputs and
the output can be captured in a truth
table. A and B represent the inputs and
Q is the output.
Logic Used Within
Control Systems
•
In manufacturing industry safe use of machines is very important. All machines should be
set up in such a way that it is impossible for the machine operator to have an accident.
Machine ‘A’ is unsafe
because it can be turned on
and used when the guard is
out of position, especially if it
is operated by a machinist
such as Ed the Handyman
(website cartoon character).
This means that the
operator’s hands could be
seriously injured by the
dangerous blade as it cuts
the material.
The animation shows what happens when the microswitch has been switched 'ON' as the guard is in the
correct position. This means that the logic states of
both inputs are 1 (true, on, high, up), consequently the
output logic state is 1 (true, on, high, up) and the
machine works.
Remember, for the AND gate to output 1 both inputs
must be 1.
Alternatively, machine ‘B’
has been fitted with a logic
circuit. It is designed to
ensure that the guard must
be in the correct position and
the ‘ON’ switch is pressed
simultaneously, before the
machine will work. This
means that the operator must
keep his/her spare hand on
the switch or electrical power
will be cut, stopping the
machine working.
Numbers
•
Storing any form of data on a computer creates problems. If the only data that a computer can store is 1s and 0s using transistors
then how do we store numbers, text, graphics, sound and video?
•
Let’s start by examining how positive, whole numbers (integers) are stored as they are the simplest to implement.
Representation of positive whole numbers
•
We can represent any number, however large, in binary. Remember we can only store numbers between 0 and 255 in one byte.
This is obviously rather restrictive since it's not dealing with large integers, negative numbers or decimal numbers.
A table exemplifying the representation of numbers in binary
•
Each memory location holds one byte of data. This data may represent text, graphics or a number.
Numbers
A Practical Example of Integer Use
•
Colours are often stored by a computer using 3 numbers to represent red, green & blue (RGB).
•
The screenshot on the right shows how a colour can be selected in a graphics application by changing the rgb values.
When the colour is saved, it
is stored as three 8 bit binary
numbers (each one between
0 and 255).
For example
R=159,G=73,B=171 would be
stored as:
Numbers
•
Real numbers, or numbers with decimal places are stored using scientific notation.
•
For example, the number 345.765 would be stored as:
•
The computer then stores two separate integers with a set number of bits.
•
The complete number is then stored as one long integer - 101000110010101000000010
•
Note that the number of bits that a computer uses to store the mantissa and exponent has an
effect on the number stored.
Numbers
Accuracy
•
By reducing or increasing the numbers of bits used to store the mantissa we can affect the
accuracy of the number. With increased bits, more decimal places can be stored.
Size
•
By reducing or increasing the numbers of bits used to store the exponent we can affect the size
of the number we can store.
What’s Normal for Today
•
A common representation in today’s computers uses 32 bits to store a real number split up as
follows:
–
–
–
Mantissa - 23 bits
Exponent - 8 bits
Signed Bit (used to store if the number is positive or negative) - 1 bit
Task
• Write about all of the following topics:
–
–
–
Explain how binary can represent Hexadecimal, Binary coded decimal and ASCII data
within a control system (use conversion tables to further explain your ideas)
Explain the following logical operators: AND, OR, NOT, NAND, NOR, XOR, specifically
how they work and how they represent data within a control system (binary form etc.)
Describe how integers, fixed-point, floating-point can be represented as data within a
control system (e.g. in binary form, but explain how) and explain when to use each
• You need to:
–
–
–
Write about minimum of 1 ¾ pages
Note down references (e.g. web addresses, books etc.)
Make sure the paragraphs are in your own words
Assessment
& Criteria
•
Describe of how data can be represented in control systems, plenty of
examples should be included– P4
•
While covering the following topics:
–Coding
•Binary
•Hexadecimal
•Binary coded decimal
•ASCII
–Logical operators
•AND
•OR
•NOT
•Other e.g. exclusive OR
–Numbers
•Integer
•fixed-point
•other e.g. floating-point
•when to use each
For further information please contact The STEM Alliance
[email protected] or visit www.STEMalliance.uk