Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Mechatronics.pdf
Скачиваний:
81
Добавлен:
23.08.2013
Размер:
5.07 Mб
Скачать

page 325

keycard entry

 

light

 

 

 

 

 

 

 

 

 

 

 

 

gate

cars enter/leave

car detector

 

 

 

 

 

 

 

 

 

-the gate will be raised by one output and lowered by another. If the gate gets stuck an over current detector will make a PLC input true. If this is the case the gate should reverse and the light should be turned on indefinitely.

-if a valid keycard is entered a PLC input will be true. The gate is to rise and stay open for 10 seconds.

-when a car is over the car detector a PLC input will go true. The gate is to open while this detector is active. If it is active for more that 30 seconds the light should also turn on until the gate closes.

23.2 FLOW CHARTS

Good when the PLC only does one thing at a time in a predictable sequence.

Basically, we can follow a flowchart one step at a time. Connecting lines indicate the sequences, and the shapes indicate the action/function.

page 326

Start/Stop

Operation

Decision

I/O

Disk/Storage

Subroutine

• The real advantage is in modeling the process in an orderly manner.

page 327

START

Reset all values off

start button pushed?

no

 

 

 

yes

 

 

Open inlet valve

 

 

Close outlet valve

 

 

 

yes

Open outlet valve

Is tank full?

 

 

Close inlet valve

 

 

no

 

 

stop button pushed?

yes

 

 

 

no

 

 

General rules for putting these together are,

-determine what the major actions are, these become the boxes.

-determine what sequence the actions normally follow, this determines the lines between elements.

-determine where the sequence may change, these become the decision diamonds.

The flowchart from the previous example can be converted to ladder logic. The first step is to name each state. From there the states can be converted to ladder logic using MCR blocks.

page 328

ASIDE: We will use MCR instructions to implement some of the state based programs. This allows us to switch off part of the ladder logic. The one significant note to remember is that any normal outputs (not latches, timers, etc.) will be FORCED OFF. Unless this is what you want, put the normal outputs outside MCR blocks.

A

MCR

If A is true then the MCR will cause the ladder in between to be executed. If A is false it is skipped.

MCR

page 329

STEP 1: Add labels to each block in the flowchart

START

F1

Reset all values off

 

F2

 

 

 

start button pushed?

no

 

 

 

 

F3

yes

 

 

 

 

 

 

Open inlet valve

 

 

 

Close outlet valve

 

 

 

 

 

F6

F4

Is tank full?

yes

Open outlet valve

 

 

 

 

Close inlet valve

 

 

 

 

no

 

 

F5

 

 

 

 

stop button pushed?

yes

 

 

 

 

 

no

 

 

page 330

STEP 2: Write ladder logic to force the PLC into the first state

first scan

F1

L

F2

U

F3

U

F4

U

F5

U

F6

U

STEP 3: Write ladder logic for each function in the flowchart

F1

MCR

outlet

U

inlet

U

F1

U

F2

L

MCR

page 331

F2

MCR

start

F2

U

F3

L

MCR

F3

MCR

outlet

U

inlet

L

F3

U

F4

L

MCR

page 332

F4

 

MCR

 

U

F4

 

tank full

F6

L

 

tank full

F5

L

 

MCR

 

F5

 

MCR

 

U

F5

 

stop

F6

L

 

stop

F4

L

 

MCR

 

page 333

F6

MCR

outlet

L

inlet

U

F6

U

F2

L

MCR

• For practice,

page 334

Draw a flow chart for cutting the grass, then develop ladder logic for three of the actions/ decisions.

Соседние файлы в предмете Электротехника