Anda di halaman 1dari 22

# Outline

## Program Scan and Memory Organization

State to Logic Statement Translation
Procedure
An example

## (a) PLC operation

(c) Memory organization
(b) Program sequence
Adapted from Parr, Programmable Controllers (3rd Ed.), Newnes, Burlington, MA, 2003.

## Logic Statements and Ladder Diagrams

A, B, O, are logic variables {1,0}
B=A
NOT A:

C = A B
A AND B:

A OR C
B: = A+B
C = A B
NOT (A AND B):
C = A+B
NOT (A OR B):

inputs,
outputs,
computed,
etc.

Generic State Si
logic for Sm to Si
state transition

logic for Si to Sj
state transition

Sm

Sj

Sn

Si

Sk

transit to Si

Si transits to

"memory" or
all states
all states
"hold" for
that transit
that Si
state Si
to Si
transits to

+ Sn
Si = (Si + Sm
+ )SjSk
logic for
logic for
Sn to Si
Sm to Si
transition
transition

## Generic Logic Statement for State Si

"memory" or
all states
all states
"hold" for
that transit
that Si
state Si
to Si
transits to

+ Sn
Si = (Si + Sm
+ )SjSk
logic for
logic for
Sn to Si
Sm to Si
transition
transition
Generic Logic Statement for Output Oi
Oi = Sp + Sq +
all states where Oi is true (on)

## State to Logic Statement Translation

1) Add dummy states so no state both
directly precedes and follows another
(eliminate bi-directional transitions).
2) Construct a statement for state S1.
3) Before the statement for S1, construct
statements for states succeeding S1.

## 4) Apply step (3) until a statement has

been constructed for each state.
5) Add a statement for each output.

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 (S3 + S2TIMER[2 sec])S1

S2 (S2 + Sd)S1S3
Sd (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 (S3 + S2TIMER[2 sec])S1

S2 (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 (S3 + S2TIMER[2 sec])S1

S2 = (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 = (S3 + S2TIMER[2 sec])S1

S2 = (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 = (S3 + S2TIMER[2 sec])S1

S2 = (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd
MOTOR = S3

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 = (S3 + S2TIMER[2 sec])S1

S2 = (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd
MOTOR = S3
TIMER = S2

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## S3 = (S3 + S2TIMER[2 sec])S1

S2 = (S2 + Sd)S1S3
Sd = (Sd + S1STARTSTOP)S2
S1 = (S1 + S2STOP + S3STOP)Sd
MOTOR = S3
TIMER = S2

computation
cycle

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## direct bi-directional transition

S3 (S3 + S2TIMER[2 sec])S1
S2 (S2 + S1)S1S3

MOTOR S3
TIMER S2

STOP

STARTSTOP

MOTOR = 0
TIMER = 0

STOP
TIMER [2 sec]

MOTOR = 0
TIMER = 1

MOTOR = 1
TIMER = 0

## direct bi-directional transition

S3 (S3 + S2TIMER[2 sec])S1
problem:
S2 (S2 + S1)S1S3
cannot reach S2
S1 (S1 + S2STOP + S 3STOP)S2

MOTOR S3 problem:
TIMER S2 cannot reach S1 from S2

## Elevator controller problem statement

Elevator controller state transition diagram
Dummy states if necessary
State transition diagram to ladder diagram
State transition diagram to logic statement

## Elevator Controller Problem Statement

Use a state diagram to describe an elevator control system
from the time the elevator reaches a floor to when it is

## Elevator Controller Problem Statement

Operation is governed by the following rules:

## It is initially in a state with the doors opening.

When the doors are fully opened, a limit switch is triggered.
The doors should remain open for 10 seconds before closing.
Doors cannot close if the doors open button is active.
Doors cannot close if the door collision switch is active.
While the doors are closing, they must be able to re-open.
Once re-opened, the doors should remain open for 3 seconds.
When the doors are fully closed, a limit switch is triggered.
This should be the final state of your state diagram

SAFETY POINT: At any time if the door collision switch turns on,
the doors must open

## Elevator Controller Problem Statement

Identify the states and draw a state transition
diagram for the elevator control system
Add any dummy states as necessary to