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

page 355

• Consider the state diagram below and implement it in ladder logic. You should anticipate what will happen if both A and C are pushed at the same time.

 

STA

STC

 

 

 

B

D

 

FS

 

 

 

 

 

 

A

C

 

 

 

 

STB

 

 

 

 

 

 

first scan

 

STAon

= STA + STB A + FS

STAoff

= STA B

STBon

= STB + STA B + STC D

STBoff

= STB ( A + C)

 

 

 

 

 

 

STCon

= STC + STB C A

 

STCoff

= STC D

NOTE: The equations are shown here for illustration purposes, but this technique is not suitable because of the parallel branches in the equations.

23.3.1.4 - State Transition Equations

This method deals updates the logic in a single scan, and only has a problem with competing transitions.

This implementation is based upon checking the state activation and deactivation separately.

page 356

First, define state variables and transitions,

 

 

ST1 = state 1 - grn NS

T1

= transition from ST1 to ST2

ST2 = state 2 - yel NS

T2

= transition from ST2 to ST3

 

 

ST3 = state 3 - grn EW

T3

= transition from ST3 to ST4

ST4 = state 4 - yel EW

T4

= transition from ST4 to ST1

 

T5

= transition to ST1 for first scan

Next, write the state entrance and exit condition equations,

 

T4 = ST4 TON2( ST4, 4)

ST1 = ( ST1 + T4 + T5)

 

 

 

T1

 

 

 

 

 

 

 

 

 

 

 

T1 = ST1 S1 S2

 

ST2 = ( ST2 + T1)

T2

 

 

T2

= ST2 TON1( ST2, 4)

ST3 = ( ST3 + T2)

 

 

T3

T3 = ST3

 

S2

ST4 = ( ST4 + T3)

 

 

S1

T4

T5

= FS

 

 

 

 

 

 

page 357

ST4

ST2

CALCULATE TRANSITIONS

ST4 T4:2/DN

ST1 S1 S2

ST2 T4:1/DN

ST3 S1 S2

FS

timer on T4:2 delay 4 sec

timer on T4:1 delay 4 sec

T4

T1

T2

T3

T5

page 358

 

ST1

 

 

 

T1

ST1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST2

 

 

 

T2

ST2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST3

 

 

 

T3

ST3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST4

 

 

 

T4

ST4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

T3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

page 359

 

ST1

 

L1

 

 

 

 

 

 

 

 

 

 

 

 

 

ST2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST4

 

L2

 

 

 

 

 

 

 

 

 

 

 

 

ST3

 

L3

 

 

 

 

 

 

 

 

 

 

 

 

ST3

 

L4

 

 

 

 

 

 

 

 

 

 

 

 

 

ST4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ST2

 

L5

 

 

 

 

 

 

 

 

 

 

 

 

ST1

 

L6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• Consider the state diagram below and implement it in ladder logic. You should anticipate what will happen if both A and C are pushed at the same time.

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