Professional Documents
Culture Documents
UNIT IV-COntroller and Algorithms PDF
UNIT IV-COntroller and Algorithms PDF
MICROPROCESSORS
MICROCONTROLLERS
PROGRAMMABLE LOGIC CONTROLLERS
ARTIFICIAL NEURAL NETWORKS
FUZZY LOGIC CONTROLLERS
25-12-2019 HITS-II-BMS-RMKP 2
OUTCOMES
Students are able to
Describe the basic structure and architecture of the microprocessor and micro
controllers and how they can be applied in mechatronic system design
Describe the basic structure of the Programmable logic controller (PLC) and
appreciate its uses in mechatronic system design
Discuss the use of Artificial Neural Networks and Fuzzy logics as control
algorithms in mechatronic systems.
25-12-2019 HITS-II-BMS-RMKP 3
Why do we need to learn
Microprocessors/controllers?
• The microprocessor is the core of computer systems.
25-12-2019 HITS-II-BMS-RMKP 4
INTRODUCTION
25-12-2019 HITS-II-BMS-RMKP 5
DIAGRAM OF A COMPUTER SYSTEM
A computer is a programmable machine that receives input, stores
and manipulates data/information, and provides output in a useful
format.
MEM ORY
INPUT-OUTPUT
CONTROL
DATAPATH
CPU
Processor System Architecture
The typical processor system consists
of:
25-12-2019 HITS-II-BMS-RMKP 9
Bus and CPU
25-12-2019 HITS-II-BMS-RMKP 10
Memory and I/O
Memory: Where instructions (programs) and data are stored
• Organized in arrays of locations (addresses), each storing
one byte (8 bits) in general
• A read operation to a particular location always returns the
last value stored in that location
25-12-2019 HITS-II-BMS-RMKP 11
8085 Microprocessor Architecture
The 8085 Bus Structure
The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates with the
other units using a 16-bit address bus, an 8-bit data bus and a control bus.
The 8085 Bus Structure
Address Bus
Consists of 16 address lines: A0 – A15
Control Bus
Consists of various lines carrying the control
signals such as read / write enable, flag bits.
The 8085: CPU Internal Structure
Serial
I/O Timer COM
Port
Port
17
25-12-2019 HITS-II-BMS-RMKP
Microcontroller
18
25-12-2019 HITS-II-BMS-RMKP
Microprocessor vs. Microcontroller
Microprocessor Microcontroller
• CPU is stand-alone, RAM, ROM,
I/O, timer are separate • CPU, RAM, ROM, I/O and timer are
all on a single chip
• designer can decide on the
amount of ROM, RAM and I/O • fixed amount of on-chip ROM,
ports. RAM, I/O ports
• expensive • for applications in which cost,
• versatility power and space are critical
• general-purpose • single-purpose (control-oriented)
• High processing power • Low processing power
• High power consumption • Low power consumption
• Instruction sets focus on • Bit-level operations
processing-intensive operations • Instruction sets focus on control
• Typically 32/64 – bit and bit-level operations
• Typically deep pipeline (5-20 • Typically 8/16 bit
stages) • Typically single-cycle/two-stage
19
25-12-2019 HITS-II-BMS-RMKP
pipeline
Intel 8051 Basic Component
• 4K bytes internal ROM
• 128 bytes internal RAM
• Four 8-bit I/O ports (P0 - P3).
• Two 16-bit timers/counters
• One serial interface
CPU RAM ROM
A single chip
I/O Serial Microcontroller
Timer COM
Port
Port
20
25-12-2019 HITS-II-BMS-RMKP
Block Diagram of General Microcontroller
External Interrupts
CPU
OSC Bus
4 I/O Ports Serial
Control
P0 P2 P1 P3 TXD RXD
21
25-12-2019 Addr/Data
HITS-II-BMS-RMKP
Other 8051 features
• only 1 On chip oscillator (external crystal)
• 6 interrupt sources (2 external , 3 internal, Reset)
• 64K external code (program) memory(only read)PSEN
• 64K external data memory(can be read and write) by RD,WR
• Code memory is selectable by EA (internal or external)
• We may have External memory as data and code
22
25-12-2019 HITS-II-BMS-RMKP
8051 Internal architecure
23
25-12-2019 HITS-II-BMS-RMKP
Selection of Microcontroller
- Factors to be considered
No of Input / Output Pins. I.e. No. of I/O’s needed for the task
concerned
Interface required. Ex. PWM is needed for motor control
Memory requirement – Size of the memory for the task
No. of Interrupts – based on no. of critical events need to be
serviced
Processing Speed
24
25-12-2019 HITS-II-BMS-RMKP
Simple Temperature Measurement System using
Microcontroller
26
25-12-2019 HITS-II-BMS-RMKP
Programmable Logic Controllers
(PLC)
Programmable Logic Controllers
• PLC – microprocessor based system used to control
machines and processes
• Stores instructions in a programmable memory
• Implements functions or set of rules
• Logics
• Sequencing
• Timing
• Counting
• Arithmetic etc..
25-12-2019 HITS-II-BMS-RMKP 28
PLC – Basics – Introduction (contd.)
25-12-2019 HITS-II-BMS-RMKP 29
PLC – Basics – Introduction (contd.)
25-12-2019 HITS-II-BMS-RMKP 30
PLC – Basics – Introduction (contd.)
25-12-2019 HITS-II-BMS-RMKP 31
PLC – Basic Components
25-12-2019 HITS-II-BMS-RMKP 34
PLC Architecture
25-12-2019 HITS-II-BMS-RMKP 35
PLC Architecture
CENTRAL PROCESSING UNIT (CPU)
• It has the following:
• An Arithmetic and Logic Unit (ALU) that is responsible for data manipulation
and carrying out arithmetic operations of addition and subtraction and logic
operations of AND, OR, NOT, and EXCLUSIVE-OR.
• Memory, termed registers, located within the microprocessor and used to
store information involved in program execution.
• A control unit that is used to control the timing of operations.
MEMORY
• System read-only-memory (ROM) gives permanent storage for the operating
system and fixed data used by the CPU.
• Random-access memory (RAM) is used for the user’s program.
• Random-access memory (RAM) is used for data.
25-12-2019 HITS-II-BMS-RMKP 36
PLC Architecture (contd.)
Control Unit / Processor:
• A control unit is used to control the timing of
operations.
• Analyze the data from the sensors through input
modules and make decisions based on the user
defined functions
• The processor functions under a permanent
supervisory operating system that directs the
overall operations from data input and output to
execution of user programs.
• Controller can perform only one operation at a time.
So, it scans each of the inputs sequentially,
evaluates the ladder diagram program, provide each
output(s), and then repeat the whole process.
• Hence, the timing control's necessary for a PLC
system.
25-12-2019 HITS-II-BMS-RMKP 37
PLC Architecture (contd.)
Control Unit / Processor:
Arithmetic and Logic Unit (ALU):
• Performs data manipulation and arithmetic and logical operations on input
variable data and determines the proper state of the output variables.
• Arithmetic operation includes addition, subtraction etc., and logic operations
include AND, OR, AND, EXCLUSIVE - OR.
Memory Unit:
• Registers located within the microprocessor and used to store information
involved in a program execution, which contains control actions to be executed by
the microprocessor for the given input.
• There are several memory elements in a PLC system.
• System Read-only Memory (ROM) gives permanent storage for the operating
system and fixed data wed by the CPU.
• RAM for the user to develop program and acts a temporary memory.
• In addition, temporary buffer stores
25-12-2019
for the I/O channels.
HITS-II-BMS-RMKP 38
PLC Architecture (contd.)
Memory Unit:
• During entering and editing including Debugging, the program is stored in the
temporary storages called RAM (Random Access memory).
• Once the program is completely finished (free & from errors), It may be 'burned'
into ROM
• When the ROM is plugged into the PLC, the device is ready to be placed into
service in the industrial environment.
• Memory may be either volatile type or Non-volatile type.
Volatile Memory:
• Volatile memory will lose all its programmed contents if operating power is
removed or lost.
Non Volatile Memory: It does not lose its content during power failure.
• Permanent memory or system memory is (used) a system memory that stores
the monitor a booting programs, lookup tables etc.,
• This usually programmed and supplied by the manufacturer and controls the
25-12-2019 HITS-II-BMS-RMKP 39
operation of PLC.
PLC Architecture (contd.)
The Different Types of ROMS are
25-12-2019 HITS-II-BMS-RMKP 40
25-12-2019 HITS-II-BMS-RMKP 41
PLC Architecture (contd.)
BUSES:
25-12-2019 HITS-II-BMS-RMKP 42
PLC Architecture (contd.)
25-12-2019 HITS-II-BMS-RMKP 43
PLC Architecture (contd.)
BUSES:
25-12-2019 HITS-II-BMS-RMKP 44
PLC Architecture (contd.)
INPUT & OUTPUT UNIT
25-12-2019 HITS-II-BMS-RMKP 45
Selection of PLC - Factors to be considered
To determine the most suitable PLC to be used in the automation
task there are several basic considerations to be made:
• Necessary input/output capacity
• Types of I/O required
• Size of memory required
• Speed and power required of the CPU and instruction set
• Communication protocols
• Power supply
25-12-2019 HITS-II-BMS-RMKP 46
Self Study:
– Role as control algorithm in Mechatronic System design
• Artificial Neural Networks (ANN)
• Fuzzy Logic – Role as Control algorithm in Mechatronic
System design
25-12-2019 HITS-II-BMS-RMKP 47