plc lab exercises

33
¤ ¤ Direct Logic 205 1 PLC Lab Exercises

Upload: shaheerlatif

Post on 02-Dec-2014

360 views

Category:

Documents


17 download

TRANSCRIPT

Page 1: PLC Lab Exercises

♦ ♦ Direct Logic 205

1

PLC Lab Exercises

Page 2: PLC Lab Exercises

♦ ♦ Direct Logic 205

2

1. Lab Exercise #1 - The PLC..................................................................................................... 51.1. Getting Started................................................................................................................... 51.2. PLC Communications....................................................................................................... 61.3. PLC Time and Date information...................................................................................... 71.4. System Information............................................................................................................ 71.5. Scan Time .......................................................................................................................... 81.6. Messages........................................................................................................................... 91.7. PLC I/O Configuration....................................................................................................... 91.8. PLC Memory Map ...........................................................................................................101.9. Memory Editor..................................................................................................................111.10. Mapping PLC I/O...........................................................................................................12

2. Lab Exercise #2 - I/O Logic and Analog Card.....................................................................142.1. Ladder Logic....................................................................................................................142.2. Single Rung ......................................................................................................................142.3. OR Rung ...........................................................................................................................152.4. AND Rung.........................................................................................................................152.5. XOR Rung.........................................................................................................................162.6. Simple Motor Starter Rung .............................................................................................162.7. FlipFlop Rung...................................................................................................................172.8. 3-way Switch Rung ..........................................................................................................172.9. The Challenger.................................................................................................................182.10. Analog Input/Output Module Specifications................................................................182.11. Analog Module Operation.............................................................................................19

3. Lab Exercise #3 - Operator Interface OP 1500..................................................................223.1. Introduction.......................................................................................................................223.2. Optimation Panel Configuration.....................................................................................223.3. Operator Panel Memory Map.........................................................................................233.4. Operator Panel Support Code.......................................................................................253.5. Operator Interface Exercise............................................................................................29

4. Lab Exercise #4 - PID Loops ................................................................................................294.1. Introduction.......................................................................................................................294.2. Exercise............................................................................................................................30

5. Lab Exercise #5 - The Drum Sequencer..............................................................................305.1. Introduction.......................................................................................................................305.2. Example............................................................................................................................315.3. Exercise............................................................................................................................32

6. Final Exercise..........................................................................................................................32

Page 3: PLC Lab Exercises

♦ ♦ Direct Logic 205

3

Introduction to Direct Logic’s DL - 205

Objective: The student will learn the memory structure of the CPU, the programming toolsin Direct32 and understand the layout and function of the Student Learning Center (SLC).

Input/Output

Objective: The student will learn the function, addressing, and the operation of the DC I/Omodule and the Analog I/O modules located in the Student Learning Center (SLC).

Operator Panel - OP 1500

Objective: The student will learn how to program all of the features of the operator paneland how to integrate the operator panel and the PLC .

PID

Objective: The student will learn the elements of a Proportional, Integral and Derivativecontroller and write a program that uses the devices of the Student Learning Center tosimulate an industrial PID controller.

Drum Controller

Objective: The student will learn how to program a drum controller in the PLC and integratethe devices of the Student Learning Center (SLC) in a simulation of an industrialapplication.

Page 4: PLC Lab Exercises

♦ ♦ Direct Logic 205

4

Introduction:

Tools required for all of the exercises in this series are:

• PLC Trainer• A PC with DirectSoft32 and Optimate configuration software loaded• Digital Multimeter

Terminology and instruction style used for these exercises:

Select - means to double click the item unless told otherwise.Press - means to type the key or key sequence that follows.Depress - means to single click a pushbutton or object.IF … ELSE Identifies there are two more paths to take and you need to read aheadto see which path is correct.

Page 5: PLC Lab Exercises

♦ ♦ Direct Logic 205

5

1. Lab Exercise #1 - The PLC

1.1. Getting Started

1. Attach the programming cable to the PCs serial port2. Plug the telephone type RJ-11 connector into the PLC (top plug)3. Plug-in the PLC power cord.4. Start the DirectSoft32 software5. Turn ON the PLC power switch

