Sie sind auf Seite 1von 28

ME 4231 Motion Control Lab

1. Introduction Background PLC - Programmable Logic Controller Origin - GM in 1968 Original goals: programmable communication capable maintainable reliable compact inexpensive Additional features: discrete & continuous control MMI PLC structure:
Program Terminal CPU / Memory I/O Modules

Programming Language RLL - Relay Ladder Logic History: RLL was documentation standard for relay panels Relay terminology
NC Contact

NO Contact Coil

ME 4231 Motion Control Lab

Programming elements Normally Open (NO) contact Normally Closed (NC) contact Coil Connectors (shorts) Timer
in preset Tx.xxx accum out

enable/ reset

inverse out

Counter

in

preset U/DCTR accum

out

enable/ reset

inverse out

Relay operation A normally open (NO) contact passes power when the associated coil (or input) is on. A normally closed (NC) contact passes power when the associated coil (or input) is off. A given coil (or input) can be associated with any number of both normally open and normally closed contacts. Timer / Counter operation Timer runs, increasing the (integer) accumulated value, when accum < preset & both inputs (in & enable/reset) are on. Counter increases the accumulated value when accum < preset, the bottom input enable/reset is on, and the top input in goes on. Output (out) is on when accum = preset. Accum is reset to zero when enable/reset is off.

ME 4231 Motion Control Lab Example: Oscillator


#0002 10001 T1.0 40001 00101 #0003 00001 T1.0 40002 00001 00101 00001

Timing Diagram
10001 00001 00101 2s 3s 2s 3s

Note: Gould-Modicon numbering convention: 0xxxx: outputs (normally > 00012 are internal coils) 1xxxx: inputs (normally 10001 through 10016) 4xxxx: counter & timer values

ME 4231 Motion Control Lab

2. RLL Design Strategy Coffee Maker Example Sequence of operations: 1. Reservoir is filled with water. 2. Power switch is turned on. 3. Heated water travels through grinds/filter to coffee pot. 4. Coffee pot reaches desired temperature. 5. Ready light turns on; pot heater turns off. 6. Coffee pot temperature drops; ready light stays on.
water

X2 Y1

X3 Y2 Y3 X1

Inputs X1 - Power on switch X2 - Water present indicator X3 - Temperature indicator Outputs Y1 - Reservoir heater Y2 - Hot plate heater Y3 - Ready light

ME 4231 Motion Control Lab

Coffee Maker: Timing Diagram


X1 X2 X3 Y1 Y2 Y3

Coffee Maker: RLL Program


X1 X2 Y1

X1

X2

X3

Y2

X3

X1

X2

Y3

Y3

ME 4231 Motion Control Lab

Street Light Strategy Timing Diagram


Green 1 Yellow 1 Red 1 Green 2 Yellow 2 Red 2

35 40

55 60

Divide problem into steps - how many steps? Proposal: assign one internal coil to each step. Add these coils to the timing diagram:

Coil 1 Coil 2 Coil 3 Coil 4 0 35 40 55 60

ME 4231 Motion Control Lab

Program the internal coils first:


#0035 10001 T1.0 40001 00104 #0005 00101 T1.0 40002 00104 00102 (C2) 00101 (C1)

etc. Program the outputs using the coils, referring to the timing diagram. For example:

00101

Y1

00101

00102

Y2

etc. Remaining problem is to reset the system correctly.

ME 4231 Motion Control Lab

3. RLL Programming Example Given the following RLL code and the operation of input 10001, complete the timing diagram for coils 00101 and 00102.
#0003 10001 T1.0 40001 00101 #0002 00101 UCTR 40002 10001 10001 00101 0 00102 0 5 10 5 10 00102 00101

Steam Cooker Example Sequence of operations: 1. The start button is momentarily closed, starting the pump. 2. The tank fills, activating first the low-level, then the high-level sensor. Then the pump stops. 3. The steam valve opens, raising the temperature until the temperature indicator is activated. 4. Ten minutes after the desired temperature is reached, the steam shuts off and the drain valve opens. 5. The tank empties, de-activating first the high-level, then the low-level sensor. Then the drain valve closes. 6. Steps 1-5 are repeated.
X1- high level Y1 temp pump X4 start steam Y2 Y3 drain X2 X3- low level

ME 4231 Motion Control Lab Inputs: X1 - High level indicator switch (on = full) X2 - Temperature indicator (on = hot) X3 - Low level indicator (off = empty) X4 - Start button (on = pushed - momentary) Outputs: Y1 Pump Y2 Steam valve Y3 Drain valve Steam Cooker Timing Diagram
X1 X2 X3 X4 Y1 Y2 Y3

ME 4231 Motion Control Lab RLL Program Steam Cooker

Pump 10004 10003 10001 00001

00001 Steam valve 10001 00003 #0600 10002 T1.0 40001 10003 00003 00002 Drain valve

ME 4231 Motion Control Lab

