Download as pdf or txt
Download as pdf or txt
You are on page 1of 88

Microcontrollers

ELDORET NATIONAL POLYTECHNIC 5. Fundamentals of Robots


ELECTRICAL AND ELECTRONICS ENGINEERING DEPARTMENT
a) Definition of a robot
b) Types of robots
DIPLOMA IN ELECTRICAL & ELECTRONICS ENGINEERING c) Elements of robotic system
(POWER OPTION)instrumentation and control telcom d) Need for using robots
e) Functions of control systems in robots
MICROCONTROLLER TECHNOLOGY f) Robot’s Performance, capabilities and specifications
COURSE OUTLINE g) Key features of robots
h) Programming methods
1. Introduction to Microcontroller Technology
a) Elements of Microcontroller Architecture 6. Robots Programming
b) Microcontroller Series a) Programming methods
c) Microcontroller Family Members b) Robot programming functions
c) Robot programming environment
2. Process Control System d) Programming activities
a) Need for Process Control e) Basic types of robot programming languages
b) Process Control Terms f) On-line and off-line programming languages
c) Block Diagram of Process Control
d) Control Modes Books
e) Implementation of Controllers 1. Practical process control: tuning and troubleshooting by Cecil
f) Functions of Actuators L. Smith.
g) Types of Actuators 2. Practical Process Control: Fundamentals of Instrumentation
and Process Control by Control Station, Inc
3. Sequential Control Systems 3. Programmable Logic Controllers: Programming Methods and
a) Sequential Control Applications by John R. Hackworth and Frederick D. Hackworth,
b) Time Delay Unit Jr.
c) Application of Decoder/Encoder 4. Programmable Logic Controllers by W. Bolton 4th Edition
d) Practical Interlock System 5. Programmable Controllers: Theory and Implementation by L.A.
e) Internal Architecture of PLC Bryan and E.A. Bryan. 2nd Ed.
f) Applications of Flow Chart and Ladder Diagram Programming 6. Industrial Automation by Srinivas Medida Vol. 6
Methods 7. Practical SCADA for Industry by David Bailey, Edwin Wright
g) Application of PLCs in functional and practical systems 8. Micro-processors and Micro-controllers by Stefan Hollenthoner
9. Introduction to Microcontrollers by Aaron Striegel & Diane Rover
4. Digital Control Systems 10. Controllers and Controlled Systems by Samson AG
a) Basic digital methods 11. Fundamentals of Industrial Instrumentation and Process
b) Computer data logging Control by William C. Dunn
c) Human Machine Interface (HMI)
d) Application of Digital Computer

ROBINSONKIPROTICH 1
Microcontrollers
TOPIC 1 INTRODUCTION TO MICROCONTROLLER TECHNOLOGY - It is such capable of performing basic computer functions, and can be
incorporated into system designs where such functions are required.
Introduction - A microprocessor can accept input data’s in binary forms, read binary
- Microcomputer is a complete computer system comprising at least instructions, perform data processing and provide desired output.
three major components, the microprocessor (CPU), Memory and IO - A microprocessor is basically classified by its word length (word length
peripheral components. represented by the number of bits, that is, 4bit, 8bit, 16bit, 32bit, 64bits
- A microcomputer could be a general purpose computer (like a PC) or a are normally used for micro processors). For example, Intel 8085 is 8-bit
system designed to fulfill a special task (for example a controller system microprocessor and Intel 8086/8088 is 16-bit microprocessor.
inside an instrument, microcontroller). - Microcontroller (µC) is a highly integrated chip, which includes on
single chip, all or most of the parts needed for a controller. It
is a specialized form of microprocessor that is designed to be self-
sufficient and cost-effective which is part of an embedded system,
that is essentially the whole circuit board. The embedding is part of
a complete device often including hardware and mechanical parts i.e.
the microcontroller and its support circuits are often built into, or
embedded in, the devices they control.
- Embedded system is a computer system designed to perform
one or a few dedicated functions often with real-time computing
constraints.
- The microcontroller typically 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.
- Microprocessor is a programmable multipurpose-multitasking logic - Microcontroller is available in different word lengths like
chip that fabricated by LSI, VLSI or other higher manufacturing microprocessors (4bit, 8bit, 16bit, 32bit, 64bit and 128 bit
techniques. In a modern computer system, the microprocessor is microcontrollers are available today). For example, Intel 8051 is 8-bit
usually referred to as CPU (central processing unit). microcontroller and Intel 8096 is 16-bit microcontroller.
- Microprocessor by definition means that this is only the central - Microcontrollers which are frequently found in automobiles, office, toys,
processing unit, with instruction decoder, registers and Arithmetic Logic machine and appliances are devices which integrate a number of
processing Unit. A CPU does not include any memory or I/O components of a microprocessor system onto a single microchip.
components.
Elements of Microcontroller Architecture
- A typical example of a microcontroller application is the monitoring of a
house. As the temperature rises, the controller causes the windows to
open. If the temperature goes above a certain threshold, the air
conditioner is activated.
- A Microcontroller is a Microcomputer in a single Chip. That means that
a microcontroller chip includes a microprocessor (CPU) as well as some
often used peripherals. A controller is used to control some process or
aspect of the environment.
ROBINSONKIPROTICH 2
Microcontrollers
- As the process of miniaturization continued, all of the components 1. CPU: This is the brain of a microcontroller. The central processor
needed for a controller were built right onto one chip. unit is responsible for executing stored program (in ROM) and
- Microcontroller is a highly integrated chip which includes, on one chip, managing the peripherals.
all or most of the parts needed for a controller. - It is responsible for fetching the instruction, decodes it, and then
- The microcontroller sees the integration of a number of useful finally executed. CPU connects every part of a microcontroller into a
functions into a single IC package. These functions are: single system.
o The ability to execute a stored set of instructions to carry out - The primary function of CPU is fetching and decoding instructions. It
user defined tasks. fetches numeric instructions from memory (opcodes) one by one,
o The ability to be able to access external memory chips interprets them and carries out some operation as a result.
to both read and write data from and to the memory. Programs consist of a collection of these opcodes mixed with
- It typically includes: (numeric) data.
 CPU (central processing unit or the microprocessor) - The CPU works its way sequentially through these instructions,
 EPROM/PROM/ROM (Read Only Memory for the program code) sometimes jumping from place to place as a result of program
 RAM (Random Access Memory for the data) design or as a result of operating conditions.
 I/O (input/output) devices (serial, parallel, ADC, DAC etc.)
 Timers
 Interrupt controller

- Registers are a little like internal memory storage areas. These are
useful for interim calculation results (this reduces the number of
reads/writes to external memory which is usually slower). Some
registers have special functions such keeping track of where the
next instruction is supposed to come from in memory.
- The arithmetic logic unit is responsible for carrying out
calculations. In some CPU's this can be quite simple; perhaps only
supporting add, subtract and basic logical operations.
- In more sophisticated CPU's, there may be several arithmetic units,
some/all capable performing advanced floating point operations.
The instruction decoder's job is to translate numeric opcodes into
sequences of actions.

ROBINSONKIPROTICH 3
Microcontrollers
- Control unit is another important part of a microprocessor. The 2. Memory: The function of memory in a microcontroller is same as
CPU’s control unit coordinates and times the CPU’s functions, and it microprocessor. It is used to store data and program. A
uses the program counter to locate and retrieve the next instruction microcontroller usually has a certain amount of RAM and ROM
from memory. Another purpose of control unit is, controlling the data (EEPROM, EPROM, etc) or flash memories for storing program
flow between microprocessor and peripheral devices/peripheral source codes.
chips. - Memory can be external memory build by extra chips or the on chip
- System bus is the connection between the several components of memory of a microcontroller. In general there are two types of
a microprocessor system. It is a collection of wires carrying memory:
information with a common purpose. It is used for every data - Program memory: is used to hold the application program. In
transfer between the Memory and the CPU for operation code most microcomputer applications the program memory is a
fetches, for data transfer to and from the RAM for dynamic data Read Only Memory (ROM).
fetch and also for data to and from the I/O devices. - Data memory is used for the dynamic data which is generated
- The transaction over the system bus can be grouped into two by the application program and for the STACK. The stack is a
groups: portion of memory where the CPU saves its own internal register
a. Read cycle: data from the Memory or I/O device into the data for calling a subroutine. Data memory must be able to
CPU read and write from the CPU, hence Random Access Memory
b. Write cycle: data from the CPU to the Memory or I/O device (RAM).
- For each read or write operation, the CPU specifies the location of - Stack is a part of RAM used for storing the current state of the
the data or instruction by placing an address on the address bus, program counter (address) when an interrupt occurs.
then activates a signal on the control bus indicating whether the - RAM is used for storing values that are liable to change during the
operation is read or write. course of the execution of a program. RAM contents are (usually)
a. READ OPERATIONS retrieve a byte of data from memory at lost each time systems are turned off/on. As a result of this, RAM is
the location specified and place it on the data bus. CPU not very useful for long term program storage.
reads the data and places it in one of its internal registers. - ROM does not lose its contents when power is removed. Thus it is
b. WRITE OPERATIONS put data from CPU on the data bus generally used for storing programs (but not variables). There are
and store it in the location specified. different technologies used to implement ROM program memory
- Address Bus carries the address of a specified location. For n such as EPROM, EEPROM and Flash memory.
address lines, 2n locations can be accessed. E.g., A 16-bit address - EPROM chip could be programmed with a special programmer and
bus can access 216= 65,536 locations or 64K locations (210 = 1024 = could be erased by applying ultra-violet light. During the normal use
1K, 26 = 64). The address bus is at least 16 bit wide. of this chip inside of the microcomputer system this memory can not
- Data Bus carries information between the CPU and memory or be written, only read.
between the CPU and I/O devices. The data bus width depends on - EEPROM are much like EPROM’s except that they are electrically
the microprocessor (8, 16 or 32 bits). erasable—no ultraviolet source is required. EEPROM is a special
- Control Bus carries control signals supplied by the CPU to type of memory not contained in all microcontrollers.
synchronize the movement of information on the address and data - Its contents may be changed during program execution (similar to
bus. Thus the control lines of the system bus controls what kind of RAM ), but remains permanently saved even after the loss of power
data transfer is in progress. (similar to ROM).
- Limitations of EEPROM’s include slow speed, high cost, and a
limited number of times that they can be reprogrammed.

ROBINSONKIPROTICH 4
Microcontrollers
3. Input/output (I/O) ports: Microprocessors and microcontrollers 4. Timers/counters: This is the one of the useful function of a
send and receive information to the outside world using ports. microcontroller. A microcontroller may have more than one timer
There are two main types of port; parallel and serial. and counters.
a) Parallel input/output ports: Parallel I/O is the most used I/O - The timers and counters provide all timing and counting functions
device in small microcomputer applications. inside the microcontroller. The major operations of this section are
- These ports can be thought of as memory cells or registers that to perform clock functions, modulations, pulse generations,
are connected to the CPU core using the data bus and also to frequency measuring, making oscillations, etc.
the outside world via pins on the side of the micro. - Counters can also be used as event counters allowing the
- In the case of parallel ports, each bit in the port register is microprocessor to perform other tasks.
connected to a pin on the chip. - Timers are typically constructed using a clock source and a counter.
- They are mainly used to drive/interface various devices such as Counters count clock periods that are input to them.
LCD’S, LED’S, printers, memories, etc to a microcontroller. - Some counters count up, some down. Counters have a limited
- A parallel I/O means that there are a number of static inputs or “width” or number of bits and as a result can only count up or down
output bits. These outputs can be used to drive some lights, to so far without “rolling over”.
switch some relays, to drive a display and so on. The input bits - An 8 bit up counter for example can only count up to 255 decimal;
can be used to read information from switches etc. one more period input will cause it to overflow and revert to zero. A
b) Serial ports: Serial ports provide various serial interfaces 16 bit down-counter will decrement down to zero, and given one
between microcontroller and other peripherals like parallel ports. more input it will roll around to 65535. When this roll over takes
- Serial communications requires the sender to send data 1 bit at place, most counters emit some kind of signal
a time a rate agreed with the intended receiver. Each bit is
given a “time slot”, the sets the transmit wire/track to the correct 5. Analog to Digital Converter (ADC)/ Digital to Analog Converter
logic level for each bit's time slot. (DAC): ADC converters are used for converting the analog signal to
- The receiver measures the voltage arriving from the sender at digital form. This device accepts an analogue input and translates
the middle of each bit's time slot. Reliable operation requires this to a digital number whose size is proportional to the magnitude
precise timing. The receiver must look at the correct times for of the analogue signal. Each Analogue to Digital Converter has an
each bit. associated input voltage range and an output numeric range.
- There are two common ways in which this is achieved: - The microcontroller instructs the ADC to “convert” the analogue
o The sender and receiver each have very accurate clocks input (e.g. sensor output) to a digital signal. Internally the ADC
that are periodically re-aligned – this is called takes a snapshot (sample and hold) of the analogue input and, in
Asynchronous transmission. this case uses a successive approximation to map this signal to a
o The other method requires both parties to share a single proportional digital number.
clock source – Synchronous transmission. - While this is going on, the microcontroller must wait. It monitors the
- Transmitting serial data is cheaper than parallel transmission as status of the “conversion finished” (sometimes called “End of
there are fewer conductors involved. Serial I/O is used to send conversion”) signal. When the conversion is done, the converted
data over longer distances to another computer system, display result can be read using input port bits.
systems (terminal) or to a printer. Mice, keyboard, USB and - DAC perform reversal operation of ADC conversion. DAC convert
Ethernet are all examples of serial transmission. the digital signal into analog format. It usually used for controlling
analog devices like DC motors, various drives, etc.

ROBINSONKIPROTICH 5
Microcontrollers
6. Interrupt control: The interrupt control used for providing interrupt Applications
(delay) for a working program. Interrupts are signals that cause the Microcontrollers are widely used in modern electronics equipments. Some
CPU to suspend its current activity and perform some other task. basic applications of microcontroller are given below.
- The interrupt may be external (activated by using interrupt pin) or - Used in biomedical instruments.
internal (by using interrupt instruction during programming). - Widely used in communication systems.
- CPU's are commonly designed to handle interrupts from various - Used as peripheral controller in PC.
sources. Each interrupt signal is associated with a particular - Used in robotics.
memory location which contains the address of the subroutine that - Used in automobile fields.
should be executed on receipt of this interrupt. System
programmers can populate these special memory locations with the Comparison between Microprocessor and Microcontroller
addresses of interrupt handling code. Microprocessors Microcontrollers
- Interrupt vector: A (special) memory location which contains the 1 - It is only a general purpose- It is a micro computer itself
address of an interrupt service routine. computer CPU
- Interrupt service routine: A piece of code that is executed on 2 - Memory, I/O ports, timers,- All are integrated inside the
receipt of an interrupt signal. interrupts are not available microcontroller chip
- Interrupt vector table: A collection of interrupt vectors. inside the chip
3 - This must have many additional- Can function as a micro
7. Special functioning block: Some microcontrollers used only for digital components to perform its computer without any
some special applications (e.g. space systems and robotics) these operation additional components.
controllers containing additional ports to perform such special 4 - Systems become bulkier and- Make the system simple,
operations. This considered as special functioning block. expensive. economic and compact
5 - Not capable for handling- Handling Boolean functions
Advantages of Microcontrollers Boolean functions
The main advantages of microcontrollers are given. 6 - Higher accessing time required - Low accessing time
- Microcontrollers act as a microcomputer without any digital parts. 7 - Very few pins are programmable - Most of the pins are
- As the higher integration inside microcontroller reduce cost and size programmable
of the system. 8 - Very few number of bit handling- Many bit handling instructions
- Usage of microcontroller is simple, easy for troubleshoot and instructions
system maintaining. 9 - Widely Used in modern PC and- widely in small control systems
- Most of the pins are programmable by the user for performing laptops
different functions. E.g. - INTEL 8086,INTEL Pentium- INTEL8051,89960,PIC16F877
- Easily interface additional RAM, ROM,I/O ports. series
- Low time required for performing operations.

Disadvantages of Microcontrollers
- Microcontrollers have got more complex architecture than that of
microprocessors.
- Only perform limited number of executions simultaneously.
- Mostly used in micro-equipments.
- Cannot interface high power devices directly.
ROBINSONKIPROTICH 6
Microcontrollers
Classification of Microcontrollers c) The 32-Bit Microcontroller
- Microcontrollers can be classified on the basis of internal bus width, - When the ALU performs arithmetic and logical operations on a double word
architecture, memory and instruction set. (32bits) at an instruction, the microcontroller is a 32-bit microcontroller. The
internal bus width of 32-bit microcontroller is of 32-bit.
- Examples of 32-bit microcontrollers are Intel 80960 family and Motorola
M683xx and Intel/Atmel 251 family. The performance and computing
capability of 32 bit microcontrollers are enhanced with greater precision as
compared to the 16-bit microcontrollers

2. Classified on the Basis of Memory/ devices


a) Embedded Microcontrollers
- When an embedded system has a microcontroller unit that has all the
functional blocks (including program as well as data memory) available on a
chip is called an embedded microcontroller.
- For example, 8051 having Program & Data Memory, I/O Ports, Serial
Communication, Counters and Timers and Interrupt Control logic on the
chip is an embedded microcontroller.
b) External Memory Microcontrollers
- When an embedded system has a microcontroller unit that has not all the
functional blocks available on a chip is called an external memory
microcontroller.
- In external memory microcontroller, all or part of the memory units are
1. Classified on the Basis of Internal Bus Width externally interfaced using an interfacing circuit called the glue circuit.
- For example, 8031 has no program memory on the chip is an external
a) The 8-Bit Microcontroller memory microcontroller
- When the ALU performs arithmetic and logical operations on a byte (8-bits)
at an instruction, the microcontroller is an 8-bit microcontroller. The internal 3. Classified on the Basis of Architecture
bus width of 8-bit microcontroller is of 8-bit. - There are mainly two categories of processors, namely, Von-Neuman (or
- Examples of 8-bit microcontrollers are Intel 8051 family and Motorola Princeton) architecture and Harvard Architecture. These two architectures
MC68HC11 family. differ in the way data and programs are stored and accessed.

b) The 16-Bit Microcontroller a) Von-Neuman Architecture


- When the ALU performs arithmetic and logical operations on a word (16- - Microcontrollers based on the Von-Neuman architecture have a single
bits) at an instruction, the microcontroller is a 16-bit microcontroller. The ‘data’ bus that is used to fetch both instructions and data. Program
internal bus width of 16-bit microcontroller is of 16-bit. instructions and data are stored in a common main memory.
- Examples of 16-bit microcontrollers are Intel 8096 family and Motorola - When such a controller addresses main memory, it first fetches an
MC68HC12 and MC68332 families. The performance and computing instruction, and then it fetches the data to support the instruction. The two
capability of 16 bit microcontrollers are enhanced with greater precision as separate fetches slows up the controller’s operation.
compared to the 8-bit microcontrollers.
ROBINSONKIPROTICH 7
Microcontrollers
- The Von-Neuman architecture’s main advantage is that it simplifies the Cycle 2: - Execute “Move Data to Accumulator” instruction
microcontroller design because only one memory is accessed. - Read next instruction
- In microcontrollers, the contents of RAM can be used for data storage and - Hence each instruction is effectively executed in one instruction cycle.
program instruction storage.
- For example, the Motorola 68HC11 microcontroller is Von-Neuman
architecture.
- Example : An Instruction “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