This window should come up on the screen momentarily.

and then the next screen will look like:

Enter a New Project name, then Select Type DL 250 and OK.The following screen will appear.

Page 6: PLC Lab Exercises

♦ ♦ Direct Logic 205

6

II.

1.2. PLC Communications

Select PLC from the upper tool bar or Press ALT P.Select Connect or Press ALT C.ADD a new Link by Selecting ADD, then COM2, then DL 05/1/2/4/350 Family (from the list),then K sequence and Address 1.Enter a name for the Link (i.e. Intro1.PRJ), then a description of the link (not required).

Fill- in the following table from the screen when it appears.

Then Select FINISH.

IF the PLC has no current program then Xref View will appear with NONE in the Elementcolumn. For this lab open project Intro1.PRJ by Selecting File from the upper tool bar andselecting Open Project or Depress CTRL O. Select Intro1.PRJ and Depress Open. Thefollowing screen will appear.

Page 7: PLC Lab Exercises

♦ ♦ Direct Logic 205

7

ELSE Highlight the link you just created and Depress Select.

IF You want to use the program in the PLC then Depress Use PLC. This will load the data thatexists in the PLC.ELSE Depress Use Disk. This will load the data from the disk.

1.3. PLC Time and Date information

The following exercises are to get you familiar with the PLC and the PLC software.Select PLC from the toolbar, then Setup and then Calendar. The following screen willappear.

Select Get PC Time and then Write to PLC. This will write the value of the time in you PC tothe memory of the PLC. Read from PLC will retrieve the current value of time from the PLC.Reset the date and time to the correct time by filling in then screen boxes, then select Write toPLC to update the PLC. Then select Read from PLC and fill-in the figure above with theretrieved value. Select Cancel to end changing calendar.

1.4. System Information

Select PLC from the toolbar, then Diagnostics and then System Information.

Page 8: PLC Lab Exercises

♦ ♦ Direct Logic 205

8

OR

Depress the on the tool bar.

The following screen will appear. Fill-in the figure below with the retrieved values. Look at thefront panel of the PLC

Verify the PLC Type,Mode, and HardwareSwitch

Note: Errors are stored in scratch pad memory that can be erased by selecting InitializeScratch Pad from PLC and Setup menus.

1.5. Scan Time

Page 9: PLC Lab Exercises

♦ ♦ Direct Logic 205

9

This screen displays then PLC program scan time (the time it takes for the program to executeone scan of the ladder program).Select PLC from the toolbar, then Diagnostics and then Scan Time.

The data presented will inform the programmer of the time required to scan the program. If the Maximum Scan Time gets to long in a time critical application the closing and opening of a switch maybe completely missed.

Fill-in the table at the left with the current data.

1.6. Messages

This screen displays the System Error and the Fault Messages recorded by the PLC.Select PLC from the toolbar, then Diagnostics and then Messages.

1.7. PLC I/O Configuration

This screen displays the I/O configuration as detected by the PLC.Select PLC from the toolbar and then Configure I/O.

Page 10: PLC Lab Exercises

♦ ♦ Direct Logic 205

10

Fill-in this table with thedata from the PLCTrainer. The PLCTrainers all have differentI/O configurations. Thistable will be used whenprogramming to addressthe various switches andlights located on thecontrol panel.

Record the trainer IDnumber:

EWU:(the I/O Configuration isonly valid for this trainer)

1.8. PLC Memory MapRetrieve the Memory Map for the 250 PLC.Select PLC from the toolbar and then Memory Map.

Note the 8PT Input MDLcard Addr In value. Forexample 20. From thetable at the left we wouldfind the Input range fromX0 - X777 (octal). The thisPLCs inputs would be X20thru X27 (this uses thestarting address from theprevious table and the factthat it is an 8 PT cardyielding these unique 8address)

The outputs might be atY20 thru Y27.

Page 11: PLC Lab Exercises

♦ ♦ Direct Logic 205

11

1.9. Memory Editor

This screen displays the contents of the memory of the PLC.Select Tools from the toolbar and then Memory Editor or Press CTRL and Y.