4. RLL Programming Example (2) Given the following RLL code and the operation of input 10001, complete the timing diagram for coils 00101 and 00102.

10001

00102

00101

00101 #0002 00101 T1.0 40001 10001 10001 00101 0 00102 0 5 10 5 10 00102

Packaging Device Example Sequence of operations: 1. Power is turned on, starting conveyor. 2. Widget traveling on conveyor is detected. 3. Solenoid activates pneumatic cylinder, loading widget into box. 4. Cylinder reaches end of stroke and pauses. 5. Cylinder returns to home position. 6. Steps 2-5 are repeated until box is full (12 widgets). 7. Conveyor stops and waits for restart button.

ME 4231 Motion Control Lab

X1

X2

X3 conveyor Cycle Start X6 widget X4

Power Stop On X5

Y1

To box

Y2

Y3

air

return

Inputs: X1 - Power On switch (momentary closed) X2 - Stop switch (momentary open) X3 - Cycle Start switch (momentary closed) X4 - Photo detector (normally open) X5 - Cylinder left limit switch (normally open) X6 - Cylinder right limit switch (normally open) Outputs: Y1 - Conveyor Y2 - Cylinder right Y3 - Cylinder left Functional Requirements: 1. X1 must remain closed for 2 seconds to turn on the machine. After 2 seconds, machine stays on when switch is released. 2. The cycle start button X3 must be pushed to start the conveyor Y1. 3. If X2 is pushed, machine turns and remains off until restarted with X1. 4. Cylinder right Y2 is activated 0.2 seconds after part is detected (X4 is opened), and remains on until X6 is closed. 5. Cylinder left Y3 is activated 0.1 seconds after cylinder move right is completed (X6 is closed), and remains on until X5 is closed. 6. Steps 3 & 4 are repeated 12 times, and then the machine stops until the cycle start button is pushed again.

ME 4231 Motion Control Lab

Packaging Device Timing Diagram:


X1 X2 X3 X4 X5

X6
Y1 Y2 Y3 C1 C2 C3 C4

ME 4231 Motion Control Lab RLL Program: Packaging Device


#0020 10001 T0.1 40001 10002 #0002 10004 T0.1 40002 10006 #0001 10006 T0.1 40003 10005 #00012 10006 UCTR 40004 10003 Conveyor 10003 00104 00001 10005 00104 Box Full 00103 Part Loaded 00102 Part Ready 00101 Power On

00001 Cylinder Right 00101 00102 00104 00002 Cylinder Left 00101 00103 00104 00003

ME 4231 Motion Control Lab

5. USING REGISTERS In a timer or counter, there are two numbers that the PLC stores and refers to: accum preset When setting up a timer or counter, an address (4xxxx) must be supplied for the accum value, since the program causes this number to change as the time increments. The preset may be either an address or a constant value - up to this point we have used only constants for the preset. Example: Timer using an address for the preset
40001 10001 T1.0 40002 10001 00001

10001 00001

Register table (access through register/edit menu): Time: 00001 10001 40001 40002 0 0 1 3 0 1 0 1 3 1 2 0 1 3 2 3 1 1 3 3 4 1 1 3 3 5 1 1 3 3 6 1 1 3 3 7 0 0 3 0 8 0 0 3 0

Notes: Registers 0xxxx and 1xxxx can only be 1 or 0. Register 4xxxx can be any integer (max 32767)

ME 4231 Motion Control Lab Steam Cooker Example


X1 X2 X3 X4 Y1 Y2 Y3 0 500 1000 1500 2000 Pump 10004 10003 10001 00001 2500 3000

00001 Steam valve 10001 00003 40002 10002 T1.0 40001 10003 00003 00002 Drain valve

Time: 00001 00002 00003 10001 10002 10003 10004 40001 40002

500

1000 1500 2000 2500 3000

600

600

600

600

600

600

600

ME 4231 Motion Control Lab 6. BLKM Programming Understanding registers (especially accum) is necessary for MMI programming the MMI program uses the register information to illustrate the process on the computer screen. Using addresses for preset is mainly useful if it can be changed by the program. We will accomplish this with the BLKM command.
input source output

dest BLKM length

BLKM operation The register values in the source registers are copied to the destination registers each logic cycle while the input is on. When the input is on and the registers have been copied, the output is turned on. Source refers to the address of the first register to be copied. Dest refers to the address to which the first register is copied. Lengthis the number of consecutive registers to be copied. For example, if length = 3, the source register and the next two are copied to the destination register and the next two.

ME 4231 Motion Control Lab

BLKM Example

40021 10001 10002 40011 BLKM 2 40031 10002 10001 40011 BLKM 2 00102 00101

00101

00103

00102

00103 40012 00103 T1.0 40001 00103 00001

ME 4231 Motion Control Lab

Time: 10001 10002 00001 00101 00102 00103 40001 40011 40012 40021 40022 40031 40032

0 0 0

1 1 0

2 1 1

3 1 1

4 1 0

5 0 0