4. Classified on the Basis of Instruction set


a) Complex Instruction Set Computer (CISC) Architecture
Microcontrollers
- Almost all of today’s microcontrollers are based on the CISC (Complex
Instruction Set Computer) concept.
- When a microcontroller has an instruction set that supports many
addressing modes for the arithmetic and logical instructions, data transfer
and memory accesses instructions, the microcontroller is said to be of CISC
b) Harvard Architecture architecture.
- Microcontrollers based on the Harvard Architecture have separate data bus - The typical CISC microcontroller has well over 80 instructions, many of
and an instruction bus. This allows execution to occur in parallel. them very powerful and very specialized for specific control tasks. It is quite
- As an instruction is being “pre-fetched”, the current instruction is executing common for the instructions to all behave quite differently. Some might only
on the data bus. Once the current instruction is complete, the next operate on certain address spaces or registers, and others might only
instruction is ready to go. recognize certain addressing modes.
- This pre-fetch theoretically allows for much faster execution than Von- - The advantages of the CISC architecture are that many of the instructions
Neuman architecture, on the expense of complexity. are macro-like, allowing the programmer to use one instruction in place of
- The Harvard Architecture executes instructions in fewer instruction cycles many simpler instructions.
than the Von-Neuman architecture. - An example of CISC architecture microcontroller is Intel 8096 family.
- For example, the Intel MCS-51 family of microcontrollers and PIC
microcontrollers uses Harvard Architecture. b) Reduced Instruction Set Computer (RISC) Architecture
- The same instruction (as shown under Von-Newman architecture) would be Microcontrollers
executed as follows: - The industry trend for microprocessor design is for Reduced Instruction Set
Cycle 1: - Complete previous instruction Computers (RISC) designs.
- Read the “Move Data to Accumulator” instruction
ROBINSONKIPROTICH 8
Microcontrollers
- When a microcontroller has an instruction set that supports fewer 8-Bit Microcontrollers
addressing modes for the arithmetic and logical instructions and for data
transfer instructions, the microcontroller is said to be of RISC architecture.
- The benefits of RISC design simplicity are a smaller chip, smaller pin count,
and very low power consumption.
- Some of the typical features of a RISC processor- Harvard architecture are:
- Allows simultaneous access of program and data.
- Overlapping of some operations for increased processing performance.
- Instruction pipelining increases execution speed.
- Orthogonal (symmetrical) instruction set for programming simplicity.
- Allows each instruction to operate on any register or use any
addressing mode

c) Specific Instruction Set Computer (SISC)


- Actually, a microcontroller is by definition a Reduced Instruction Set
Computer. It could really be called a Specific Instruction Set Computer
(SISC).
- The basic idea behind the microcontroller was to limit the capabilities of the
CPU itself, allowing a complete computer (memory, I/O, interrupts, etc) to fit 16-Bit Microcontrollers
on the single chip.
- At the expense of the more general purpose instructions that make the
standard microprocessors (8088, 68000, 32032) so easy to use, the
instruction set was designed for the specific purpose of control (powerful bit
manipulation, easy and efficient I/O, and so on).

Commercial Microcontroller Devices


- Microcontrollers come in many varieties. Depending on the power and
features that are needed, one might choose a 4 bit, 8 bit, 16 bit, or 32 bit
microcontroller. Intel 8048 Microcontroller and their variant
- In addition, some specialized versions are available which include features - The 8048 was used in the Magnavox Odyssey video game console, and
specific for communications, keyboard handling, signal processing, video Roland ProMars analog synthesizers. The original IBM PC keyboard used
processing, and other tasks. an 8048 as its internal microcontroller.
- The 8049 has 2 KB of masked ROM (the 8748 and 8749 had EPROM) that
4-Bit Microcontrollers can be replaced with a 4 KB external ROM, as well as 128 bytes of RAM
and 27 I/O ports. The µC's oscillator block divides the incoming clock into
15 internal phases, thus with its 11 MHz maximum crystal one gets 0.73
MIPS (of one-clock instructions). Some 70% of instructions are single
byte/cycle ones, but 30% need two cycles and/or two bytes, so the raw
performance would be closer to 0.5 MIPS.

ROBINSONKIPROTICH 9
Microcontrollers
- The Intel 8748 has on-chip clock oscillator, 2× 8-bit timers, 27× I/O ports, - The registers input/output ports and static RAM make up the data address
64 bytes of RAM and 1 KB of EPROM. A version with 2 KB EPROM and space. The working registers are mapped in as the first 32 memory spaces
128 bytes RAM was also available under the 8749 number. followed by the I/O ports, which means that the actual usable RAM starts at
Device Internal Memory Remarks memory location 100H.
- Atmel's AVR’s have a two-stage pipeline design. The next machine
Subset of 8048, 20 pins, instruction is fetched as the current one is executing. Most instructions take
8020 1K × 8 ROM 64 × 8 RAM
only 13 I/O lines just one or two clock cycles, making AVR’s relatively fast among the eight-
8035 none 64 × 8 RAM bit microcontrollers. The AVR’s were designed for the efficient execution of
8039 none 128 × 8 RAM compiled code
- By combining an 8-bit RISC CPU with In-System Self-Programmable Flash
8040 none 256 × 8 RAM on a monolithic chip, the ATMega8 is a powerful micro-controller that
8048 1K × 8 ROM 64 × 8 RAM provides a highly-flexible and cost-effective solution to man embedded
8049 2K × 8 ROM 128 × 8 RAM control applications

8748 1K × 8 EPROM 64 × 8 RAM


8749 2K × 8 EPROM 128 × 8 RAM
8051 PIC AVR ARM
Microcontroll Microcontroll Microcontroll Microcontroll
Device Internal Memory Remarks
er: er: er: er:
Universal Peripheral (Peripheral (Advanced (Advanced
8041 1K × 8 ROM 64 × 8 RAM
Interface (UPI) Interface Virtual RISC) RISC
8041AH 1K × 8 ROM 128 × 8 RAM UPI Controller) Machine)
1K × 8 OTP UPI, OTP EPROM version of Manufacturer Intel Microchip Atmel ARM Holdings
8741AH 128 × 8 RAM Technology
EPROM 8041AH
8042AH 2K × 8 ROM 256 × 8 RAM UPI Families: 8051 variants PIC16,PIC17, Tiny, Atmega, ARM v4,5,6,7
PIC18, PIC24, Xmega, and series
2K × 8 OTP UPI, OTP EPROM version of PIC32 special
8742AH 256 × 8 RAM
EPROM 8042AH purpose AVR
Popular AT89C51, PIC18fXX8, Atmega8, 16, LPC2148,
The AVR Microcontrollers Microcontroll P89v51, etc PIC16f88X, 32, Arduino ARM Cortex-
- This type of AVR Advanced Virtual RISC controller belongs to the cheapest ers PIC32MXX Community M0 to ARM
but most versatile micro-controllers. Cortex-M7,
- The AVR’s are a family of RISC (Reduced Instruction Set Computer) etc.
microcontrollers from Atmel.
Bus width 8-bit for 8/16/32-bit 8/32-bit 32-bit mostly
- The AVR is a Harvard architecture machine where programs and data are
stored separately. Program instructions are stored in semi-permanent Flash standard core also available
memory which loads and manipulates data in the volatile SRAM. The in 64-bit
AVR’s have 32 single-byte registers. ISA CISC Some feature RISC RISC
of RISC
ROBINSONKIPROTICH 10
Microcontrollers
Memory Von Neumann Harvard Modified Modified Intel 8051 Microcontroller
Architecture architecture architecture Harvard - Intel 8051 and 80C51 are 8-bit microcontrollers and members of Intel MCS-
architecture 51 family (commonly referred to as 8051). 8051 is a Harvard architecture,
Speed 12 4 1 clock/ 1 clock/ CISC instruction set, single chip microcontroller (µC) series which was
Clock/instructi Clock/instructi instruction instruction developed by Intel in 1980 for use in embedded systems.
- In addition to on-chip clock oscillator, 2 16-bit timers, 4 I/O ports and a
on cycle on cycle cycle cycle
serial port, all 8051 and 80C51 chips have 128 bytes of RAM and 4 KB
Memory ROM, SRAM, SRAM, FLASH Flash, SRAM, Flash, masked ROM. If necessary, 8051 memory can be expanded up to 128 KB
FLASH EEPROM SDRAM, by adding up to 64 KB of external program and data memory.
EEPROM - Intel's original MCS-51 family was developed using NMOS technology, but
Communicati UART, PIC, UART, UART, USART, UART, USART, later versions, identified by a letter C in their name (e.g., 80C51) used
on Protocols USART,SPI,I2C USART, LIN, SPI, I2C, LIN, I2C, SPI, CMOS technology and consume less power than their NMOS
CAN, (special CAN, USB, predecessors. This made them more suitable for battery-powered devices
Ethernet, SPI, purpose AVR Ethernet, I2S,
I2S support CAN, DSP, SAI
USB, (serial audio
Ethernet) interface),
IrDA
Power Average Low Low Low
Consumption

A typical 8051 contains:


⇒ CPU with Boolean processor
⇒ 5 or 6 interrupts: 2 are external, 2 priority levels
⇒ 2 or 3 16-bit timer/counters
⇒ Programmable full-duplex serial port (baud rate provided by one of the
timers)
⇒ 32 I/O lines (four 8-bit ports)
⇒ RAM
⇒ ROM/EPROM in some models

- I/O Ports: All 8051 microcontrollers have 4 I/O ports each comprising 8
bits which can be configured as inputs or outputs. Accordingly, in total of 32

ROBINSONKIPROTICH 11
Microcontrollers
input/output pins enabling the microcontroller to be connected to peripheral
devices are available for use.
- Memory Organization: The 8051 has two types of memory and these are
Program Memory and Data Memory. Program Memory (ROM) is used to
permanently save the program being executed, while Data Memory (RAM)
is used for temporarily storing data and intermediate results created and
used during the operation of the microcontroller.
- All 8051 microcontrollers have a 16-bit addressing bus and are capable of
addressing 64 kb memory.
- Counters and Timers: The 8051 microcontroller has 2 timers/counters -
called T0 and T1. As their names suggest, their main purpose is to
measure time and count external events. Besides, they can be used for
generating clock pulses to be used in serial communication, so called Baud
Rate.

Physical Addressing

ROBINSONKIPROTICH 12
Microcontrollers

-
ROBINSONKIPROTICH 13
Microcontrollers

ROBINSONKIPROTICH 14
Microcontrollers

- -

ROBINSONKIPROTICH 15
Microcontrollers
8051 variant Microcontrollers

- The 8051 has the widest range of variants of any embedded controller on
the market.
- The smallest device is the Atmel 89c1051, a 20 Pin FLASH variant with 2
timers, UART, 20mA.
- The fastest parts are from Dallas, with performance close to 10 MIPS.
- The most powerful chip is the Siemens 80C517A, with 32 Bit ALU, 2
UARTS, 2K RAM, PLCC84 package, 8 x16 Bit PWM’s, and other features.
- Among the major manufacturers are:
• AMD Enhanced 8051 parts (no longer producing 80x51 parts)
• Atmel FLASH and semi-custom parts
• Dallas Battery backed, program download, and fastest variants
• Intel 8051 through 80C51gb / 80C51sl
• Matra 80C154, low voltage static variants
• OKI 80c154, mask parts
• Philips 87C748 through 89Cc588 - more variants than anyone else
• Siemens 80C501 through 80C517a, and SIECO cores
• SMC COM20051 with ARCNET token bus network engine
• SSI 80x52, 2 x HDLC variant for MODEM use

- Intel 8751 and 87C51 belong to MCS-51 family of 8-bit microcontrollers.


The MCUs include 128 bytes of RAM and 4 KB programmable ROM, and
can be expanded with 128 KB of external memory (64 KB of external
program memory and 64 KB of data memory). The chips also have 2 16-bit
timers, 32 I/O lines, a serial port, and on-chip oscillator.
- First generations of 8751 devices were manufactured using HMOS/NMOS
technology. 87C51 microcontrollers switched to CMOS process, which
helped to reduce power consumption considerably.
- 8751/87C51 microcontrollers were manufactured in several packages,
including plastic and ceramic DIP, plastic leaded chip carrier, and quad flat-
pack.
- Some packages contained a quartz window, which allowed the contents of
EPROM to be erased, and then re-programmed. 8751/87C51 MCUs
without the quartz window could be programmed only once.

ROBINSONKIPROTICH 16
Microcontrollers
TOPIC 2 PROCESS CONTROL SYSTEM - Small changes in a process can have a large impact on the end result.
Variations in proportions, temperature, flow, turbulence, and many other
Introduction factors must be carefully and consistently controlled to produce the desired
- Industrial process control (PC) is a fascinating and challenging area of end product with a minimum of raw materials and energy.
electronics technology and nothing has revolutionized this area like the
microcontroller. Process Control
- The microcontroller has added a level of intelligence to the evaluation of - Process control technology is the tool that enables manufacturers to keep
data and a level of sophistication in the response to process disturbances. their operations running within specified limits and to set more precise limits
- In this respect, you may hear that microcontrollers are embedded as the to maximize profitability, ensure quality and safety.
“brains” in much of our manufacturing equipment and consumer electronic - Process control refers to the methods that are used to control process
devices. variables when manufacturing a product.
- It consists of monitoring the state of a critical parameter, detecting when it
Process and Control varies from desired state, and taking action to restore it. It involves the
- Process as used in the terms process control and process industry, refers process variable, set points and manipulated variable.
to the methods of changing or refining raw materials to create end products - Thus the definition of process control is a controllable process that must
i.e. an operation that uses resources to transform inputs into outputs. It is behave in a predictable manner. For a given change in the manipulated
the resource that provides the energy into the process for the variable the process variable must respond in a predictable and consistent
transformation to occur. manner.
- Most basic process control systems consist of a control loop. Control loops
in the process control industry work in the same way, requiring three tasks
to occur: Measurement, Comparison and Adjustment. This has four
main components which are:
 A measurement of the state or condition of a process
 A controller calculating an action based on this measured value against
a pre-set or desired value (set point)
- Process industries include the chemical industry, the oil and gas industry,  An output signal resulting from the controller calculation which is used
the food and beverage industry, the pharmaceutical industry, the water to manipulate the process action through some form of actuator
treatment industry, and the power industry etc.  The process itself reacting to this signal, and changing its state or
- Control in process industries refers to the regulation of all aspects of the condition
process. Precise control of level, temperature, pressure and flow is
important in many process applications.
- The raw materials, which either pass through or remain in a liquid, gaseous,
or slurry (a mix of solids and liquids) state during the process, are
transferred, measured, mixed, heated or cooled, filtered, stored, or handled
in some other way to produce the end product.
- Refining, combining, handling, and otherwise manipulating fluids to
profitably produce end products can be a precise, demanding, and
potentially hazardous process.

ROBINSONKIPROTICH 17
Microcontrollers
- Controlling a process requires knowledge of four basic elements, the - For example, a control point might be the temperature at which a chemical
process itself, the sensor that measures the process value, the final reaction takes place. Accurate control of temperature ensures process
control element that changes the manipulated variable, and the efficiency. Manufacturers save money by minimizing the resources required
controller. to produce the end product.
- In industrial process control, the Process Variable (PV) is measured by an
instrument in the field and acts as an input to an automatic controller which 3. Ensure safety
takes action based on the value of it. - Safety, environmental, and economic considerations are all very important.
- Devices that measure PV are transducers or sensors. In many cases, the Precise process control may also be required to ensure safety.
PV sensor consists of a direct measurement device called an element and - In a sense, economics is the ultimate driving force—an unsafe or
a separate signal processor called a transmitter. environmentally hazardous process will ultimately cost more to operate,
- The controller is the device that processes the error signal, determines the through fines paid, insurance costs, and so forth.
required control action and provides a control output Manipulated Variable - In many industries (petroleum refining, for example), it is important to
(MV) to the process. The device that converts the control output into control minimize energy costs while producing products that meet certain
action is the actuator. specifications.
- Better process automation and control allows processes to operate closer
Need for Process Control to “optimum” conditions and to produce products where variability
- Manufacturers control the production process for the following reasons: specifications are satisfied.
o Reduce variability - The concept of fail-safe is always important in the selection of
o Increase efficiency instrumentation. Fail-safes allow a system to return to a safe state after a
o Ensure safety breakdown of the control. This fail-safe allows the process to avoid
o Quality hazardous conditions that may otherwise occur.

1. Reduce Variability 4. Quality


- Process control can reduce variability in the end product, which ensures a - In addition to safety, process control systems are central to maintaining
consistently high-quality product. Manufacturers can also save money by product quality.
reducing variability. - In blending and batching operations, control systems maintain the proper
- Reducing variability can also save money by reducing the need for product ratio of ingredients to deliver a consistent product. They tightly regulate
padding to meet required product specifications. temperatures to deliver consistent solids in cooking systems. Without this
- Padding refers to the process of making a product of higher-quality than it type of control, products would vary and undermine quality.
needs to be to meet specifications.
- When there is variability in the end product (i.e., when process control is Process Control Terminologies
poor), manufacturers are forced to pad the product to ensure that i) Process Variable (PV) is a measure of the process output that changes
specifications are met, which adds to the cost. in response to changes in the manipulated variable. In the temperature
- With accurate, dependable process control, the set-point (desired or control loop example, the measured variable is temperature, which must
optimal point) can be moved closer to the actual product specification and be held close to 100 °C. In this example and in most instances, the
thus save the manufacturer money. measured variable is also the process variable. The measured
variable is the condition of the process fluid that must be kept at the
2. Increase efficiency designated setpoint.
- Some processes need to be maintained at a specific point to maximize ii) Set Point (SP) is the value at which the operator wishes to maintain the
efficiency. process variable at. For example, if a process temperature needs to be
ROBINSONKIPROTICH 18
Microcontrollers
kept within 5 °C of 100 °C, then the setpoint is 100 °C. A temperature ix) Controller Output/variable (CO) is the signal from the controller to the
sensor can be used to help maintain the temperature at setpoint. The final control element.
sensor is inserted into the process, and a controller compares the x) Deadband is the value that must be traversed before the controller output
temperature reading from the sensor to the setpoint. will change its direction again. For example, on the heat exchanger, if the
iii) Manipulated variables - these input variables are adjusted dynamically thermostat is configured with a 110°C Set Point and a 20°C deadband,
to keep the controlled variables at their set-points. the steam valve will open at 100°C and close at 120°C. If such a large
fluctuation from the Set Point is acceptable, then the process is under
control.
xi) Process Dead Time is the period of time that passes between a change
in the controller output and a change in the process variable being
measured. Dead time is often the result of transportation delays (material
on a belt, compressible material in a pipe) although sensors and final
control elements may add to process dead time. Dead time is the enemy
of loop tuning, the amount of dead time in a process will determine how
"tightly" the process can be tuned and remain stable.
xii) Process Time Constant is the amount of time for the process variable to
reach 63.2 percent of its final value in response to a step change in a first
order process.
xiii) Process lag is the delay time it takes the controlled variable to respond
iv) Controlled variables - these are the variables which quantify the to a change in the controller output signal. In such a case, the error
performance or quality of the final product, which are also called output signal persists for some time before the process can return to the set
variables. point and this may cause the control valve to open too wide.
v) Error signal/actuating signals is the deviation of the process variable Consequently, the process variable may overshoot the set point. In such
from the Set Point and is defined as E = SP - PV. In the temperature cases, process control will be improved by the addition of a derivative
control loop example, the error is the difference between the 110°C controller.
measured variable and the 100 °C setpoint—that is, the error is +10°C. xiv) Process gain is the response of the process variable to a change in the
The objective of any control scheme is to minimize or eliminate error. controller output, or the change in the process variable divided by the
vi) Offset is a sustained deviation of the process variable from the setpoint. change in the controller output.
In the temperature control loop example, if the control system held the xv) Control stability is the ability of a measured variable to return to its set
process fluid at 100.5 °C consistently, even though the setpoint is 100 °C, point after a disturbance.
then an offset of 0.5 °C exists. xvi) Linear process is one that has non-varying process characteristics over
vii) Load disturbance is an undesired change in one of the factors that can the range of the process variable.
affect the process variable. They represent input variables that can cause xvii) Nonlinear process is one that has varying process characteristics over
the controlled variables to deviate from their respective set points. In the the range of the process variable.
temperature control loop example, adding cold process fluid to the vessel
would be a load disturbance because it would lower the temperature of
the process fluid
viii) Final Control Element (FCE) is the device that changes the value of the
manipulated variable.