Each memory location is initially displayed as 16 bits and the address is in octal. You have theability to display the memory location in the various number formats. Highlight the address toview and select a new format. Note the X to the left of the data changed to a B, O, D, or T,depending on the selection.

The variable area identified in the memory map table is general purpose storage area for you,the programmer, to use. You need to manage this area. The system will not restrict where inthese areas you place data, but if you spread data all over the area, it will be harder to viewand keep track of during program development.

One way of managing the storage area is to identify memory locations with names. The namecan be entered into the PLC through the Documentation Editor table. This screen displays thenames assigned to the memory of the PLC. Select Tools from the toolbar and thenDocumentation Editor or Press CTRL and D.

The nickname field is used to identify the memory location and the description can be used tohold additional information. The R pushbutton will advance the list to the next data type and the

button can be used to search for a specific address.

Page 12: PLC Lab Exercises

♦ ♦ Direct Logic 205

12

This table identifies all of the nickname addresses and the corresponding PLC memorylocations.

MEMORY MAP FOR PLC TYPE: 250 Addresses for NicknamesElement Global

TypeElementRange

GlobalRange

VRange

BitRange

PointerRange

Pointer to BitRange

Program MemoryTimer AccumulatorCounter AccumulatorVariableSystem StatusVariableSystem StatusInputOutputVariableStage StatusTimer StatusCounter StatusSystem Status

WORDWORDWORDWORDWORDWORDWORDBITBITBITBITBITBITBIT

TA0 - TA377CTA0 - CTA177

X0 - X777Y0 - Y777CO - C1777SO - S1777TO - T377CT0-CT177SP0- SP777

00000 - 07679V0 - V377V1000 - Vl177V1400 - V7377V7400 - V7777V10000- V17777V37000- V37777V40400 - V40437V40500 - V40537V40600 - V40677V41000 - V41077V41100 - V41117V41140-V41147V41200 - V41237

V1400 - V7377V7400 - V7777V10000- V17777V37000- V37777VX0 - VX760VY0 - VY760VC0 - VC1760VS0 - VS1760VT0 - VT360VCT0-VCT160VSP0- VSP760

BOO - B377.15B1000.0 - B1177.15B1400,0 - B7377.15B74C)0.0 - B7777.15BI0000.0- B17777.15B37000,0- B37777,15B40400,0 - B40437.15B40500.0 - B40537.15B40600.0 - B40677.15B41000.0 - B41077.15B41100.0 - B41117.15B41140.0-B41147.15B41200.0- B41237.15

PTA0 - PTA377PCTA0 - PCTA177P1400 - P7377P7400 - P7777P10000- P17777P37000- P37777

PB0.0 - PB377,15PB1000.0 - PB1177.15PB1400.0 - PB7377,15PB7400.0 - PB7777.15PB10000.0 -PB17777.15PB37000,0- PB37777.15

EXAMPLEDECIMAL BCD/HEX OCTAL BINARY

V1400 = 4264 10A8 10250 0001 0000 1010 1000V10250 = 4096 1000 10000 0001 0000 0000 0000

B1400.7 = THE SEVENTH BIT OF V1400 = 1Pointer P1400 = VALUE OF DATA AT ADDRESS OF V10250 = 4096Pointer PB1400.12 = TWELFTH BIT OF THE VALUE OF DATA AT ADDRESS OF V10250 = B10250.12 = 1 Pointers point through anaddress obtained from the original address to get the value of data at the pointed to address

1.10. Mapping PLC I/O

Using the data from PLC I/O Configuration table we will identify the I/O configuration for thisPLC. First locate the “8 PT INPUT MDL” in the table and note the Addr In (it will be a 0 or 20).This example will assume 0.

Press and the following screen will appear.

Page 13: PLC Lab Exercises

♦ ♦ Direct Logic 205

13

Change the element to pointer to theaddress and then change the format toBCD/Hex (this allows you to see X0 to X17in the Value Current display). Note that thecurrent value is not zero. Now depress theRed Pushbutton and observe the value. Itshould read 0. The number identifies thevalue of the bit of the address of the RedPushbutton. For example if the element isX0 and the current value is 8 when the redpushbutton is released then that numbercorresponds to the fifth bit which is X0 (0), X1 (1),

