process control with twido plc lab guide

Upload: eva-nagy

Post on 02-Jun-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    1/19

    Process Control using TWIDO PLCLaboratory Guide

    Embedded and Ambient Systems Laboratory

    BMEVIIIA350

    Author:KOVCSGbor

    [email protected]

    Budapest University of Technology and Economics

    Department of Control Engineering and Information Technology

    2014

    mailto:[email protected]:[email protected]:[email protected]
  • 8/10/2019 Process Control With Twido Plc Lab Guide

    2/19

    Process Control using TWIDO PLC Contents

    2

    Contents

    1 TWIDO controllers ........................................................................................................................... 3

    2 Basics of ladder diagram programming........................................................................................... 4

    2.1 Basic logic elements ................................................................................................................ 4

    2.2 Operandslanguage objects .................................................................................................. 5

    2.3 Basic function blocks ............................................................................................................... 6

    2.4 State machines ........................................................................................................................ 9

    3 Measurement tasks ....................................................................................................................... 12

    3.1 Manufacturing line control .................................................................................................... 12

    3.2 Control of a 3D manipulator .................................................................................................. 13

    3.3 Control of a chemical process model .................................................................................... 15

    3.4 Control of a signalled pedestrian crossing ............................................................................ 16

    4 Appendix: Laboratory report skeleton .......................................................................................... 18

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    3/19

    Process Control using TWIDO PLC TWIDO controllers

    3

    1 TWIDO controllersTWIDO is the PLC family of Schneider Electric designed for low complexity applications, containing

    both modular and compact devices. During the measurement, different models of compact

    controllers will be used.

    Being compact devices, PLCs used during the measurement enclose the power supply unit, the CPU

    and the IOs in the same housing. Parts of a compact TWIDO PLC are shown byFigure 1.

    1 Covers of input and output connectors

    2 Hinge door

    3 RS485 connector (programming

    interface)

    4 Place of operator display

    5 Input connectors

    6 Connector for extension modules

    (located at the right side)

    7 Input, output and status LEDs

    8 Output connectors

    9 Setpoint potentiometers

    10 Place of second serial port

    11 Power connection

    12 RTC / EEPROM expansion slot

    Figure 1Parts of a compact TWIDO PLC

    Depending on the model, PLCs might have 24V DC or 230V AC power inputs, from which the power

    supply unit generates lower voltage supply for the CPU and other modules.

    The CPU is responsible for operating the PLC, running the operating system and the user program. It

    is equipped with 32kBytes of RAM, of which the program memory has the capacity of 3000

    instructions. The RAM includes 256 bit registers and (depending on the use of function blocks) at

    most 3000 word registers. The CPU allows simultaneous use of 128 counters and 128 timers. The

    RAM is battery-powered to store its contents during power outage, but an external 32kByte EEPROM

    cartridge can also be used. The controller can also be equipped with a real-time clock (RTC) module.

    Depending on the model, compact TWIDO PLCs might have up to 24 digital IOs with 0-24V voltage

    levels, decoupled from the CPU. Analogue setpoint potentiometers are also available in the base

    unit. PLCs in the lab have relay outputs, but models with solid-state digital outputs are also available

    both in sink and source configurations. States of inputs and outputs are displayed on the front panel

    LEDs. Further inputs and outputs (both digital and alalog ones) can be connected to the base unit in

    forms of expansion modules.

    Every TWIDO PLC is equipped with an RS485 communication interface, serving both as programming

    interface and a MODBUS communication port for connection to other controllers. Othercommunication interfaces (ASI, CAN or Ethernet) are available as expansion modules.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    4/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    4

    2 Basics of ladder diagram programmingAmong the PLC programming languages defined by the standard IEC-1131 (and later IEC-61131), the

    ladder diagram is the most popular one used in simple applications. In the followings, the basic

    concepts of ladder programming will be presented using the syntax of its TWIDO implementation.

    2.1

    Basic logic elements

    As initially designed to mimic relay logics, ladder diagram consist of rungs, each implementing a

    logical function. In each scan cycle, the PLC reads the inputs, evaluates the logic functions from the

    top to the bottom, and updates the outputs. Basic logic elements of ladder diagrams are shown by

    Table 1.

    Contacts Coils

    Normally open (NO) contact Normally opern (NO) coil

    Normally closed (NC) contact Normally closed (NC) coil

    Rising edge sensitive contact Set (latch) coil

    Falling edge sensitive contact Reset (unlatch) coil

    Table 1Basic logic elements

    Inputs of a logical function correspond to the contacts, while its outputs correspond to the coils. The

    current flow starts from the left side of the rung, and directed towards the right through the contacts

    and then the coils. The normally open (NO) contact can be interpreted as a simple pushbutton: it

    conducts if the value of the associated variable (written over the contact in the diagram) is true (1).

    The normally closed (NC) contact works the opposite way: it conducts if the corresponding variable is

    false (value 0), so it can be considered as a normally closed pushbutton. Serial interconnection of

    normally open contacts (resp. normally closed contacts) realize an AND (resp. NAND) operation,

    while their parallel interconnection implements an OR (resp. NOR) operation.

    Normally open (NO) coils set the corresponding variable to 1 if energized, and set it to 0 otherwise.

    Similarly, normally close (NC, negated) coils set the corresponding variable to 1 if not energized.

    Figure 1Implementation of a logical function

    The ladder diagram above implements the logical function Y=NOT(A OR (B AND NOT C)). The top

    branch on the left conducts if Ais true, while the bottom one conducts if Bis true and Cis false (B

    AND NOT C). The coil on the right is energized if either of the branches on the left conduct, i.e. if the

    condition A OR (B AND NOT C)is true. However, since the coil is a normally closed one, the variableCis set to the value NOT(A OR (B AND NOT C)).

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    5/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    5

    It is important to emphasise that the operation of the rung implements a logical function, which sets

    the output no matter its condition is satisfied or not. Beginners often make a mistake by associating

    the above ladder rung with the instruction IF (A OR (B AND NOT C)) THEN (Y=0)of high-

    level programming languages. However, this is not correct: the instruction above does not change

    the value of Y if the condition is not satisfied. On the other hand, the logical function implemented by

    the ladder rung sets the output to 1 in that case. Therefore, the logical function should be associated

    with the instruction IF (A OR (B AND NOT C)) THEN (Y=0) ELSE (Y=1).

    Variables associated to the coils are set to the value corresponding to the part of the rung left from

    them in each scan cycle. If we would like to add memory-like behaviour to a variable, Set and Reset

    coils should be used. The Set coil sets the corresponding variable to 1 if energized, and does not

    change its value if not energized. Clearing the variable can be achieved by a Reset coil in a similar

    way.

    Due to the cyclic behaviour of PLCs, the user program can not directly set the output bits. Instead, it

    sets the bits of the output map stored in the memory, which are copied to the physical outputs after

    the end of the program scan. Therefore, if an output bit is assigned by coils in multiple rungs, the last

    assignment will overwrite the results of the formers in the output map, so therefore those

    assignments do not appear at the physical output. It is strongly recommended to write each output

    only in one single rung of the diagram.

    2.2

    Operands language objects

    Operands used by different operations are referred to as language objects by the TwidoSuite

    development environment. These objects can be bit, word, double word or (in case of some PLC

    models) floating point language objects. During the measurement only bit and word objects will be

    used. Language objects, except to immediate values, are referenced by their identifier. The identifier

    starts with the %character, followed by the object type (1 or 2 characters) and the number of the

    object. In case of function blocks, the identifier is extended by the identifier of the function block

    variable the objects represents.

    Bit object include digital inputs and outputs, memory bits and function block outputs. Inputs, outputs

    and memory bit objects are identified by the characters I, Q and M, respectively. Addresses of inputs

    and outputs are composed of two numbers delimited by a dot (.). The first number corresponds to

    the module the given port is located at (the base unit, used during the measurement, has the

    number 0), while the second is the number of the given input or output inside the module. In case of

    memory bits, the address is one single number from 0 to 255.

    Word objects include analog inputs and outputs (IW and QW), memory words (MW) and constants

    (KW), and some function block variables. Referencing input, output and memory word objects is the

    same as referencing their bit object counterparts.

    Variables of function blocks (see next section) can be referenced by adding a dot (.) and the variable

    identifier to the identifier of the function block object (like when referencing a property of an object).

    Language objects used during the measurement are shown byTable 2.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    6/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    6

    Language

    objectDescription Example

    %Ix.y Digital input y of module x %I0.4Digital input 4 of the base unit

    %Qx.y Digital output y of module x %Q0.0Digital output 0 of the base unit

    %Mi Memory bit number i %M4Memory bit number 4

    %MWi Memory word number i %MW3Memory word number 3

    %KWi Word constant number i %KW3Word constant number 3

    %Ci Counter number i %C2.VValue of the counter number 2

    %TMi Timer number i %TM7.QOutput of the counter number 7

    Table 2Language objects

    2.3

    Basic function blocks

    Beside simple logic elements, more sophisticated blocks, the so-called function blocks can also be

    used in ladder diagram. The most important timer, counter, compare and operation function blocks

    of TWIDO will be presented in the sequel.

    Timers

    TWIDO compact PLCs allow the simultaneous use of 128 timer blocks (%TM0%TM127) which might

    be of different types (TON, TON, TP). Output Qof the timer block is a delayed copy of the input IN

    and its actual behaviour depends on the type of the counter. The time delay can be set by the time

    base (base) and preset parameters. The time base can be 1ms, 10ms, 100ms or 1 min (pay attention

    that 1 minute is the default setting), and the delay can be expressed as the multiple of the time base

    defined by the preset value (e.g. using 10ms time base and a preset value of 30 will result in a delay

    of 300ms): .

    Figure 2The Timer function block

    The output of the timer (%TMi.Q, read-only), the preset value (%TMi.P) and the current value of

    the counter (%TMi.V, read-only) can be addressed from the user program.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    7/19

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    8/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    8

    Figure 6The Counter function block

    The value 1 of the R(Reset) input sets the current value of the counter to 0, while the value 1 of the

    S(Set) input sets it to the predefined preset value. Rising edges on the CUand CDinputs increment

    and decrement the counter value, respectively.

    The current value of the counter can be in the range of 0 to 9999. Overflow (9999 0)is signalled by

    the value 1 of the output F(Full), while underflow (0 9999)is signalled by the output E(Empty).

    The value of the output D (Done) is set to 1 if the current value equals the preset value. These

    outputs can be referenced as language objects, e.g. as %Ci.D.

    However the current value and preset value of the counter do not appear as outputs (as being not

    logical values), they can be accessed through compare and operation function blocks using the

    language objects %Ci.V and %Ci.P, respectively. Note that the current value of the counter is

    read-only.

    The Compare function block

    Non-logical operators (e.g. memory words or counter values) can be compared to each other using a

    compare function block.

    Figure 7The Compare function block

    The block is evaluated only if energized, i.e. the condition to its left evaluates to true. The

    comparison operation can be = or while the operators can be word or double

    word objects, including immediate values (seeFigure 7).

    The Operate function block

    Non-logical assignments and arithmetic operations can be carried out using an Operate function

    block. The block is evaluated only if energized, i.e. the condition to its left evaluates to true: in that

    case, the operation defined above the block is executed.

    Assignment is represented by the operator :=. The left side of the operator can be any non-read-

    only language object, while any language object or immediate value can be present at the right side.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    9/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    9

    Right side might also include an arithmetic formula using addition (+), subtraction (-), multiplication

    (*), division (/), remainder (REM), square root (SQRT), increment (INC), decrement (DEC) or

    absolute value (ABS) operations, depending on the data types of the operands.

    Figure 8The Operate function block

    2.4 State machines

    Operation of controlled processes can often be described by finite state machines, which are then

    implemented by a ladder diagram. Generally Moore-model automata are used, i.e. the outputs

    depend only on the current state.

    As an illustrative example, consider the control of a simple heating device: the equipment can be

    turned on by pressing a pushbutton. In that case, only one of the two heaters is turned on (LOW

    mode). Upon a second press of the button, the other heater is also turned on (HIGH mode). The third

    press of the button turns off the equipment. The state transition diagram of the process is illustrated

    byFigure 9.

    Figure 9State transition diagram of the heating device

    Implementation of state machines can be carried out in three simple steps:

    1.

    definition of the transitions

    2. definition of the output mapping

    3. initialization of the state machine

    At first, a memory bit (the state register) should be assigned to each state. The value of a state

    register is 1 if and only if the corresponding state of the state machine is active, otherwise it is 0. In

    the sequel the registers assigned to the three states of the heating device will be referred to as

    S_OFF, S_LOWand S_HIGH.

    Implementation of a state machine means the definition of the mapping which gives the next state

    as the function of the current state and the conditions of the transitions. Therefore, in order to

    execute a transition, it has to be evaluated whether the initial state of the transition is the current

    state and whether the condition of the transition is met. If both evaluate to true, the current state

    has to be replaced to the destination state of the given transition, i.e. the state register bit of the

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    10/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    10

    current state has to be set to 0 and the state register bit of the destination state has to be set to 1.

    The rung for implementing a generalized transition is shown byFigure 10.

    Figure 10General template for implementing state transitions

    Here and are the state registers associated to the origin

    and destination state of the transition, respectively. The condition of the transition is modelled here

    by a simple contact, but in general, any logical function can be plugged in there.

    The ladder diagram describing the state transitions of the heating device is given byFigure 11.

    Figure 11Ladder diagram implementing the state transitions of the heating device

    When implementing the output mapping, the rule of writing an output only in one single rung has to

    be respected. In case of state machines with multiple states, it is useful to make a table containing

    the state of each output in the different states. Let us denote the outputs of the heating device by

    the symbolic names HEATER1 and HEATER2 (corresponding the on/off state of the two heaters).

    Then the table of the output mapping is given byTable 3Output mapping of the .

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    11/19

    Process Control using TWIDO PLC Basics of ladder diagram programming

    11

    State S_OFF S_LOW S_HIGH

    HEATER1 0 1 1

    HEATER2 0 0 1Table 3Output mapping of the heating device

    Based on the table, the output mapping can easily be implemented as illustrated byFigure 12.

    Figure 12Ladder diagram implementing the output mapping of the heating device

    However the implementation of the transitions can assure that no more than one state can be active

    simultaneously, each state register bit is set to its default value 0 upon starting the PLC, i.e. there will

    be no active state. In order to start the state machine from its initial state, the corresponding state

    register bit has to be set to 1.

    One solution, which is platform-independent, i.e. can be used in any environment, is to set the state

    register of the initial state to 1 if all state registers are of value 0 (seeFigure 13).

    Figure 13General solution to initialize the state machine

    A more sophisticated (and, especially in case of a high number of states, more convenient) solution is

    to use the current state of the PLC as condition for setting the initial state of the state machine. PLCs

    usually use a system bit or system word to notify the user program that the current scan cycle is the

    first one after startup, so this information can be used to initialize the state machine. TWIDO PLCs set

    the system bit %S13 to 1 during the first scan, so the initialization of the state machine can be

    implemented as shown byFigure 14.

    Figure 14Initialization of the state machine on a TWIDO PLC

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    12/19

    Process Control using TWIDO PLC Measurement tasks

    12

    3 Measurement tasksOne of the following tasks will be assigned for each group. The measurement tasks model such

    control problems, which are solved using PLCs in the industrial practice.

    3.1 Manufacturing line control

    The manufacturing line model consists of four conveyors, two pushers connecting the perpendicular

    conveyors, a milling machine and a drilling machine (seeFigure 15).

    Figure 15Layout of the manufacturing cell

    Photo sensors are installed along the conveyors. Parts arriving in front of the sensor break the light

    beam and therefore their presence is signalled by the logical value 0 of the corresponding photo

    sensor. Conveyor motors and machines can be operated by setting the corresponding PLC output to1. In case of pushers, the direction of motors can be set by an other PLC output (1: forward, 0:

    backward). Limit switches are placed at the forward and backward extremities of the pushers, which

    signal if pressed by the device.

    The control of the manufacturing line should achieve the following operation. When a part is put

    onto Conveyor 1 (in front of Photo sensor 1), the conveyor should be started in order to forward the

    part to Pusher 1. Passing the part to the pusher can be achieved by operating the controller for 2

    seconds after the part has passed Photo sensor 2. The pusher should push the part to Conveyor 2 (for

    smooth operation, Conveyor 2 should be operating during the pushing operation), and then retract

    to its back position.

    As the part arrives to the milling machine, Conveyor 2 should be stopped, and the machine should be

    operated for 3 seconds. Afterwards, the conveyor should forward the part towards the drilling

    machine: it should be operated for approximately 4 seconds after the part left the milling machine,

    and Conveyor 3 should be turned on in the meantime.

    As the part arrives to the drilling machine, Conveyor 3 should be stopped and the machine should be

    operated for 5 seconds. Afterwards, the conveyor should forward the part to Pusher 2 (again, 4

    seconds of conveyor operation is needed after the part leaves the machine).

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    13/19

    Process Control using TWIDO PLC Measurement tasks

    13

    Pusher 2 should forward the part to Conveyor 4 (which should be started during the extension of the

    pusher for smooth operation) and then retract to its back position. Conveyor 4 should be operated

    for additional 2 seconds after the part has passed by Photo sensor 5, and then stopped.

    Measurement task

    Implement a PLC program which achieves the operation described above. You can assume that onlyone part is present in the whole line.

    Additional task

    Modify the program to deal with multiple parts present in the line simultaneously.

    Hints

    Implement distinct state machines for the elements of the line (input conveyor, output

    conveyor, machines, pushers) and operate them simultaneously. Take the time to design the

    state machines on a piece of paper before implementing them.

    Take care not to move pushers to incorrect directions upon the activation of the limitswitches.

    If you experience any problem (e.g. pusher off the rail) stop the line using the emergency

    shutdown button and ask for assistance.

    3.2

    Control of a 3D manipulator

    The task is to relocate parts from an output conveyor to an input conveyor using a 3D manipulator.

    The manipulator is a 3-degrees-of-freedom arm, equipped with a mechanical gripper, as shown by

    Figure 16.

    Figure 16The 3D manipulator

    Joint 1 is a rotational one, which rotates the whole arm around its vertical axis (the positive direction

    is the clockwise one). Joint 2 is a translational one, which allows lowering (positive direction) or lifting

    (negative direction) the horizontal segment of the arm. Joint 3 allows extending (positive direction)

    or retracting (negative direction) the horizontal segment. The gripper can be opened by positive

    motion of its motor and closed by negative motion. There are two PLC outputs corresponding to each

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    14/19

    Process Control using TWIDO PLC Measurement tasks

    14

    joint and the gripper. The first turns the motor on or off, while the second sets the direction of

    movement (0: negative direction, 1: positive direction).

    Reference positions of the joints and the gripper (a given angular position for Joint 1, top position for

    Joint 2, fully retracted position for Joint 3, closed position for the gripper) are sensed by limit

    switches, providing absolute position information. Joints are also equipped with pulse switches,which output a square signal when the given joint is moved. By summing these pulses with respect to

    the sign of the direction of movement (i.e. incrementing the counter in case of positive direction and

    decrementing it in case of negative direction), the relative position of the joints from their reference

    position can be obtained. Positions of the manipulator are given using these values (the so-called

    joint coordinates), e.g. the coordinate (30,0,20) means that Joint 1 has turned 30 pulses from its

    reference position to the positive direction, Joint 2 is in its reference (top) position and Joint 3 has

    been extended by 20 pulses.

    The manipulator should be controlled as follows. After the start of the controller, the position of the

    arm is unknown, so it has to be calibrated, i.e. all joints have to be moved to their reference positionsindicated by the limit switches. At first the gripper has to be moved to negative direction until the

    limit switch signals, then Joint 2 (lifting), Joint 3 (retract) and finally Joint 1 (turning to counter-

    clockwise direction) has to be moved to negative direction.

    After calibration, the manipulator should be moved to Position 1 over the output conveyor and the

    gripper should be opened. If a part arrives at the output conveyor (the value of the photo sensor

    input becomes 0), the arm should be lowered to Position 2, and the part should be picked up by

    closing the gripper. Then the arm should be fully lifted (Position 1 again), and moved to Position 3

    over the input conveyor. Then it should be lowered to Position 4 and the gripper should be opened.

    After lifting the arm back to Position 3, it should be recalibrated by moving it to its reference

    position. After the calibration, it should be moved to Position 1 and the controller should wait for the

    next part to pick up.

    Measurement task

    Implement a PLC program which operates the manipulator as described above.

    Hints

    Implement a state machine, which controls the successive movements defined above. Take

    the time to design the state machine on a piece of paper before implementing it.

    Use counters to count the pulses of each joint and the gripper (take care of the direction ofthe movement). Use the appropriate limit switches to reset these counters.

    When the goal of a movement is the reference (0) position of a joint, use the limit switch for

    sensing the goal position instead of the less reliable counters.

    Joints 1 and 3 should be moved only if the limit switch of Joint 2 is active (the vertical

    segment is fully lifted).

    The manipulator might harm itself and parts of the manufacturing cell. If you experience a

    dangerous situation, stop the movement immediately by the emergency shutdown button

    and ask for assistance.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    15/19

    Process Control using TWIDO PLC Measurement tasks

    15

    3.3 Control of a chemical process model

    The model consists of two tanks, two pumps, a mixer, a level sensor, two pushbuttons and a status

    light (green lights signalling the operation of the pumps and the mixer are in serial connections with

    the corresponding motors). Pump 1 pumps the liquid from Tank 1 to Tank 2 (storing, betrol in

    Hungarian), while Pump 2 operates in the reverse direction (discharging, kitrol in Hungarian).

    Level of Tank 2 is measured by a floating level sensor, which triggers a digital switch if the level

    reaches the high level, and another if the level reaches the low level. The layout of the model is

    shown byFigure 17.

    Figure 17Layout of the chemical process model

    In discontinuous operating mode, the operation is started by pressing the START button. Pump 1

    should fill Tank 2 (the pump should be operated until the high level sensor becomes active), and then

    the liquid should be mixed for 5 seconds. Then the liquid should be pumped back to Tank 1 (the

    pump should be operated until the low level sensor becomes active), and the process should be

    stopped. During the whole procedure, the lamp should be lit.

    In continuous operating mode, the process should not be stopped after discharging, but a new cycle

    should be started (i.e. the liquid should be pumped again to Tank 2 etc.). In this operating mode, the

    process can be stopped by pressing the STOP button. Upon pressing the button, the operation should

    not terminate immediately, but after discharging (when Tank 2 becomes empty). In order to notify

    the operator that the request for stop has been processed, the lamp should blink during the

    termination (otherwise it should be lit continuously).

    Measurement tasks

    1. Implement a PLC program which implements the discontinuous operating mode.

    2.

    Modify the program such that it realizes the continuous operating mode.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    16/19

    Process Control using TWIDO PLC Measurement tasks

    16

    Additional task

    Modify the program such that it allows emergency shutdown. If the STOP button is pressed in the

    termination phase (i.e. it is pressed at a second time), switch off all motors regardless the current

    operation. Take care to pump all liquid from Tank 2 to Tank 1 before starting the normal operation

    after an emergency shutdown.

    Hints

    It is advised to solve the problem using a state machine. Take the time to design the state

    machine on a piece of paper before implementing it.

    Use system bit %S6to implement blinking of the light. The system bit outputs a 0-1 sequence

    with 1Hz frequency.

    3.4

    Control of a signalled pedestrian crossing

    On roads with heavy vehicle traffic but rare needs of pedestrians to cross the road, pedestrian

    request-based signalling is commonly used. Pedestrians arriving the side of the road can request a

    green signal by pressing a button, which is granted for them after a while. You can find such a

    pedestrian crossing at the tram station of Goldmann Gyrgy tr.

    Figure 18Layout of the signalled pedestrian crossing

    The controller should operate the traffic lights the following way. Initially, the lights show green for

    the vehicles and red for the pedestrians. If a crossing request is signalled by pushing the button, the

    WAIT (VRJON) light should be lit to notify the pedestrian about processing the request. After 2seconds, the light for the vehicles should be turned to yellow, then, after another 2 seconds, to red.

    After 1 second, the pedestrian light should be turned to green for 5 seconds and the WAIT light

    should be turned off. Then, the green light for the pedestrians should start blinking for 5 seconds,

    and then turned to red. The same time the light for the vehicles should show a red-yellow signal, and

    after 2 seconds, turned to green.

    Measurement task

    Implement a PLC program which can control the traffic lights accordingly to the description above.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    17/19

    Process Control using TWIDO PLC Measurement tasks

    17

    Additional task

    Implement the feature of night mode.By switching the mode switch to night mode, the yellow

    lights for the vehicles should start blinking while the lights for the passengers should be turned off.

    Take care of returning to a safe state (red for all directions) when switching back to daylight mode.

    Hints Lights and buttons of the two sides are connected to common IOs.

    It is advised to solve the problem using a state machine. Take the time to design the state

    machine on a piece of paper before implementing it.

    Use system bit %S6to implement blinking of lights. The system bit outputs a 0-1 sequence

    with 1Hz frequency.

  • 8/10/2019 Process Control With Twido Plc Lab Guide

    18/19

    Process Control using TWIDO PLC Appendix: Laboratory report skeleton

    18

    4 Appendix: Laboratory report skeleton

    Laboratory Report

    Embedded and Ambient Systems Laboratory (BMEVIMIA350)

    Process Control with TWIDO PLC

    Date: ..

    Group:

    Students: ()

    ()

    The Laboratory Report is to be sent by email with the project documentation attached to the address

    [email protected] within 7 days from the measurement session. Reports sent late are not

    accepted.

    mailto:[email protected]:[email protected]:[email protected]
  • 8/10/2019 Process Control With Twido Plc Lab Guide

    19/19

    Process Control using TWIDO PLC Appendix: Laboratory report skeleton

    19

    Measurement task

    Outline of the solution

    Project documentation

    Project documentation generated by TwidoSuite is attached in file .

    < Attention! Only documentation generated from a well-commented project (i.e. descriptivesymbolic names, comments attached to each rung) is acceptable! >