ROBINSONKIPROTICH 19
Microcontrollers
Control Modes a large volume of water so that too much or too little steam has
- In control, there are control systems which can be discrete or analog, minimal effect on the overall temperature; or where a modest
manual or automated, periodic or continuous. amount of temperature cycling is acceptable.
- Control operations that involve human action to make an adjustment are 2. Modulating control: If the output of a controller can move through
called manual control systems. Conversely, control operations in which no a range of values, this is modulating control. Modulation Control
human intervention is required, such as an automatic valve actuator that takes place within a defined operating range only. That is, it must
responds to a level controller, are called automatic control systems. have upper and lower limits. Modulating control is a smoother form
- There are five basic forms of control available in Process Control: of control than step control. It can be used in both open loop and
1. On-Off or ‘bang-bang’ control: The oldest strategy for control is to use closed loop control systems.
a switch giving simple on-off control. This is a discontinuous form of 3. Open loop control: Open loop control is thus called because the
control action, and is also referred to as two-position control. control action (Controller Output Signal) is not a function of the PV
- On-Off Control allows only 2 control valve positions; fully opened or fully (Process Variable) or load changes. The open loop control does not
closed. self-correct, when these PV’s drift.
- A perfect on-off controller is 'on' when the measurement is below the 4. Feed forward control: Feed forward control is a form of control
set-point (SP) and the manipulated variable (MV) is at its maximum based on anticipating the correct manipulated variables required to
value. Above the SP, the controller is 'off' and the MV is at a minimum. deliver the required output variable. It is seen as a form of open loop
- A thermostat on a heater is an example of control that is on or off. A control as the PV is not used directly in the control action.
temperature sensor turns the heat source on if the temperature falls 5. Closed loop or feedback control: If the PV, the objective of
below the set point and turns the heat source off when the set point is control, is used to determine the control action it is called closed
reached. There is no measurement of the difference between the set loop control system. In closed loop control the controller output is
point and the measured temperature (e.g. no error measurement) and determined by difference between the process variable and the Set
no adjustment to the rate at which heat is added other than all or none. Point.
On/Off Control

controller turned on over-peaking

80ºC
T (ºC) Set Point

70ºC

Load

Time
0 1 2 3 4 5 6
- When the process water temperature is less than the set point of 80 ºC,
the steam valve opens fully and when the process water reaches or
exceeds 80 ºC, the controller signals the control valve to close fully.
- This type of control requires the least expensive equipment and is
suitable when there is a large process “capacity”, e.g., when there is
ROBINSONKIPROTICH 20
Microcontrollers
Control Modes in closed loop/feedback control Proportional control (P)
- Most Closed loop Controllers are capable of controlling with three - This is the principal means of control. The controller produces action
control modes which can be used separately or together that is proportional to the error E. That is, the proportional component
o Proportional Control (P): Determines the speed of response Mp of the controller output M is equal to a coefficient times the current
of the loop. value of the control error E
o Integral or Reset Control (I): Forces the controller to line out
at its set point.
o Derivative, or Rate Control (D): Enhances stability margin,
which permits the gain to be increased

Mode Characteristics
- The controller output M can be seen as the sum of the outputs of the
individual modes:

- Proportional Control opens and closes a control valve by an amount


which is proportional to the error in the measured variable, i.e., the
magnitude of the deviation from the set point.
- The automatic controller needs to correct the controllers output, with an
Control Error. action proportional to E. The correction starts from an output value at
- The traditional PID control equation is based entirely on the control error the beginning of automatic control action.
E, which is the difference between the set point SP and the process - Proportional Band is another term for controller sensitivity. It is the
variable PV. reciprocal of gain but proportional band is usually stated in percent. It is
- The sign of the control error depends on the controller action: usually defined, in percentage terms, as the ratio of the input value, or
E = SP - PV for a reverse acting controller PV to a full or 100% change in the controller output value or MV.
E = PV - SP for a direct acting controller - The tuning coefficients KC and Kp have exactly the same effect on the
- Direct action means that, when the controller sees an increasing signal proportional action.
from the transmitter, its output will increase (e.g. increased coolant flow - Consequently, there is really no distinction between these two
when process fluid is too hot). coefficients in the equation for the proportional mode.
- For reverse action, increasing measurement signals cause the - But as we shall see, their overall effect is very different when other
controller output to decrease (decreased steam flow when process fluid modes are added to the controller. The controller gain Kc multiplies all
is too hot). modes in the controller, whereas the proportional gain KP is applied to
the proportional mode only.
- Many digital systems permit the proportional mode and/or the derivative
mode to be based on the process variable instead of on the control
error.

ROBINSONKIPROTICH 21
Microcontrollers
Integral control (I) Derivative control (D)
- The integral component MI is equal to a coefficient times the integral of - The derivative component MD of the controller output M is equal to a
the control error E. That is, it produces a control action that is coefficient times the rate of change of the control error E. The control
proportional to the integral of the error E with time. action is proportional to the rate at which the error is changing dE/dt

Where

- The derivative mode enhances the stability margin for the control loop,
which reduces the overshoot and degree of oscillations.
- When used effectively, the derivative mode permits the controller gain
to be increased, thereby providing a faster response to set - point
changes and disturbances.
- When the controller contains only the proportional mode, the controlled - Since the rate of change of noise can be large, using D-Control as a
variable is not necessarily equal to the set point when the loop lines out. means of enhancing the stability of a control loop is done at the
- This behavior, known as droop or offset. When the integral or reset expense of amplifying noise.
mode is present, the controlled variable must equal the set point when - But this is achieved only when proper tuning procedures are followed.
the loop lines out. - As D-Control on its own has no purpose, it is always used in
- This type of behavior is desirable in most loops, so the integral or reset combination with P-Control or PI-Control. This results in a PD-Control or
mode is usually present. PID-Control. PID Control is mostly used if D-Control is required.
- Integral action is used to control towards no offset in the output signal.
This means that it controls towards no error (E = 0). Integral control is
normally used to assist proportional control. The combination of both is
called as PI-control.

ROBINSONKIPROTICH 22
Microcontrollers
Controller Types PD Controller
- PID controllers use a 3 basic behavior types or modes: P - - D mode is used when prediction of the error can improve control
proportional, I- integrative and D - derivative. While proportional and or when it necessary to stabilize the system.
integrative modes are also used as single control modes, a derivative - Often derivative is not taken from the error signal but from the
mode is rarely used on it’ s own in control systems. system output variable. This is done to avoid effects of the sudden
- Combinations such as PI and PD control are very often used in practical change of the reference input that will cause sudden change in the
systems. value of error signal.
- Sudden change in error signal will cause sudden change in control
P Controller output. To avoid that, it is suitable to design D mode to be proportional
- In general it can be said that P controller cannot stabilize higher order to the change of the output variable.
processes. - The addition of a derivative mode to a proportional controller modifies
- For the 1st order processes, meaning the processes with one its response to inputs. The PD equation:
energy storage, a large increase in gain can be tolerated.
- Proportional controller can stabilize only 1st order unstable process.
Changing controller gain KP can change closed loop dynamics. - A PD controller provides an element to the response which is largest
- A large controller gain will result in control system with: when the rate of change of the error is greatest and diminishes as it
o smaller steady state error, i.e. better reference following, becomes smaller.
o Faster dynamics, i.e. broader signal frequency band of - Thus with a step input signal, the controller output rises faster when we
the closed loop system and larger sensitivity with respect apply the step input signal than with just proportional control. With PD
to measuring noise, control, the output rises more rapidly toward the steady–state value and
o smaller amplitude and phase margin the overshoot is reduced.
- 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. Such
systems are systems with one energy storage (1st order capacitive
systems).
- 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.

- PD controller is often used in control of moving objects such are


flying and underwater vehicles, ships, rockets etc. One of the reason
is in stabilizing effect of PD controller on sudden changes in
heading variable y(t).
ROBINSONKIPROTICH 23
Microcontrollers
PI Controller: PID Controller
- The addition of an integral element to a proportional controller modifies - PID controller has all the necessary dynamics: fast reaction on
the response removing the offset and giving a steady-state value the change of the controller input (D mode), increase in control signal
same as the input set value. to lead error towards zero (I mode) and suitable action inside
control error area to eliminate oscillations (P mode).

- PI controller will eliminate forced oscillations and steady state error


resulting in operation of on-off controller and P controller respectively.
- However, introducing integral mode has a negative effect on - Derivative mode improves stability of the system and enables increase
speed of the response and overall stability of the system. in gain K and decrease in integral time constant Ti, which
- Thus, PI controller will not increase the speed of response. It can be increases speed of the controller response.
expected since PI controller does not have means to predict what will
happen with the error in near future. PID action control circuits
- PID action can be performed using either analog or digital electronic
circuits.
- In order to understand how electronic circuits are used to perform these
functions, the analog circuits used for the individual actions will be
discussed.

(a) error generating circuit and (b) proportional circuit.


- The circuit shown above in fig a is used to compare the signal from the
- PI controllers are very often used in industry, especially when measured variable and the reference to generate the error signal.
speed of the response is not an issue. The PI controllers are used - Proportional action is achieved as shown in Fig. b by amplifying the
when: error signal Vin.
o Fast response of the system is not required - The stage gain is the ratio of R2/R1; the gain can be adjusted using the
o Large disturbances and noise are present during operation of the potentiometer R2. The output is inverted.
process - The circuit for derivative action is shown below. The feedback resistor
o There is only one energy storage in process (capacitive or inductive) can be replaced with a potentiometer to adjust the differentiation
o There are large transport delays in the system duration. The output signal is inverted.
ROBINSONKIPROTICH 24
Microcontrollers
- This signal can be changed to a non-inverted signal with an inverting - Below is an analog PID controller that uses five Op-Amps.
amplifier stage if required.

- A circuit to perform integral action is shown below. Capacitive feedback


around the amplifier prevents the output from the amplifier from
following the input change.
- The output changes slowly and linearly when there is a change in the
measured variable
- The slope of the output waveform is set by the time constant of the
feedback C1 and the input resistance R1. This is integral action and the
output from the integrator is the area under the input waveform.
- This area can be adjusted by replacing R1 with a potentiometer. The
output of the amplifier is inverted
Tuning of Closed Loop Control
- Tuning is adjustment of control parameters to the optimum values for
the desired control response.
- Stability is a basic requirement. However, different systems have
different behavior, different applications have different requirements,
and requirements may conflict with one another.
- PID tuning methods are:
o Manual tuning method,
o Ziegler–Nichols tuning method,
o PID tuning software methods.
- Ideally, a properly tuned control loop will:
- PID controller is used when dealing with higher order capacitive - Operate within safe constraints of the process.
processes (processes with more than one energy storage) when their - Maximize operating profit.
dynamic is not similar to the dynamics of an integrator (like in many - Eliminate offset from Set Point.
thermal processes). - Be stable over the normal operating range.
- PID controller is often used in industry, but also in the control of - Avoid excessive control action (not overstress the final control
mobile objects (course and trajectory following included) when element)
stability and precise reference following are required. - Minimize the effect of known disturbances:
ROBINSONKIPROTICH 25
Microcontrollers
• a valve actuator that in turn varies the flow rate of…
• the process.
- When the product of the gains of all four of these component parts
equals one, the system will become unstable when a process
disturbance occurs (a set-point change).
- It will oscillate at its natural frequency which is determined by the
process lag and response time, and caused by the loop gain becoming
one.
- Then measure the frequency of oscillation (the period of one cycle of
1. Manual Tuning Method oscillation), this being the ultimate period PU.
- In manual tuning method, parameters are adjusted by watching system - In addition, the final value of KC is the critical gain of the controller (KU).
responses. Kp, Ki, Kd are changed until desired or required system This gain value, when multiplied with the unknown process Gain(s), will
response is obtained. give a Loop Gain, KLoop , of 1.
- Although this method is simple, it should be used by experienced - The stages of obtaining closed loop tuning (continuous cycling method)
personal. One Manual Tuning Method Example: - Put Controller in P-Control Only
- Firstly, Ki and Kd are set to zero. Then, the Kp is increased until the - Select the P-Control to ERR = (SP - PV)
output of the loop oscillates, after obtaining optimum Kp value, it should - Put the Controller into Automatic Mode
be set to approximately half of that value for a "quarter amplitude - Make a Step Change to the Set point
decay" type response. - Take action based on the Observation
- Then, Ki is increased until any offset is corrected in sufficient time for - Conclude the Tuning Procedure.
the process. However, too much Ki will cause instability.
- Finally, Kd is increased, until the loop is acceptably quick to reach its 3. Damped cycling tuning method
reference after a load disturbance. However, too much Kd also will - This method is a variation of the continuous cycling method. It is used
cause excessive response and overshoot. whenever continuous cycling imposes a danger to the process, but a
- A fast PID loop tuning usually overshoots slightly to reach the set point damped oscillation of some extent is acceptable.
more quickly; however, some systems cannot accept overshoot, in - The steps of closed loop tuning (damped cycling method) are as
which case an over-damped closed-loop system is required, which will follows:
require a Kp setting significantly less than half that of the Kp setting o Put the Controller into P-Control Only
causing oscillation. o Select the P-Control to ERR = (SP - PV)
o Put the Controller in Automatic Mode
2. Ziegler–Nichols tuning method (Continuous cycling method) o Make a Step Change to the Set point
- This method of tuning requires determining the critical value of o Take action based on the Observation.
controller gain (KC) that will produce a continuous oscillation of a control
loop. 4. PID Tuning Software
- This will occur when the total loop gain (KLOOP) is equal to one. The - There is some prepared software that they can easily calculate the gain
controller gain value (KC) then becomes known as the ultimate gain parameter. Any kind of theoretical methods can be selected in some
(KU). these methods. Some Examples:
- If we consider a basic liquid flow control loop utilizing: o MATLAB Simulink PID Controller Tuning,
• A venturi flow meter with a 4-20 mA output feeding into… o BESTune, Expert Tune etc.
• a PID controller which in turn has a 4-20 mA output that controls...
ROBINSONKIPROTICH 26
Microcontrollers
Implementation of Control Loops envelope and in so doing shorts the two contacts together in the
- Implementation of the control loops can be achieved using pneumatic, mercury switch.
analog, or digital electronics. - The contact closure operates a low voltage relay turning ON the blower
- The first process controllers were pneumatic. However, these have motor and the heating element.
largely been replaced by electronic systems, because of improved - When the room temperature rises to a predetermined set point the
reliability, less maintenance, easier installation, easier adjustment, bimetallic strip tilts the mercury switch back causing the mercury to flow
higher accuracy, lower cost, can be used with multiple variables, and away from the contacts.
have higher speed operation. - The low voltage electrical circuit is turned OFF, the relay opens, and the
power to the heater and the blower motor is disconnected.
ON/OFF action pneumatic controller
- Figure below shows a pneumatic furnace control system using a
pneumatic ON/OFF controller.

- The ON/OFF controller action has many applications in industry; an


- In this case the furnace temperature sensor moves a flapper that example of some of these uses is as shown.
controls the air flow from a nozzle.
- When the temperature in the furnace reaches its set point the sensor
moves the flapper toward the nozzle to stop the air flow and allow
pressure to build up in the bellows.
- The bellows operates an air control relay that shuts OFF the air flowing
to the control valve turning OFF the fuel to the furnace.
- When the temperature in the furnace drops below a set level the flapper
is opened by the sensor, reducing the air pressure in the bellows, which
in turn opens the air control valve allowing the air pressure to drop and
the control valve to open, turning ON the fuel to the furnace.

ON/OFF action electrical controller


- An example of an ON/OFF action electrical room temperature controller
is shown below.
- In this case the room temperature is sensed by a bimetallic sensor. The
sensor operates a mercury switch.
- As the temperature decreases the bimetallic element tilts the mercury - In this case, cartons on a conveyer belt are being filled from a hopper.
switch down causing the mercury to flow to the end of the glass
ROBINSONKIPROTICH 27
Microcontrollers
- When a carton is full it is sensed by the level sensor, which sends a - If the derivative restriction is removed the output pressure is fed back to
signal to the controller to turn OFF the material flowing from the hopper the flapper via the proportional bellows to oppose the error signal and to
and to start the conveyer moving. give proportional action.
- As the next carton moves into the filling position it is sensed by the - System gain is adjusted by moving the position of the bellows along the
position sensor, which sends a signal to the controller to stop the flapper arm, i.e., the closer the bellows is positioned to the pivot the
conveyer belt and to start filling the carton. greater the movement of the flapper arm.
- Once it is full the cycle repeats itself. - By putting a variable restriction between the pressure supply and the
- A level sensor in the hopper senses when the hopper is full and when it proportional bellows, a change in Pin causes a large change in Pout, as
is almost empty. the feedback from the proportional bellows is delayed by the derivative
- When empty, the sensor sends a signal to the controller to turn ON the restriction.
feed valve to the hopper and when the hopper is full it is detected and a - This gives a pressure transient on Pout before the proportional bellows
signal is sent to the controller to turn the feed to the hopper OFF. can react, thus giving derivative action.
- The duration of the transient is set by the size of the bellows and the
PID action pneumatic controller setting of the restriction.
- Many configurations for PID pneumatic controllers have been - Integral action is achieved by the addition of the integral bellows and
developed over the years, have served us well, and are still in use in restriction as shown. An increase in Pin moves the flapper towards the
some older processing plants. nozzle causing an increase in output pressure.
- But pneumatic controllers have, with the advent of the requirements of - The increase in output pressure is fed to the integral bellows via the
modern processing and the development of electronic controllers, are restriction until the pressure in the integral bellows is sufficient to hold
now extinct. the flapper in the position set by the increase in Pin , creating integral
action.