6 0 0

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

ME 4231 Motion Control Lab Given the following RLL program, complete the timing diagram and fill in the table of register values at t=10 seconds.
#0003 10001 T1.0 40001 10001 40051 10001 40021 BLKM 2 40061 00101 40021 BLKM 2 00103 00102 00101

00102

00101

00104

00103

00104 40022 00104 T1.0 40002 00104 00001

40001

40002

40021

40022

40051

40052

40061

40062

T=0 T=10

ME 4231 Motion Control Lab

10001 00101 0 00102 0 00103 0 00104 0 00001 0 5 10 5 10 5 10 5 10 5 10

ME 4231 Motion Control Lab

7. RECIPES Given the following RLL program, complete the timing diagram and fill in the table of register values at t=10 seconds.
40009 10001 10002 40003 BLKM 3 00101

40006 10002 10001 40003 BLKM 3 00102

00101

00103

00102 40003 00103 T1.0 40002 00103 40005 00103 T1.0 40001 00103 00002 00001

ME 4231 Motion Control Lab

40001 40002 40003 40004 40005 40006 40007 40008 40009 40010 40011

T=0 0 0 0 0 0 1 2 3 4 5 6

T=10

10001 10002 00101 0 00102 0 00103 0 00001 0 00002 0 5 10 5 10 5 10 5 10 5 10

RECIPE EXAMPLE: Ice Cream Maker Ingredients: Premix (eggs, cream, sugar, etc.), vanilla, strawberry, chocolate Outputs: Premix dispenser Vanilla dispenser Strawberry dispenser Chocolate dispenser Mixer Recipes: Vanilla 5 1.5 0 0 30 Strawberry 5 .3 1.3 0 35 Chocolate 6 .2 0 .5 40

00001 00002 00003 00004 00005

Premix Vanilla Strawberry Chocolate Mix Time

ME 4231 Motion Control Lab

Initial Register Values: Recipe 40101 40102 40103 40104 40105 Vanilla 40111 50 40112 15 40113 0 40114 0 40115 30 Strawberry Chocolate 40121 50 40131 60 40122 3 40132 2 40123 13 40133 0 40124 0 40134 5 40125 35 40135 40

0 0 0 0 0

Inputs: Start button Select Vanilla Select Strawberry Select Chocolate

10001 10002 10003 10004

10001

00026

00021

00021 40101 00021 T0.1 40001 00021 00022

00021

00022 40102

00001

00021 T0.1 40002 00021

00023

00021

00023

00002

ME 4231 Motion Control Lab


40103 00021 T0.1 40003 00021 00024

00021 00021

00024 40104

00003 00025

T0.1 40004 00021

00021

00025

00004

00022

00023 40105

00024

00025

00026 00005

00005 T1.0 40005 00021 40111 10002 00028 00029 40101 BLKM 5

00026

00027

40121 10003 00027 00029 40101 BLKM 5 00028

40131 10004 00027 00028 40101 BLKM 5 00029

ME 4231 Motion Control Lab

8. Examples Given the following RLL program, complete the timing diagram and fill in the table of register values at t=10 seconds.

10001

00102

00101

00101 40011 00101 T1.0 40001 00102 00102

40021 00102 40011 BLKM 3 40012 00103 T1.0 40002 00104 40013 00104 UCTR 40003 10001 00001 00104 00103

Register 40001 40002 40003 40011 40012 40013 40021 40022 40023

T=0 0 0 0 2 3 4 1 2 3

T=10

10001 00101
0 5 5 5 5 5 10 10

00102
0

00103
0 10 10

00104
0

00001
0 10

ME 4231 Motion Control Lab Given the following RLL program, complete the timing diagram and fill in the table of register values at t=10 seconds.

10001

00103

00101

00101 40011 00101 T1.0 40001 00102 00103 00102

Register
40009 00102 UCTR 40002 10001 00103

40003 00102 10001 40010 BLKM 00104

40001 40002 40003 40004 40005 40006 40007 40008 40009 40010 40011 40012

T=0 0 0 3 4 5 1 2 3 3 0 0 0

T=10

40006 10001 00102 40010 BLKM 3 00001

10001 00101
0 5 5 5 5 5 10 10

00102
0

00103
0 10 10

00104
0

00001
0 10

ME 4231 Motion Control Lab

9. REVIEW Given the following RLL program, complete the timing diagram and fill in the table of register values at t=10 seconds.
40021 00102 T1.0 40001 10001 40031 10001 40021 BLKM 2 00102 00101

Register 40001 40002 40003 40011 40012 40021 40022 40031 40032

40021 00101 40011 BLKM 2 00103

T=0 0 0 0 1 1 4 7 3 2

T=10

40012 00103 T1.0 40002 00104 40022 00104 UCTR 40003 10001 00001 00104

10001 00101
0 5 5 5 5 5 10 10

00102
0

00103
0 10 10

00104
0

00001
0 10

Das könnte Ihnen auch gefallen