Programmable Logic Controllers PLCs Ladder Implementation of Sequence
Programmable Logic Controllers (PLCs) Ladder Implementation of Sequence Generators • • • ACOE 347 Counters as Sequence Generators Arbitrary Sequence Generators with different state durations Sequence Generators 1
Positive Edge Detection ACOE 347 Sequence Generators 2
A modulo-4 up counter • The counter should increment on each false-to-true transition of the input switch. Present State ACOE 347 Next State Excitation Simplified O 1 O 0 D 1 D 0 0 0 0 1 U L - L 0 1 1 0 L U 1 0 1 1 L L - L 1 1 0 0 U U Sequence Generators 3
A modulo-4 up counter (Ladder Diagram) Positive Edge Detection If Present St. =00 then Next St. =01 Latch O 0 (O 1 remains 0) If Present St. =01 then Next St. =10 Latch O 1 and Unlatch O 0 If Present St. =10 then Next St. =11 Latch O 0 (O 1 remains 0) If Present St. =11 then Next St. =00 Unlatch O 1 and Unlatch O 0 Count Up Next State (NS) Present State (PS) ACOE 347 Sequence Generators 4
A modulo-4 up counter (Free Running, frequency – scan frequency) • The counter should increment at the frequency of the PLC scan cycle, only if the input switch is closed. Present State Next State Excitation Simplified O 1 O 0 D 1 D 0 0 0 0 1 U L - L 0 1 1 0 L U 1 0 1 1 L L - L 1 1 0 0 U U ACOE 347 Sequence Generators 5
A modulo-4 up counter (Free Running, frequency – scan frequency) Generate Clock pulse If Present St. =00 then Next St. =01 Latch O 0 (O 1 remains 0) If Present St. =01 then Next St. =10 Latch O 1 and Unlatch O 0 If Present St. =10 then Next St. =11 Latch O 0 (O 1 remains 0) If Present St. =11 then Next St. =00 Unlatch O 1 and Unlatch O 0 Clock Count Enable Next State (NS) Present State (PS) ACOE 347 Sequence Generators 6
Modulo-4 counter with 0. 25 Hz frequency • The counter should increment at a 0. 25 Hz frequency, only if the input switch is closed. Generate Clock pulse (f=0. 25 Hz) If Present St. =00 then Next St. =01 Latch O 0 (O 1 remains 0) If Present St. =01 then Next St. =10 Latch O 1 and Unlatch O 0 If Present St. =10 then Next St. =11 Latch O 0 (O 1 remains 0) If Present St. =11 then Next St. =00 Unlatch O 1 and Unlatch O 0 ACOE 347 Sequence Generators 7
Mod-4 simplified • To simplify the ladder diagram – Modify rungs to have only one output – Group together all rungs that Latch (Unlatch) the same output – Replace a group of rungs with a single one, removing the inputs that appear as both Check if Open and Check-if-Closed (X + X’ = 1) ACOE 347 Sequence Generators 8
Mod-4 Formal Design • A formal way for obtaining the ladder diagram is by using the excitation table of the SR latch ON ON+1 L U 0 0 0 X 0 1 1 0 0 1 1 1 X 0 Present St. 01 10 00 11 Next State Excitation (Set/Reset) O 1 O 0 L 1 U 1 L 0 U 0 0 1 0 X 1 0 0 1 1 X 0 1 1 0 0 0 1 ACOE 347 Sequence Generators 9
Examples • Design a 2 -bit Gray Code generator (0 1 3 2) with a 4 second time delay between states ON ON+1 L U 0 0 0 X 0 1 1 0 0 1 1 1 X 0 Present St. 01 11 00 10 Next State Excitation (Set/Reset) O 1 O 0 L 1 U 1 L 0 U 0 0 1 0 X 1 0 0 1 1 0 X 0 1 0 X 1 1 1 0 X 0 0 1 ACOE 347 Sequence Generators 10
Sequence Generators (with varying delays between states) Present State Next State Excitation O 2 O 1 O 0 D 2 D 1 D 0 0 1 0 0 L - - 1 0 0 1 1 0 - L - 1 1 0 1 1 1 - - L 1 1 1 0 0 0 U U U ACOE 347 Sequence Generators 11
- Slides: 11