0% found this document useful (0 votes)
138 views

Sample Solution Exercise PLC Programmingplc

The document describes an automated industrial gate controlled by buttons, sensors, and a remote controller. It provides details on the gate components and their functions, and outlines tasks to design and implement a control system for the gate using informal descriptions and ladder logic. The tasks include designing controls for basic gate operation, adding remote control functionality, and developing test cases to validate the control algorithms.

Uploaded by

Imran Al Noor
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views

Sample Solution Exercise PLC Programmingplc

The document describes an automated industrial gate controlled by buttons, sensors, and a remote controller. It provides details on the gate components and their functions, and outlines tasks to design and implement a control system for the gate using informal descriptions and ladder logic. The tasks include designing controls for basic gate operation, adding remote control functionality, and developing test cases to validate the control algorithms.

Uploaded by

Imran Al Noor
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Automation Systems Discrete Event Control Systems and Networked Automation Systems

sample solution to 2nd exersise

Description about the Plant

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

Extended informal specification

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

Applied Signals Table of input signals


Meaning of logic 0 Button is not pressed Button is not pressed Button is pressed Button is not pressed Gate is complete closed Gate is complete open Light beam is obstructed Meaning of logic 1 Button is pressed Button is pressed Button is not pressed Button is pressed Gate is not complete closed Gate is not complete open Light beam is not obstructed

AS

Signal-Name TasterAUF TasterAB Not_Aus FernSt Unten_S10 Oben_S30 OptSensor

Table of output signals


Meaning of logic 0 Motor does not rotates counterclockwise Motor does not rotates clockwise Meaning of logic 1 Motor rotates counter-clockwise (gate moves upward) Motor rotates clockwise (gate moves downward)
Georg Frey

Signal-Name SchLM1 SchRM1

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

Task 1 (Informal Controller Design)

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

Task 2 (Implementation of Informal Design)


(* Check if Emergency-Stop is pressed *) LDN Not_Aus S EmergencyStopActivated (* Check user wants gate to be opened *) LD TasterAUF S Direction (* check if user wants gate to be closed *) LD TasterAB R Direction (* 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
WS 10/11 8 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

Task 5 (Implementation of Informal Design with Remote Control)


(* Check if Emergency-Stop is pressed *) LDN Not_Aus S EmergencyStopActivated (* Check user wants gate to be opened *) LD TasterAUF S Direction (* check if user wants gate to be closed *) LD TasterAB R Direction (* check if remote control butto was pressed *) LD FernSt ANDN FernStOld AND Direction R Direction JMPC Continue LD FernSt ANDN FernStOld ANDN Direction S Direction Continue: (* store value for auxiliary variable to check if remote control button is pressed and released *) LD FernSt ST FernStOld
WS 10/11 10 Georg Frey

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

Formal Design of Gate Control


GateOpened SchLM1=0 SchRM1=0 (!Oben_S30 & !FernSt&!TasterAB) & Not_Aus

AS

(!OptSensor | TasterAUF | FernSt) & Not_Aus

OptSensor&(TasterAB | FernSt) & Not_Aus

!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

Formal Implementation of Gate Control


(* Detect rising edge on remote control *) LD TRUE R RisingEdge LD ANDN S LD ST FernSt FernStOld RisingEdge FernSt FernStOld (* Transition GateClosed -> OpenGate *) LD GateClosed AND (TasterAUF OR RisingEdge ) AND Not_Aus R GateClosed S OpenGate JMPC Continue (* Transition OpenGate -> GateOpened *) LD OpenGate ANDN Oben_S30 ANDN RisingEdge ANDN TasterAB AND Not_Aus R OpenGate S GateOpened JMPC Continue (* Transition CloseGate -> OpenGate *) LD CloseGate AND (TRUE ANDN OptSensor OR TasterAUF OR RisingEdge ) AND Not_Aus R CloseGate S OpenGate JMPC Continue WS 10/11 12 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

Formal Implementation of Gate Control


(* Transition OpenGate -> CloseGate *) LD OpenGate AND (TRUE AND OptSensor AND (TasterAB OR RisingEdge ) ) AND Not_Aus R OpenGate S CloseGate JMPC Continue (* Transitions to Emergency Stop *) LD GateOpen ANDN Not_Aus R GateOpened S EmergencyStop JMPC Continue LD ANDN R S JMPC LD ANDN R S JMPC CloseGate Not_Aus CloseGate EmergencyStop Continue GateClosed Not_Aus GateClosed EmergencyStop Continue WS 10/11 13 Georg Frey LD ANDN R S JMPC OpenGate Not_Aus OpenGate EmergencyStop Continue (* Gate Opened *) LD GateOpened R SchLM1 R SchRM1 (* Close Gate*) LD R S CloseGate SchLM1 SchRM1 (* Gate Closed *) GateClosed SchLM1 SchRM1 (* Open Gate *) LD S R OpenGate SchLM1 SchRM1 (* Emergency Stop *) EmergencyStop SchLM1 SchRM1

AS

Continue:

LD R R

LD R R

You might also like