PID electronic controller


- Figure below shows the block diagram of an analog PID controller

- The pressure from the sensing device Pin is compared to a set or


reference pressure Pref to generate a differential force (error signal) on
the flapper to move the flapper in relation to the nozzle giving an output
pressure proportional to the difference between Pin and Pref.
ROBINSONKIPROTICH 28
Microcontrollers
- The measured variable from the sensor is compared to the set point in - This circuit above is an implementation of analog PID controller which is
the first unity gain comparator; its output is the difference between the complex because all the amplifier blocks are shown doing a single
two signals or the error signal. function to give a direct comparison to the block diagram and is only
- This signal is fed to the integrator via an inverting unity gain buffer and used as an example.
to the proportional amplifier and differentiator via a second inverting - In practice there are a large number of circuit component combinations
unity gain comparator, which compares the error signal to the integrator that can be used to produce PID action.
output.
- Initially, with no error signal the output of the integrator is zero so that
the zero error signal is also present at the output of the second
comparator
- When there is a change in the measured variable, the error signal is
passed through the second comparator to the proportional amplifier and
the differentiator where it is amplified in the proportional amplifier,
added to the differential signal in a summing circuit, and fed to the
actuator to change the input variable.
- Although the integrator sees the error signal, it is slow to react and so
its output does not change immediately, but starts to integrate the error
signal.
- If the error signal is present for an extended period of time, the
integrator will supply the correction signal via the summing circuit to the - In new designs, PLC processors can be used to replace the analog
actuator and input the correction signal to the second comparator. circuits to perform the PID functions using digital techniques.
- This will reduce the effective error signal to the proportional amplifier to
zero, when the integrator is supplying the full correction signal to the
actuator. Digital Controllers
- Any new change in the error signal will still be passed through the - Modern process facilities will use a computer or PLC processor as the
second comparator as the integrator is only supplying an offset to heart of the control system.
correct for the first long-term error signal. - The system will be able to control analog loops, digital loops, and will
- The proportional and differential amplifiers can then correct for any new have a foundation fieldbus input/output for communication with smart
changes in the error signal. sensors.
- All of these control functions may not be required in small process
facilities but in large facilities they are necessary.
- The individual control loops are not independent in a process but are
interrelated and many measured variables may be monitored and
manipulated variables controlled simultaneously.
- Several processors may also be connected to a mainframe computer
for complex control functions.

ROBINSONKIPROTICH 29
Microcontrollers
Process Control Actuators
- Actuators are the final elements in a control system. They receive a low
power command signal and energy input to amplify the command signal
as appropriate to produce the required output.
- It converts the command signal from controllers or higher-level
components into physical adjustment in adjustable process variable.
Actuators drive motions in mechanical systems. Most often this is by
converting electrical energy into some form of mechanical motion.
- Actuators take fluid, electric or some other source of power and convert
it through a motor, piston or other device to perform work.
- Basic actuators are used to move valves to either fully opened or fully
closed positions.
- Actuators for control or position regulating valves are given a positioning
signal to move to any intermediate position with a high degree of
accuracy.
- Although the most common and important use of an actuator is to open
- The analog output from the monitors is converted to a digital signal in and close valves, current actuator designs go far beyond the basic open
an ADC. The loop signal is then selected in a multiplexer and PID action and close function. The valve actuator can be packaged together with
is performed in the processor using software programs. position sensing equipment, torque sensing, motor protection, logic
- The digital output signal is then fed to the actuator through a control, digital communication capacity and even PID control all in a
demultiplexer and a DAC. compact environmentally protected enclosure
- The processor has mass storage for storing process data for later use - Applications range from simple low power switches to high power
or making charts and graphs and will also be able to control a number hydraulic devices operating flaps and control surfaces on aircraft;
of peripheral units and monitors as shown. valves, car steering, process plant automation, etc
- Digital controllers will compare the digitized measured variable to the Logical Mechanism
set point stored in memory to produce an error signal which it can Signal
amplify under program control and feed to an actuator via a DAC. Signal Electric Hydraulic
Processing Pneumatic Final Actuation
- The processor can measure the rate of change of the measured & Amplification Element
variable and produce a differential signal to add to the digital correction
signal.
- In addition, the processor can measure the area under the measured
variable signal which it will also add to the digital correction signal.
- All of these actions are under program control; the setting of them Actuator
program parameters can be changed with a few key strokes, making Sensor
the system much more versatile than the analog equivalent. Types of Actuators
1. Electrical actuators
 Solenoids
 Electric motors
 DC servomotors

ROBINSONKIPROTICH 30
Microcontrollers
 AC motors Solenoid Actuators
 Stepper motors - Solenoids are the most common actuator components. The basic
2. Hydraulic actuators principle of operation is that, there is a moving ferrous core (a piston)
 Use hydraulic fluid to amplify the controller command signal that will move inside wire coil.
3. Pneumatic actuators - Normally the piston is held outside the coil by a spring. When a voltage
 Use compressed air as the driving force is applied to the coil and current flows, the coil builds up a magnetic
field that attracts the piston and pulls it into the center of the coil.
Manual Actuators - The piston can be used to supply a linear force. Well known
- A manual actuator employs levers, gears, or wheels to facilitate applications of these include in pneumatic values and car door openers.
movement while an automatic actuator has an external power source to
provide the force and motion to operate a valve remotely or
automatically.
- Power actuators are a necessity on valves in pipelines located in
remote areas; they are also used on valves that are frequently operated
or throttled. Valves that are particularly large may be impossible or
impractical to operate manually simply because of the sheer
horsepower requirements. Some valves may be located in extremely
hostile or toxic environments that preclude manual operation.
- Additionally, as a safety feature, certain types of power actuators may
be required to operate quickly, shutting down a valve in case of
emergency.

Electrical Actuators
- The electric actuator has a motor drive that provides torque to operate a
valve.
- Electric actuators are frequently used on multi-turn valves such as gate
or globe valves. With the addition of a quarter-turn gearbox, they can be
utilized on ball, plug, or other quarter-turn valves. - As mentioned before, inductive devices can create voltage spikes and
may need snubbers circuits, although most industrial applications have
Electromagnetic Actuators low enough voltage and current ratings they can be connected directly
- This exploits the mutual attraction of soft ferrous materials in a magnetic to the PLC outputs.
field. The device has one coil which provides the field energy and the - Most industrial solenoids will be powered by 24Vdc and draw a few
energy to be transformed. The attractive force is unidirectional such that hundred mA.
the return device of some type is needed, often a spring.
- Relays or solenoids are based on this principle which is widely used in Motors
cars to switch a range of electrical equipment with a current demand of - Electrical Motors are continuous actuators that convert electrical
more than about 10Amps – examples include in fans, head lights, horn, energy into mechanical energy.
and wipers. - There are basically three types of conventional electrical motor
available: DC type Motors, Stepper Motors and AC type Motors.

ROBINSONKIPROTICH 31
Microcontrollers
- The DC motor achieves this by producing a continuous angular rotation required stator field rotational sequence but they have better
that can be used to rotate pumps, fans, compressors, wheels, etc. torque/speed characteristics, are more efficient and have a longer
- As well as conventional rotary motors, linear motors are also available operating life than equivalent brushed types.
which are capable of producing a continuous liner movement.  Servo Motor – This type of motor is basically a brushed DC motor
- AC Motors are generally used in high power single or multi-phase with some form of positional feedback control connected to the rotor
industrial applications were a constant rotational torque and speed is shaft. They are connected to and controlled by a PWM type
required to control large loads such as fans or pumps. controller and are mainly used in positional control systems and
radio controlled models.
- Normal DC motors have almost linear characteristics with their speed of
rotation being determined by the applied DC voltage and their output
torque being determined by the current flowing through the motor
windings.
- The speed of rotation of any DC motor can be varied from a few
revolutions per minute (rpm) to many thousands of revolutions per
minute making them suitable for electronic, automotive or robotic
applications.
- By connecting them to gearboxes or gear-trains their output speed can
be decreased while at the same time increasing the torque output of the
motor at a high speed.
- The motors wound stator is an electromagnet circuit which consists of
The Basic DC Motor electrical coils connected together in a circular configuration to produce
- DC Motor is most commonly used actuator for producing continuous the required North-pole then a South-pole then a North-pole etc, type
movement and whose speed of rotation can easily be controlled, stationary magnetic field system for rotation, unlike AC machines whose
making them ideal for use in applications were speed control, servo stator field continually rotates with the applied frequency.
type control, and/or positioning is required. - The current which flows within these field coils is known as the motor
- It consists of two parts, a “Stator” which is the stationary part and a field current.
“Rotor” which is the rotating part. The result is that there are basically - These electromagnetic coils which form the stator field can be
three types of DC Motor available. electrically connected in series, parallel or both together (compound)
 Brushed Motor – This type of motor produces a magnetic field in a with the motors armature.
wound rotor (the part that rotates) by passing an electrical current - A series wound DC motor has its stator field windings connected in
through a commutator and carbon brush assembly, hence the term series with the armature. Likewise, a shunt wound DC motor has its
“Brushed”. The stators (the stationary part) magnetic field is stator field windings connected in parallel with the armature as shown.
produced by using either a wound stator field winding or by
permanent magnets. Generally brushed DC motors are cheap,
small and easily controlled.
 Brushless Motor – This type of motor produce a magnetic field in
the rotor by using permanent magnets attached to it and
commutation is achieved electronically. They are generally smaller
but more expensive than conventional brushed type DC motors
because they use “Hall effect” switches in the stator to produce the
ROBINSONKIPROTICH 32
Microcontrollers
- Using Hall effect sensors, the polarity of the electromagnets is switched
- The rotor or armature of a DC machine consists of current carrying by the motor control drive circuitry. Then the motor can be easily
conductors connected together at one end to electrically isolated copper synchronized to a digital clock signal, providing precise speed control.
segments called the commutator. - Brushless DC motors can be constructed to have, an external
- The commutator allows an electrical connection to be made via carbon permanent magnet rotor and an internal electromagnet stator or an
brushes (hence the name “Brushed” motor) to an external power supply internal permanent magnet rotor and an external electromagnet stator.
as the armature rotates. - Advantages of the Brushless DC Motor are is higher efficiencies, high
- The magnetic field setup by the rotor tries to align itself with the reliability, low electrical noise, good speed control and more importantly,
stationary stator field causing the rotor to rotate on its axis, but can not no brushes or commutator to wear out producing a much higher speed.
align itself due to commutation delays. - However their disadvantage is that they are more expensive and more
- The rotational speed of the motor is dependent on the strength of the complicated to control.
rotors magnetic field and the more voltage that is applied to the motor
the faster the rotor will rotate. By varying this applied DC voltage the DC Servo Motor
rotational speed of the motor can also be varied. - DC Servo motors are used in closed loop type applications were the
- Although DC brushed motors are very efficient and cheap, problems position of the output motor shaft is fed back to the motor control circuit.
associated with the brushed DC motor is that sparking occurs under - Typical positional “Feedback” devices include Resolvers, Encoders and
heavy load conditions between the two surfaces of the commutator and Potentiometers as used in radio control models such as aero-planes
carbon brushes resulting in self generating heat, short life span and and boats etc.
electrical noise due to sparking, which can damage any semiconductor - A servo motor generally includes a built-in gearbox for speed reduction
switching device such as a MOSFET or transistor. and is capable of delivering high torques directly.
- To overcome these disadvantages, Brushless DC Motors were - The output shaft of a servo motor does not rotate freely as do the shafts
developed. of DC motors because of the gearbox and feedback devices attached.

Brushless DC motor
- The brushless DC motor is very similar to a permanent magnet DC
motor, but does not have any brushes to replace or wear out due to
commutator sparking.
- Therefore, little heat is generated in the rotor increasing the motors life.
The design of the brushless motor eliminates the need for brushes by
using a more complex drive circuit were the rotor magnetic field is a
permanent magnet which is always in synchronization with the stator
field allows for a more precise speed and torque control.
- The control of the brushless DC motors is very different from the normal
brushed DC motor, in that it this type of motor incorporates some
means to detect the rotors angular position (or magnetic poles) required
to produce the feedback signals required to control the semiconductor
switching devices.
- The most common position/pole sensor is the “Hall Effect Sensor”, but - A servo motor consists of a DC motor, reduction gearbox, positional
some motors also use optical sensors. feedback device and some form of error correction.

ROBINSONKIPROTICH 33
Microcontrollers
- The speed or position is controlled in relation to a positional input signal
or reference signal applied to the device.
- The error detection amplifier looks at this input signal and compares it
with the feedback signal from the motors output shaft and determines if
the motor output shaft is in an error condition and, if so, the controller
makes appropriate corrections either speeding up the motor or slowing
it down.
- This response to the positional feedback device means that the servo
motor operates within a “Closed Loop System”.
- As well as large industrial applications, servo motors are also used in
small remote control models and robotics, with most servo motors being
able to rotate up to about 180 degrees in both directions making them
ideal for accurate angular positioning.
- However, these RC type servos are unable to continually rotate at high
speed like conventional DC motors unless specially modified.
- A servo motor consist of several devices in one package, the motor, - A continuous logic 1 or logic 0 is applied to the input of the circuit to turn
gearbox, feedback device and error correction for controlling position, the motor ON (saturation) or OFF (cut-off) respectively.
direction or speed. They are widely used in robotics and small models - A flywheel diode is connected across the motor terminals to protect the
as they are easily controlled using just three wires, Power, Ground and switching transistor or MOSFET from any back emf generated by the
Signal Control. motor when the transistor turns the supply OFF.
- As well as the basic ON/OFF control the same circuit can also be used
to control the motors rotational speed.
- By repeatedly switching the motor current ON and OFF at a high
DC Motor Switching and Control enough frequency, the speed of the motor can be varied between stand
- Small DC motors can be switched On or Off” by means of switches, still (0 rpm) and full speed (100%).
relays, transistors or MOSFET circuits with the simplest form of motor - This is achieved by varying the proportion of ON time (tON) to the OFF
control being “Linear” control. time (tOFF) and this can be achieved using a process known as Pulse
- This type of circuit uses a bipolar Transistor as a Switch (A Darlington Width Modulation.
transistor may also be used were a higher current rating is required) to - With PWM, the motor voltage is controlled by applying pulses of
control the motor from a single power supply. variable frequency for example, at a low frequency or with very few
- By varying the amount of base current flowing into the transistor the pulses the average voltage applied to the motor is low, and therefore
speed of the motor can be controlled for example, if the transistor is the motor speed is slow.
turned on “half way”, then only half of the supply voltage goes to the - At a higher frequency or with many pulses, the average motor terminal
motor. voltage is increased and the motor speed will also increase.
- If the transistor is turned “fully ON” (saturated), then all of the supply - To control the direction of a DC motor, the polarity of the DC power
voltage goes to the motor and it rotates faster. applied to the motor’s connections must be reversed allowing its shaft to
- Then for this linear type of control, power is delivered constantly to the rotate in the opposite direction.
motor as shown below. - One very simple and cheap way to control the rotational direction of a
DC motor is to use different switches arranged in the following manner:

ROBINSONKIPROTICH 34
12V
Microcontrollers Q_2N4401
12V Q_2N4401

D1N4004 D1N4004
D1 D3 C
A

Q3
Q1

M1
M
Q_2N2222
Q_2N2222

D1N4004
D1N4004 D4
D2 D
B

Q4
Q2

- To achieve bi-directional control of a motor (as well as its speed),


Transistor H-bridge type circuit arrangement is used. - In figure above the transistors are operated at cutoff and saturation
- The d.c motors also sink more current which cannot be supplied by the conditions so that they can act as switch.
microcontroller hence requiring the use of an interface between the - Diodes D1, D2, D3 and D4 are used to block the supply voltage not to
microcontroller and the motors. flow directly to the motor.
- There are various components used to implement the circuit; relays, - If we apply appropriate pulse width modulation (PWM) signals to A, B, C
solid state transistors and IC motor drivers. and D, the transistors will start to switch on and off.
- As with uni-directional DC motor control as seen above, the rotational - This will supply us also with control over the speed of the motor. By
speed of the motor can also be controlled using Pulse Width Modulation changing the duty cycle of a pulse sequence one can change the
or PWM. Then by combining H-bridge switching with PWM control, both average power supplied by that sequence.
the direction and the speed of the motor can be accurately controlled. - Therefore, the speed of the motor will change based on the duty cycle
(i.e., average power) of the pulse sequence. For example, if the motor
The Operation Table of an H-Bridge has 75 rpm with a 75% duty cycle, it will have approximately 50 rpm
Function A B C D with 50% duty cycle signal.
Forward 1 0 0 1 - Commercial off the shelf decoder IC’s such as the SN754410 Quad Half
Reverse 0 1 1 0 H-Bridge IC or the L298N which has 2 H-Bridges are available with all
Brake 1 0 1 0 the necessary control and safety logic built in are specially designed for
Brake 0 1 0 1 H-bridge bi-directional motor control circuits.
Fuse test 1 1 0 0
Fuse test 0 0 1 1

