Sample Solution Exercise PLC Programmingplc
Sample Solution Exercise PLC Programmingplc
AS
Industrial gate
WS 10/11
Georg Frey
Informal Specification
AS
The industrial gate is driven by 2 contactors, the gate is driven upward by SchLM1 and is driven downward by SchRM1. To determine the position, two sensors are available. Oben_S30 detects the upper limit position and Unten_S10 senses the lower limit position. There are 2 Buttons available for Human-Machine-Interaction. By pressing the TasterAUF button, the gate is driven upward (open). By pressing the TasterAB button, the gate is driven downward (close). One should be aware, the gate should react on the level changing of the button, i.e. the button need not to be pressed during the opening or closing of the gate. The gate is not designed to be half-opened. To avoid damage to human or material, a light barrier (OptSensor) is provided. If the light barrier senses an object, the gate should be driven upward until it reaches the upper limit position. The gate stops immediately and remains its actual position by pressing the Not-Aus button (Not_Aus). It can not operate until a Reset is taken place.
WS 10/11 3 Georg Frey
AS
Additionally to the simple specification, the gate can be controlled by a remote controller. The remote controller has only one button, it should be considered as a biased switch. The gate should react as following by pressing the button on the remote controller:
It the gate is moving and is not completely opened or closed, then it should move to the opposite direction. If the gate is complete closed, it should be opened. If the gate is complete opened, it should be closed. If the light barrier senses an object, the remote controller has no more function on the gate.
WS 10/11
Georg Frey
AS
WS 10/11
Task
AS
1. Please design a control for the simple specification (without remote controller) 2. Convert your control algorithm to IL 3. Think about test cases to validate your control algorithm. (white box test) 4. Take the remote controller into consideration, add its function to your solution. 5. Convert your control algorithm to IL 6. Think about test cases to validate your control algorithm. (white box test)
WS 10/11
Georg Frey
AS
Calculation of Auxiliary Variables: If !Not_Aus Then EmergencyStopActivated=1 If TasterAUF Then Direction=1 If TasterAB Then Direction=0 Calculation of Outputs If ((Direction | !OptSensor) & Oben_S30 & !EmergencyStopActivated) Then SchLM1=1 Else SchLM1=0 If (!Direction & OptSensor & Unten_S10 & !EmergencyStopActivated) Then SchRM1=1 Else SchRM1=0
WS 10/11
Georg Frey
AS
Task 4 (Informal Controller Design with Remote Control) Calculation of Auxiliary Variables: If !Not_Aus Then EmergencyStopActivated=1 If TasterAUF Then Direction=1 If TasterAB Then Direction=0 If FernSt & !FernStOld & Direction Then Direction = 0 Else If FernSt & !FernStOld & !Direction Then Direction = 1 FernStOld=FernSt Calculation of Outputs If ((Direction | !OptSensor) & Oben_S30 & !EmergencyStopActivated) Then SchLM1=1 Else SchLM1=0 If (!Direction & OptSensor & Unten_S10 & !EmergencyStopActivated) Then SchRM1=1 Else SchRM1=0
WS 10/11 9 Georg Frey
AS
AS
(* set motor for opening gate if condition is fullfilled *) LD TRUE AND (Direction ORN OptSensor ) AND Oben_S30 ANDN EmergencyStopActivated ST SchLM1 (* set motor for closing gate if condition is fullfilled *) LDN Direction AND OptSensor AND Unten_S10 ANDN EmergencyStopActivated ST SchRM1
AS
!Not_Aus OpenGate SchLM1=1 SchRM1=0 EmergencyStop SchLM1=0 SchRM1=0 !Not_Aus !Not_Aus CloseGate SchLM1=0 SchRM1=1
!Not_Aus
OptSensor & (TasterAB | FernSt) & Not_Aus (TasterAUF | FernSt) & Not_Aus (!Unten_S10 & !FernSt&!TasterAUF) & Not_Aus GateClosed SchLM1=0 SchRM1=0
WS 10/11
11
Georg Frey
AS
(* Transition GateOpened -> CloseGate *) LD GateOpened AND (TasterAB OR RisingEdge ) AND OptSensor AND Not_Aus R GateOpened S CloseGate JMPC Continue (* Transition CloseGate -> GateClosed *) LD CloseGate AND TasterAUF ANDN Unten_S10 ANDN RisingEdge ) AND Not_Aus R CloseGate S GateClosed JMPC Continue
AS
Continue:
LD R R
LD R R