X2 (2), X3(4), X4(8).For example if the element is X20 and thecurrent value is 32 when the red pushbuttonis released then that number corresponds tothe seventh bit which is X20(0), X21(1), X22(2),

X23(4), X24(8), X25(16), X26(32).

Now determine the address of the other pushbuttons and fill in the table. Note subtract thevalue of the Red pushbutton from the current value when you depress another pushbuttonand then determine the address.

Address Nickname Address Nickname Red Pushbutton X Red Light Y Yellow Pushbutton X Yellow Light Y Green Pushbutton X Green Light Y White Pushbutton X White Light Y

Next locate the “8 PT OUTPUT MDL” in the PLC I/O Configuration table and note the Addr Out(it will be a 0 or 20). This example will assume 20. Change the format to Bit and change theelement to the first output address Y20. Note that the current status of the output ON or OFF.

Select the opposite state in the New area and send that data to the PLC by pressing the pushbutton. Note the light on the Output Card associated with that address will turn ON orOFF. One of the indicator lights may also light if this is its address. Cycle through the outputaddress until you have all the data filled-in in the table.Assign nicknames to all of the pushbuttons and lights.

Page 14: PLC Lab Exercises

♦ ♦ Direct Logic 205

14

2. Lab Exercise #2 - I/O Logic and Analog Card

2.1. Ladder Logic

This exercise will use boolean logic and ladder logic to implement some simpleprograms in the PLC. If you want to clear the previous program from the PLC follow thefollowing steps:

Clear Memory

Clear the PLC memory by selecting PLC from the toolbar and then Clear PLCMemory. Select ALL and OK. Answer the question to Switch to Program Mode.

View the current ladder program by selecting View from the toolbar and then Ladder View.Important

All programs must end with an END command. If you cleared memory, then you needto add an end command to the ladder. The ladder editor is started selecting Edit fromthe toolbar and selecting Edit Mode at the bottom of the list or Press CTRL and E. Ifasked for a password it is “PLC DIRECT” all caps and a space between words.

For the following examples the pushbuttons are named PB1, PB2, PB3 and PB4 and the lightsare named LT1, LT2, LT3 and LT4.

2.2. Single Rung

Logic Table - Light is ON when switch is closed.

Single Line Diagram

PB1 LT1 PB1 LT1

0 0 ( ) 1 1

Truth Table (END)

The lines that connect the ladder elements are called wires and can be drawn using the keystrokes found by selecting EDIT and then Wire >.

Page 15: PLC Lab Exercises

♦ ♦ Direct Logic 205

15

Complete the following tables, draw the equivalent ladder logic and then enter into the PLCand test the code. The following are some buttons that will be used in this process.

Read from PLC Write to PLC Change PLC Mode System Information Check code for Syntax errors

After the ladder logic has been entered it must be tested for syntax errors by pressing

or F8. After a syntax check then the code must be written to the PLC by pressing orSHIFT and F9. Once written to the PLC, the PLC must be in the RUN mode to begin

execution of the code. Select or CTRL, SHIFT and R to show the mode screen.

2.3. OR Rung

Logic Table - Light is ON when either switch is closed.

OR Diagram

( )

(END)Truth Table

2.4. AND Rung

Logic Table - Light ON when both switches are closed.

AND Diagram

( )

(END)Truth Table

Page 16: PLC Lab Exercises

♦ ♦ Direct Logic 205

16

2.5. XOR Rung

Logic Table - Light is ON only when one switch open and the other is closed.

XOR Diagram

( )

(END)Truth Table

2.6. Simple Motor Starter Rung

Logic Table - Start Pushbutton energizes the output which stays ON until the Stop Pushbuttonis pushed (recommend the REDPB for the stop pushbutton).

Motor Starter Diagram

( )

(END)Truth Table

Page 17: PLC Lab Exercises

♦ ♦ Direct Logic 205

17

2.7. FlipFlop Rung

Logic Table - The output changes ON/OFF states on each closer of the switch. A new entity,a positive differential also known as a one shot is needed to complete this rung. The one shotis true or closed for only one scan following a transition from open to closed on SW1.