ROBINSONKIPROTICH 35
Microcontrollers
- Because of their discrete step operation, stepper motors can easily be
rotated a finite fraction of a rotation at a time, such as 1.8, 3.6, 7.5
degrees etc. So for example, lets assume that a stepper motor
completes one full revolution (360o in exactly 100 steps.
- Then the step angle for the motor is given as 360 degrees/100 steps =
3.6 degrees per step. This value is commonly known as the stepper
motors Step Angle.
- A Stepper Motor is particularly well suited to applications that require
accurate positioning and repeatability with a fast response to starting,
stopping, reversing and speed control and another key feature of the
stepper motor, is its ability to hold the load steady once the require
position is achieved.
-

DC Stepper Motor - There are three basic types of stepper motor, Variable Reluctance,
- Stepper Motors are also electromechanical actuators that convert a Permanent Magnet and Hybrid (a sort of combination of both). For the
pulsed digital input signal into a discrete (incremental) mechanical diagram above, variable reluctance stepper motor is shown.
movement are used widely in industrial control applications. - The motor consists of a central rotor surrounded by four
- A stepper motor is a type of synchronous brushless motor in that it does electromagnetic field coils labelled A, B, C and D.
not have an armature with a commutator and carbon brushes but has a - All the coils with the same letter are connected together so that
rotor made up of many, some types have hundreds of permanent energizing, say coils marked. A will cause the magnetic rotor to align
magnetic teeth and a stator with individual windings. itself with that set of coils.
- The stepper motor does not rotate in a continuous fashion like a - By applying power to each set of coils in turn the rotor can be made to
conventional DC motor but moves in discrete “Steps” or “Increments”, rotate or "step" from one position to the next by an angle determined by
with the angle of each rotational movement or step dependant upon the its step angle construction, and by energizing the coils in sequence the
number of stator poles and rotor teeth the stepper motor has. rotor will produce a rotary motion.
ROBINSONKIPROTICH 36
Microcontrollers
- The stepper motor driver controls both the step angle and speed of the
motor by energizing the field coils in a set sequence for example,
“ADCB, ADCB, ADCB, A…” etc, the rotor will rotate in one direction
(forward) and by reversing the pulse sequence to “ABCD, ABCD,
ABCD, A…” etc, the rotor will rotate in the opposite direction (reverse).
- It should be noted that, the more rotor teeth and or stator coils would
result in more control and a finer step angle.
- Also by connecting the electrical coils of the motor in different
configurations, Full, Half and micro-step angles are possible.
- However, to achieve micro-stepping, the stepper motor must be driven
by a (quasi) sinusoidal current that is expensive to implement.
- It is also possible to control the speed of rotation of a stepper motor by
altering the time delay between the digital pulses applied to the coils
(the frequency), the longer the delay the slower the speed for one
complete revolution.
- By applying a fixed number of pulses to the motor, the motor shaft will
rotate through a given angle.
- There are many stepper motor controller IC’s available which can
control the step speed, speed of rotation and motors direction. One Hydraulic and Pneumatic Actuators
such controller IC is the SAA1027 which has all the necessary counter - Hydraulic and Pneumatic actuators are often simple devices with a
and code conversion built-in, and can automatically drive the 4 fully minimum of mechanical parts, used on linear or quarter-turn valves.
controlled bridge outputs to the motor in the correct sequence. - A control valve requires an actuator that is capable of positioning the
- The RS SAA1027 is a bipolar integrated circuit intended for driving a 4- movable part to any value between the two extremes of fully open and
phase two stator stepper motor. The circuit consists of a bidirectional 4- fully closed.
state counter and a code converter to drive the four outputs in the - Positioning actuators are generally classified as to the source of power:
sequence required for driving a stepper motor. pneumatic, electric, and occasionally hydraulic.
- It features high noise immunity inputs, clockwise and anticlockwise - Pneumatic actuators their source of power is from compressed air while
operation, a reset facility and high current outputs that are protected hydraulic actuator their source of power is from fluids but principally
against damage by voltage overshoots. works the same way.
- Features of RS SAA1027 - Sufficient air or fluid pressure acts on a piston to provide thrust in a
● High noise immunity inputs linear motion for gate or globe valves.
● Clockwise and counter-clockwise rotation - Alternatively, the thrust may be mechanically converted to rotary
● Reset facility motion to operate a quarter-turn valve.
● High output current
● Outputs protected against damage by overshoots. Hydraulic Actuators
- The most common type of hydraulic actuator is the hydraulic cylinder. A
cylinder uses pressurized fluid to create a linear force/motion.
- Single acting cylinders apply force when extending and typically use a
spring to retract the cylinder. Double acting cylinders apply force in both
directions.
ROBINSONKIPROTICH 37
Microcontrollers
- For the motor, fluid is pumped in the left side of the case, putting that
area under pressure. Within the pressurized area, all surfaces receive a
force, but only those three surfaces indicated with arrow will effect
rotation.
- The pressure on the teeth next to the case will case the gears to rotate.
The pressure on the meshing teeth in the centre would cause the gears
to turn in the opposite direction, but this torque is overpowered because
two teeth are pushing the other way.

Pneumatic Actuators
- They convert air pressure into mechanical motion. There are two basic
- In the figure below, a fluid is pumped into one side of the cylinder under types: Linear actuators (cylinder/piston or diaphragm types) and rotary
pressure causing that side of the cylinder to expand, and advancing the actuators.
piston. - Piston and rotary actuators are functionally similar to their hydraulic
counterparts.
- Pneumatic cylinder consists of a piston in a cylinder in one of two basic
internal configurations.
- The double acting cylinder connects to the valve with two tubes and can
be driven in either direction.
- The single acting cylinder can only be driven in one direction with air
pressure and is returned by a spring.
- The fluid on the other side of the piston must be allowed to escape
freely - if the incompressible fluid was trapped the cylinder could not
advance. The force the cylinder can exert is proportional to the cross
sectional area of the cylinder.
- Under normal operating conditions, both ends of the cylinder are filled
with fluid. If additional fluid enters port A, the piston will move toward the
right, but the fluid must be able to escape through port B
- Some actuators can create rotary motion and are very similar to the
pump designs. The figure below shows a gear motor rotary actuator. - Rotary actuators convert air pressure into rotary mechanical motion.
One common design is the vane motor.

ROBINSONKIPROTICH 38
Microcontrollers
- The motor consist of a rotor that is offset in housing. Protruding from the
rotor are spring-loaded vanes that seal against the housing and slide in
and out of the rotor as it turns.
- Motion is achieved because the vanes on the top have more exposed
surface area than on the bottom and hence receive more force, causing
the rotor to turn clockwise.
- In most cases rotary actuators are not chosen for their efficiencies, but
for their power, speed and torque

- Advantages of pneumatic actuators


•They are fast on ON/OFF type tasks.
• Have big forces with elasticity.
• No hydraulic oil leak problems.
- Disadvantage: Directional control valves
• Speed control is not possible because the air pressure depends on - A directional control valve on the receipt of some external signal, which
many variables that are out of control might be mechanical, electrical or a pressure signal, change the
direction of, or stop, or start the flow of fluid in some part of the
Valves pneumatic/hydraulic circuit.
- A valve is a device that starts, stops, or regulates the flow of a fluid/air - Thus, it might be used to control the direction of fluid flow to a cylinder
by adjusting the position of a movable part. and so use the movement of its piston to carry out actuation.
- Valves may be applied for either ON–OFF service (often called block - The basic symbol for a control valve is a square. With a directional
valves) or for regulatory service (often called control valves). control valve two or more squares are used, with each square
- Based on the nature of the moving part, valves are broadly classified representing the positions to which the valve can be switched.
into two categories: - Thus, figure below represents a valve with two switching positions, and
o Rising stem (sliding stem) valves: Examples include globe, angle, a valve with three switching positions.
and diaphragm valves.
o Rotary stem valves: Examples include ball and butterfly valves.
- The stem is the movable part that affects the flow through the valve.
The term “ valve position ” refers to the position of the stem. The valve Two position
position M is usually expressed in percent, but expressing M as a
fraction is more convenient in some equations.
- The choice regarding type of valve is based on factors such as cost, Three Position
pressure recovery, minimum pressure within the valve, tendency to leak
when closed. a) Flow path b) Shut off c) Initial connections
- A control valve requires an actuator that is capable of positioning the
movable part to any value between the two extremes of fully open and - Lines in the boxes are used to show the flow paths with arrows
fully closed. Positioning actuators are generally classified as to the indicating the direction of flow.
source of power — pneumatic, electric, and occasionally hydraulic. - The pipe connections, i.e the inlet and outlet ports of the valve, are
- The figure below shows the means by which valves can be switched indicated by lines drawn on the outside of the box and are drawn for just
between positions.
ROBINSONKIPROTICH 39
Microcontrollers
the ‘rest/initial/neutral position’ i.e when the valve is not actuated as - When the switch is closed and a current passes through the solenoid,
figure (c). the valve switches position and pressure is applied to extend the piston
- Directional control valves are described by the number of ports and the in the cylinder.
number of positions. Thus, a 2/2 valve has 2 ports and 2 positions, a
3/2 valve 3 ports and 2 positions.

Control of a single acting cylinder a) before solenoid activated b) when activated

- Figure below shows how a double-solenoid activated valve can be used


to control a double-acting cylinder.
- Momentary closing switch S1 causes a current to flow through the
- For example, figure below shows the symbol for a 3/2 valve which solenoid at the left-hand end of the valve and so result in the piston
solenoid activation and return by means of a spring. extending.
- Thus, when the solenoid is not activated by a current through it, the - On opening S1 the valve remains in this extended position until a signal
signal port 2 is connected to the exhaust 3 and so is at atmospheric is received by the closure of switch S2 to activate the right-hand
pressure. solenoid and return the piston.
- When the solenoid is activated, the pressure supply P is connected to
the signal port 2 and thus the output is pressurized.

Control of a double-acting cylinder


- Figure below shows how such a valve might be used to cause the
piston in a single-acting cylinder to move; the term single-acting is used
when a pressure signal is applied to only one side of the piston. Flow-Control Valves
- One common type of actuator used in process control system is the
flow-control valve, which regulates the flow of fluids.
ROBINSONKIPROTICH 40
Microcontrollers
- The control valve has a built-in valve-operating mechanism, allowing it Questions
to be controlled remotely by a signal from the controller. Usually, this 1. Describe controller ON/OFF action.
signal is either electric or pneumatic. 2. What is the difference between simple ON/OFF action and differential
- Figure (a) shows a solenoid–actuated, on-off valve. When the solenoid ON/OFF action?
is energized, the valve is pulled open, and the fluid flows. 3. Give a list of applications for ON/OFF controller action.
- When the solenoid is de-energized, a spring returns the valve to the 4. Why is the gain setting critical in proportional action?
closed position. On-off valves are used in batch processes (for 5. What is the difference between an error signal and a measured variable
example, a washing machine where the tank is filled to a specified level signal?
as quickly as possible, agitated for a while, then emptied). 6. What is the difference between lag time and dead time?
- Many processes require the ability to vary the flow of a fluid in a pipe on 7. What is the difference between offset and error signal?
a continuous basis. To do this, the valve stem must be controlled with a 8. What are some of the actions that can be taken to reduce correction
linear actuator of some type. time?
- Figure (b) shows an electrically operated valve. In this case, an electric 9. What is a dead-band?
motor drives a lead screw-type valve stem, so it can be put in any 10. What would be the effect of time constants on correction time?
position. 11. What types of control do not normally require derivative action?
- Pneumatically operated valves use air pressure as the control signal. 12. Why is ON/OFF action not normally suitable for control of a process?
Shown in figure(c), you can see that as the air pressure is increased,
the diaphragm will move down (against a spring) and close the valve.
This type of valve could be used in an on-off or a variable-flow
application.

ROBINSONKIPROTICH 41
Microcontrollers
TOPIC 3: Sequential Control System - The term logic is used because programming is primarily concerned
- A control system in which the individual steps are processed in a with implementing logic and switching operation.
predetermined order, progression from one sequence step to the next - The PLC is designed as replacement for the hard-wired relay and timer
being dependent on defined conditions being satisfied. logic to be found in traditional control panels, where PLC provides ease
- This is where the output is dependent not only on the actual inputs but and flexibility of control based on programming and executing logic
on the sequence of the previous inputs and outputs (memorizing instructions.
events). - A PLC has three main aspects: the inputs and outputs and the control
- Sequential problems have long been solved using conventional logic program. In figure below, PLC has eight inputs and four outputs.
gates as building blocks, but using certain techniques to express and - The input is anything that can
identify the sequence logic equations that control the system outputs sense the status of the
- Such a system may be time-dependent, in which the step transition environment and then convert that
conditions are functions of time only; on external-event dependent, information in to a signal. Often the
where the conditions are functions of Input signals only; or combinations signal can simply be a voltage that
of these (and perhaps more complex) conditions. is either on or off. For example,
- Every process control facility, even if it is primarily a “continuous” input devices can be proximity
process, has sequential aspects. Startup and shutdown are two switches, photoelectric sensors,
examples that are hard to escape. temperature sensors, push
- Advanced PLC instructions such as shift registers, sequencers, master buttons, or pressure sensors.
control relays, timers etc are provided to simplify the design and - The outputs are connected to the devices that need to be controlled
implementation of sequence systems. like motors, indicator lights, fans, warning sirens or heating elements.
- Control processes need devices to monitor events or measure needed
Internal Relay values. These devices are generically called inputs to the PLC.
- In PLCs there are elements that are used to hold data, i.e. bits, and - The program uses a set of logical instructions that drives the outputs
behave like relays, being able to be switched on or off and switch other based on the inputs.
devices on or off. Hence the term internal relay. - Flowchart is a graphical or symbolic representation of an algorithm. It is
- Such internal relays do not exist as real-world switching devices but are the diagrammatic representation of the step-by-step solution to a given
merely bits in the storage memory that behave in the same way as problem.
relays.
- For programming, they can be treated in the same way as an external Practical Interlock System
relay output and input. Thus inputs to external switches can be used to  An interlock is a device used to prevent undesired states in a state
give an output from an internal relay. machine, which in a general sense can include any electrical, electronic,
- This then results in the internal relay contacts being used, in conjunction or mechanical device or system.
with other external input switches to give an output, e.g. activate a  In most applications an interlock is used to help prevent a machine from
motor. harming its operator or damaging itself by stopping the machine when
tripped.
- PLC is a unit of hardware used to control and automate industrial  Household microwave ovens are equipped with interlock
processes. It is a micro-computer based controller that uses stored switches which disable the magnetron if the door is opened.
instructions in programmable memory to implement logic, sequencing,  Similarly household washing machines will interrupt the spin
timing, counting and arithmetic functions through digital or analog cycle when the lid is open.
input/output modules, for controlling machines and processes.
ROBINSONKIPROTICH 42
Microcontrollers
 Interlocks also serve as important safety devices in industrial settings, Solenoid
where they protect employees from devices such as robots, presses,  Solenoid is a device that produces mechanical motion from the
and hammers. energization of an electromagnet coil. The movable portion of a
 While interlocks can be something as sophisticated as curtains of solenoid is called an armature.
infrared beams and photodetectors, they are often just switches.  Solenoids can be used to electrically open door latches, open or shut
valves, move robotic limbs, and even actuate electric switch
Manual vs. Automatic Operation of Interlock Systems mechanisms. However, if a solenoid is used to actuate a set of switch
 Operation of an interlock system may take place either through manual contacts, then the term relay
or automatic trip.  Solenoid valve is an electromechanically operated valve. The valve is
 In a manual trip, the interlock system is manually actuated from a controlled by an electric current through a solenoid: in the case of a two-
switch or pushbutton, which may be located on a local panel in the field port valve the flow is switched on or off; in the case of a three-port
or in the control room. A manual trip allows an operator to trip the valve, the outflow is switched between the two outlet ports.
system independently of the interlock system in the event of a
hazardous situation developing. Limit switch
 An automatic trip, as the name implies, is automatically activated when  Some switches are specifically designed to be operated by the motion
a hazardous situation is detected. A common example is the de- of a machine rather than by the hand of a human operator.
energizing of a solenoid valve that fails a control valve to its safe  These motion-operated switches are commonly called limit switches,
position. because they are often used to limit the motion of a machine by turning
off the actuating power to a component if it moves too far.
Manual vs. Automatic Reset of Interlocks  They are used for controlling machinery as part of a control system, as
 A tripped component (e.g. a solenoid valve) needs to be reset after a a safety interlocks, or to count objects passing a point.
trip had been initiated. The reset may be done either automatically or  A limit switch is an electromechanical device that consists of an
manually. actuator mechanically linked to a set of contacts. When an object
 Self-Canceling Interlock has automatic reset that returns the interlock comes into contact with the actuator, the device operates the contacts
system to normal operation when the usual process conditions had to make or break an electrical connection.
been re-established or when the offending situation had been effectively  Limit switches are used in a variety of applications and environments
dealt with. because of their ruggedness, ease of installation, and reliability of
 Manual Reset Interlock requires the operator to re-initiate the process operation. They can determine the presence or absence, passing,
before continuing the operation of the equipment involved. This method positioning, and end of travel of an object. They were first used to define
is generally preferable over automatic reset because it requires an the limit of travel of an object; hence the name "Limit Switch"
investigation of the possible causes for the trip. Positive action by the
operating personnel to return the operating conditions to normal is  Components of limit Switch
required before the interlock can be cancelled.  Actuator: The portion of the switch that comes in contact with
 Manual reset on a solenoid valve is most commonly carried out by the the object being sensed. When there is no force or torque
use of a latching lever that locks the valve when a trip occurs. Unlatch applied to the actuator it is in the unactuated, free or rest
of the lever is required to return the solenoid valve to its normal position. The position to which the actuator must be moved in
operation. Alternatively, a solenoid valve can simply be reset by the use order to operate the contacts is called the trip point or operating
of a pushbutton that energizes the valve. position. When the motion of the actuator is reversed, the

ROBINSONKIPROTICH 43
Microcontrollers
position at which the contacts return to their original state is Mechanical Advantages of Limit Switches
called the reset point or releasing position.  Ease of use
 Simple visible operation
 Head: It houses the mechanism that translates actuator  Durable housing
movement into contact movement. When the actuator is moved  Well sealed for reliable operation
as intended, the mechanism operates the switch contacts.  High resistance to different ambient conditions found in industry
 Contact Block: It houses the electrical contact elements of the  High repeatability
switch. It typically contains either two or four contact pairs.  Positive opening operation of contacts (some models)
 Terminal Block: The terminal block contains the screw
terminations. This is where the electrical (wire) connection Electrical Advantages of Limit Switches
between the switch and the rest of the control circuit is made.  Suitable for switching higher power loads than other sensor
 Switch Body: The switch body houses the contact block in a technologies (5A at 24V DC or 10A at 120V AC typical vs. less
plug-in switch. It and terminal block in the nonplug-in switch. than 1A for proximities or photoelectrics)
 Base: The base houses the terminal block in a plug-in switch.  Immunity to electrical noise interference
Nonplug-in switches do not have a separate base  Immunity to radio frequency interference (walkie-talkies)
 No leakage current
 Minimal voltage drops
Limit switches come in several varieties:
 Simple Normally Open and/or Normally Closed operation
 Lever actuator limit switch: These limit switches closely resemble
rugged toggle or selector hand switches fitted with a lever pushed Disadvantages of Limit Switches
by the machine part. Often, the levers are tipped with a small roller
 Shorter contact life than solid-state technology
bearing, preventing the lever from being worn off by repeated
 Moving mechanical parts wear out eventually
contact with the machine part.
 Not all applications can use contact sensing
 Proximity switches sense the approach of a metallic machine part
either by a magnetic or high-frequency electromagnetic field. Simple
Typical Applications
proximity switches use a permanent magnet to actuate a sealed
switch mechanism whenever the machine part gets close.  Conveyor systems
 More complex proximity switches work like a metal detector,  Transfer machines
energizing a coil of wire with a high-frequency current, and  Automatic turret lathes
electronically monitoring the magnitude of that current. If a  Milling and boring machines
metallic part (not necessarily magnetic) gets close enough to  Radial drills
the coil, the current will increase, and trip the monitoring
circuit.
 Another form of proximity switch is the optical switch,
comprised of a light source and photocell. Machine position
is detected by either the interruption or reflection of a light
beam. Optical switches are also useful in safety applications,
where beams of light can be used to detect personnel entry
into a dangerous area.
ROBINSONKIPROTICH 44
Microcontrollers
Encoder
- The encoder is a device that senses a physical parameter and converts
it to a digital code.
- An encoder is a sensor of mechanical motion that generates digital
signals in response to motion. As an electro-mechanical device, an
encoder is able to provide motion control system users with information
concerning position, velocity and direction.
- There are two different types of encoders: linear and rotary.
- Linear encoder responds to motion along a path, while a rotary
encoder responds to rotational motion. An encoder is generally
categorized by the means of its output.
 Incremental encoder generates a train of pulses which can be
