Escolar Documentos
Profissional Documentos
Cultura Documentos
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
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
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.
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
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
X1
X2
X3
Y2
X3
X1
X2
Y3
Y3
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:
etc. Program the outputs using the coils, referring to the timing diagram. For example:
00101
Y1
00101
00102
Y2
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
00001 Steam valve 10001 00003 #0600 10002 T1.0 40001 10003 00003 00002 Drain valve
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.
X1
X2
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.
X6
Y1 Y2 Y3 C1 C2 C3 C4
00001 Cylinder Right 00101 00102 00104 00002 Cylinder Left 00101 00103 00104 00003
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)
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
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
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.
BLKM Example
40021 10001 10002 40011 BLKM 2 40031 10002 10001 40011 BLKM 2 00102 00101
00101
00103
00102
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
40001
40002
40021
40022
40051
40052
40061
40062
T=0 T=10
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
00101
00103
00102 40003 00103 T1.0 40002 00103 40005 00103 T1.0 40001 00103 00002 00001
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
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
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
10001
00026
00021
00021
00022 40102
00001
00023
00021
00023
00002
00021 00021
00024 40104
00003 00025
00021
00025
00004
00022
00023 40105
00024
00025
00026 00005
00005 T1.0 40005 00021 40111 10002 00028 00029 40101 BLKM 5
00026
00027
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
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
Register
40009 00102 UCTR 40002 10001 00103
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
10001 00101
0 5 5 5 5 5 10 10
00102
0
00103
0 10 10
00104
0
00001
0 10
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
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