Você está na página 1de 55

DAE 32003

Industrial Electronics
NOR FAEZAH ADAN
Jabatan Kejuruteraan Elektrik, PPD
PROGRAMMABLE LOGIC
CONTROLLER
(PLC)
What is Programmable Logic Controller?

A Programmable Logic Controller is a


microprocessor based system which uses a
programmable memory for implementing specific
functions such as logic, sequencing, timing,
counting and arithmetic to control various types
of machines or processes through analog or
digital input / output modules.
PLC applications
Basic PLC components

1. Processor

2. Memory unit

3. Power supply

4. I/O module

5. Programming
device
Basic PLC components
Typical PLC cabinet at
site
You might ask why not simply wire the switch to the light - and you might be
able to do that in some situations, but let's assume the switch must use low
voltage DC, and the stack light requires 110VAC. Now we have an application
where a relay might be used, and since a PLC is basically a collection of relays -
we can use a PLC!
PLC operations
1. A PLC monitors inputs, makes decisions based on its program,
and controls outputs to automate a process or machine.
2. The operation of the PLC system is simple and straightforward.
The processor or CPU completes three processes:
(1) Scans, or reads from the input devices,
(2) Executes or "solves" the program logic &
(3) Updates or writes to the output devices.

SCAN TIME
The scan time is a continuous and sequential process of reading the
status of inputs, evaluating the control logic and updating the
outputs. Scan time varies from 1msec to 30msec.
SCAN TIME
The scan time is a continuous and sequential process of reading the
status of inputs, evaluating the control logic and updating the
outputs. Scan time varies from 1msec to 30msec.
PLC advantages
PLCs are similar to computer but have certain features which are
specific to their use as controller. These are:

1. They are rugged and designed to withstand vibrations,


temperature, humidity, and noise.

2. The interfacing for inputs and outputs is inside the controller.

3. Easily programmed and easily understood programming


language.
Mnemonic code
Mnemonic code
Mnemonic code examples
Mnemonic code examples
Mnemonic code examples
Activity
Convert the ladder diagram to mnemonic code

Answer
Activity
Convert the ladder diagram to mnemonic code

Answer
Activity
Convert the ladder diagram to mnemonic code
Hardware configuration of PLC
Hardware configuration of PLC

Lab training
set
Methods to upload programs to PLC

OMRON
CQM1H Programming
console

Programming
software:
CX programmer
MEMORY MAP / ADDRESS
OMRON
CQM1H

Lab training set


PLC instructions
1. Timer Ladder diagram structure
2. Counter
3. Move
4. Compare
5. Add & Sub
6. Keep
7. Difu & Difd
Timer / Counter address is
PLC instruction: TIMER from TIM 000 - 511

TIM
• Require a TIM number and a set value (SV).
• For Omron CQM1H, SV must be between
#0000 and #9999.
• Value of parameter SV is multiplied by 0.1s,
the result being total time in seconds.
PLC instruction : TIMER Timer / Counter address is
from TIM 000 - 511
PLC instruction : TIMER Timer / Counter address is
from TIM 000 - 511

Mnemonic code
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511

CNT
• Require a CNT number and a set value
(SV).
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511

CNTR(12)
• Require a CNT number and a set value
(SV).
• Can count up, down and reset function.
• CNTR is a reversible counter where
both up count and down count can be
down by the same counter
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511

00004 Mnemonic code


CP
LD 00004
00002 CNT 007 LD 00002
CNT 007
#10 #10
LD CNT 007
OUT 10010
CNT 007
10010 (siren)

END
Activity – Timer & Counter
An incoming bar for a parking lot will raise up for 20 seconds
when sensor 1 detects an incoming car. After passing the bar,
sensor 2 will start count up the number of cars that parks in the
parking lot. At the exit sensor 3 will deduct out going cars from
the parking lots. If at one time the number of cars in the parking
lot is 20 then the full sign light will be on.

Incoming Sensor 1

Sensor 3
Sensor 2

Outgoing
Activity – Timer & Counter
: MOVE
PLC instruction

MOV(21)
To move a data from one channel to another channel.

S : Source Channel
IR,SR,AR,DM,HR,TC,LR,#
D : Destination channel
IR,AR,DM,HR,LR
P_On MOV (21) Transfer data from
000 channel 000 to 100
100

Source input Channel 000 Destination Output Ch 100


