Anda di halaman 1dari 12

1

Discrete Control
MCS361 Mechatronics Instrumentation
Ittichote Chuckpaiwong, Ph.D.
Department of Mechanical, Mahidol University
State Transition Diagram (STD)
and State Transition Table
State transition diagrams and state transition
table show transitions between states, and
actions.
S1 S2 S2
S2 S1 S1
0 1 State \ Event
1 0 S2
0 1 S1
S2 S1 Current \ Next
State transition diagram
State transition table
2
State Transition Diagram (STD)
and State Transition Table
Open Close S2
Close Open S1
S2 S1 Current \ Next
State transition table
State transition diagram
Relay Controller Example #1
Input devices: Switch S1
Output devices: Motor
Number of state variables = 2
Number of states = 2
2
= 4
#1 : S1 closed, motor off
#2 : S1 opened, motor off
#3 : S1 closed, motor on
#4 : S1 opened, motor on
E1 : Switch S1 is pressed
E2 : Switch S2 is released
3
Relay Controller Example #1
#1 : S1 opened, motor off
#2 : S1 closed, motor off
#3 : S1 opened, motor on
#4 : S1 closed, motor on
E1 : Switch S1 is pressed
E2 : Switch S2 is released
- - - E2 #4
- - - - #3
- - - - #2
E1 - - - #1
#4 #3 #2 #1 Current \ Next
State transition table
Relay Controller Example #1
Motor on
(#4)
Motor off
(#1)
Press s1 (E1)
Release s1 (E2)
State transition diagram
- - - E2 #4
- - - - #3
- - - - #2
E1 - - - #1
#4 #3 #2 #1 Current \ Next
State transition table
4
Ladder diagram Elements
Output devices
Input devices Relays
Ladder Diagram of Example #1
5
Experiment on LADSIM
OP0 =RL1 (Relay)
OP1 =M (Motor)
IP0 =S1 (NO)
Modified Example #1:
On-Delay 5 sec
Activate the motor after the switch is
pressed for 5 sec.
6
Modified Example #1:
Count 5
Activate the motor after the switch is
pressed 5 times
Relay Controller Example #2
L1 on
L2 off
L1 off
L2 on
Press PB1
Press PB2
Release PB1 Release PB2
Not quite complete!
7
Relay Controller Example #2
L1 off
L2 on
PB1 released
PB2 released
Press PB1
Press PB2
Release PB1
Release PB2
L1 on
L2 off
PB1 pressed
PB2 released
L1 on
L2 off
PB1 released
PB2 released
L1 off
L2 on
PB1 released
PB2 pressed
Press PB2
L1 off
L2 on
PB1 pressed
PB2 pressed
Complete? What if we press PB2 first?
Release PB1
Release PB2
Ladder Diagram of Example #2
8
Experiment for Example #2
OP0 =RL1
OP1 =L1 (Red)
OP2 =L2 (Green)
IP0 =PB1 (NO)
IP1 =PB2 (NC)
Ladder Diagram of Example #3
Requirements:
Hit START, move to down position
Hit STOP, stop immediately
Hit UP, move up
Hit DOWN, move down
Output elements
M1, M2
Input elements
LS1, LS2, START, STOP, UP, DOWN
9
Ladder Diagram of Example #3
STD for Example #3
PB1 =0
PB2 =0
PB3 =0
PB4 =0
Press-release
PB1 (START)
LS1 =0
LS2 =0
M1 =0
M2 =0
PB1 = 0
PB2 =0
PB3 =0
PB4 =0
LS1 =0
LS2 =0
M1 =0
M2 = 1
Press-relase
PB2 (STOP)
Hit bottom (LS2)
PB1 =0
PB2 =0
PB3 =0
PB4 =0
LS1 =0
LS2 = 1
M1 =0
M2 = 0
Hit top (LS1)
PB1 =0
PB2 =0
PB3 = 0
PB4 =0
LS1 =0
LS2 = 0
M1 = 1
M2 =0
Press-release
PB3 (UP)
PB1 =0
PB2 =0
PB3 =0
PB4 =0
LS1 = 1
LS2 =0
M1 = 0
M2 =0
Press-release
PB4 (DOWN)
10
Experiment for Example #3
Define variables
IP0 =PB1 (START)
IP1 =PB2 (STOP)
IP2 =PB3 (UP)
IP3 =PB4 (DOWN)
IP4 =LS1 (UP)
IP5 =LS2 (DOWN)
OP0 =M1
OP1 =M2
Discrete-State Controllers
Relay sequencer or relay logic panel
Hard-wired programming
Simultaneous and continuous
Programmable Logic Controller (PLC)
Processor, input & output modules
Not simultaneous nor continuous
11
PLC Operation
PLC Operations
I/O Scan Mode
Execution Mode
Scan Time
Typically 5-20 ms
PLC Software Functions
Control relays
Counters
Timers
Simple (a)
Accumulating (b)
Special functions
One-shot
ADC
etc.
12
Exercise 1
Use the Traffic Lightsimulator in the
program LABSIM3 to design a controller of
the automatic traffic light system.
Green 5 sec Amber
Amber 1 sec Red
Red 5 sec Green
Exercise 2
Use the Car Parksimulator in the
program LABSIM3 to design a controller of
the automatic car park system.