FlipFlop Diagram

( )

(END)Truth Table

2.8. 3-way Switch Rung

Logic Table - These two switches are used in a house to turn ON and OFF a light from twodifferent locations. Each switch has a common leg connected to an normally open and anormally closed contact.

3-way Diagram

( )

(END)Truth Table

2.9. The Challenger

Logic Table - The 4-way switch configuration starts with the 3-way circuit and adds a 4-wayswitch between the 3-way switches. The 4-way switch either is straight through orcrisscrossed depending on the switch position (up or down).

Page 18: PLC Lab Exercises

♦ ♦ Direct Logic 205

18

4-way Diagram

( )

(END)

2.10. Analog Input/Output Module SpecificationsThe F2-4AD2DA Analog Input/Output module provides several hardware features:_ On-board 250 ohm, 1/2 watt precision resistors provide substantial over-current-protectionfor 4–20mA current loops._ Analog inputs and outputs are optically isolated from the PLC logic._ The module has a removable terminal block so the module can be easily removed orchanged without disconnecting the wiring._ With a DL250 CPU, you can update all input and output channels in one scan._ On-board active analog filtering and RISC-like microcontroller provide digital signalprocessing to maintain precision analog measurements in noisy environments._ Low-power CMOS design requires less than 80mA from an external 18–26.4 VDC powersupply.4-Ch. In / 2-Ch. OutThe following tables provide the specifications for the F2-4AD2DA AnalogInput/Output Module:

Number of Input Channels 4, single ended (one common)Range 4 to 20 mA currentResolution 12 bit (1 in 4096)Input Impedance 250Ω ±1%, 1/2W, 25ppm/°C current input resistanceMaximum Continuous Overload ±40 mA, each current inputInput Stability ±1 countCrosstalk –70 dB, 1 count maximumCommon Mode Rejection –50 dB at 800 HzActive Low-Pass Filter –3 dB at 50Hz, 2 poles (–12 dB per octave)Step Response 10 mS to 95%Full Scale Calibration Error ±12 counts maximum, at 20 mA current inputOffset Calibration Error ±8 counts maximum, at 4 mA current inputMaximum Input Inaccuracy ±0.3% @ 25°C (77°F)

±0.45% @ 0 to 60°C (32 to 140°F)

Number of Output Channels 2 single ended (one common)

Page 19: PLC Lab Exercises

♦ ♦ Direct Logic 205

19

2, Range 4 to 20 mA currentResolution 12 bit (1 in 4096)Peak Withstanding Voltage 75 VDC, current outputsExternal Load Resistance 0Ω minimum, current outputsMinimum, Loop Supply Voltage Range 18–30VDC, current outputsMaximum Load / Power Supply 620Ω/18V, 910Ω/24V, or 1200Ω/30V current outputs24V, 18V, 30V, Linearity Error (best fit) ±1 count (±0 025% of full scale) maximum0.025% Settling Time 100 µs maximum (full scale change)Maximum Inaccuracy ±0.1% @ 25°C (77°F)

±0.3% @ 0 to 60°C (32 to 140°F)Full Scale Calibration Error ±5 counts at 20 mA current outputOffset Calibration Error ±3 counts at 4 mA current outputDigital Input and Output Points Required 16 point (X) inputs and 16 point (Y) outputsUpdate rate for D2-250 is 2 output channels per scan maximum –1 input and 1 output channel

2.11. Analog Module Operation

The address to configure, retrieve and send data to the F2-4AD2DA Analog Input/Outputmodule is dependent on the slot where it is located in the base.

Page 20: PLC Lab Exercises

♦ ♦ Direct Logic 205

20

The analog modulesslot number can beretrieved from the I/OConfiguration. Theformat for the numberof channels is shown

below. The following example is for a module located in slot 3. The SP0 address of thecontact is a special relay that is true only for the first scan of the code and will send this setupinformation to themodule only once. TheK in the LD instructionrepresents a constantinteger. The nextinstruction outputs thevariable to addressV7663, which is themodule parameterlocation for No. ofchannels. The nextinstruction is the LoadAddress and the O tellsthe PLC that it is anOctal Address since it isused as a pointer. Thevalues of the input andoutput channels will bestored in address asshown.