Example
Display Error Code of Machine To Aid Tracing Source Of Problem.

Using MOV(21) instruction design :


• Activation of error input signal 00001 to 00003 will sound an
alarm and at the same time display the error code.
• Input 00006 will reset the error code displayed after machine
recovery from error.
00001
RED LIGHT
Alarm
10000
00002

00003

00001
MOV(21)
#0001 Alarm Code #1
101

00002 MOV(21) Alarm Code #2


#0002
101

00003 MOV(21)
#0003 Alarm Code #3
101

00006
MOV(21) Reset Alarm
#0000 Code Display
101

END
: COMPARE
PLC instruction

CMP(20)
Compare is used to compare the data in a specific channel with
the data in another channel or a four-digit hexadecimal constant.
Cp1: First Compare Word
CMP(20)
IR,SR,AR,DM,HR,TC,LR,#
Cp1
Cp 2: Second Compare Word
Cp2
IR, AR, DM, HR, LR
Example
ADDR OP CODE DATA
25313 TR0
0000 LD 25313
CMP(20) 0001 OUT TR0
#0020 0002 CMP (20)

HR1 #0020

25507 ( < ) HR1


10001 Green
Light 0003 AND 25507
0004 OUT 10001
25506 ( = )
Red Light 0005 LD TR 0
10002
0006 AND 25506
0007 OUT 10002
PLC instruction : ADD
ADD(30)
To add data in two different channel.

Au: Augend Channel


IR,SR,AR,DM,HR,TC,LR,#
ADD(30)
Au Ad: Addend Channel
Ad IR,SR,AR,DM,HR,TC,LR,#
R
R: Result

IR,AR,DM,HR,LR
Example
ADD(30) ADDR OP CODE DATA
00007 0000 LD 00007
HR000
#1234 0001 ADD(30)
0002 HR000
HR000
#1234
HR000
1. The operation:
0003 END(01)
HR000 #0001
#1234

HR000 #1235
2. Add #0001 + #1234 = #1235
3. The result:
HR000 #1235
: SUBTRACT
PLC instruction

SUB(31)
To subtract data in two different channel.

Mi: Minuend Channel


IR,SR,AR,DM,HR,TC,LR,#
SUB(31)
Mi Su: Subtrahend Channel
Su IR,SR,AR,DM,HR,TC,LR,#
R
R: Result

IR,AR,DM,HR,LR
Example
SUB(31) ADDR OP CODE DATA
00007 0000 LD 00007
HR000
#1234 0001 SUB(31)
0002 HR000
HR000
#1234
HR000
1. The operation:
0003 END(01)
HR000 #3234
#1234

HR000 #2000
2. Sub #3234 + #1234 = #2000
3. The result:
HR000 #2000
PLC instruction: KEEP
KEEP(11)
• To replace normal latching.
• Has two input, set and reset.
• Better use HR so the output retain even though power fails.

Set =00000
KEEP (11)

Reset=00001 IR/Output
Port/HR

END
PLC instruction : DIFFERENTIATE UP
DIFU(13)
DIFU turns its output ON when it
detects an OFF to ON transition in its
input signal.
: DIFFERENTIATE DOWN
PLC instruction

DIFD(14)
DIFD turns its output ON when it
detects an ON to OFF transition in its
input signal or from HIGH to LOW
signal .
Exercise 1
Replace CNT with ADD and SUB.

A simple car park control system allows only a maximum of 30


cars parking spaces. Every time a car comes in, an incoming
sensor will add 1 and any car that goes out an outgoing sensor
will deduct 1. If the car park is occupied with 30 cars at one time,
a full sign will be lighted up to inform there is no vacancy.
Answer
Exercise 2
Use KEEP instruction to solve these problems instead of normal
latching.
A sensor is placed outside yellow line that enclosed the robot to
provide safety cautions to the user. If the sensor detects
someone crossing the yellow line the robot will automatically
stop its operation and the siren will on until a reset button is
pressed. Then the push button need to be pressed for robot to
run again.
sensor

YELOW LINE

ROBOT

sensor sensor
Answer
Exercise 3
Use DIFU and DIFD to solve the problem.

An automatic home garage is equipped with sensor 1, S1, that


detects the approaching car and will open the garage until
sensor 2, S2,detects the whole car body has safely parks inside
the garage.

S2

S1

Garage Door
Answer

Você também pode gostar