used to determine position and speed.
o Incremental encoders have two separate outputs called
“quadrature outputs”.
o These two outputs are displaced at 90o out of phase from each
other with the direction of rotation of the shaft being determined
from the output sequence.  Absolute encoder generates unique bit configurations to track
o The number of transparent and dark segments or slots on the positions directly.
disk determines the resolution of the device and increasing the o They provide a unique output code for every single position of
number of lines in the pattern increases the resolution per rotation indicating both position and direction.
degree of rotation. o Their coded disk consists of multiple concentric “tracks” of light
o Typical encoded discs have a resolution of up to 256 pulses or and dark segments.
8-bits per rotation. o Each track is independent with its own photo detector to
o The simplest incremental encoder is called a tachometer. It has simultaneously read a unique coded position value for each
one single square wave output and is often used in angle of movement.
unidirectional applications where basic position or speed o The number of tracks on the disk corresponds to the binary “bit”-
information only is required. resolution of the encoder so a 12-bit absolute encoder would
o The “Quadrature” or “Sine wave” encoder is the more common have 12 tracks and the same coded value only appears once
and has two output square waves commonly called channel A per revolution.
and channel B. This device uses two photo detectors, slightly o One main advantage of an absolute encoder is its non-volatile
offset from each other by 90o thereby producing two separate memory which retains the exact position of the encoder without
sine and cosine output signals. the need to return to a “home” position if the power fails.

Advantages of an Encoder
- Highly reliable and accurate
- Low-cost feedback
- High resolution
- Integrated electronics

ROBINSONKIPROTICH 45
Microcontrollers
- Fuses optical and digital technology - Linear encoders are used in metrology instruments, motion systems
- Can be incorporated into existing applications and high precision machining tools ranging from digital calipers and
- Compact size coordinate measuring machines to stages, CNC Mills, manufacturing
gantry tables and semiconductor steppers.
Disadvantages of an Encoder - Optical linear encoders: dominate the high resolution market and may
- Subject to magnetic or radio interference (Magnetic Encoders) employ shuttering/Moiré, diffraction or holographic principles. Optical
- Direct light source interference (Optical Encoders) encoders are the most accurate of the standard styles of encoders, and
- Susceptible to dirt, oil and dust contaminates the most commonly used in industrial automation applications. When
specifying an optical encoder, it’s important that the encoder has extra
Encoders Application protection built in to prevent contamination from dust, vibration and
- Encoders have become an essential component to applications in many other conditions common to industrial environments. Light sources used
different industries. include infrared LEDs, visible LEDs, miniature light-bulbs and laser
- The following is a partial list of industries making use of encoders: diodes.
• Automotive – The automotive industry utilize encoders as sensors of - Magnetic linear encoders: it employs either active (magnetized) or
mechanical motion may be applied to controlling speed. passive (variable reluctance) scales and position may be sensed using
• Consumer Electronics and Office Equipment – In the consumer sense-coils, Hall effect or magneto-resistive readheads. With coarser
electronics industry, encoders are widely used office equipment such as scale periods than optical encoders (typically a few hundred
PC-based scanning equipment, printers, and scanners. micrometers to several millimeters) resolutions in the order of a
• Industrial – In the industrial industry, encoders are used in labeling micrometer are the norm.
machines, packaging and machine tooling with single and multi-axis - Capacitive linear encoders work by sensing the capacitance between
motor controllers. Encoders can also be found in CNC machine control. a reader and scale. Typical applications are digital calipers. One of the
• Medical – In the medical industry, encoders are utilized in medical disadvantages is the sensitivity to uneven dirt, which can locally change
scanners, microscopic or nanoscopic motion control of automated the relative permittivity.
devices and dispensing pumps. - Inductive technology is robust to contaminants, allowing calipers and
• Military - The military also utilizes encoders in their application of other measurement tools that are coolant-proof. A well-known
positioning antennas. application of the inductive measuring principle is the Inductosyn.
• Scientific Instruments – Scientific equipment implement encoders in
the positioning of an observatory telescope. b) Rotary encoders
- Rotary Encoders are another type of position sensor which resemble
a) Linear encoders potentiometers but are non-contact optical devices used for converting
- Linear encoder is a sensor or transducer paired with a scale that the angular position of a rotating shaft into an analogue or digital data
encodes position. code.
- The sensor reads the scale in order to convert the encoded position into - In other words, they convert mechanical movement into an electrical
an analog or digital signal, which can then be decoded into position by a signal (preferably digital).
digital readout (DRO) or motion controller. - All optical encoders work on the same basic principle. Light from an
- Motion can be determined by change in position over time. Linear LED or infra-red light source is passed through a rotating high-
encoder technologies include optical, magnetic, inductive, capacitive resolution encoded disk that contains the required code patterns, either
and eddy current. Optical technologies include shadow, self-imaging binary, grey code or BCD.
and interferometric. - Photo detectors scan the disk as it rotates and an electronic circuit
processes the information into a digital form as a stream of binary
ROBINSONKIPROTICH 46
Microcontrollers
output pulses that are fed to counters or controllers which determine the Flowcharts
actual angular position of the shaft. - Flowchart is a graphical or symbolic representation of an algorithm. It is
the diagrammatic representation of the step-by-step solution to a given
problem.
- It is ideal for a process that has sequential process steps. The steps will
be executed in a simple order that may change as the result of some
simple decisions.
- The symbols used for flowcharts are shown below. These blocks are
connected using arrows to indicate the sequence of the steps. The
different blocks imply different types of program actions.

General rules for flowcharts


- All symbols of the flowchart are connected by flow lines (note arrows,
not lines)
- Flow lines enter the top of the symbol and exit out the bottom, except
for the Decision symbol, which can have flow lines exiting from the
bottom or the sides
- Flowcharts are drawn so flow generally goes from top to bottom
- The beginning and the end of the flowchart is indicated using the
terminal symbol

Note
- Programs always need a start block, but PLC programs rarely stop so
the stop block is rarely used. Other important blocks include operations
and decisions. The other functions may be used but are not necessary
for most PLC applications.
ROBINSONKIPROTICH 47
Microcontrollers
Example 1
- A flowchart is shown in below for a control system for a large water
tank.
- When a start button is pushed the tank will start to fill, and the flow out
will be stopped.
- When full, or the stop button is pushed the outlet will open up, and the
flow in will be stopped.
- In the flowchart the general flow of execution starts at the top. The first
operation is to open the outlet valve and close the inlet valve.
- Next, a single decision block is used to wait for a button to be pushed.
When the button is pushed the yes branch is followed and the inlet
valve is opened, and the outlet valve is closed.
- Then the flow chart goes into a loop that uses two decision blocks to
wait until the tank is full, or the stop button is pushed.
- If either case occurs the inlet valve is closed and the outlet valve is
opened. The system then goes back to wait for the start button to be
pushed again.
- When the controller is on the program should always be running, so
only a start block is needed.
- Many beginners will neglect to put in checks for stop buttons.

Questions with solutions


1. Draw a flow chart for cutting the grass, then develop ladder logic for
three of the actions/decisions.
2. Design a garage door controller using a flowchart. The behavior of the
garage door controller is as follows,
 there is a single button in the garage, and a single button remote
control.
 when the button is pushed the door will move up or down.
 if the button is pushed once while moving, the door will stop, a
second push will start motion again in the opposite direction.
 there are top/bottom limit switches to stop the motion of the door.
 there is a light beam across the bottom of the door. If the beam is
cut while the door is closing the door will stop and reverse.
 there is a garage light that will be on for 5 minutes after the door
opens or closes.

ROBINSONKIPROTICH 48
Microcontrollers
Flowchart for the above example

ROBINSONKIPROTICH 49
Microcontrollers
Questions
1. A signal lamp is required to be switched on if a pump is running and the
pressure is satisfactory, or if the lamp test switch is closed. Draw a
flowchart and ladder diagram.
2. Consider a valve which is to be operated to lift a load when a pump is
running and either the lift switch is operated or a switch operated
indicating that the load has not already been lifted and is at the bottom
of its lift channel. Devise a flowchart and ladder diagram.
3. An Alarm system is used in conjunction with an automated bottling
system in a milk bottling plant. A conveyer belt carries empty bottles
that are to be filled with milk. The alarm goes off in any of the conditions
occurs.
- Milk tank is empty and bottles are in conveyor belt.
- There are no bottles in the conveyer and there is milk in the tank.
- There is milk in the tank and bottles on the conveyor belt but electric
power is off.
- There is no milk in the tank, no bottles on the conveyor belt and
electric power is off.
i) Write down a Boolean expression for the alarm system.
ii) Implement this system using a flowchart and PLC ladder
diagram.
5. Components pass along a chute and interrupt a light switch which goes
low (off) each time it is interrupted. Every time 6 components have been
counted, an eject operation is used to remove the batch and the then it
all starts again.
Produce a flowchart and ladder logic diagram to do this operation. The
counter is designated C460

6. Design a flowchart and ladder program for an industrial control system


that:
 Count ten objects passing along a conveyor belt;
 Closes a deflecting gate when the number has been deflected
into a carton
 Allows a time of 5 seconds between the tenth object counted
and closing of the deflector.

7. A controlled car park has 4 spaces in the packing lot. Cars are detected
and allowed to enter into the parking space if available. If NO space a
“Full” indicator lamp should be lit, otherwise individual indicator lamps

ROBINSONKIPROTICH 50
Microcontrollers
should light to show the available parking space. Design a flowchart and
PLC ladder diagram of the car parking system; include comments on
every rung.

8. With the aid of a flowchart and ladder program, explain how a converter
can be used in a machine to direct 6 products to a packaging box and
12 products to another box simultaneously.

9. A machine is being designed to wrap boxes of chocolate. The boxes


arrive at the machine on a conveyor belt. The list below shows the
process steps in sequence.
- The box arrives and is detected by an optical sensor (P), after this
the conveyor is stopped (C) and the box is clamped in place (H).
- A wrapping mechanism (W) is turned on for 2 seconds.
- A sticker cylinder (S) is turned on for 1 second to put consumer
labelling on the box.
- The clamp (H) is turned off and the conveyor (C) is turned on.
- After the box leaves the system returns to an idle state.
Develop ladder logic for the system using a flowchart. Don’t forget to
include regular start and stop inputs.

10.

ROBINSONKIPROTICH 51
Microcontrollers
Topic 4: Digital control system
Introduction
- 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 (available) at all
times.

- 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.
- Error signal e(t) is sampled at intervals of T. In the context of control
- However, digital control systems employ a computer as a and communication, sampling is a process by which a continuous time
fundamental component in the controller. signal is converted into a sequence of numbers at discrete time
- It can be viewed from different perspectives including control intervals.
algorithm, computer program, conversion between analog and - One of the most important aspects is the sampling process level.
digital domains, system performance etc. - It is a fundamental property of digital control systems because of the
- In a digital control system, the control algorithm is implemented in a discrete nature of operation of digital computer.
digital computer.
Analog to Digital converter (ADC)
- ADC is an electronic device that converts an input analog voltage (or
current) to a digital number proportional to the magnitude of the voltage
or current.
- With introduction of digital computers the data or physical quantity taken
in analogue form must be converted to digital form in order to be
computed.
- In order to covert an analogue quantity to a digital number, three
processes takes place; sampling, quantization and binary encoding.

Analog Sampling Quantization Binary Digital


Input Encoding Output
Principles of operation
- The computer typically receives a measurement of the controlled
variable, also often receives the reference input, and produces its Sampling Quantization Binary
output using an algorithm. Period T Interval Q codebook
- This output is usually converted to an analog signal using a D/A
converter, and then amplified by a power amplifier to drive the plant.

ROBINSONKIPROTICH 52
Microcontrollers
Filtering: Quantization
- Before sampling, the analog input must be filtered with an anti-aliasing - This is the process of approximating a continuous range of values by
filter. relatively small set discrete symbols or integer values.
- The anti-aliasing filter is a low-pass filter that limits high frequencies in - To store or transmit the sampled values via a digital system, the sample
the input signal to only those that meet the requirements of the values are represented in numerical form.
sampling theorem. - This requires quantizing where each discrete sample value is rounded
- The filter eliminates frequencies that exceed a certain limit that is off to the closest numerical value in a set of digital words in use.
determined by the sampling rate. - Each sampled amplitude must be converted to one of a finite number of
Sampling possible values, or levels. For ease in conversion to binary form, the
- The first step in converting a signal to digital form is to use a sample- number of levels is usually a power of 2 depending on the degree of
and-hold circuit. precision required.
- This circuit samples the input signal at a rate determined by a clock - The quantized signal stays at the sample value until the next sampling
signal and holds the level on a capacitor until the next clock pulse. The instants. In this quantizing process the information in accurate signal
amplitude of an analog signal is first sampled. values is lost because of rounds off and the original signal cannot be
- The purpose of the sample and hold circuit is to take a sample of the reproduced exactly any more.
input signal (analog) and hold it essentially constant while the A/D - The quality of the coding depends on the number of quantum levels that
conversion is taking place. is defined to provide the required performance.
- This function is usually implemented with a switch and capacitor. The
switch connects the capacitor to the signal conditioning circuit once Binary encoding
every sample period. - In the next step in the digitization process, the output of the quantizer is
- The capacitor then holds the voltage value measured until a new mapped into a binary sequence.
sample is acquired. - It is apparent that 8 levels require three binary digits, or bits; 16 levels
- Many times, the sample and hold circuitry is incorporated into the same require four bits; and 256 levels require eight bits. In general 2n levels
integrated circuit package. require n bits.
- The more samples per second there are, the more representative of the - In order to use more levels, more binary samples would have to be
analog signal the set of samples will be. squeezed into the allotted time slot between successive signal samples.
- After sampling, the signal value is known only at discrete points in time,
called sampling instants. Types of ADC
- If there points have a sufficient close spacing, a smooth curve drawn - There are several types of analog to digital converter.
through them allows interpolating immediate values to any degree of o Successive approximation (Potentiometric) ADC
accuracy. o Ramp type ADC
- The number of samples per second is called the sampling frequency o Integrating Type ADC
or sampling rate, and it depends on the highest frequency component o Dual –slope integrating type
present in the analog signal.
- The relation of sampling rate end the highest frequency of the signal to
be sample is as follows:
- The sampling theorem states that if the highest frequency content in
the input signal is fh Hz, then input signal can be recovered without
distortion if it is sampled at a rate of at least 2f h samples/sec.
ROBINSONKIPROTICH 53
Microcontrollers
Analog Signal how long it takes for the capacitor to discharge. This length of time is
proportional to the input voltage.

Successive approximation A/Ds


- Successive approximation A/Ds allow much higher sampling rates (up
to a few hundred kHz with 12 bits is possible) while still being
reasonable in cost.
t - The conversion algorithm is similar to that of a binary search, where the
Sampling A/D starts by comparing the input with a voltage (generated by an
8
internal D/A converter), corresponding to half of the full-scale range.
6 - If the input is in the lower half, the first digit is zero and the A/D repeats
Amplitude

this comparison using the lower half of the input range. If the voltage
4
had been in the upper half, the first digit would have been 1.
2 - This dividing of the remaining fraction of the input range in half and
comparing to the input voltage continues until the specified number of
t bits of accuracy has been obtained. It is obviously important that the
T input signal does not change when the conversion process is underway.
8 Quantizing
Digital to analog conversion
6
Amplitude

- Today microcomputers are widely used for industrial control. The output
4 of the microcomputer is a digital quantity.
- In many applications the digital output of the microcomputer has to be
2 converted into analog quantity which is used for the control of relay,
small motor, actuator etc.
t - In communication system digital transmission is faster and convenient
encoding but the digital signals have to be converted back to analog signals at
101 111 111 110 011 001 001 011110 111 111 110 011 001 001 011 the receiving terminal.
- DAC converters are also used as a part of the circuitry of several ADC
converters.
- Thus, digital to analog converter is used to convert digital quantity into
analog quantity. DAC converter produces an output current of voltage
Integrating (or dual slope) A/Ds proportional to digital quantity (binary word) applied to its input.
- These are used for very low frequency applications (a few hundred - It functions as a zero-order hold, holding its output at a constant value
hertz maximum) and may have very high accuracy and precision (e.g. until it receives the next discrete input.
22 bit). - There are several ways of making a digital to analog converter. Some of
- They are found in thermocouple and RTD modules. Other advantages them are given as under.
include very low cost, noise and mains pickup tend to be reduced by the 1. Binary weighted resistor DAC
integrating and dual slope nature of the A/D converter. 2. R-2R Ladder network
- The A/D procedure essentially requires a capacitor to be charged with 3. Serial DAC converter
the input signal for a fixed time, and then uses a counter to calculate
ROBINSONKIPROTICH 54
Microcontrollers
Binary weighted Resistor DAC mode for the purpose of summing so that it performs as an excellent
- It consists of the following four major components. current to voltage converter.
1. n switches one for each bit applied to the input
2. a weighted resistor ladder network, where the resistance are The Data Acquisition System
inversely proportional to the numerical significance of the - This is electronic instrument, or group of interconnected electronic
corresponding binary digital hardware items, dedicated to the measurement and quantization of
3. a reference voltage Vref and analog signals for digital analysis or processing.
4. A summing amplifier that adds the current flowing in the resistive - Once the parameter to be measure is translated into the analog-
network to develop a signal that is proportional to the digital input. electrical domain, the DAS performs the translation to the digital-
electrical domain.
- In some cases the DAS simply records, or stores the digital data. While
more sophisticated systems may be capable of analysis or further
processing.
- For instance, a DAS may be as simple as a digital voltmeter (DVM)
which displays its output as a decimal readout, or it may be complex
enough to contain a large-scale computer as part of its hardware.

- The reference voltage source VR is considered to have zero internal


impedance.
- The resistor that are connected to the switches have value such as to
make the current flow proportion to the binary weight of the respective
input. Elements of DAS
- But the resistor in the MSB position has the value R, the next has the - Analog multiplexer: permits a number of original sources to be
value 2R etc. The resistor of the LSB has the value of (2n-1) R. automatically measure by the same data acquisition hardware.
- When all the bits of digital word have value of 1, then the output current - It consists of a series of switches whose inputs are tied to the various
of D/A converter is termed the full scale output current and is an analog signals and whole outputs are tied to a common measuring
important design parameter. point.
- On the other hand, if all switches are open i.e. all ai coefficients are - Each input is individually connected to the measuring point in a
zero, then the output voltage (current) is zero. predetermined sequence. The number of channels in a multiplexer may
- The maximum output voltage Vo = -RiI depends on the feedback resistor vary from two to several hundred.
Rf. As, the operational amplifier is operated in the negative feedback