The dial on the panel is connected to a potentiometer which will feed an analog signal to oneof the input channels. Type in the required code to access your F2-4AD2DA AnalogInput/Output module and change the mode from Run to Program and then back to Run. Thiscauses the SP0 to be activate for one scan and setup the module in the PLC. Determine the

input address assignment by pressing the will bring up the following screen. Change theelement to the first address that is assigned to an input. In this code example the first addressis V2000. If the Current value is > 0 the try turning the dial to change the number. If thenumber changes then that is the channel and the element is the address. Repeat looking atthe input address until the channel for the potentiometer is identified (V2001, V2002, V2003).

Input channel assignment: Data address:

Minimum channel value: Maximum channel value:

Channel Nickname assigned

Page 21: PLC Lab Exercises

♦ ♦ Direct Logic 205

21

Connect a multimeter on the milliamp scale across the red and black terminals on the lowerright side of the panel or if using a resistor use the volt scale. See below:

these terminals are connected to one of the twoanalog output from the module. Note the metershould read either 4ma or 1 volt dc.

Press and set the element to the first outputaddress that you pointed to in the rungs youentered to setup the analog module. In thisexample V2004. Now enter 4095 into New and

the write this to the PLC by pressing . If themultimeter reads 20ma or 5 volts DC then this is the active channel. If no then change theaddress to next address, for example V2005 and repeat sending 4095 to the channel.

Output channel assignment: Data address:

Minimum channel value: Maximum channel value:

Channel Nickname assigned

Page 22: PLC Lab Exercises

♦ ♦ Direct Logic 205

22

3. Lab Exercise #3 - Operator Interface OP 1500

3.1. Introduction

The operator interface is a device that is programmed to provide a means for the operator tointeract with the PLC code. The interaction can include starting and stopping a process,reporting system status, inputting data and setpoints, and modifying and altering the ongoingprocess.

The Optimate 1500 is programmed using an Optimation Editor. This is offline program that isconfigured and then the data is transferred to the panel. The panel is connected to the PLCvia two cables and a telephone type coupler. This is the configuration to transfer data to thePLC. When transferring the program between the computer program and the panel theprogramming cable is plugged into the other side of the coupler and the PLC is removed.

There are two switches on the right side of the panel. The top is power to the panel and thelower switch when Program (UP) will allow a program to be transferred to the panel and in theRun (DOWN) position the PLC can communicate with the panel. When ever the Program/Runswitch is moved up or down the panel needs to be reset by turning the panel OFF and thenback ON.

3.2. Optimation Panel Configuration

Start the software and the first screen will look like:

Page 23: PLC Lab Exercises

♦ ♦ Direct Logic 205

23

Ensure the Type is set to OP1500 and the Address is set to the area of memory you plan touse. Then press the Configure Panel pushbutton and make entries to get the screen to

look like this picture. Double clicking a message number will open the next editor screen. Amessage line is limited to a total of 20 characters. Both a data display and a data entry pointis programmed using the character, all of the other characters will print on the screen as theyappear. Note the condition of the pushbuttons. Change the cable configuration and theprogramming switch and the press Write to Panel.

3.3. Operator Panel Memory Map

Page 24: PLC Lab Exercises

♦ ♦ Direct Logic 205

24

Enter nicknames for the addresses associated with the operator panel.

V1400 - Line1 B1406.0 - F1 B1407.0 - L1V1401 - Line2 B1406.1 - F2 B1407.1 - L2V1402 - Line1Data B1406.2 - F3 B1407.2 - L3V1403 - Line1DP B1406.3 - F4 B1407.3 - LF1V1404 - Line2Data B1406.4 - F5 B1407.4 - LF2V1405 - Line2DP B1406.5 - DA B1407.5 - LF3

B1406.9 - EN B1406.9 - DAKB1406.10 - UP B1406.9 - BEEPOFFB1406.11 - DN

Page 25: PLC Lab Exercises

♦ ♦ Direct Logic 205

25

3.4. Operator Panel Support Code

Page 26: PLC Lab Exercises

