Professional Documents
Culture Documents
Microcontroller Lecture Notes Module III
Microcontroller Lecture Notes Module III
(DIPLOMA COURSE)
POWER OPTION
MODULE:III
MICROCONTROLLER TECHNOLOGY
TRAINING MANUAL
BY
DR. CLIFF ORORI MOSIORI
© 2015
Rvist lecture notes – DEE- Electrical and Electronic Engineering Department- EE 2015 By Cliff OroriMosiori © 2015
Table of Contents
MICROCONTROLLER TECHNOLOGY ................................................................................................ i
INTRODUCTION................................................................................................................................... 1
Microcontrollers ...................................................................................................................................... 1
Common Terms in Microcontrollers .................................................................................................... 2
Types of Microcontrollers.................................................................................................................... 4
i. The 8-Bit Microcontroller ........................................................................................................ 4
ii. The 16-Bit Microcontroller....................................................................................................... 4
iii. The 32-Bit Microcontroller ................................................................................................... 5
Microcontroller Architectural Features................................................................................................. 5
1. Von-Neuman Microcontroller Architecture .............................................................................. 5
2. Harvard Microcontroller Architecture....................................................................................... 6
3. Complex Instruction Set Computer (CISC) Microcontroller Architecture.................................. 7
4. Reduced Instruction Set Computer (RISC) Microcontroller Architecture .................................. 7
5. Specific Instruction Set Computer (SISC) Microcontroller Architecture ................................... 7
TOPIC ONE............................................................................................................................................ 8
ELEMENTS OF A MICROCONTROLLER ARCHITECTURE ............................................................. 8
Central Processing Unit (CPU) ............................................................................................................ 8
Machine Cycle ................................................................................................................................. 8
CPU Organization and operation ...................................................................................................... 8
Memory Placement of Program and Data ....................................................................................... 11
Memory............................................................................................................................................. 13
Primary Memory ............................................................................................................................... 13
Random Access Memory (RAM) ................................................................................................... 13
Read- Only Memory (ROM) .......................................................................................................... 14
Programmable Read Only Memory (PROM).................................................................................. 14
Erasable Programmable Read Only Memory (EPROM) ................................................................. 14
Electrically Erasable and Programmable ROM (EEPROM)............................................................ 14
Flash Memory ............................................................................................................................... 14
Non-Volatile RAM - (NVRAM) .................................................................................................... 15
Accessing Memory ........................................................................................................................ 15
Input/Output Ports ............................................................................................................................. 15
ii
Rvist lecture notes – DEE- Electrical and Electronic Engineering Department- EE 2015 By Cliff OroriMosiori © 2015
Timers ............................................................................................................................................... 16
Counters ............................................................................................................................................ 16
Microcontroller Families Series ............................................................................................................. 17
A). Intel 8048 microcontroller Series ................................................................................................. 17
Memory ............................................................................................................................................ 17
Interrupts ......................................................................................................................................... 18
I/O ports ........................................................................................................................................... 18
Registers ........................................................................................................................................... 18
Instruction Set ................................................................................................................................. 19
Addressing Modes ........................................................................................................................... 19
B). Intel 8051 Microcontroller ........................................................................................................... 19
Pin-out Description ........................................................................................................................ 20
Input/Output (I/O) pin .................................................................................................................... 21
Input/Output Ports (I/O Ports) ........................................................................................................ 21
Memory Organization in 8051 Microcontrollers ............................................................................. 22
Addressing modes in 8051 microcontrollers ................................................................................... 23
Special Function Registers (SFRs) ................................................................................................. 23
Counters and Timers ...................................................................................................................... 26
Universal Asynchronous Receiver and Transmitter (UART) .......................................................... 26
Intel 8051 Microcontroller Interrupts ............................................................................................. 26
Intel 8051 Microcontroller Power Consumption Control ................................................................ 27
TOPIC TWO ......................................................................................................................................... 28
PROCESS CONTROL SYSTEMS ........................................................................................................ 28
System Process Control terms ............................................................................................................ 28
Block Diagram of process control ...................................................................................................... 29
Control modes ................................................................................................................................... 29
a. The ON/OFF control mode..................................................................................................... 29
b. Proportional control mode ...................................................................................................... 30
c. Derivative control mode ......................................................................................................... 31
d. Integral control mode ............................................................................................................. 32
e. Proportional +integral (PI)...................................................................................................... 32
f. Proportional + Differential (PD) ............................................................................................. 32
iii
Rvist lecture notes – DEE- Electrical and Electronic Engineering Department- EE 2015 By Cliff OroriMosiori © 2015
iv
Rvist lecture notes – DEE- Electrical and Electronic Engineering Department- EE 2015 By Cliff OroriMosiori © 2015
v
.
INTRODUCTION
Microcontrollers
A microcontrolleris a highly integrated chip on single chip with most of the parts needed for a
controller to function. The microcontroller includes: CPU (Central Processing Unit), RAM
(Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only
Memory), I/O (input/output) – serial and parallel, timers, interrupt controller. Intel 8051 is 8-bit
microcontroller while Intel 8096 is 16-bit microcontroller.
Microcontrollers offer a mechanism that controls the operation of a machine. The first
microcontrollers were Intel 8048 integrated into PC keyboards, Intel 8051 and 68HCxx series of
microcontrollers from Motorola. Microcontrollers perform numeric operationsthat include;
• Supermarkets in Cash Registers, Weighing Scales, etc.
• Home in Ovens, Washing Machines, Alarm Clocks, etc.
• Toys, VCRs, Stereo Equipment, etc.
• Office in Typewriters, Photocopiers, Elevators, etc.
• Industry in Industrial Automation, safety systems, etc.
• On roads in Cars, Traffic Signals, etc.
Theyare connected to the outside world through the I/O pins of the microcontrollers.
1
.
2
.
Mixed-Signal Controller
This is a microcontroller which can process both digital and analog signals components.
Embedded System
In embedded systems, the control unit is integrated into the system like in a cell phone,
where the controller is included in the device.
Real-Time System
Controllers are frequently used in real-time systems where the reaction to an event has to
occur within a specified time as found in aerospace, railroad, or automotive areas,
Embedded Processor
This term “embedded processor” is used for high-end devices (32 bits), whereas
“controller” is traditionally used for low-end devices (4, 8, 16 bits).
Digital Signal Processor (DSP)
Digital signal processors are used to process signals like in telecommunications where a
mobile phone contain a DSP andare designed for fast addition and multiplication.
Embedded Controller
An embedded controller is a controller that is embedded in a greater system.Is a controller that is
embedded into some other device for some purpose other than to provide computing
functions.Modern embedded microcontrollers are built using microprocessorsmaking the entire
controller component to fit onto a small circuit board and contains arithmetic and logic units
(ALU), Instruction decode and control unit, Instruction register, Program counter (PC), clock
circuit (internal or external), reset circuit (internal or external) and registers. A CPU built into a
single VLSI chip is called microprocessor with a simplified blockdiagram of the CPU shown
below.
Microprocessor
A Microprocessor is general-purpose element in digital computer or central processing unit
(CPU).A digital computer having microprocessor as the CPU along with I/O devices andmemory
is known as microcomputer. The block diagram below shows amicrocomputer.
3
.
Types of Microcontrollers
Microcontrollers are classifiedbased on their internal bus width, architecture, memoryand
instruction set as shown in the figure below.
4
.
The performance andcomputing capability of 32 bit microcontrollers are enhanced with greater
precision ascompared to the 16-bit microcontrollers. The 8-bit is the slowest of the three types.
Microcontrollers are grouped as either embedded microcontrollers or external memory
microcontrollers as;
1. Embedded Microcontrollers
When an embedded system has a microcontroller unit that has all its functional blocks(including
program and data memory) available on a chip is called an embeddedmicrocontroller. For
example, 8051 having Program & Data Memory, I/O Ports, SerialCommunication, Counters and
Timers and Interrupt Control logic on the chip is anembedded microcontroller.
2. External Memory Microcontrollers
When an embedded system has a microcontroller unit does not have all its functionalblocks on a
chip is called an external memory microcontroller. Here all or part of the memory units are
externally interfaced usingan interfacing circuit called the glue circuit. For example, 8031 has no
program memoryon the chip is an external memory microcontroller.
1. Von-NeumanMicrocontroller Architecture
These Microcontrollers have a single (data) busthat is used to fetch both instructions and data.
This means that Program instructions and Data arestored in a common main memory. When such
a controller addresses the main memory,it first fetches an instruction and then it fetches the data
to support the instruction later.Von-Neuman architecture has only one memory to be accessed.
5
.
The content in RAM is used for data storage and program instruction storage, e.g. the Motorola
68HC11 series. Its Instruction is simply as “Read a byte from memory and store it in the
accumulator” as follows:
Cycle 1: - Read instruction
Cycle 2: - Read data out of RAM and put into Accumulator
These two separate fetch processes slows down the controller’s operation. The Von-Neuman
Architectureis shown below:
6
.
7
.
TOPIC ONE
ELEMENTS OF A MICROCONTROLLER ARCHITECTURE
Machine Cycle
To execute an instruction, the processor must perform the following:
1. Fetch the instruction from memory
2. Decode the instruction to understand it
3. Execute the instruction as understood
4. Store the result back in the memory.
These four steps are referred to as Machine Cycle.Generally one machine cycle = X clock cycles
(where (X) depends on the particular instruction being executed). The shorter the clock cycle, the
lesser the time it takes to complete one machine cycle,executing the instruction faster and hence
a faster processor.
Increment the What is a Program Counter? What does it count? How much
8
.
Decode the Why is the instruction decoded? How does it get decoded?
Instruction
Fetch the What are operands? What does it mean to fetch? Is this
Operands fetching distinct from the fetching in Step 1 above? Where
are the operands? How many are there? Where do we put the
operands after we fetch them?
Performing an Is this the main step? What part of the CPU performs this
Operation operation?
Representing Programs
Each complex task carried out by a computer needs to be broken down into a sequence of
simpler tasks. This requires a binarymachineinstruction for the most primitive tasks. Consider
a task that adds two numbers, held in memory locations designated by B and C and stores the
result in memory location designated by A.
AssemblyInstruction Effect
LOAD R2, B - Copy the contents of memory location designated by B
into Register 2
ADD R2, C - Add the contents of the memory location designated by
Cinto the contents of Register 2 and put the result back
into Register 2
STORE R2, A - Copy the contents of Register 2 into the memory
location designated by A.
Each of these assembly instructions needs to be encoded into binary for execution by the Central
Processing Unit (CPU). Let’s try this encoding for a simple architecture called TOY1.
TOY1 Architecture
TOY1 is a fictitious architecture with the following characteristics:
9
.
Instruction Format
Using TOY1 instructions above that are 16-bits (to fit into a main-memory word), each
instruction is divided into a number of instruction fields that encode a different piece of
information for the CPU as shown below;
Field Name OPCODE REG ADDRESS
The OPCODEfield identifies the CPU operation required. Since TOY1 only supports 16
instructions, these can be encoded as a 4-bit natural number. Using TOY1 above, Op-codes 1 to
4 will be given by:
0001 = LOAD 0010 = STORE 0011 = ADD 0100 = SUB
The REGfield defines a General CPU Register. Arithmetic operations will use 1 register
operand and 1 main memory operand and the results are written back to the register. Since
TOY1 has 4 registers; these can be encoded as a 2-bit natural number:
00 = Register 0 01 = Register 1 10 = Register 2 11 = Register 3
The ADDRESS field defines the address of a word in RAM. Since TOY1 has upto 1024
memory locations; a memory address can be encoded as a 10-bit natural number. If we define
addresses 200H, 201H and 202H for A, B and C, we can encode the example above as:
10
.
2 0 0 0 0 0 0
2 0 1 0 0 0 9
2 0 2 0 0 0 6
11
.
Control Unit
The Control Unit is the CPU component thatco-ordinates all activity within the CPU. It
has connections to all parts of the CPU and includes a sophisticated timing circuit.
Arithmetic & Logic Unit
The ALUcarries out arithmetic e.g. addition, comparison, subtraction and logical Boolean
operations e.g. AND/OR/NOT.
ALU Input Registers 1 and 2
These are special registers that hold the input operands for the ALU operations.
ALUOutput Register
This is a special register that holds the result of an ALU operation. On completion of an
ALU operation, the result is copied from the ALU Output register to its final destination,
e.g. to a CPU register, or main-memory, or to an I/O device.
General Registers R0, R1, R2, R3
These are for the programmer to use in his/her programs.
Buses
A Bus is a collection of wires carrying information with a common purpose. For each
read or write operation, the CPU specifies the location of the data or instruction by
placing an address on the address bus then activates a signal on the control bus indicating
whether the operation is read or write. The Busesserve as communication highways for
passing information within the CPU using internal CPU busses and between the CPU and
the main memory using;
The address busis used to send addresses from the CPU to the main memory; these
addresses indicate the memory location the CPU wishes to read or write it carries the
address of a specified location. For n address lines, 2n locations can be accessed e.g., A
16-bit address bus can access 216 = 65,536 locations or 64K locations (210 = 1024 = 1K,
26 = 64).
12
.
The data bus is bi-directional; for writing, the data bus is used to send a word from the
CPU to main-memory; for reading, the data bus is used to send a word from main-
memory to the CPU.
The Control busis used to indicate whether the CPU wishes to read from a memory
location or write to a memory location.
Read Operations
- retrieve a byte of data from memory at the location specified and place it on the data bus. CPU
reads the data and places it in one of its internal registers.
Write Operations
- put data from CPU on the data bus and store it in the location specified.
Control Devices
- are outputs, or actuators, that can affect the world around themwhen supplied with a voltage or
current.
Monitoring Devices
- are inputs, or sensors, that are stimulated by temperature,pressure, light, motion, etc. and
convert this to voltage or current read by the computer.
Note: The interface circuitry converts the voltage or current to binary data, or vice versa.
Memory
A computer memory is of two types; (1). Primary Memory - Internal storage; (2), Secondary
Memory - External storage
Primary Memory
This is the internal memory and is the main area in a computer where the data is stored. Stored
data can be recalled instantly, quicklyaccessed and correctly whenever desiredby the CPU for
reading or storing. Primary memory is classified into two types:Random Access Memory
(RAM) and Read- Only Memory (ROM).
13
.
Mask-ROM - (MROM).
An MROM iscomposed of several layers. The geometrical layout of those layers defines the
chip’s function. A MROM contains a matrix of memory cells. The name Mask-ROM is derived
from the one mask which defines the row-column connections.
Flash Memory
Flash is a variant of EEPROM where erasing is not possible for each address, but only for larger
blocks or even the entire memory.Its internal logic is simplified, which in turn reduces the price
considerably. Flash EEPROM is used for program and not data memory.Flash-EEPROMs have a
14
.
lower guaranteed write/erase cycle endurance compared to EEPROMs – about 1,000 to 10,000
cycles. Flash-EEPROMs are cheaper.
Accessing Memory
Many microcontrollers come with on-chip program and data memory with two methods of
accessing memory:
i. Each memory is addressed separately. In ATmega16, the address ranges has three
different memory types. The programmer specifies which memory is to be accessed by
using different access methods.
ii. All memory types share a common address range. In HCS12 the programmer accesses
EEPROM in the same way as SRAM. The microcontroller uses the address to decide
which memory the access goes to.
Suppose a 16 bit controller writes a word (two bytes) into SRAM, say at address 0x0100. The
word consists of a low and a high byte. There are two variants: the low byte could go to 0x0100
and the high byte to the next address (0x0101), or the other way around. That is the problem
ofendianness:
Big Endian:
Big Endian architectures store the high byte first. So, if you write the word 0x1234 to
address 0x0100, the high byte 0x12 goes to address 0x0100, and the low byte 0x34 to
address 0x0101. The name is derived from this order: The Big End of the word is stored
first – therefore, it is called Big Endian.
Little Endian:
Little Endian architectures access memory the other way around i.e. Little End of the
word first. The low byte is stored first. Writing 0x1234 at address 0x0100 on a little
endian architecture writes 0x34 to address 0x0100 and 0x12 to address 0x0101.
Input/Output Ports
The 8051 microcontrollers has four I/O ports each of 8 bits which is configured as inputs or
outputs. A total of 32 input/output pins enable the microcontroller to be connected to peripheral
devices. Pin configuration, i.e. whether it is to be configured as an input (1) or an output (0)
depends on its logic state. In order to configure a microcontroller pin as an output, you apply
logic zero (0) to appropriate I/O port bit. Voltage level on appropriate pin will be 0. In order to
15
.
configure a microcontroller pin as an input, apply a logic one (1) to appropriate port and the
voltage level on appropriate pin will be 5V.
Timers
Timers are used for a variety of tasks ranging from simple delays over measurement of periods to
waveform generation. The timer module is a counter module and controllers provide one or more
timers with 8 and/or 16 bit resolution. The use of the timer is as a counter. Timers allow the user
to time-stamp external events, to trigger interrupts after a certain number of clock cycles, and to
generate pulse-width modulated signals for motor control.
Counters
Each timer is a counter which is either incremented or decremented upon every clock tick. The
direction is either fixed or configurable. The current count value can be read through a count
register and can be set to a specific value by the user. For a timer resolution of n, the count value
is within [0, 2n − 1]. Timers raise an interrupt whenever they experience an overflow of the count
value.This can be used to implement a rudimentary periodic signal by setting the count value to a
givenstart value and then waiting for the overflow.
16
.
Prescaler
This mode also uses the system clock but filtered through a prescaler. The prescaler is another
counter of variable length of 8 or 10 bit are values which is incremented with the system clock.
The timer itself, however, is clocked by one of the prescaler bits. The bit next to thelsb will again
divide the frequency by two, and so on. The timer module provides mode bits which allow the
user to select some prescale values (8, 64, 256, . . .).
TOPIC THREE
MICROCONTROLLER FAMILIES
Microcontrollerfamilies are classified into series. These include the following types of series:
Stack is stored in data memory locations 08h - 17h (8 - 23) and can be 8-levels deep. The stack
starts at location 08h and grows upwards and when a CALL instruction is executed the return
17
.
address (12 bits) and the upper 4 bits of the program status word (CY, AC, F0 and BS flags) are
stored in the stack.
Interrupts
The processor has two maskableinterrupts which are:
I/O ports
It has twenty sevenI/O lines:
8-bit quasi-bidirectional ports 1 and 2.
8-bit bidirectional BUS port.
3 Test inputs
Registers
Program counter
It is a 12 bit most significant bit of the program counter is not updated when the program counter
is incremented. To tell the MCU to set/reset this bit the program should use SEL MB1 or SEL
MB0 instructions.
Accumulatoris used for data moving, arithmetic, logic and I/O operations.
Workingregistersare used for temporary data storage. These registers can be addressed directly
by many instructions. There are two sets of working registers - bank 0 and bank 1, each bank has
8 working registers.
RAM pointer registersare used by many instructions to address RAM indirectly. These
registers are located in RAM. Their addresses are 00h and 01h for register bank 0, and 18h and
19h for register bank 1.
18
.
Instruction Set
8048 instruction set consists of the following instructions:
Data moving instructions.
Arithmetic - add, increment and decrement. No subtract nor compare instructions.
Logic - rotate, AND, OR, exclusive OR, NOT and bit test.
Control transfer - conditional branch (limited to current 256-byte page) and unconditional
jumps and calls (limited to current 2 KB memory block).
Input/Output instructions - input, output and logic operations with port data.
Timer/counter related instructions - start, stop and read value of the timer/counter.
Other - flag operations, decimal adjust, nibble swap, memory bank selection,
enable/disable interrupts, etc.
Addressing Modes
i. Implied addressing - the data value/data address is implicitly associated with
the instruction.
Accumulator - the instruction implies that the accumulator contains data.
Register - references data in one of 8 working registers in the currently selected
data memory bank.
ii. Immediateaddressing- 8-bit data is provided in the instruction.
iii. Absoluteaddressing- the instruction operand specifies the memory address
where control is transferred. The instruction may have 8-bit or 11-bit operand:
8-bit operands are used to transfer control within current 256-byte program memory page.
11-bit operands are used to transfer control within current 2 KB program memory block.
iv. Register indirectaddressing– instruction specifies RAM pointer register that
contains RAM address, where data is located.
Accumulator indirect– the accumulator contains a program memory address within
current 256-byte program memory page where the program control will be transferred.
19
.
satisfies the user's basic needs and 4 ports having in total of 32 input/output lines. Its RAM is
organized, the operation of Central Processor Unit (CPU) and ports enable further upgrade.
Pin-out Description
Pins 1-8: Port 1- Each of these pins can be configured as an input or an output.
Pin 9: RS-A logic one on pin 9 disables the microcontroller and clears the contents of registers.
A logic zero to pin 9 the program starts execution from the beginning.
Pins10-17: Port 3- Similar to port 1, each of these pins can serve as general input or output.
Pin 10: RXD- Serial asynchronous input /synchronous communication output pin.
Pin 11: TXD-Serial asynchronous c output /Serial synchronous communication clock output.
Pin 12: INT0- Is the Interrupt 0 input.
Pin 13: INT1- is the Interrupt 1 input.
Pin 14: T0- is the Counter 0 clock input.
Pin 15: T1- is the Counter 1 clock input.
Pin 16: WR- is the Write to external (additional) RAM.
Pin 17:- RD- is the Read from external RAM.
Pin 18, 19: X2, X1-is the internal oscillator input and output. A quartz crystal which specifies
operating frequency is connected to these pins.
Pin 20: GND- is the Ground terminal.
Pin 21-28: Port 2- If there is no intention to use external memory then these port pins are
configured as general inputs/outputs. The higher address byte, i.e. addresses A8-A15 will appear
on this port.
Pin 29: PSEN- If external ROM is used for storing program then a logic zero (0) appears on it
every time the microcontroller reads a byte from memory.
Pin 30: ALE- Prior to reading from external memory, the microcontroller puts the lower address
byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the
external register memorizes the state of P0 and uses it as a memory chip address.
20
.
Pin 31: EA- By applying logic zero to this pin, P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. It means that even there
is a program written to the microcontroller, it will not be executed.
Pin 32-39: Port 0- Similar to P2, if external memory is not used, these pins are used as general
inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is
driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0).
Pin 40: VCC- is the +5V power supply source pin.
21
.
Memory expansion
It is possible to add two external memory chips with capacity of 64Kb each. P2 and P3 I/O ports
are used for their addressing and data transmission. The first one is used for reading data from
external data memory (RAM) while the other is used for reading data from external program
memory (ROM).
22
.
23
.
stored in the accumulator. Data to be moved from one register to another must go through the
accumulator.
The B Register
Multiplication and division can be performed only upon numbers stored in A and B registers.
Suppose it is necessary to perform some arithmetical operations upon numbers previously stored
in the R registers: (R1+R2) - (R3+R4). A register for temporary storing results of addition is
needed. This is how it looks in the program:
MOV A,R3; Means: move number from R3 into accumulator
ADD A,R4; Means: add number from R4 to accumulator (result remains in accumulator)
MOV R5,A; Means: temporarily move the result from accumulator into R5
MOV A,R1; Means: move number from R1 to accumulator
ADD A,R2; Means: add number from R2 to accumulator
SUBB A,R5; Means: subtract number from R5 (there are R3+R4)
24
.
P - Parity bit- if a number stored in the accumulator is even then this bit will be
automatically set (1), otherwise it will be cleared (0). It is mainly used during data
transmit and receive via serial communication.
- Bit 1. This bit is intended to be used in the future versions of microcontrollers.
OV Overflow- occurs when the result of an arithmetical operation is larger than 255 and
cannot be stored in one register. Overflow condition causes the OV bit to be set (1).
Otherwise, it will be cleared (0).
RS0, RS1 - Register bank select bits. These two bits are used to select one of four
register banks of RAM. By setting and clearing these bits, registers R0-R7 are stored in
one of four banks of RAM.
F0 - Flag 0. This is a general-purpose bit available for use.
AC - Auxiliary Carry Flagis used for BCD operations only.
CY - Carry Flag is the (ninth) auxiliary bit used for all arithmetical operations and shift
instructions.
25
.
If neither external memory nor serial communication system are used then 4 ports within total of
32 input/output pins are available for connection to peripheral environment. Each bit within these
ports affects the state and performance of appropriate pin of the microcontroller.
TRANSMIT - Data transmission is initiated by writing data to the SBUF register. This process
starts after any instruction being performed upon this register. When all 8 bits have been sent, the
TI bit of the SCON register is automatically set.
RECEIVE - Data receive through the RXD pin starts upon the two following conditions are
met: bit REN=1 and RI=0 (both of them are stored in the SCON register). When all 8 bits have
been received, the RI bit of the SCON register is automatically set indicating that one byte
receives is complete.
26
.
ASSIGNMENT
27
.
TOPIC TWO
PROCESS CONTROL SYSTEMS
Process control is a sustained phenomenon or one marked by gradual changes through a series of
states.The paramount needs ofsystem process control are;
i. Safety
The state of being certain that adverse effects will not be caused by some agent under
defined conditions and nobody will be affected or inconvenienced in the process.
ii. Quality
a characteristic property that defines the apparent individual nature of something
toensure that a property generated is of high and precise required level.
iii. Environment
The totality of surrounding conditions must be maintained and controlled so as not to
affect life and quality of product is maintained.
iv. Economics
This deals with the production and distribution and consumption of goods and
services and their management. Production of products and services are of fair price.
28
.
Control modes
Controllers use3 basic modes: P - proportional, I - integrative and D - derivative.Combinations
such as PI and PD control are very often in practical systems. The control modeincludes the
following:
29
.
exceeds 80 ºC, the controller signals the control valve to close fully. It is the least expensive
equipment and is suitable when there is a large capacityprocess.
For heating control, the output is on when the temperature is below the set-point, and off above
set-point. Since the temperature crosses the set-point to change the output state, the process
temperature will be cycling continually, going from below set-point to above, and back below.
One special type of on-off control used for alarm is a limit controller. This controller uses a
latching relay, which must be manually reset and is used to shut down a process when a certain
temperature is reached.
30
.
b) faster dynamics, i.e. broader signal frequency band of the closed loop system and
larger sensitivity with respect to measuring noise
c) smaller amplitude and phase margin
When P controller is used, large gain is needed to improve steady state error. Stable systems do
not have problems when large gain is used. If constant steady state error can be accepted with
such processes, than P controller can be used. Small steady state errors can be accepted if sensor
will give measured value with error or if importance of measured value is not too great anyway.
31
.
where the load changes often and the controller is expected to compensate automatically due to
frequent changes in set-point, the amount of energy available, or the mass to be
controlled.Because of features that include auto- or self-tuning, where the instrument will
automatically calculate the proper proportional band, rate and reset values for precise control;
serial communications, where the unit can “talk” to a host computer for data storage, analysis,
and tuning; alarms, that can be latching (manual reset) or non-latching (automatic reset), set to
trigger on high or low process temperatures or if a deviation from set-point is observed;
timers/event indicators which can mark elapsed time or the end/beginning of an event.
PID controller has fast reaction on change of the controller input (D mode), increase in control
signal to lead error towards zero (I mode) and suitable action inside control error area to
eliminate oscillations (P mode). Derivative mode improves stability of the system and enables
increase in gain K and decrease in integral time constant Ti, which increases speed of the
controller response. PID controller is used when dealing with higher order capacitive processes
when their dynamic is not similar to the dynamics of an integrator (like in many thermal
processes). Conventional autopilot is for the most part PID type controllers.
33
.
set to approximately half of that value for a "quarter amplitude decay" type response. Then, Kiis
increased until any offset is corrected in sufficient time for the process. Too much Ki will cause
instability. Finally, Kd is increased, until the loop is acceptably quick to reach its reference after a
load disturbance.
Implementation of controllers
There are three basic types of controllers: on-off, proportional and PID. Depending upon the
system to be controlled, the operator will be able to use one type or the other to control the
process.
35
.
It can be shown that the circuit is capable of delivering the PID actions as:
( )
u(t) = Kp[ e(t) + ∫ ( ) + ]
The proportional gain Kp is decided by the ratio R2/R1of the first amplifier; the integral action is
decided by R3and C1and the derivative action by R5and C2.The final output comes out with a
negative sign, compared to the equation above.
36
.
⇒ [e(k)- (e)k – 1)
∫ ( ) ⇒T0∑ ( ) ; t = kT0
2. Velocity algorithm
From the above expression, one can write the error signal at the (k-1)th instant as:
q0 =Kp(1+ )
q1= - Kp(1+ − )
q2 =Kp
The above algorithm is known as Velocity algorithm. The major advantage of this algorithm is
that it is of recursive type and calculates the incremental output at each sample instant. As a
result, it requires only to store three previous values: e(k), e(k-1) and e(k-2).
Actuators
An actuator is the device that brings about the mechanical movements required for any physical
process in the factory. An actuator can be broken down into two separate modules: the signal
amplifier and the transducer.
37
.
The amplifier converts the (low power) control signal into a high power signal that is fed into the
transducer; the transducer converts the energy of the amplified control signal into work; this
process usually involves converting from one form of energy into another, e.g. electrical motors
convert electrical energy into kinetic energy.There many types of actuators that include the
following;
1. Hydraulic Actuators
2. Pneumatic Actuators
3. Solenoid Actuators
4. Digital stepper motor drives
5. Stepper motor drives
6. IC L298
7. IC SAA 1027
1. Pneumatic Actuators
Physical processes in pneumatic drives obey the gas laws that describes the relationship between
thermodynamictemperature (T), pressure (P) and volume (V) of gases. Three of these laws,
Boyle’s law,Charles’s law, and Gay-Lussac’s law, when combined to form the combined gas
law;
P1V1/T1= P2V2/ T2
which with the addition of Avogadro’s law later gave way to the ideal gas law. Other important
gas laws include Dalton’s law of partial pressures. A gas that obeys these gas laws is known
exactly as an ideal gas. The most important gas law is the ideal gas law, which states that:
PV = nRT
All pneumatic actuators can be subdivided into the following types:
• diaphragm pneumatic actuators;
• pneumatic power cylinders;
• gas-engine pneumatic actuators;
• turbine pneumatic actuators;
• jet-stream pneumatic actuators;
• pneumomuscles;
• combined pneumatic actuators.
Automatic pneumatic drive
It represents a complex of devices and consists of a source of gas energy, units of gas networks
and mains (UGM), pneumatic amplifiers (PA), pneumatic engines (PE), the mechanism of
transfer (MT) and directors, converting and summing device (CSD), amplifiers of capacity of
electric signals (ACE), electromechanical converters (EMC), devices of feedbacks (DF),
adjusting circuits AC) and internal feedbacks (IF).All complex of these devices is intended for
amplification and transformation of a low-powerinput signal into mechanical moving of the
target shaft of the executive mechanism. The initial drive size of a drive is electric signal Uip of
low power Nipwhich is corrected and amplifies with the help of additional feed energy of the
capacity amplifier in the converting and summing device (CSD).
38
.
The amplified control signal moves on electromechanical converter (EMC) that accordingly
moves the managing body of pneumoamplifier (PA) on the size value z. The angle of the turn of
electromechanical converter’s (EMC) axis in direct ratio corresponds to the size value z. To
increase dynamic properties and accuracy of reproduction of the input signal the automated drive
has feedbacks EF and DF and adjusting circuits (AC) on speed, acceleration
and loading.
Work of the pneumatic actuator consists in moving of a rod under influence of the difference
of pressure p1 − p2 in cavities that is formed due to the difference of gas charges G1 − G2.
39
.
c). Pneumomuscles
Pneumomuscles are linear pneumatic drives which can reproduce the movements similar to
natural muscles. In comparison with power cylinders they develop the big initial efforts to the
same working diameters. We distinguish lengthen and reduced pneumomuscles. Character of
movement is defined with geometry of a braid of a pneumomuscle.
40
.
2. Hydraulic Actuators
Liquid is the physical body possessing fluidity. Fluidity is understood as easy mobility
ofparticles. Due to fluidity, liquids show resistance to shift in direct dependence on speed of shift
deformation andto compression. Taking into account mechanical properties we can distinguish
two types of liquid: lowcompressible(dropping) liquids which insignificantly change the volume
when temperatureand pressure change, and compressed (gaseous).Cavitation is accompaniedby
formation of steam-to-gas bulbs that move with a stream of liquid in area with higherpressure,
slam and radiate shock wave. Cavitation can arise at low pressure in pipelines, pumps -
everywhere where the stream ofliquid is exposed to bends, to narrowing’s expansion (valves,
throttles, etc.) followed by.The original form, for incompressible flow in a uniform gravitational
field (such as onEarth), is:
+ gh + = const.
The equation is named after Daniel Bernoulli.The second Bernoulli’s equation is written for
compressiblefluids following the streamline flow:
+ φ + φ = const.
The constant on the right hand side is often called the Bernoulli constant and denoted b. For
steadyinviscid adiabatic flow with no additional sources or sinks of energy, b is constant along
any given streamline. When b may vary along streamlines, it still proves auseful parameter,
related to the ‘head” of the fluid. Hydraulic actuators include the following;
i. Hydraulic Cylinders
Hydraulic cylinders widely apply in building, digging, hoisting-and-transport, road machines,
automobiles, and also in the processing equipment - metal-cutting machine tools, forge -pressing
machines. The hydraulic cylinder of one- sided action has a plunger 1, moved by force of
pressure of liquid to one side. Reverse motion of the plunger is made under action of external
force F if it operates continuously, or spring 2. The unique external condensation of the plunger
consists of the basic 3 and antisplash 4 condensing elements. The hydraulic cylinder of double-
sided action has the piston 5 with a rod 7, condensed by internal 6 and external 8 sealants.
41
.
42
.
b. Batching
Batching of liquids and the fused metals are foundry manufacture can be madeby system which
circuit is shown in figure below. The lever with a ladle is actuated by the power cylinder.
c. Robotics
On the basis of pneumatic actuators stationary and mobile robots with wide functionalities
can be created.One of the first stationary Russian serial pneumatic industrial robots is M¨I - 9
˜N.The robot has four degrees of mobility provided by horizontal and vertical power cylinders,
and also by a turning drive of gripping device and a drive of fingers.Mobile pneumatic robots
allow to realize walking type of moving.
3. The IC L298
Trainees to discuss this as homework assignment
4. The IC SAA1027
Trainees to discuss this as homework assignment
5. Solenoid Actuators
Trainees to discuss this as homework assignment
43
.
it a stream of electric pulses. Each pulse makes the motor rotate by a fixed angle. Figure below
shows a simple stepper motor.
TOPIC THREE
SEQUENTIAL CONTROL SYSTEMS
Sequence control
It is a process in which one event follows another until a job is completed. This is done in a serial
arrangement in which things follow in logical order or a recurrent pattern.
It is applied in the assembly line process, conveyor systems, industrial robots, power protection
systems, motor starting and control systems etc. and it is characterized by;
i. Discrete loads
ii. Product output is in units or boxes
iii. Different equipment modifies the product at each step
iv. Steps are staged
44
.
ii. Another way to provide time delay is using fiber optic delay line. Here you will have
to convert microwaves to light and back again. Amplification means the delay line
will be non-reciprocal, and you will need separate TDUs for transmit and receive, or
some means of turning the amplifiers around.
iii. Delay lines can be made using microstrip, stripline, or coax.
The following are some relevant specifications for TDUs:
i. Bandwidth
ii. Insertion loss
iii. Total time delay (expressed in nanoseconds or picoseconds)
iv. Time delay flatness over frequency (expressed in %)
v. Number of bits
vi. Amplitude matching over delay states
vii. Amplitude tracking over frequency
Time delay units can be in the following ways:
1. Control relays
2. Digital relays
3. Analogue relays
If there are some unused or combinations which are also called ‘don’t care’ combinations in the
n-bit code, then there will be fewer than 2n output lines. This means that if there are 3-input
lines, then the maximum of outputs expected are eight unique output lines. If this was a 3-bit
input code where the only used 3-bit combinations are simply given as 000, 001, 010, 100, 110
and 111, then this decoder will have only six output lines. In this case, 011 and 101 are being
either unused or taken as don’t care combinations. It is therefore general taken as if n and m are
the numbers of input and output lines respectively, then m and n relates as, m ≤ 2n. Decoders
generate a maximum of 2n possible minterms with an n-bit binary code.
45
.
The truth table above is of a logic circuit that implements a 3-to-8 line decoder function where
this decoder has three inputs designated as A, B and C and eight outputs as D0, D1, D2, D3, D4,
D5, D6 and D7.
Encoders
An encoderis a multiplexer without its single output line. It is truly a combinational logic
function that has 2n or even fewer input lines and n output lines. This corresponds to n selection
lines in any multiplexer. The n output lines generate the binary code for the possible 2 n input
lines. For an octal-to-binary encoder, its encoder would have eight input lines where each will
represent an octal digit and three output lines representing the three-bit binary equivalent. The
truth table of such an encoder is given in the figure below where D0 to D7 represent octal digits
0 to 7 and the A, B, and C only represent binary digits.
The figure above shows the hardware implementation of the octal-to-binary encoder described
by the truth table. It is noted here also that this circuit has the shortcoming that it produces an all
0s output sequence when all input lines are in logic ‘0’ state but it solved by having an
additional line to indicate an all 0s input sequence.For this eight input lines, would have 28= 256
possible combinations but in an octal-to-binary encoder, only eight of these 256 combinations
46
.
would have any physical meaning as shown in the above truth table. The remaining 248
combinations of input variables are the ‘don’t care’ input combinations. It is also noted that
only one of the input lines at a time is in logic ‘1’ state.
Interlock Systems
Interlocking
Interlocking is defined as an arrangement of signals and signal appliances so interconnected that
their movements must succeed each other in proper sequence". In railway signaling, an
interlockingis an arrangement of signal apparatus that prevents conflicting movements through
an arrangement of tracks such as junctions or crossings. The signaling appliances and tracksare
sometimes collectively referred to as an interlocking plant or system. Some of the fundamental
principles of interlocking include:
Signals are not operated to allow conflicting motion to take place at the same time.
Switches and other appliances in the route must be properly 'set' (in position) before a
signal is allowed to enter that route.
Once a route is setand a motion is given a signal to proceed over that route, all switches
and other movable appliances in the route are locked in position until next signal.
Types of Interlocking
Interlocking can be categorized as;
i. Mechanical or analogue
ii. Electrical (solenoid or electro-mechanical or control relay-based.
iii. Limit Switches are electro-mechanical devices that consist of an actuator
mechanically linked to a set of contacts. When an object comes into contact with the
actuator, the device operates the contacts to make or break an electrical connection.
Our limit switches work in a variety of applications and environments because of
their ruggedness, simple visible operation, easy installation and reliable operation
iv. Electronic/computer-based digital.
a. Mechanical interlocking
In mechanical interlocking plants, a locking bedis constructed that consists of steel bars forming
a grid. The levers that operate switches, derails, signals or other appliances are connected to the
bars running in one direction. The bars are constructed so that, if the function controlled by a
given lever conflicts with that controlled by another lever, mechanical interference is set up in
the cross locking between the two bars, in turn preventing the conflicting lever movement from
being made.
b. Electro-mechanical interlocking
Power interlocking may use mechanical locking to ensure the proper sequencing of levers, but
the levers are considerably smaller as they themselves do not directly control the field devices. If
47
.
the lever is free to move based on the locking bed, contacts on the levers actuate the switches and
signals which are operated electrically or electro-pneumatically. Before a control lever may be
moved into a position which would release other levers, an indication must be received from the
field element that it has actually moved into the position requested.
d. Electronic interlocking
Modern interlocking are solid state devices where the wired networks of relays are replaced by
software logic running on special-purpose control hardware. The logic is implemented by
software needed by reprogramming rather than hard-wired circuitry.
Forms of locking
Electric locking
The combination of one or more electric locks or controlling circuits by means of which
levers in an interlocking machine, or switches or other devices operated in connection
with signaling and interlocking are secured against operation under certain conditions.
Section locking
Electric locking is effective while a train occupies a given section of a route and adapted
to prevent manipulation of levers that would endanger the train while it is within that
section.
Route locking
Electric locking take effect when a train passes a signal is adapted to prevent
manipulation of levers that would endanger the train while it is within the limits of the
route entered.
Approach locking
Electric locking effective while a train is approaching a signal that has been set for it to
proceed and adapted to prevent manipulation of levers or devices that would endanger
that train.
Stick locking
Electric locking taking effect upon the setting of a signal for a train to proceed, released
by a passing train, and adapted to prevent manipulation of levers that would endanger an
approaching train.
Indication locking
Electric locking adapted to prevent any manipulation of levers that would bring about an
unsafe condition in case a signal, switch, or other operated device fails to make a
movement corresponding with that of the operating lever.
Check locking or traffic locking
Electric locking that enforces cooperation between the Operators at two adjacent plants in
such a manner that prevents opposing signals governing the same track from being set to
proceed at the same time.
49
.
component in the industrial automation sector. They contain functional features like PID
controllers, sequential control, timers and counters, ease of programming, reliable controlling
capabilities and ease of hardware usage.The PLC is designed as a replacement for the hardwired
relay and timer logic to be found in traditional control panels, where PLC provides ease and
flexibility of control based on programming and executing logic instructions. The internal
functions such as timers, counters and shift registers making sophisticated control possible using
even the smallest PLC. The structure of a PLC can be divided into four parts. They are
input/output modules, central processing unit (CPU), memory and programming terminal.PLCs
are also a special-purpose digital computer in industries as well as in other control-system areas.
PLCs are capable of monitoring the inputs continuously from sensors and producing the output
decisions to operate the actuators based on the program. PLCs are manufactured by companies
like;Moellers, Mitsubishi, Eaton and Siemens. Every PLC system needs at least these three
modules:
PLC Architecture
50
.
Homework
Trainees to do the following as an home assignment
Discuss the following LCs
i. Moellers,
ii. Mitsubishi,
iii. Eaton
iv. Siemens.
The ROM memory contains the operating system, driver and application programs, whereas the
RAM stores user-written programs and working data. These PLCs use retentive memory to save
user programs and data when the power supply breaks or fails and to resume the execution of a
user program ones the power is restored. Thus, these PLCs do not need any use of a keyboard or
monitor for reprograming the processor each time. The retentive memory can be implemented
with the use of long-life batteries, EEPROM modules and flash memory methods.
BUS or Rack
This bus enables the communication between CPU and I/O modules to send or receive the data.
This communication is established by addressing the I/O modules according to the location
fromCPU module along the bus. Some buses provide necessary power to I/O module circuitry,
but they do not provide any power to sensors and actuators connected to I/O modules.
51
.
A modular PLC
It is built with several components that are plugged into a common rack or bus with extendable
I/O capabilities. It contains power supply module, CPU and other I/O modules that are plugged
together in the same rack, which are from same manufacturers or from other manufacturers.
These modular PLCs come in different sizes with variable power supply, computing capabilities,
I/O connectivity, etc.Modular PLCs are further divided into small, medium and large PLCs based
on the programmemory size and the number of I/O features.
Sizes of PLCs
a. Small PLC
- is a mini-sized PLC that is designed as compact and robust unit mounted or
placed beside the equipment to be controlled. This type of PLC is used for
replacing hard-wired relay logics, counters, timers, etc. This PLC I/O module
expandability is limited for one or two modules and it uses logic instruction list or
relay ladder language as programming language.
b. Medium-sized PLC
- is mostly used PLC in industries which allows many plug-in modules that are
mounted on backplane of the system. Some hundreds of input/ output points are
provided by adding additional I/O cards – and, in addition to these –
communication module facilities are provided by this PLC.
c. Large PLCs
- are used wherein complex process control functions are required. These PLCs’
capacities are quite higher than the medium PLCs in terms of memory,
programming languages, I/O points, and communication modules, and so on.
53
.
Mostly, these PLCs are used in supervisory control and data acquisition (SCADA)
systems, larger plants, distributed control systems, etc.
Many types of programmable logic controller are used in the manufacturing industry. They are
defined by the physical configuration of their hardware as well as the types of software or
programming languages used. Programmable logic controller hardware is built to withstand
intense weather or physical wear and software is often made to be somewhat elastic to
accommodate many different situations. As a result, the various controllers are often designed
for manufacturing and automation systems.
Types of PLCS
The different types can include;
i. Ladder logic
Ladder logic is one of the most common programmable logic controller types. Relay
logic hardware is automated and maintained using programmable logic. This makes
this type useful in industrial systems, because many functions can be maintained with
minimal human interaction. Ladder logic can be combined with multiple forms of
programmable controllers to create advanced systems.
ii. Traditional programming
Traditional programming logic controllers use common computer languages, such as
BASIC, to input commands and maintain a system. This type includes some level of
human interaction. They might be used to control relay-based systems or factory
manufacturing processes that must be flexible.
iii. State logic
State logic is considered to be one of the flexible types of programmable logic
controller. By building a computerized model of a real-world task, programmable
state logic controllers are used to assist with tasks that might change quickly. State
logic allows for simulation of decision-making because the state of a program will
change based on input and output data.
iv. Human-machine interface
Human-machine interfaces combine the different controllers to allow for automation
and routine human interaction. These systems rely on input commands to provide
data to users when requested. This type is more advanced and fully automated
systems because various programming languages are needed to facilitate consistent
interaction.
54
.
Applications of PLC
1. Below is a PLC for a simple process control wherein the conveyor belt operation, the position
sensor and other sensor outputs are connected to the input module of the PLC, and from the
output modules – a motor is controlled. When the sensors are activated, then the CPU of the PLC
reads the inputs, and correspondingly processes them according to the program and produces the
outputs to operate the motor so that the conveyor is controlled.
Applications of PLC
2. PLC and SCADA combination of control structure is used in industrial automation sector and
also in electrical utility systems like power transmission and distribution systems. Programmable
sequential switching operation is another major application area of the PLC.
55
.
TOPIC FOUR
DIGITAL CONTROL SYSTEMS
Digital control systems
A digital control system model can be viewed from different perspectives including control
algorithm, computer program, conversion between analog and digital domains, system
performance etc. The most important aspects is the sampling process level. In continuous time
control systems, all the system variables are continuous signals. Whether the system is linear or
nonlinear, all variables are continuously present and therefore known at all times. A continuous
time control system is shown in Figure below.
In a digital control system, the control algorithm is implemented in a digital computer. The error
signal is discretized and fed to the computer by using an A/D (analog to digital) converter. The
controller output is again a discrete signal which is applied to the plant after using a D/A (digital
to analog) converter. General block diagram of a digital control system is shown in Figure
below. The values of error, e(t) is sampled at intervals of time, T. In the context of control and
communication, sampling is a process by which a continuous time signal is converted into a
sequence of numbers at discrete time intervals. It is a fundamental property of digital control
systems because of the discrete nature of operation of digital computer.
Digital electronics are electronics that represent signals by discrete bands of analoglevels, rather
than by continuous range. All levels within a band represent the same signal state. Digital
56
.
techniques are useful because it is easier to get an electronic device to switch into one of a
number of known states than to accurately reproduce a continuous range of values. A sequential
system is a combinational system with some of the outputs fed back as inputs. This makes the
digital machine perform a "sequence" of operations. The simplest sequential system is a
mechanism that represents a binarydigit or "bit". Sequential systems divide into two further
subcategories. "Synchronous" sequential systems change state all at once, when a "clock" signal
changes state. "Asynchronous" sequential systems propagate changes whenever inputs change.
Synchronous sequential systems are made of well-characterized asynchronous circuits such as
flip-flops that change only when the clock changes and which have carefully designed timing
margins. To implement a synchronous sequential state machine is to divide it into a piece of
combinational logic and a set of flip flops called a "state register’. Each time a clock signal ticks,
the state register captures the feedback generated from the previous state of the combinational
logic and feeds it back as an unchanging input to the combinational part of the state machine.
The fastest rate of the clock is set by the most time-consuming logic calculation in the
combinational logic. Many systems need circuits that allow external unsynchronized signals to
enter synchronous logic circuits. These are inherently asynchronous in their design and must be
analyzed as such. Examples of widely used asynchronous circuits include synchronizer flip-
flops, switch de-bouncers and arbiters.
Alarms
One-alarm, two-alarm, three-alarm fires, are categories of fires indicating the level of response
by local authorities with an elevated number of alarms indicating increased commitment of
resources. The term multiple-alarm is a quick way of indicating that a fire was severe and
difficult to contain. The multi-alarm designation is based on the number of units responding to a
fire; the more vehicles and firefighters responding, the higher the alarm designation. With this
unit/firefighter alarm designation, the initial dispatch is referred to as a "first alarm" and is the
largest. Subsequent alarms are calls for additional units.
57
.
be a multi-channel data collection instrument equipped with one or more external sensors.Some
data loggers interface with a personal computer and utilize software to activate the data logger
and view and analyze the collected data, while others have a local interface device (keypad,
LCD) and can be used as a stand-alone device.
Applications
58
.
The Multiplexer
The multiplexer, (“MUX” or “MPX”), is a combinational logic circuit designed to switch one of
several input lines through to a single common output line by the application of a control signal.
Multiplexers operate like very fast acting multiple position rotary switches connecting or
controlling multiple input lines called “channels” one at a time to the output. They can be digital
circuits made from high speed logic gates used to switch digital or binary data or they can be
analogue types using transistors and relays to switch one of the voltage or current inputs through
to a single output.
59
.
Multiplexing
Multiplexing is a term used to describe the operation of sending one or more analogue or digital
signals over a common transmission line at different times or speeds. The device used is called a
Multiplexer. The most basic type of multiplexer device is that of a one-way rotary switch as
shown below.
Multiplexers are also known as data selectors because they can “select” each input line. They are
used as one method of reducing the number of logic gates required in a circuit design or when a
single data line or data bus is required to carry two or more different digital signals. The
selection of each input line in a multiplexer is controlled by an additional set of inputs called
control lines and according to the binary condition of these control inputs, either “HIGH” or
“LOW” the appropriate data input is connected directly to the output. A multiplexer has an even
number of 2N data input lines and a number of “control” inputs that correspond with the number
of data inputs.
We can increase the number of data inputs to be selected further simply by following the same
60
.
procedure and larger multiplexer circuits can be implemented using smaller 2-to-1 multiplexers
as their basic building blocks. So for a 4-input multiplexer we would therefore require two data
select lines as 4-inputs represents 22 data control lines give a circuit with four inputs, I0, I1, I2, I3
and two data select lines A and B as shown.
In this example at any one instant in time only ONE of the four analogue switches is closed,
connecting only one of the input lines A to D to the single output at Q. As to which switch is
closed depends upon the addressing input code on lines “a” and “b“, so for this example to
select input B to the output at Q, the binary input address would need to be “a” = logic “1” and
“b” = logic “0”.
Multiplexers are not limited to switching a number of different input lines or channels to one
61
.
common single output.There are also types that can switch their inputs to multiple outputs and
have arrangements or 4-to-2, 8-to-3 or even 16-to-4 etc configurations and an example of a
simple Dual channel 4 input multiplexer (4-to-2) is given below:
The combination of these resistors will determine the overall gain of the amplifier, (Av). Then
the gain of the amplifier can be adjusted digitally by simply selecting the appropriate resistor
combination. Digital multiplexers are sometimes also referred to as “Data Selectors”.
62
.
TOPIC FIVE
FUNDIMENTALS OF ROBOTS
Robots are devices that are programmed to move parts, or to do work with a tool. Robotics is a
multidisciplinary engineering field dedicated to the development of autonomous devices,
including manipulators and mobile vehicles.A robot can be defined as follows:
1. A robot is a re-programmable multi-functional manipulator designed to move
materials, parts, tools, or specialized devices through variable programmed motions for
the performance of a variety of tasks.
2. A robot is an automatically controlled, reprogrammable, multipurpose, manipulator
programmable in three or more axes, which may be either fixed in place or mobile for use
in industrial automation applications.
3. A robot is any automatically operated machine that replaces human effort, though it
may not resemble human beings in appearance or perform functions in a humanlike
manner.
4. A robot is an electric machine which has some ability to interact with physical objects
and to be given electronic programming to do a specific task that may also have some
ability to perceive and absorb data on physical objects or on its local physical
environment, or to process data, or to respond to various stimuli.
5. A robot is a mechanical device that sometimes resembles a human and is capable of
performing a variety of often complex human tasks on command or by being
programmed in advance.
63
.
- Sensors are the parts that sense and can detect objects or things like heat and light and
convert the object information into symbols or in analog or digital form and then robot
reacts according to the information provided by the sensory system. The sensors used in
robotics are;
Vision Sensors: Camera, Frame Grabber, Image processing unit
Proximity Sensors: distance is estimated between the robot and the object.
Proprioceptive Sensors: are responsible for monitoring self-maintenance and
controlling internal status. This includes battery monitoring, current sensing, and
heat monitoring.
Logical Sensors
2. Motors
A variety of electric motors provide power to robots making them move with various
programmed motions. AC /DC motors can be used.
3. Driving Mechanisms:
Gears and Chains, Pulleys and Belts, Gearboxes are used to transmit rotational motion
from one place to another
4. Servomotors
They adjust themselves until they match the signal. A very common use of servos is in
Radio Controlled models (R/C Servos).
5. Power Supply: Power supply is provided by two types of sources:
Batteries that are used once only and then discarded.
Rechargeable batteries: operate from a reversible chemical reaction and can be
recharged thousand times.
6. Electronic controls:
This uses a digital logic control circuit which controls the mechanical system. This circuit
is connected to the mechanical system through a bridge relay. A control signal generates
a magnetic field in the relay's coil that mechanically closes a switch.
7. Microcontroller systems
Microcontrollers are intelligent electronic devices that are used inside robots. They
deliver functions similar to those performed by a microprocessor (CPU) inside a personal
computer. It comprises of;
Speed: is designated in clock cycles, and is usually measured in millions
of cycles per second (Megahertz, MHz).
Size: specifies the number of bits of information the Microcontroller can
process in one step (e.g, 4-, 8-, 16-, and 32-bits).
Memory: Microcontrollers count most of their read-only memory (ROM)
in thousands of bytes (kB) and random access memory (RAM) in single
bytes.
8. Languages
The following programming languages are used:
64
.
Types of robots
There are three types of robots;
i. Manual robots
ii. Semi-automatic robots
iii. Automatic robots
Classification of Robot
Robots can be classified in many ways. This is according to;
a). their degrees of freedom,
b). kinematical structure,
c). drive technology,
d). work-shop geometry and
e). motion characteristics.
65
.
66
.
A dexterous workspace is the volume of space within which every point can be reached
by the end effecter inall possible orientation.
i).Cartesian robot
In this the kinematic structure of a robot arm is made of three mutually perpendicular prismatic
joints. The wrist center position of a Cartesian robot can be described by three Cartesian co-
ordinates associated with the three prismatic joints. The regional work-space of a Cartesian robot
is a rectangular box. When a Cartesian robot is mounted on rails above its workspace, it is called
a gantry robot.
ii).Cylindrical Robot
A robot arm is called cylindrical robot if either the first or second joint of a Cartesian robot is
replaced by a revolute join. The wrist center position of a cylindrical robot can be described by a
set of cylindrical coordinate system associated with the three joint variables. The workspace of a
cylindrical robot is confined by two concentric cylinders of finite length.
iii).Spherical Robot
A robot arm is called a spherical robot if either the first or second joint of a Cartesian robot is
replaced by a revolute joint. The wrist center position of a spherical robot can be described by a
set of spherical coordinate system associated with the three joint variables. The workspace of
cylindrical robot is confined by two concentric spheres.
iv).Articulated Robot
A robot arm is said to be an articulated robot if all three joints are revolute. The workspace of an
articulated robot is very complex, typically a crescent shaped cross section. Puma robot is an
articulated robot.
67
.
ii). Spherical
A rigid body is said to be under a spherical motion if all particles in the body describe curves that
lie on concentric spheres. A mechanism is said to be a spherical mechanism if all the moving
links perform spherical motion about a common stationary point. A manipulator is called a
spherical manipulator if it is made up of a spherical mechanism.
iii). Spatial Manipulator
A rigid body is said to perform a spatial motion if its motion cannot be characterized as planar or
spherical motion. A manipulator is called a spatial manipulator if at least one of the moving links
in the mechanism possesses a general spatial motion. Planar and spherical mechanisms can be
considered as special cases of spatial mechanisms.
Laws of Robotics
Asimov proposed the three "Laws of Robotics" and later added a 'Zeroth law' as given below:
Law Zero:
A robot may not injure humanity, or, through inaction, allow humanity tocome to harm.
Law One:
A robot may not injure a human being, or, through inaction, allow a humanbeing to come
to harm, unless this would violate a higher order law.
Law Two:
A robot must obey orders given to it by human beings, except where such orderswould
conflict with a higher order law.
Law Three:
A robot must protect its own existence as long as such protection does notconflict with a
higher order law.
Robot Anatomy
Industrial robots come in a variety of shapes and sizes. They are capable of various
armmanipulations and they possess different motion systems.Four basic configurations are
identified with available industrialrobots:
68
.
1. Cartesian configuration
A robot which is constructed around this configuration consistsof three orthogonal slides, as
three slides are parallel to the x, y, and z axesof the Cartesian coordinate system. By appropriate
movements of these slides, the robot iscapable of moving its arm at any point within its three
dimensional rectangular spaced workspace.
2. Cylindrical configuration
The robot body is a vertical column thatswivels about a vertical axis. The arm consists of several
orthogonal slides which allow thearm to be moved up or down and in and out with respect to the
body.
3. Polar configuration
This configuration also goes by the name “spherical coordinate”because the workspace within
which it can move its arm is a partial sphere. The robot has a rotary base and a pivot that can be
used to raise and lower atelescoping arm.
4. Jointed-arm configuration
It is combination of cylindrical and articulated configurations.This is similar in appearance to the
human arm,the arm consists of severalstraight members connected by joints which are analogous
to the human shoulder, elbow, andwrist. The robot arm is mounted to a base which can be rotated
to provide the robot with thecapacity to work within a quasi-spherical space.
69
.
• Wrist bend: Up or down movement of the wrist, this also involves rotationmovement.
• Wrist yaw: Right or left swivel of the wrist.
Motion systems
1. Point-to-point (PTP) control robot: is capable of moving from one point to anotherpoint.
The locations are recorded in the control memory. PTP robots do not controlthe path to get from
one point to the next point. Common applications includecomponent insertion, spot welding,
hole drilling, machine loading and unloading, andcrude assembly operations.
2. Continuous-path (CP) control robot: with CP control, the robot can stop at anyspecified
point along the controlled path. All the points along the path must be storedexplicitly in the
robot’s control memory. Typical applications include spray painting,finishing, gluing, and arc
welding operations.
3. Controlled-path robot: the control equipment can generate paths of differentgeometry such
as straight lines, circles, and interpolated curves with a high degree ofaccuracy. All controlled-
path robots have a servo capability to correct their path.
positioning in 3D space, while the other 2or 3 areused for orientation of the end effector. 6
degrees of freedom are enough to allow the robot toreach all positions and orientations in 3D
space. 5 D.O.F requires a restriction to 2D space, orelse it limits orientations. 5 D.O.F robots are
used for handling tools such as arcwelders.
2. Work Volume/Workspace
The robot tends to have a fixed and limited geometry. Thework envelope is the boundary of
positions in space that the robot can reach. For a Cartesianrobot (like an overhead crane) the
workspace might be a square, for more sophisticated robotsthe workspace might be a shape that
looks like a ‘clump of intersecting bubbles’.
3. Precision Movement
The precision with which the robot can move the end of its wrist is a critical consideration in
most applications. A portion of a linear positioning system axis, with showing control resolution,
accuracy and repeatability is required. In robotics, precision of movement is a complex issue,
and we willdescribe it as consisting of three attributes:
i). Control resolution
ii). Accuracy
iii). Repeatability
i. Control Resolution
This is the smallest change that can be measured by the feedbacksensors, or caused by the
actuators, whichever is larger. If a rotary joint has an encoder thatmeasures every 0.01 degree of
rotation and a direct drive servo motor is used to drive thejoint, with a resolution of 0.5 degrees,
then the control resolution is about 0.5 degrees (theworst case can be 0.5+0.01).
ii. Accuracy
This is determined by the resolution of the workspace. If the robot is commandedto travel to a
point in space, it will be off by some amount, the maximum distanceshould be considered the
accuracy.
iii. Repeatability
The robot mechanism will have some natural variance in it. This means thatwhen the robot is
repeatedly instructed to return to the same point, it will not always stop atthe same position.
5. Speed
Refers either to the maximum velocity that is achievable by the TCP, or by individualjoints. This
number is not accurate in most robots, and will vary over the workspace as thegeometry of the
robot changes.
6. Weight Carrying Capacity (Payload)
The payload indicates the maximum mass the robotcan lift before either failure of the robots, or
dramatic loss of accuracy. It is possible toexceed the maximum payload, and still have the robot
operate, but this is not advised. Whenthe robot is accelerating fast, the payload should be less
than the maximum mass. This isaffected by the ability to firmly grip the part, the robot structure
and the actuators.The end of arm tooling should be considered part of the payload.
71
.
72
.
CHAPTER 6
PROGRAMMING A ROBOT
There are various methods which robots can be programmed to perform a given work cycle and
theyof four categories as follows;
1. Manual method
2. Walkthrough method
3. Lead through method
4. Off-line programming method
1. Manual method
This method is not really programming in its sense but more like setting up a machine rather than
programming. It is the procedure used for the simpler robots and involves setting mechanical
stops, cams, switches or relays in the robots control unit. For these low technology robots used
for short work cycles (e.g., pick and place operations), the manual programming method is
adequate.
2. Walkthrough method
In this method the programmer manually moves the robots arm and hand through the motion
sequence of the work cycle. Each movement is recorded into memory for subsequent playback
during production. The speed with which the movements are performed can be controlled
independently so that the programmer does not have to worry about the cycle time during the
walk through. The main concern is getting the position sequence correct. The walk through
method would be appropriate for spray painting and arc welding.
3. Lead-through method
The lead-through method makes use of a teach pendant to power drive the robot through its
motion sequence. The teach pendant is a small hand held device with switches and dials to
control the robots physical movements. Each motion is recorded into memory for future
playback during work cycle. The lead through method is very popular among robot programming
methods because of its ease and convenience.
Advantages of this programming include:
_ It is easy and no special programming skills or training
Disadvantages of this programming include:
_ it is not practical for large or heavy robots
_ High accuracy and straight-line movements are difficult to achieve
_ it is difficult to edit out unwanted operator moves
_ it is difficult to incorporate external sensor data
_ it is difficult to synchronization with other machines or equipment in the work cell
_ A large amount of memory is required
73
.
74
.
• Example for program instructions are :- Move to point, Move to a point in a straight line
motion, open gripper, close gripper. (MOVE, MOVES, APPRO, APPROS, DEPART,
OPENI, CLOSEI, AND EXIT).
Textual Statements
Language statements include basic motion statement lke:
MOVE P1
Commands the robot to move from its current position to a position and orientation defined by
the variable name P1.The point p1 must be defined. The most convenient method way to define
P1 is to use either powered lead through or manual leads through to place the robot at the desired
point and record that point into the memory.
HERE P1 OR LEARN P1
These are used in the lead through procedure to indicate the variable name for the point. What is
recorded into the robot’s control memory is the set of joint positions or coordinates used by the
controller to define the point. For example, (236,157,63,0,0,0). The first values give joint
positions of the body and arm and the last three values (0,0,0) define the wrist joint positions.
MOVES P1
It denotes movement that is to be made using straight line interpolation. The suffix‘s’ designates
a straight line motion.
DMOVE (4,125)
Suppose the robot is presently at a point defined by joint coordinates (236,157,63,0,0,0) and it
is desired to move joint 4from 0 to 125. DMOVE represents a delta move. Approach and depart
statements are useful in material handling operations.
75
.
DEPART 40 MM
The destination is point p1 but the approach command moves the gripper to a safe
distance(40mm) above the point. Move statement permits the gripper to be moved directly to the
part for grasping. A path in a robot program is a series of points connected together in a single
move. A move statement is used to drive the robot through the path. A path is given a variable
name;
DEFINE PATH123=PATH (P1,P2,P3)
MOVE PATH123
SPEED 75 the manipulator should operate at 75% of the initially commanded velocity where the
initial speed is given in a command that precedes the execution of the robot program. For
example,
SPEED 0.5 MPS
EXECUTE PROGRAM1
This indicates that the program named PROGRAM1 is to be executed by the robot at a speed of
0.5m/sec.
76
.
Commands for controlling the end-effectors .Although end effectors are attached to the wrist of
the manipulator, they are very much like external devices. A Special command is written for
controlling the end effector. Basic commands are;
OPEN (fully open)
and
CLOSE (fully close)
For grippers with force sensors that can be regulated through the robot controller, a command
such as ,
CLOSE 2.0 N
This controls the closing of the gripper until a 20.N force is encountered by the grippers. A
similar command would be used to close the gripper to a given opening width is,
CLOSE 25 MM
A special set of statements is often required to control the operation of tool type end
effectors.(such as spot welding guns, arc welding tools, spray painting guns and powered
spindles).
End Effectors
An End effector can be defined as a device which is attached to the robot’s wrist to perform a
specific task. The task might be work part handling, spot welding, spray painting, or any of a
great variety of other functions. The possibilities are limited only by the imagination and
ingenuity of the application engineers who design robot systems. The end effectors are the
special purpose tooling which enables the robot to perform a particular job. For purpose
organization, we will divide the various types of end effectors into two categories: grippers and
tools.
1. Grippers:
- These are used to grasp and hold an object and place it at a desired location. Grippers can
be classified as;
Mechanical grippers
Vacuum or suction cups
Magnetic grippers
Adhesive grippers
Hooks, Scoops, and so forth.
2. Tools:
- A robot is required to manipulate a tool to perform an operation on a work part. Here the
tool acts as end-effectors. Spot-welding tools, arc-welding tools, spray painting nozzles,
and rotating spindles for drilling and grinding are typical examples of tools used as end-
effectors.
77
.
2. Interlocks
An interlock is the feature of work cell control which prevents the work cycle sequence from
continuing until a certain conditions or set of conditions has been satisfied. In a robotic work
cell, they are two types: outgoing and incoming. The outer going interlock is a signal sent from
the workstation controller to some external machine or device that will cause it to operate or not
to operate for example this would be used to prevent a machine from initiating its process until it
was commanded to process by the work cell controller, an incoming interlock is a single from
some external machine or device to the work controller which determines whether or not the
programmed work cycle sequence will proceed.
Robotic Sensors
The robot must take on more human like senses and capabilities in order to perform the task in a
satisfactory way. These senses and capability includes vision and hand eye coordination, touch,
and hearing. The types of sensors used in robotics are grouped into three categories;
1. Vision sensors
78
.
3. Proximity sensors
Proximity sensors are used to sense when one object is close to another object. On a robot, the
proximity sensors would be located n or near the end effectors. This sensing capability can be
engineered by means of optical proximity devices, eddy-current proximity detectors, magnetic
field sensors, or other devices. In robotics, proximity sensors might be used to indicate the
presence or absence of a work part or other object.
4. Voice sensors
Voice programming can be defined as the oral communication of commands to the robot or other
machine. The robot controller is equipped with a speech recognition system which analyzes the
voice input and compares it with a set of stored word patterns. When a match is found between
the input and the stored vocabulary word the robot performs some actions which correspond to
the word. Voice sensors could be useful in robot programming to speed up the programming
procedure.
Robot Applications
There is a need to replace human labour by robots in:
• Work environment hazardous for human beings
79
.
80
.
81
.
Advantages of Robots
• Robotics and automation can increase productivity, safety, efficiency, quality, and
consistency of Products
• Robots can work in hazardous environments
• Robots need no environmental comfort
• Robots work continuously without any humanity needs and illnesses
• Robots have repeatable precision at all times
• Robots can be more accurate than humans at milli or micro inch accuracy.
• Robots and their sensors can have capabilities beyond that of humans.
• Robots can process multiple stimuli or tasks simultaneously, humans can only one.
• Robots replace human workers who can create economic problems.
Disadvantages of Robots
• Robots lack capability to respond in emergencies, this can cause:
_ Inappropriate and wrong responses
_ A lack of decision-making power
_ A loss of power
_ Damage to the robot and other devices
_ Human injuries
• Robots may have limited capabilities in;
_ Degrees of Freedom
_ Dexterity
_ Sensors
_ Vision systems
_ Real-time Response
• Robots are costly, due to;
_ Initial cost of equipment and Installation Costs
_ Need for peripheralsand Need for training
_ Need for Programming
82
.
Email: [email protected]
END
By Dr. Cliff OroriMosiori©RVIST 2015
83