ROBINSONKIPROTICH 55
Microcontrollers
- Signal conditioning: Very often the signals presented to the inputs of - Manual Data Entry: Many data acquisition systems provide users with
the data acquisition system are not in a form appropriate for conversion, a way to tag the data they are accumulating, through some sort of
and so they must be preconditioned. The required signal conditioning manual data entry.
could consist of linear amplification, logarithmic amplification, filtering, - They may wish to note such things as the type of data, special
peak detection, or sample-and-hold. conditions surrounding the measurements, and / or the run number.
- Often more than one of these functions is required. For instance, it is - Such information is generally provided in a “header” that precedes the
not uncommon to combine amplification with filtering or to find a low- actual measurement data.
level amplifier before a sample-and-hold.
- Digital buffer: The ability to record discrete events is often a
requirement of a data acquisition system.
- Since these events are usually accompanied by the opening or closing
of a switch, they represent a digital input, out-of-tolerance conditions or
some other situations that might invalidate the data collection are most
often designated as “discrete events”.

- Output buffer: The output buffer acts as the data collector for the DAS./
In an ordered sequence, it gathers up such data as the multiplexer
channel number, the signal conditioner gain, A/D converter data,
manual data, clock information, and discrete events.
- The buffer combines the data with the proper format for entry into the
recording or processing system. It also provides the proper buffering
and control to interface with the recording or processing device.
- If the processing device were a minicomputer, the output buffer might
be called a “Peripheral controller”.
- Analog-to-Digital (A/D) Converter: The analog-to-digital converter
- Recording / processing device: A number of different equipment
actually translates the analog signal into an encoded digital format.
types can fill the role of the recording or processing device. Some of
- Of the numerous ways to perform this function, only about half dozen
the equipment types commonly used are paper tape punches,
techniques have found wide acceptance. Most notable are the dual-
teleprinters (TTY), magnetic tape units, line printers, cathode-ray tube
slope integrating and the successive approximation converters.
displays, floppy disks, general-purpose digital computers, and special-
- A/D converters are often referred to by the number of output digits they
purpose digital processors.
produce. In a binary system, the range is from 4 to 16 bits, while in a
binary-coded decimal system, 5 to 4 digits are normal.
- In recent years, all these components of the data acquisition system
have become more automated; a typical block diagram can be found
- Digital clock: The digital clock provides the master timing for the data
with the exception of manual entry, which is accomplished directly the
acquisition system.
computer through the keyboard display.
- It may be as simple as a multiphased crystal controlled oscillator, or it
- Clock Information is supplied by the computer, and timing is generated
may provide the user with a wide selection of multiplexer rates and
in the input/output (I/O) controller.
modes of operation. Some systems also contain both time-of-day and
- This system configuration has two distinct advantages: first, on-line
day-of-year clocks.
programmable processing is possible; and second, a host of storage
ROBINSONKIPROTICH 56
Microcontrollers
media is available. The rapid expansion of the data acquisition field is - The latest trend in test instrumentation is to embed a micro processor in
directly attributable to the advent of low-cost computer hardware, which the heart of the equipment. This places tremendous programming
makes systems like that of figure below a reality. power and flexibility in the hands of the user.
- Yet we should not overlook the dotted-line box in the lower right-hand - The data acquisition system potential uses are:-
corner of the figure. Software can easily become a more costly burden 1. Data logging
than the hardware. 2. Signal analysis
3. Automated factory testing, and
4. Process control

Data Logging
- The data logger is a data acquisition system that measures the analog
inputs, translates the results into the digital domain, and stores the data
for future processing or analysis.
- From the earliest days of recorded data, scientists have set up
experiments with appropriate analog measuring devices at critical points
in the operation.
- They have tabulated their data either by visual observation at set
intervals or by recording it on another analog device, such as a pen
recorder.
- In either case, they had to spend many hours analyzing the results.
The data logger provides an automated method of making the
measurements and recording the data.
- It can perform these functions at precise intervals and with a degree of
accuracy beyond any person’s physical capability.
- Because the data is store in digital format, the data analysis is easily
performed by an off-line computer.
- Since many data loggers are highly portable, data-taking can be
automated even in very remote locations.

Alarm System
- In industrial plants and installations, control systems are used to monitor
and control processes.
- Control Systems, whether a conventional Control Desk or a
Computer/PLCs System with SCADA or a Distributed Control System
(DCS), provides a man-machine-interface to monitor and control the
plant equipment and processes.
- Alarm Systems are an integral part of man-machine interface. An alarm
system consists of both hardware and software including; field signal
sensors, transmitters, alarm generators & handlers, alarm processors,

ROBINSONKIPROTICH 57
Microcontrollers
alarm displays, annunciator window panels, alarm recorders and - Each pushbutton would indicate the area from which the alarms
printers. originate and also when depressed would cause the appropriate
- Alarm systems indicate the abnormal conditions and problems of the schematic to appear on the operator display.
plant and equipment to the operators, enabling them to take corrective - There exist two types of alarms:
action and bring the plant/equipment back to normal conditions. o Real Time Alarms are the alarms that show the current alarms in
- Alarm systems give signals to the operators in the form of audible the system.
sound, visual indications in different colors and/or continuous blinking, o Historical alarms are simply the logging of real time alarms. This
text messages, etc. will give a historical of the alarms that will allow system engineers
- An alarm system brings the following to the notice of the operator: to prevent alarms.
 problems that need operator attention - Only four alarm priorities should be implemented. These are:
 process changes that require corrective action o High priority: Alarms that warn of dangerous conditions that
 unsafe operating conditions before Emergency Shut-down of could cause a shutdown of a major activity.
the plant o Medium priority: Alarms that should be acted on as quickly as
 hazardous conditions possible; but will not cause a shutdown.
 deviations from desired/normal conditions o Low priority: Alarms that should be dealt with when time permits.
o Event only: Statistical or technical information. No enunciator
sounds for these.
- The limiting of the number of types of alarms is to keep the system
straightforward and with easy interpretation of the alarms.
- Higher priority alarms should be louder; lower pitched and have a higher
pulse frequency than the lower priority alarms.
- Alarms are classified as unacknowledged (and flashing on the screen)
until the operator acknowledges them via the keyboard. They then
become an accepted alarm.
- One weakness in many alarm systems is the occurrence of trivial
alarms, which irritate and confuse the operator.

Human Machine interface (HMI)


- Human–Machine Interface or HMI is the apparatus or device which
presents processed data to a human operator, and through this, the
human operator monitors and controls the process.
- The HMI of a digital control system is where data is processed and
presented to be viewed and monitored by a human operator.
- This interface usually includes control where the individual can interface
with the control system
- It uses the project screens created during project development and
- Another approach as opposed to the pure screen listing of alarms is to animates them based on real-time data received from field control units
have an associated enunciator panel (situated next to the operator and field data servers.
display) with illuminated pushbuttons.

ROBINSONKIPROTICH 58
Microcontrollers
- Authorized operators can monitor detailed activities for many types of - The secondary level, which consists of a number of displays,
devices and send commands using standard faceplate command associated with that of the primary level. These should be able to be
windows and group displays. accessed directly from the primary level displays.
- Typical hardware that is provided is: - The tertiary level, which gives more details on certain secondary level,
o One or more operator displays (which may be of the touch displays.
type) - The various graphic screens that are available are:
o Industrial (or Mylar) type keyboards which have audible or o Free form graphic screens: This is where the screen format can
tactile feedback be created by the users, using whatever layout and symbols they
o Operator panels consisting of highlighted keys to bring up can create. These are best constructed by the operators (with
predefined graphic displays assistance from the engineer). They offer the designer complete
o Printers (one for alarms and one for reports) flexibility in the layout of the information.
o Alarm buzzers (or external sirens) o Operating group displays: Here a standard set of symbols is
- A useful addition although possibly expensive option is a video copier used to create displays as required. These provide the data in a
for reproducing the operator screens in color. standard presentation format.
o Trend displays: These displays occupy part or the entire screen
depending on the configuration. They provide trends on the data
of analog values.
o Alarm displays: These log the current alarms for the system.
- It has been shown that operators consult and use overview type
schematics at least ten times more often than secondary and tertiary
schematics.
- It is thus imperative that as much effort as possible goes into the correct
design of such displays.
- The operators should be consulted as much as possible in the design of
these screens to make them as useful as possible.
- Displays should appear within one second of the operator pressing the - Overview displays have to cover a large amount of the system and it is
appropriate display key(s) thus important to eliminate any part of the display, which does not
convey information to the operator.
Operator displays and graphics - This would mean that equipment outlines and flow lines are not put into
- The organization of displays should be done in a clear and logical way overview schematics.
to allow the operator to quickly and effectively identify the information of - Secondary and tertiary displays are consulted less and probably require
interest. more information than that of the live updates.
- The architecture of displays is to have a progressive decrease in scope - Outlines of equipment and text messages should be de-emphasized by
of the displays and a progressive increase in detail as the operator using low intensity colors.
looks for some specific information (and is proceeding down the - An icon should be designed to indicate clearly the area associated with
hierarchy of displays). a given schematic or operation.
- Displays should be organized into three layers: - This allows the operator to quickly work out which area the current
- The primary level which is an overview level and which should be display is referring to.
reached directly from the function keys on the keypad.

ROBINSONKIPROTICH 59
Microcontrollers
Topic 5: Fundamentals of Robots General Characteristics
- The word robot first appeared in print in the 1920 play R.U.R. - Specialized machine tools with a degree of flexibility that distinguishes
(Rossum’s Universal Robots) by Karel Capek, a Czechoslovakian them from fixed-purpose automation.
playwright. "Robot" in Czech comes from the word "robota", meaning - ability to move mechanical arm to perform work.
"compulsory labor“. - It is essentially a mechanical arm that is bolted to the floor, a machine,
- Typical of early science fiction, the robots take over and exterminate the the ceiling, or, in some cases the wall fitted with its mechanical hand,
human race. and taught to do repetitive task in a controlled, ordered environment.
- Robot is defined as an electromechanical device with multiple degrees- - robot interface with their work environment once a mechanical hand has
of-freedom (DOF) that is programmable to accomplish a variety of been attached to the robot’s toolmounting plate.
tasks. - A general-purpose, programmable machine possessing certain
- The Robotics Industries Association (RIA) defines robot in the following anthropomorphic characteristics
way: ‘An industrial robot is a programmable, multi-functional  Hazardous work environments
manipulator designed to move materials, parts, tools, or special devices  Repetitive work cycle
through variable programmed motions for the performance of a variety  Consistency and accuracy
of tasks’.  Difficult handling task for humans
- An industrial robot consists of a number of rigid links connected by  Multishift operations
joints of different types, controlled and monitored by a computer.  Reprogrammable, flexible
- Robot technology is an applied science that is referred to as a  Interfaced to other computer systems
combination of machine tools and computer applications. This includes
such diverse fields as machine design, control theory, microelectronics, Basic Components
computer programming, artificial intelligence, human factors, and - The basic components of an industrial robot are:
production theory. o Manipulator
- Robotics is the science of robots while humans working in this area are o End effector (which is the part of the manipulator).
called roboticists. o Power supply
- Isaac Asimov coined and popularized the term robotics through many o Controller.
science-fiction novels and short stories. o Means for programming.
- Asimov's most important contribution to the history of the robot is the - The manipulator, which is the robot’s arm, consists of segments
creation of his “Three Laws of Robotics”. jointed together with axes capable of motion in various directions
1. A robot may not injure a human being, or, through inaction, allow a allowing the robot to perform work.
human being to come to harm. - The end effector which is a gripper tool, a special device, or fixture
2. A robot must obey the orders given it by human beings except attached to the robot’s arm, actually performs the work.
where such orders would conflict with the First Law. - Power supply provides and regulates the energy that is converted to
3. A robot must protect its own existence as long as such protection motion by the robot actuator, and it may be electric, pneumatic, or
does not conflict with the First or Second Law. hydraulic.
- Asimov later adds a "zeroth law" to the list: - The controller initiates, terminates, and coordinates the motion of
- Zeroth law: A robot may not injure humanity, or, through inaction, sequences of a robot. Also it accepts the necessary inputs to the robot
allow humanity to come to harm. and provides the outputs to interface with the outside world.
- The means for programming is used to record movements into the
robot’s memory. A robot may be programmed using any of several
different methods. The teach pendant, also called a teach box or hand-
ROBINSONKIPROTICH 60
Microcontrollers
held programmer, teaches a robot the movements required to perform a Robotics Terminology
useful task. The operator uses a teach pendant to move the robot 1. DOF degrees-of-freedom: the number of independent motions a
through the series of points that describe its desired path. The points device can make. (Also called mobility)
are recorded by the controller for later use.

2. Position: The translational (straight-line) location of something.


3. Orientation: The rotational (angle) location of something. A robot’s
orientation is measured by roll, pitch, and yaw angles.
4. Link: A rigid piece of material connecting joints in a robot.
5. Joint: The device which allows relative motion between two links in a
robot.
6. Workspace/Work envelop: The volume in space that a robot’s end-
effector can reach, both in position and orientation.
7. Payload: the ability to carry, continuously and satisfactorily, a given
maximum weight at a given speed.
8. Velocity/speed: the maximum speed at which the tip of a robot is
capable of moving at full extension, expressed in inches or millimeters
per second. The speed is usually specified at a specific load or
assuming that the robot is carrying a fixed weight. Actual speed may
vary depending upon the weight carried by the robot.
9. Cycle: time it takes for the robot to complete one cycle of picking up a
given object at a given height, moving it to a given distance, lowering it,
releasing it, and returning to the starting point.
10. Accuracy: a robot’s ability to position the end effector at a specified
point in space upon receiving a control command without previously
having attained that position.
11. Repeatability: the ability of a robot to return consistently to a previously
defined and achieved location.

ROBINSONKIPROTICH 61
Microcontrollers
12. Resolution: the smallest incremental change in position that it make or
its control system can measure.
13. Size: the physical size of a robot, which influences its capacity and its
capabilities.

Controller
- The controller is the part of a robot that coordinates all movements of
the mechanical system.
- It also receives input from the immediate environment through various
sensors.
- The heart of the robot’s controller is generally a microprocessor linked
to input/output and monitoring devices.
- The commands issued by the controller activate the motion control
mechanism, consisting of various controllers, amplifiers, and actuators.
- An actuator is a motor or valve that converts power into robot
movement.
- This movement is initiated by a series of instructions, called a program,
stored in the controller’s memory.
- The controller has three levels of hierarchical control. Hierarchical
control assigns levels of organization to the controllers within a robotic
system.
- Each level sends control signals to the level below and feedback signals
to the level above. The levels become more elemental as they progress Manipulator
toward the actuator. Each level is dependent on the level above it for - The manipulator consists of segments that may be jointed and that
instructions. move about, allowing the robot to do work.
- The three levels are: - The manipulator is the arm of the robot which must move materials,
o Level I—Actuator Control. The most elementary level at which parts, tools, or special devices through various motions to provide
separate movements of the robot along various planes, such as useful work.
the X, Y, and Z axes are controlled. - A manipulator can be identified by method of control, power source,
o Level II—Path Control. The path control (intermediate) level actuation of the joints, and other factors. These factors help identify the
coordinates the separate movements along the planes best type of robot for the task at hand.
determined in Level I into the desired trajectory or path. - For example, you would not use an electric robot in an environment
o Level III—Main Control. The primary function of this highest where combustible fumes exist and a spark could cause an explosion.
control level is to interpret the written instructions from the - The manipulator is made up of a series of segments and joints much
human programmer regarding the tasks required. The like those found in the human arm.
instructions are then combined with various environmental - Joints connect two segments together and allow them to move relative
signals and translated by the controller into the more elementary to one another. The joints provide either linear (straight line) or rotary
instructions that Level II can understand. (circular) movement.
- The muscles of the human body supply the driving force that moves the
various body joints. Similarly, a robot uses actuators to move its arm
ROBINSONKIPROTICH 62
Microcontrollers
along programmed paths and then to hold its joints rigid once the - A robot movement can be divided into two general categories: arm and
correct position is reached. body (shoulder and elbow) motions and wrist motions.
- Manipulation is carried out using mechanical devices such as linkages, - The individual joint motions associated with these categories are
gears, actuators, and feedback devices. There are two basic types of referred to as degree of freedom. Each axis is equal to one degree of
motion provided by actuators: linear and rotary. freedom. typically an industrial robots are equipped with 4-6 degrees of
- Linear actuators provide motion along a straight line; they extend or freedom
retract their attached loads. - The wrist can reach a point in space with specific orientation by any of
- Rotary actuators provide rotation, moving their loads in an arc or circle. three motions: a pitch, or up-and-down-motion; a yaw, or side-to-side
Rotary motion can be converted into linear motion using a lead screw or motion; and a roll, or rotating motion. The joint labeled pitch, yaw, and
other mechanical means of conversion. roll are called orientation axes.
- These types of actuators are also used outside the robot to move - The points that manipulator bends, slides, or rotates are called joints or
workpieces and provide other kinds of motion within the work envelope. position axes. Position axes are called as world coordinates, is
identified as being fixed location within the manipulator that serves as
absolute frame of reference.
o The x-axis travel moves the manipulator in an in-and-out
motion.
o The y-axis motion causes the manipulator to move side-to-side.
o The z axis motion causes the manipulator to move in and up
and-down motion.
- The mechanical design of a robot manipulator relates directly to its work
envelope and motion characteristics.
- A tachometer is a device used to measure the speed of an object. In the
case of robotic systems, a tachometer is used to monitor acceleration
and deceleration of the manipulator’s movements

End Effector
- The end effector is the robot’s hand, or the end-of-arm tooling on the
robot.
- It is a device attached to the wrist of the manipulator for the purpose of
grasping, lifting, transporting, maneuvering, or performing operations on
a workpiece.
- The end effector is one of the most important components of a robot
system. The robot’s performance is a direct result of how well the end
effector meets the task requirements.
- The area within reach of the robot’s end effector is called its work
envelope.

Power Supply
- The power supply provides the energy to drive the controller and
actuators. It may convert ac voltage to the dc voltage required by the
ROBINSONKIPROTICH 63
Microcontrollers
robot’s internal circuits, or it may be a pump or compressor providing
hydraulic or pneumatic power.
- The three basic types of power supplies are electrical, hydraulic, and
pneumatic. The most common energy source available, where industrial
robots are used, is electricity. The second most common is compressed
air, and the least common is hydraulic power.
- These primary sources of energy must be converted into the form and
amount required by the type of robot being used.
- The electronic part of the control unit, and any electric drive actuator,
requires electrical power.
- A robot containing hydraulic actuators requires the conversion of
electrical power into hydraulic energy through the use of an electric,
motor-driven, hydraulic pump.
- A robot with pneumatic actuators requires compressed air, which is - These tasks require three joints, or three degrees of freedom.
usually supplied by a compressor driven by an electric motor. - The three degrees of freedom in the robot arm are the rotational
traverse, the radial traverse, and the vertical traverse.
o The rotational traverse (x-axis travel) is movement on a
Degrees of Freedom vertical axis. This is the side-to-side swivel of the robot’s arm on
- Although robots have a certain amount of dexterity, it does not compare its base.
to human dexterity. o The radial traverse (y-axis motion)is the extension and
- The movements of the human hand are controlled by 35 muscles. retraction of the arm, creating in-and-out motion relative to the
Fifteen of these muscles are located in the forearm. The arrangement of base.
muscles in the hand provides great strength to the fingers and thumb for o The vertical traverse (z-axis motion) provides up-and-down
grasping objects. motion.
- Each finger can act alone or together with the thumb. This enables the - For applications that require more freedom, additional degrees can be
hand to do many intricate and delicate tasks. In addition, the human obtained from the wrist, which gives the end effector its flexibility.
hand has 27 bones. - The three degrees of freedom in the wrist have aeronautical names:
- Figure below shows the bones found in the hand and wrist. This bone, pitch, yaw, and roll.
joint, and muscle arrangement gives the hand its dexterity. o The pitch, or bend, is the up-and-down movement of the wrist.
- Degrees of freedom (DOF) is a term used to describe a robot’s o The yaw is the side-to-side movement.
freedom of motion in three dimensional space—specifically, the ability o The roll, or swivel, involves rotation.
to move forward and backward, up and down, and to the left and to the
right.
- For each degree of freedom, a joint is required. A robot requires six
degrees of freedom to be completely versatile.
- Its movements are clumsier than those of a human hand, which has 22
degrees of freedom.
- The number of degrees of freedom defines the robot’s configuration.
For example, many simple applications require movement along three
axes: X, Y, and Z.
ROBINSONKIPROTICH 64
Microcontrollers
- The second classification is the servo robot. These robots are classified
as either intelligent or highly intelligent. The primary difference between
an intelligent and highly intelligent robot is the level of awareness of its
environment.