♦ ♦ Direct Logic 205

26

Page 27: PLC Lab Exercises

♦ ♦ Direct Logic 205

27

Page 28: PLC Lab Exercises

♦ ♦ Direct Logic 205

28

Page 29: PLC Lab Exercises

♦ ♦ Direct Logic 205

29

3.5. Operator Interface Exercise

Program the operator interface to have F1, F2 as alternate and F3, F4, and F5 to havemomentary action. When F1 is on then turn on the yellow light. When F3 is depressed thenturn on the green light keeping it on until there is a screen change and bring up two new lines,one to display the value of the active analog input channel and one to display the value sent tothe active analog output channel. When F4 is pressed replace one of the lines with an valueinput that will change the value sent to the active analog output channel. Using F2 switchsources of data to the active analog output channel between the value set with F4 and thevalue read from the active analog input channel.

4. Lab Exercise #4 - PID Loops

4.1. IntroductionThe DL250 PLC processor can support up to four proportional-integral-derivative (PID) loops.The computing powered to support this algorithm is generally found in much larger processors.The PID loop controller is used to control a process to a desired setpoint and is used when thesystem response characteristics do not allow simple ON/OFF control to keep the componentat a specified setpoint. The PID loop uses one of two equations to evaluate the systemcharacteristics and provide an output to a device to attempt to bring the component to thedesired setpoint.

In this diagram the current tank level is converted by the analog input module. The level iscompared with the desired setpoint that resides in the PLC and an error signal is generated.A proportional, integral, and derivative gain is applied to error signal to calculate a output thatis applied to a control valve via the output module. The details of setting up a PID loop can beviewed by selecting PLC from the toolbar, then Setup and then PID. If asked to switch to

Page 30: PLC Lab Exercises

♦ ♦ Direct Logic 205

30

program mode respond Yes. Enter the Table Start Address, this is the starting address andrequires 32 words to contain 1 PID loop. Increase the number of loops to 1.

Press Update and Exit. Select Configure and set the Sample Rate to 1.0 sec. SelectSP/PV and note the address of the setpoint, this should be an address in the range used bythe PID loop. In the Process Variable select Auto transfer from I/O module and then enter theslot and channel number of the active analog input channel (a number between 1 and 4). In theOutput enter 4095 in the Upper Limit and leave the lower limit at 0. Select Auto transfer to I/Omodule and enter the slot and channel number of the active analog output channel (a numberbetween 1 and 2). In the Tuning enter 25 for Gain (proportional gain) and 10 for Reset (IntegralGain) and select Freeze Bias. Close the PID screen and save both to the PLC and disk.

4.2. ExercisePlace the PLC in the run mode and enter 600 in the setpoint address. Selecting View from thetoolbar and then PID View. From this screen the Mode can be changed from Manual to Auto.If the loop is in alarm and you can’t get it to clear and run correctly then reset the loop by writing0 to the first word of the PID loop memory area.

Use the PID View, the multimeter connected to the output and the potentiometer that is thePresent Value to vary the parameters of the PID loop to learn the characteristics of the PIDloop. Adjusting the gains and/or setting the integral to 0 and see the response of the loop.Additional information is available in the DL 205 PLC User Manual Section 8.

5. Lab Exercise #5 - The Drum Sequencer

5.1. IntroductionThe drum sequencer is a box instruction that has four configurations that simulate an electro-mechanical drum sequencer. These instructions can be used to organize and step through arepetitive sequence of outputs. A practical application would be the timer on a washer ordryer. To implement a drum sequencer, 4 counters are used to control and advance thesequencer. The counters are numbered sequentially from the first programmed counter andprovide the following functions.

1) Current step counts2) Timer value3) Points to the preset step4) Points to the current step

Each of the sixteen steps can be programmed with a step duration and/or a condition to allowthe step to start timing. The event drum instruction will be presented in this lab.In the following example CT0 will be the first counter and CT1, CT2, and CT3 will be used asdescribed above. The Step Preset is the step the drum start processing after the Reset hasbeen toggled. Using the nicknames for the inputs, outputs and events can make the instructionvery readable.

Page 31: PLC Lab Exercises

