State Machines in Ladder Logic Pure relay logic
- Slides: 12
State Machines in Ladder Logic • Pure relay logic - traditional design: – – 2 states = 1 coil 3 -4 states = 2 coils 5 -8 states = 3 coils, etc. difficult to debug, modify and document • Pure relay logic - “one-hot” design – 1 coil per state – easier to debug, modify, and document • RLL-Plus – – “Stages” JMP “coils” easiest to write and maintain not available in all brands of PLC’s
Second Example Revisited /i. SENSOR • i. RET S 0 o. CYL=0 i. SENSOR o. CYL=0 S 2 i. EXT S 1 o. CYL=1
Example #2 State Diagram /i. SENSOR • i. RET S 0 o. CYL=0 i. SENSOR o. CYL=0 S 2 i. EXT S 1 o. CYL=1 c. S 0 = c. S 2 • /i. SENSOR • i. RET + c. S 0 • /i. SENSOR + /c. S 0 • /c. S 1 • /c. S 2 c. S 1 = c. S 0 • i. SENSOR + c. S 1 • /i. EXT c. S 2 = c. S 1 • i. EXT + c. S 2 • /(/i. SENSOR • i. RET) = c. S 1 • i. EXT + c. S 2 • (i. SENSOR + /i. RET)
Example #2 State Diagram /i. SENSOR • i. RET S 0 o. CYL=0 i. SENSOR o. CYL=0 S 2 i. EXT S 1 o. CYL=1 c. S 0 = c. S 2 • /i. SENSOR • i. RET + c. S 0 • /i. SENSOR + /c. S 0 • /c. S 1 • /c. S 2 c. S 1 = c. S 0 • i. SENSOR + c. S 1 • /i. EXT c. S 2 = c. S 1 • i. EXT + c. S 2 • i. SENSOR + c. S 2 • /i. RET)
Ex #2 - RLL-Plus Stages /i. SENSOR • i. RET S 0 o. CYL=0 i. SENSOR o. CYL=0 S 2 i. EXT S 1 o. CYL=1
Multi-state Example • When sensor detects block; clamp block, drill hole, shift, drill 2 nd hole, shift back, release clamp
Inputs and Outputs • • i. SENSOR block present • o. DRILL start drilling i. DRILLDN drill is down • o. CLAMP activate clamp i. DRILLUP drill is up • o. SHIFT shift block i. CLAMPED fully holder clamped • i. RELEASED fully unclamped • i. POS 1 unshifted • i. POS 2 shifted
State Diagrams • One state per “action” • Look for “wait” states needed
State Diagram
RLL-Plus
RLL-Plus
RLL-Plus
- Frame relay layers
- State diagram to ladder logic
- Relay logic gates
- Ladder diagram simulator
- Relay logic controllers
- Metric shuffle ladder
- In an incompletely specified machine
- State machines digital electronics
- Latch and unlatch ladder logic
- Input module
- First order logic vs propositional logic
- First order logic vs propositional logic
- Third order logic