Non-Servo Robots
- Non-servo robots are the simplest robots and are often referred to as
“limited sequence,” “pick-and-place,” or “fixed-stop robots.”
- The non-servo robot is an open-loop system. In an open-loop system,
no feedback mechanism is used to compare programmed positions to
actual positions.
- A good example of an open-loop system is the operating cycle of a
washing machine
- Non-servo robots are also limited in their movement and these
limitations are usually in the form of a mechanical stop. This form of
robot is excellent in repetitive tasks, such as material transfer.
- One may question if the non-servo robots qualify as a robot based on
the definition provided by the Robot Institute of America.
- A robot requires a total of six degrees of freedom to locate and orient its - However, if these robots are equipped with a programmable logic
hand at any point in its work envelope. controller (PLC) they easily meet the requirement of a reprogrammable
- Although six degrees of freedom are required for maximum flexibility, device, thus allowing them to be classified as a robot.
most applications require only three to five. - The diagram in Figure below represents a pneumatic (air-controlled),
- When more degrees of freedom are required, the robot’s motions and non-servo robot.
controller design become more complex.
- Some industrial robots have seven or eight degrees of freedom. These
additional degrees are achieved by mounting the robot on a track or
moving base. This addition also increases the robot’s reach

Classifying Robots
- Robots can be classified in various ways, depending on their
components, configuration, and use.
- Three common methods of classifying robots are by the types of
control system used, the type of actuator drive used, and the shape
of the work envelope.
 At the beginning of the cycle, the controller sends a signal to the
Type of Control System control valve of the manipulator.
- Robots may use one of two control systems—non-servo and servo.  As the valve opens, air passes into the air cylinder, causing the rod
- The earliest type of robot was non-servo, which is considered a non- in the cylinder to move. As long as the valve remains open, this rod
intelligent robot. continues to move until it is restrained by the end stop.

ROBINSONKIPROTICH 65
Microcontrollers
 After the rod reaches the limit of its travel, a limit switch tells the
controller to close the control valve.
 The controller sends the control valve a signal to close.
 The controller then moves to the next step in the program and
initiates the necessary signals. If the signals go to the robot’s end
effector, for example, they might cause the gripper to close in order
to grasp an object.
- The process is repeated until all the steps in the program have been
completed.
- Characteristics of non-servo robots:
• Relatively inexpensive compared to servo robots.
• Simple to understand and operate.
- The diagram in figure above details one of the axes used in a hydraulic
• Precise and reliable.
robot and helps to explain its operation.
• Simple to maintain.
• Capable of fairly high speeds of operation. o When the cycle begins, the controller searches the robot’s
• Small in size. programming for the desired locations along each axis.
• Limited to relatively simple programs. o Using the feedback signals, the controller determines the actual
locations on the various axes of the manipulator.
Servo Robots o The desired locations and actual locations are compared.
o When these locations do not match, an error signal is generated
- The servo robot is a closed-loop system because it allows for feedback.
In a closed-loop system, the feedback signal sent to the servo amplifier and fed back to the servo amplifier. The greater the error, the
affects the output of the system. higher the intensity of the signal.
o These error signals are increased by the servo amplifier and
- A servo amplifier translates signals from the controller into motor
voltage and current signals. Servo amplifiers are used in motion control applied to the control valve on the appropriate axis.
systems where precise control of position or velocity is necessary. o The valve opens in proportion to the intensity of the signal
received. The opened valve admits fluid to the proper actuator to
- In a sense, a servomechanism is a type of control system that detects
move the various segments of the manipulator.
and corrects for errors.
- Figure below shows a block diagram of a servo robot system. o New signals are generated as the manipulator moves.
o The servo control valves close when there are no more error
signals, shutting off the flow of fluid.
o The manipulator comes to rest at the desired position.
o The controller then addresses the next instruction in the
program, which may be to move to another location or operate
some peripheral equipment.
- The process is repeated until all steps of the program are completed.
- Characteristics of servo robots are :
- Relatively expensive to purchase, operate, and maintain.
- Use a sophisticated, closed-loop controller.
- Wide range of capabilities.

ROBINSONKIPROTICH 66
Microcontrollers
- Can transfer objects from one point to another, as well as along - However, manufacturers are beginning to offer robots that use direct-
a controlled, continuous path. drive motors, which eliminate some of these problems. These high-
- Respond to very sophisticated programming. torque motors drive the arm directly, without the need for reducer gears.
- Use a manipulator arm that can be programmed to avoid - Using direct-drive motors in robots results in a more streamlined design.
obstructions within the work envelope. Maintenance requirements are also reduced.
- Robots that use direct-drive motors operate at higher speeds, with
Type of Actuator Drive greater flexibility, and greater accuracy than those that use conventional
- One common method of classifying robots is the type of drive required electric-drive motors.
by the actuators. - Applications currently being performed by robots with direct-drive
• Electrical actuators use electric power. motors are mechanical assembly, electronic assembly, and material
• Pneumatic actuators use pneumatic (air) power. handling.
• Hydraulic actuators, use hydraulic (fluid) power. - These robots will increasingly meet the demands of advanced, high-
speed, precision applications.
Electric Drive
- Three types of motors are commonly used for electric actuator drives: Hydraulic Drive
ac servo motors, dc servo motors, and stepper motors. - Many earlier robots were driven by hydraulic actuator drives. A
- Both ac and dc servo motors have built-in methods for controlling exact hydraulic drive system uses fluid and consists of a pump connected to a
position. reservoir tank, control valves, and a hydraulic actuator.
- Many newer robots use servo motors rather than hydraulic or pneumatic - Hydraulic drive systems provide both linear and rotary motion using a
ones. much simpler arrangement than conventional electric-drive systems.
- Small and medium-size robots commonly use dc servo motors. - The storage tank supplies a large amount of instant power, which is not
Because of their high torque capabilities, ac servo motors are found in available from electric-drive systems.
heavy-duty robots. - Hydraulic actuator drives have several advantages.
- A stepper motor is an incrementally controlled dc motor. Stepper motors o They provide precise motion control over a wide range of
are rarely used in commercial industrial robots, but are commonly found speeds.
in educational robots. o They can handle heavy loads on the end of the manipulator arm,
- Conventional, electric-drive motors are quiet, simple, and can be used can be used around highly explosive materials,
in clean-air environments. Robots that use electric actuator drives o and are not easily damaged when quickly stopped while carrying
require less floor space, and their energy source is readily available. a heavy load.
- The rotary motion of most electric actuator drives must be geared down - However, they are expensive to purchase and maintain and are not
(reduced) to provide the speed or torque required by the manipulator. energy efficient.
- However, the conventionally geared drive causes problems of backlash, - Hydraulic actuator drivers are also noisier than electric-drive actuators
friction, compliance, and wear. These problems cause inaccuracy, poor and are not recommended for clean-room environments due to the
dynamic response, need for regular maintenance, poor torque control possibility of hydraulic fluid leaks.
capability, and limited maximum speed on longer moves.
- Loads that are heavy enough to stall (stop) the motor can cause Pneumatic Drive
damage. Conventional electric-drive motors also have poor output - Pneumatic drive systems make use of air-driven actuators. Since air is
power compared to their weight. This means that a larger, heavier also a fluid, many of the same principles that apply to hydraulic systems
motor must be mounted on the robot arm when a large amount of are applicable to pneumatic systems.
torque is needed.
ROBINSONKIPROTICH 67
Microcontrollers
- Pneumatic and hydraulic motors and cylinders are very similar. Since o Radial movement: This enables the robot to move its end-
most industrial plants have a compressed air system running throughout effector radially to reach distant points.
assembly areas, air is an economical and readily available energy o Vertical movement: This enables the robot to take its end-
source. effector to different heights.
- This makes the installation of robots that use pneumatic actuator drives - These degrees of freedom, independently or in combination with others,
easier and less costly than that of hydraulic robots. define the complete motion of the end-effector.
- For lightweight pick-and-place applications that require both speed and - These motions are accomplished by movements of individual joints of
accuracy, a pneumatic robot is potentially a good choice. the robot arm. The joint movements are basically the same as relative
- Pneumatic actuator drives work at high speeds and are most useful for motion of adjoining links.
small-to-medium loads. - Depending on the nature of this relative motion, the joints are classified
- They are economical to operate and maintain and can be used in as prismatic or revolute.
explosive atmospheres. o Prismatic joints: In a prismatic joint, also known as a sliding
- However, since air is compressible, precise placement and positioning or linear joint (L), the links are generally parallel to one. They
require additional components to achieve the smooth control possible permit links to move in a linear relationship. They are called
with a hydraulic system. prismatic because the cross section of the joint is considered as
- It is also difficult to keep the air as clean and dry as the control system a generalized prism. The variation are
requires.  Linear joint (L)
- Robots that use pneumatic actuator drives are noisy and vibrate as the  Orthogonal joint (O)
air cylinders and motors stop.

Shape of the Work Envelope


- Robots come in many sizes and shapes. The type of coordinate system
used by the manipulator also varies. o Revolute joints permit only angular motion between links. Their
- The type of coordinate system, the arrangement of joints, and the length variations include:
of the manipulator’s segments all help determine the shape of the work  Rotational joint (R)
envelope.  Twisting joint (T)
- The joints of a robot are designed to enable the robot to move its end-  Revolving joint (V)
effector along a path from one position to another as desired.
- To identify the maximum work area, a point on the robot’s wrist is used,
rather than the tip of the gripper or the end of the tool bit.
- Therefore, the work envelope is slightly larger when the tip of the tool is
considered.
- Rotational joint (R) is identified by its motion, rotation about an axis
Robotic Joints perpendicular to the adjoining links. Here, the lengths of adjoining links
- A robot joint is a mechanism that permits relative movement between do not change but the relative position of the links with respect to one
parts of a robot arm. another changes as the rotation takes place.
- The basic movements required for a desired motion of most industrial - Twisting joint (T) is also a rotational joint, where the rotation takes
robots are: place about an axis that is parallel to both adjoining links.
o Rotational movement: This enables the robot to place its arm - Revolving joint (V) is another rotational joint, where the rotation takes
in any direction on a horizontal plane. place about an axis that is parallel to one of the adjoining links. Usually,
ROBINSONKIPROTICH 68
Microcontrollers
the links are aligned perpendicular to one another at this kind of joint. Disadvantages:
The rotation involves revolution of one link about another. • Requires large operating volume.
• Exposed guiding surfaces require covering in corrosive or dusty
Physical Configuration environments.
- Four basic configurations are identified with most of the commercially • can only reach front of itself
available industrial robots • axes hard to seal
1. Cartesian configuration
2. Cylindrical configuration 2. Cylindrical Configuration
3. Polar configuration - In this configuration, the robot body is a vertical column that swivels
4. Joint-arm configuration about a vertical axis.
- The arm consists of several orthogonal slides which allow the arm to be
1. Cartesian Configuration moved up or down and in and out with respect to the body.
- A robot which is constructed around this configuration consists of three - Robots with cylindrical configuration have one rotary (R) joint at the
orthogonal slides; the three slides are parallel to the x, y, and z axes of base and linear (L) joints succeeded to connect the links i.e. 2 prismatic
the Cartesian coordinate system i.e. with 3 prismatic joints (linear joints joints and one rotary joint.
(L).

- By appropriate movements of these slides, the robot is capable of - These robots are commonly used for:
moving its arm at any point within its three dimensional rectangularly • handling at die-casting machines
spaced work space. Gantry robots are Cartesian robots (LLL). • assembly operations
- These robots are commonly used for: • handling machine tools
• pick and place work • spot welding
• assembly operations
• handling machine tools Advantages:
• arc welding • can reach all around itself
• rotational axis easy to seal
Advantages: • relatively easy programming
• Ability to do straight line insertions into furnaces. • rigid enough to handle heavy loads through large working space
• Easy computation and programming. • good access into cavities and machine openings
• Most rigid structure for given length.

ROBINSONKIPROTICH 69
Microcontrollers
Disadvantages: Articulated robots
• can't reach above itself - Those with the designation TRR are also called articulated robots. An
• linear axes is hard to seal articulated robot more closely resembles the human arm. These robots
• won’t reach around obstacles have at least 3 rotary joints.
• exposed drives are difficult to cover from dust and liquids

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.
- Thus, the polar robots have a work space of spherical shape and the
arm is connected to the base with a twisting (T) joint and rotatory (R)
and linear (L) joints follow. - They are commonly used for:
- Robot with 1 prismatic joint and 2 rotary joints – the axes consistent with • assembly operations
a polar coordinate system. • welding
• weld sealing
• spray painting
• handling at die casting or fettling machines

Advantages:
• all rotary joints allows for maximum flexibility
• any point in total volume can be reached.
• all joints can be sealed from the environment.

Disadvantages:
• Extremely difficult to visualize, control, and program.
- The designation of the arm for this configuration can be TRL or TRR. • Restricted volume coverage.
Robots with the designation TRL are also called spherical robots. This • low accuracy
robots are commonly used for:
• handling at die casting or fettling machines 4. Jointed-arm configuration
• handling machine tools - This is combination of cylindrical and
• arc/spot welding articulated configurations. This is similar in
Advantages: appearance to the human arm.
• Large working envelope. - The arm consists of several straight members
• Two rotary drives are easily sealed against liquids/dust. connected by joints which are analogous to
Disadvantages: the human shoulder, elbow, and wrist.
• Complex coordinates more difficult to visualize, control, and - The robot arm is mounted to a base which
program. can be rotated to provide the robot with the
• Exposed linear drive. capacity to work within a quasi-spherical
• low accuracy. space.
ROBINSONKIPROTICH 70
Microcontrollers
5. SCARA (Selective Compliance Articulated Robot Arm) Robots
- This is similar to jointed-arm robot except that vertical axes are used for
shoulder and elbow joints to be compliant in horizontal direction for
vertical insertion tasks.
- The robot has at least 2 parallel rotary joints.
- They are commonly used for:
• pick and place work
• assembly operations

Advantages:
• high speed.
• height axis is rigid
• large work area for floor space
• moderately easy to program.

Disadvantages:
• limited applications.
• 2 ways to reach point
• difficult to program off-line
• highly complex arm a) LRL robot, b) RRL robot, c) TRL robot, d) LVL robot

Question
Sketch following manipulator configurations
(a) TRT:R, (b) TVR:TR, (c) RR:T.

Solution:

R
R
T T R
R T
R
R V

T T

(a) TRT:R (b) TVR:TR (c) RR:T

ROBINSONKIPROTICH 71
Microcontrollers
Motion System (Robot Control Systems)
1. Point-to-point (PTP) control robot
- This is capable of moving from one point to another point. The locations
are recorded in the control memory.
- PTP robots do not control the path to get from one point to the next
point.
- Common applications include component insertion, spot welding, hole
drilling, machine loading and unloading, and crude assembly
operations.

2. Continuous-path (CP) control robot


- The CP robot is capable of performing movements along the controlled
path. With CP from one control, the robot can stop at any specified point
along the controlled path.
- All the points along the path must be stored explicitly in the robot's
control memory.
- Applications Straight-line motion is the simplest example for this type of
robot. Some continuous-path controlled robots also have the capability
to follow a smooth curve path that has been defined by the programmer.
- In such cases the programmer manually moves the robot arm through
the desired path and the controller unit stores a large number of
individual point locations along the path in memory (teach-in).
- Typical applications include spray painting, finishing, gluing, and arc
welding operations.

3. Controlled-path robot
- In controlled-path robots, the control equipment can generate paths of
different geometry such as straight lines, circles, and interpolated
curves with a high degree of accuracy.
- Good accuracy can be obtained at any point along the specified path.
- All controlled-path robots have a servo capability to correct their path.
- Only the start and finish points and the path definition function must be
stored in the robot's control memory.
- It is important to mention that all controlled-path robots have a servo
capability to correct their path.

4. Intelligent control robot


- This exhibits behavior that makes it seem intelligent, e.g., responds to
sensor inputs, makes decisions, communicates with humans

ROBINSONKIPROTICH 72
Microcontrollers

ROBINSONKIPROTICH 73
Microcontrollers

ROBINSONKIPROTICH 74
Microcontrollers

ROBINSONKIPROTICH 75
Microcontrollers

ROBINSONKIPROTICH 76
Microcontrollers

ROBINSONKIPROTICH 77
Microcontrollers

ROBINSONKIPROTICH 78
Microcontrollers

ROBINSONKIPROTICH 79
Microcontrollers

ROBINSONKIPROTICH 80
Microcontrollers

ROBINSONKIPROTICH 81
Microcontrollers

ROBINSONKIPROTICH 82
Microcontrollers

ROBINSONKIPROTICH 83
Microcontrollers

ROBINSONKIPROTICH 84
Microcontrollers

ROBINSONKIPROTICH 85
Microcontrollers

ROBINSONKIPROTICH 86
Microcontrollers

5. Classified on the Basis of Architecture


ROBINSONKIPROTICH 87
Microcontrollers
Harvard Architecture
- Microcontrollers based on the Harvard Architecture have separate data
bus and an instruction bus. This allows execution to occur in parallel.
- As an instruction is being “pre-fetched”, the current instruction is
executing on the data bus. Once the current instruction is complete, the
next instruction is ready to go.
- This pre-fetch theoretically allows for much faster execution than Von-
Neuman architecture, on the expense of complexity.
- The Harvard Architecture executes instructions in fewer instruction
cycles than the Von-Neuman architecture.
- For example, the Intel MCS-51 family of microcontrollers and PIC
microcontrollers uses Harvard Architecture.
- The same instruction (as shown under Von-Newman architecture)
would be
executed as follows:
Cycle 1: - Complete previous instructio
- Read the “Move Data to Accumulator” instruction
Cycle 2: - Execute “Move Data to Accumulator” instruction
- Read next instruction
Hence each instruction is effectively executed in one instruction cycle.

ROBINSONKIPROTICH 88

You might also like