♦ ♦ Direct Logic 205

31

5.2. ExampleThis example shows a bread recipe sequence.

Page 32: PLC Lab Exercises

♦ ♦ Direct Logic 205

32

NOTEWhen the drum instruction is first written to the PLC the PLC must be shifted to

PROGRAM mode and then back to RUN for the instruction to fully allocate memory.The drum RESET must also be toggled in order to reset the instruction correctly.

Notice the use of nicknames to simplify the readability of the sequencer operation. Step 2 willwait until 1 gallon of water has been added and likewise step 3 will wait until 5 additionalgallons have been added. Ladder logic will be added to support the sequencer output. Forexample the water temperature maybe controlled to a specific temperature. The ladder logiccould require a minimum temperature or the water will be directed toward the drain until it issuitable for the dough. The value in the field 0.01 sec/Count defines the time base for thesequencer. In this example 6000 X .01 = 60 sec/count or 1 minute.

5.3. ExerciseDevelop the code for a drum sequencer that will blink one of the four lights and when theoperator presses the same colored button the light will turn on solid for 5 seconds and thensequence to the next programmed light and start blinking. Use the pushbuttons and lights onthe operator interface to START, STOP, and RESET the drum as well as using the green lightto show that it is running. Program the drum so that the nicknames are used to document theinstructions. Try to write the program so that the light pattern can be changed by only alteringthe drum instruction. Extra effort would be to have the operator interface show which step thedrum was ON and what color of light was being operated.

NOTEWhen the drum instruction is first written to the PLC the PLC must be shifted to

PROGRAM mode and then back to RUN for the instruction to fully allocate memory.The drum RESET must also be toggled in order to reset the instruction correctly.

6. Final ExerciseProblem- Le Machine

Your task is to program a 500 lb. Commercial Washing Machine. The machine has a liquid productdispenser for soap (S), bleach (B), sour/softener (SS). The customer wants the machine to have anautomatic cycle for white material, colored material, and permanent press. The machine rotates inboth clockwise and counterclockwise directions when washing or rinsing, changing direction ever 15seconds. The machine has separate motors for wash, draining, Iow and high speed spin.

The drain valve is either open or closed and must be closed to fill, failing open on a loss of power.The water supply is hot (200 + 10°F) delivered at 40 gallons per minute and cold (60 + 5°F) deliveredat 60 gallons per minute. The water fill time is not included in the time to perform a step (timer stopsuntil the water level is satisfied). Low water level requires about 60 gallons of water and high about100 gallons. The product supply metering pumps are set to deliver a rate of 2 ounces per second.

Task:

Page 33: PLC Lab Exercises

♦ ♦ Direct Logic 205

33

Receive desired cycle type selection (1, 2, or 3) from the operator panel. Start, stop and abort cycleswitch are to be defined on the operator panel. The green, yellow, and red lights on the operatorpanel will indicate the injection of soap, bleach, or sour/softener. The white indicator will be on duringthe entire cycle, the green indicator will be on when the wash motor is running, the yellow indicatorwill be on when drain valve is shut and flashing during a drain cycle, and the red indicator will be onduring Iow spin and flashing when the fast spin motor is running. Total elapsed cycle time will bedisplayed on the operator panel.Program a drum instruction to run the machine trough the first two cycles and program anotherdrum instruction to run the Permanent Press cycle.

StepWaterLevel

Temp (°F)White Color PermPress

Product Amount (oz.)White Color PermPress

Time (Min)White Color PermPress

1 Flush H 80 65 65 3 3 32 Wash L 120 80 65 S-80 S-65 S-60 7 7 43 Drain 2 2 24 Wash L 120 80 65 S-30 S-30 S-30 5 5 45 Drain 2 2 26 Wash L 120 S-15, B-45 - - 47 Drain 27 Rinse H 100 80 65 5 5 3.58 Drain 2 2 29 Spin - L 2 2 210 Rinse H 80 80 80 3 3 311 Drain 2 2 212 Rinse L 80 80 80 SS-70 SS-50 SS-45 5 5 513 Drain 2 2 214 Spin - L15 Spin -H

4 4 3 8 8 8