Target behavior
Start automatic operation with the Start button: move each base from the supply conveyor to the jig, put a cover on it, and send it out on the discharge conveyor. Repeat for 5 bases
What you will learn
This equipment puts a cover on a base workpiece.
You need to coordinate three units in the right order: two conveyors, a loader, and a cover transfer. Take it on as a wrap-up of all the previous problems!
How the equipment works
Control panel
I/O assignment
| Input | Description | Output | Description |
|---|---|---|---|
| X0 / X1 / X2 | Start / Stop / Reset | Y0 | Supply conveyor |
| X3 | Emergency stop (stays ON when pressed) | Y1 | Loader up/down (ON = down) |
| X4 | Photoelectric sensor 1: base arrived | Y2 | Air gripper (ON = close) |
| X5 / X6 | Loader raised / lowered | Y3 | Jig clamp (ON = clamp) |
| X7 / X8 | Gripper open / closed | Y4 | Suction (vacuum valve) |
| X9 / X10 | Clamp retracted / extended | Y5 | Vacuum break valve |
| X11 | Proximity sensor: base in the jig | Y6 | Discharge conveyor |
| X12 | Photoelectric sensor 2: cover present | Y7 / Y8 | Run lamp / Error lamp |
| X13 | Proximity sensor: covers in the magazine | Y9 / Y10 / Y11 | Signal tower green / yellow / red |
| X14 | Suction confirmed (pressure switch) | ||
| X15 | Photoelectric sensor 3: exit |
The following points are registered for the three servo motors.
| Axis | Point No. | Position [mm] | Speed [mm/s] | Acceleration [mm/s²] | Description |
|---|---|---|---|---|---|
| Axis 1 Loader | 1 | 5 | 200 | 800 | Above the supply conveyor (base pick-up position) |
| 2 | 100 | 200 | 800 | Above the jig | |
| 3 | 200 | 200 | 800 | Above the discharge conveyor | |
| Axis 2 Cover Y | 1 | 0 | 200 | 800 | Above the magazine |
| 2 | 150 | 200 | 800 | Above the jig | |
| Axis 3 Cover Z | 1 | 0 | 100 | 400 | Raised end (travel height) |
| 2 | 35 | 100 | 400 | Pick up the 1st cover / place a cover on the base in the jig | |
| 3 | 47 | 100 | 400 | Pick up the 2nd cover | |
| 4 | 59 | 100 | 400 | Pick up the 3rd cover | |
| 5 | 71 | 100 | 400 | Pick up the 4th cover | |
| 6 | 83 | 100 | 400 | Pick up the 5th cover |
The relays used to control each of the three axes are as follows. Operation enable, forced stop, and operable are shared by all axes.
See the description of Problem 12 for how to use each relay. In the U_WRPPNT and U_RDAERC instructions, specify 1 to 3 as the axis number.
| Name (all axes) | Direction | Relay |
|---|---|---|
| Operation enable | Output | R0 |
| Forced stop | Output | R2 |
| Operable | Input | R6600 |
| Name | Direction | Axis 1 Loader | Axis 2 Cover Y | Axis 3 Cover Z |
|---|---|---|---|---|
| Servo ON | Output | R305 | R705 | R1105 |
| Servo ready | Input | R6905 | R7305 | R7705 |
| Homing request | Output | R310 | R710 | R1110 |
| Homing complete | Input | R6910 | R7310 | R7710 |
| Positioning start | Output | R200 | R600 | R1000 |
| Positioning start acknowledged | Input | R6800 | R7200 | R7600 |
| Axis busy | Input | R6903 | R7303 | R7703 |
| Positioning complete | Input | R6802 | R7202 | R7602 |
| Positioning complete clear | Output | R202 | R602 | R1002 |
| Axis error | Input | R6900 | R7300 | R7700 |
| Axis error clear | Output | R300 | R700 | R1100 |
DM0 goes from 1 to 5.| Axis | Role | Points |
|---|---|---|
| Axis 1 Loader traverse | Moves the loader left and right | P1 above supply conveyor / P2 above jig / P3 above discharge conveyor |
| Axis 2 Cover transfer Y | Carries the suction pad between the magazine and the jig | P1 above magazine / P2 above jig |
| Axis 3 Cover transfer Z | Moves the suction pad up and down | P1 raised end / P2 to P6 pick-up height of covers 1 to 5 (P2 is also the height for placing on the jig) |
The loader up/down (Y1) and the chuck (Y2) are air cylinders. Their motion is confirmed with auto switches (X5 to X8).
| Step | Description | Condition to advance | Main outputs |
|---|---|---|---|
MR0 | Preparing | MR50 automatic operation, R6600 ready, servo ready on 3 axes | - |
MR1 | Homing | Homing complete on 3 axes | R310/R710/R1110 ON |
MR2 | Cycle start | MR50 automatic operation (DM0 +1) | - |
MR3 | Waiting for base | X4 photoelectric 1 | Y0 supply conveyor |
MR4 | Loader to supply pick-up | Axis 1 start acknowledged and positioning complete | Axis 1 → P1 |
MR5 | Supply pick-up: lowering | X6 lowered end | Y1 ON |
MR6 | Supply pick-up: gripping | X7 and X8 OFF and T0 0.5 s | Y1 ON, Y2 SET |
MR7 | Supply pick-up: raising | X5 raised end | - |
MR8 | Loader to jig | Axis 1 start acknowledged and positioning complete | Axis 1 → P2 |
MR9 | Place on jig: lowering | X6 lowered end | Y1 ON |
MR10 | Place on jig: release | X7 chuck open | Y1 ON, Y2 RES |
MR11 | Place on jig: raising | X5 raised end | - |
MR12 | Clamp / loader retreat | X10 forward end, X11 present, axis 1 complete | Y3 SET, axis 1 → P1 |
MR13 | Cover transfer to magazine | Axis 2 start acknowledged and positioning complete | Axis 2 → P1 |
MR14 | Cover pick-up: lowering | Axis 3 start acknowledged and positioning complete | Axis 3 → P[DM0+1] |
MR15 | Cover suction | X14 suction confirmed | Y4 SET |
MR16 | Cover pick-up: raising | Axis 3 start acknowledged and positioning complete | Axis 3 → P1 |
MR17 | Cover transfer to jig | Axis 2 start acknowledged and positioning complete | Axis 2 → P2 |
MR18 | Cover place: lowering | Axis 3 start acknowledged and positioning complete | Axis 3 → P2 |
MR19 | Cover place: release | T1 0.5 s and X14 OFF | Y4 RES, Y5 ON |
MR20 | Cover place: raising | Axis 3 start acknowledged and positioning complete | Axis 3 → P1 |
MR21 | Cover check | X12 photoelectric 2 (MR41 fault if not detected within 2 s) | - |
MR22 | Unclamp / cover transfer retreat | X9 retracted end, axis 2 complete | Y3 RES, axis 2 → P1 |
MR23 | Loader to jig | Axis 1 start acknowledged and positioning complete | Axis 1 → P2 |
MR24 | Jig pick-up: lowering | X6 lowered end | Y1 ON |
MR25 | Jig pick-up: gripping | X7 and X8 OFF and T3 0.5 s | Y1 ON, Y2 SET |
MR26 | Jig pick-up: raising | X5 raised end | - |
MR27 | Loader to discharge conveyor | Axis 1 start acknowledged and positioning complete | Axis 1 → P3 |
MR28 | Discharge place: lowering | X6 lowered end | Y1 ON |
MR29 | Discharge place: release | X7 chuck open | Y1 ON, Y2 RES |
MR30 | Discharge place: raising | X5 raised end | - |
MR31 | Waiting to pass photoelectric 3 | Falling edge of X15 | Y6 discharge conveyor |
MR32 | Waiting for drop | T4 1 s → MR2 if DM0 is 1 to 4 / MR40 if 5 | Y6 discharge conveyor |
MR40 | All workpieces done | - | - |
Based on this approach, try writing the ladder yourself first.
In the simulator, you can create the wiring and ladder and actually run the 3D equipment model.
| Device | Comment |
|---|---|
| Inputs | |
X0 | Start |
X1 | Stop |
X2 | Reset |
X3 | Emergency stop |
X4 | Photoelectric 1 base arrived |
X5 | Loader raised end |
X6 | Loader lowered end |
X7 | Chuck open |
X8 | Chuck closed |
X9 | Clamp retracted end |
X10 | Clamp forward end |
X11 | Proximity jig workpiece present |
X12 | Photoelectric 2 cover present |
X14 | Suction confirmed |
X15 | Photoelectric 3 discharge |
| Outputs | |
Y0 | Supply conveyor |
Y1 | Loader down |
Y2 | Chuck close |
Y3 | Jig clamp |
Y4 | Vacuum valve |
Y5 | Vacuum break valve |
Y6 | Discharge conveyor |
Y7 | Run lamp |
Y8 | Error lamp |
Y9 | Tower light green |
Y10 | Tower light yellow |
Y11 | Tower light red |
| Internal relays | |
MR0 | Preparing |
MR1 | Homing |
MR2 | Cycle start (waits here when stopped) |
MR3 | Supply conveyor: waiting for base |
MR4 | Loader to supply pick-up |
MR5 | Supply pick-up: lowering |
MR6 | Supply pick-up: gripping |
MR7 | Supply pick-up: raising |
MR8 | Loader to jig |
MR9 | Place on jig: lowering |
MR10 | Place on jig: release |
MR11 | Place on jig: raising |
MR12 | Clamp / loader retreat |
MR13 | Cover transfer to magazine |
MR14 | Cover pick-up: lowering |
MR15 | Cover suction |
MR16 | Cover pick-up: raising |
MR17 | Cover transfer to jig |
MR18 | Cover place: lowering |
MR19 | Cover place: release |
MR20 | Cover place: raising |
MR21 | Cover check |
MR22 | Unclamp / cover transfer retreat |
MR23 | Loader to jig |
MR24 | Jig pick-up: lowering |
MR25 | Jig pick-up: gripping |
MR26 | Jig pick-up: raising |
MR27 | Loader to discharge conveyor |
MR28 | Discharge place: lowering |
MR29 | Discharge place: release |
MR30 | Discharge place: raising |
MR31 | Discharge: waiting to pass photoelectric 3 |
MR32 | Discharge: waiting for drop |
MR40 | All workpieces done |
MR41 | Missing-cover fault |
MR50 | Automatic operation |
MR52 | Emergency stop active |
| Timers | |
T0 | Supply pick-up: grip wait |
T1 | Cover place: release wait |
T2 | Cover check timeout |
T3 | Jig pick-up: grip wait |
T4 | Discharge: drop wait |
| Data memory | |
DM0 | Workpiece number |
| Positioning unit | |
R0 | Operation enable |
R2 | Forced stop |
R200 | Axis 1 Positioning start |
R300 | Axis 1 Axis error clear |
R305 | Axis 1 Servo ON |
R310 | Axis 1 Homing request |
R600 | Axis 2 Positioning start |
R700 | Axis 2 Axis error clear |
R705 | Axis 2 Servo ON |
R710 | Axis 2 Homing request |
R1000 | Axis 3 Positioning start |
R1100 | Axis 3 Axis error clear |
R1105 | Axis 3 Servo ON |
R1110 | Axis 3 Homing request |
R6600 | Ready |
R6800 | Axis 1 Positioning start acknowledged |
R6802 | Axis 1 Positioning complete |
R6905 | Axis 1 Servo ready |
R6910 | Axis 1 Homing complete |
R7200 | Axis 2 Positioning start acknowledged |
R7202 | Axis 2 Positioning complete |
R7305 | Axis 2 Servo ready |
R7310 | Axis 2 Homing complete |
R7600 | Axis 3 Positioning start acknowledged |
R7602 | Axis 3 Positioning complete |
R7705 | Axis 3 Servo ready |
R7710 | Axis 3 Homing complete |
| Special relays | |
CR2002 | Always ON |
CR2008 | One pulse ON at start |
The row numbers in the figures match the row numbers in the simulator's ladder window.
CR2008 (one pulse at start) SETs the first step MR0 (preparing).R0 and servo ON for the 3 axes (R305/R705/R1105).X3 SETs MR52 (emergency stop active)R2 turns ON and stops the 3 axes.X2 clears the axis errors of the 3 axes and also clears the missing-cover fault MR41.LDF, falling edge), RES MR52 if the emergency stop has been releasedEvery step transition has an N.C. contact of MR52, so the process does not advance during an emergency stop. The conveyor and positioning start outputs also have an N.C. contact of MR52 so that they stop.
On the other hand, the loader up/down, chuck, clamp, and suction do not use MR52. If the emergency stop also returned the pneumatic devices, the loader would drop the workpiece it is holding.
MR50 (automatic operation) latches with Start X0, and the latch is broken by the N.C. contacts of Stop X1, emergency stop MR52, and all-done MR40.
MR50 is only checked in two places: "preparing → homing" and "cycle start → next workpiece". So even if Stop is pressed midway, the machine finishes discharging the workpiece being assembled and then stops at the cycle start (MR2) (cycle stop). After resuming from an emergency stop with Reset, it also stops once the current workpiece is discharged; press Start again to continue.
R6600), and all 3 axes are servo ready, go to homingMR3 and at the same time add 1 to the workpiece number with INC DM0.X4 detects the base. The supply conveyor Y0 runs only during MR3 (row 135), so it stops as soon as the step advances.MR4→MR5: the loader has arrived above the supply conveyor (axis 1 P1) (R6800 and R6802)MR5→MR6: lowered end X6 → gripMR6→MR7: when chuck open X7 and chuck closed X8 are both OFF and 0.5 s (T0) has passed since the close command → raiseMR7→MR8→MR9: at raised end X5, move above the jig (axis 1 P2), then lowerMR9→MR10→MR11→MR12: release at the lowered end, confirm chuck open X7, then raiseA chuck that has gripped a workpiece stops against it and never reaches the closed end X8 (problem 7). So the grip is judged by three conditions: "left the open end, has not reached the closed end, and 0.5 s has passed". If the closed end turns ON, the chuck missed the workpiece and closed on nothing, so the step does not advance.
In MR12, the jig clamp Y3 is SET and, at the same time, the loader returns above the supply conveyor (axis 1 P1). The cover transfer will come above the jig, so the loader has to get out of the way.
The step advances when all three are in place: clamp forward end X10, workpiece present on the jig X11, and the loader move complete. As in problem 13, doing two unrelated motions in the same step shortens the cycle time.
MR13→MR14: axis 2 has arrived above the magazine (P1)MR14→MR15: axis 3 has lowered to the height of cover NMR15→MR16: when suction confirmed X14 turns ON, raiseMR16→MR17→MR18: return to the raised end (axis 3 P1), then carry above the jig with axis 2 (P2)MR18→MR19: lower axis 3 to the place height (P2)MR19→MR20: when the vacuum break has run for 0.5 s (T1) and suction confirmed is OFF, raise (same as problem 9)MR20→MR21: back at the raised end → cover checkAxis 2 (horizontal) only moves while axis 3 is at the raised end (P1). Moving sideways while lowered would make the suction pad or the cover hit the magazine or the base.
X12 detects the cover, go to unclamp.T2) of entering the cover check step, SET the missing-cover fault MR41. The error lamp Y8 and the red tower light Y11 turn on, and the process stays at the cover check.MR22, RES the clamp Y3 and at the same time move the cover transfer (axis 2) back above the magazine. Advance when clamp retracted end X9 and the axis 2 move are both complete.Detecting a fault because "a condition was not met within a set time" is called a timeout. Add one to steps that wait for a sensor, in case the condition never comes; when the machine stops, the cause is clear right away.
This is the same flow as moving the base to the jig (MR4 to MR11), but this time the loader grips above the jig (axis 1 P2) and releases above the discharge conveyor (axis 1 P3).
MR23 to MR26: move above the jig → lower → grip (T3 0.5 s) → raiseMR27 to MR30: move above the discharge conveyor → lower → release → raiseThe grip waiting time is split between T0 and T3 because using TMR on the same timer in two places would be a double coil.
Y6 and advance on the falling edge (LDF) of photoelectric sensor 3 X15, which catches the moment the workpiece has passed the sensor.T4) later, if DM0 is 1 to 4, go back to the cycle start MR2 for the next workpieceDM0 is 5, go to all-done MR40. MR40 ends automatic operation MR50.Row 097 connects the comparison instructions = DM0 1 to = DM0 4 in parallel (OR) with vertical lines.
MR4) and for retreating (MR12); P2 is used in MR8 and MR23.R200.The start output has an N.C. contact of MR52, so R200 turns OFF during an emergency stop. When the machine resumes after Reset, R200 turns ON again and its rising edge restarts the move to the same point. This is how the machine "resumes from where it stopped".
MR13 (to the magazine) and MR22 (retreat), and P2 in MR17 (to the jig)R600MR14), check the value of DM0 with comparison instructions and set P2 for cover 1, P3 for cover 2, … P6 for cover 5.MR16, MR20) and P2 for lowering to place (MR18)R1000The covers are stacked 12 mm each, so the lowering distance must grow by 12 mm for every cover taken. In problem 13 the workpiece number was used directly as the point number, as in U_WRPPNT 1 DM0. Here, P1 is used for the raised end, so the point number is one more than the workpiece number. The ladder therefore splits the cases with = DM0 n and writes U_WRPPNT 3 n+1.
Y0 ON while waiting for the base (MR3)Y6 ON during discharge (MR31, MR32)Y1 ON during the 8 steps of lowering and working at the lowered end (grip, release). In all other steps it is OFF and the loader rises.Y2 (chuck close) in the two grip steps and RES it in the two release stepsT0 and T3 count the grip waiting timeY3 in MR12 and RES it in MR22Y4 in cover suction MR15MR19, RES Y4, turn ON the vacuum break valve Y5, and count 0.5 s with T1T2 (2 s)T4 (1 s). It has an N.C. contact of MR52 so that it does not count during an emergency stop.| Output | Lights when |
|---|---|
Y7 Run lamp | Automatic operation MR50 |
Y8 Error lamp / Y11 red | Emergency stop MR52 or missing-cover fault MR41 |
Y9 green | Automatic operation, with no emergency stop and no fault |
Y10 yellow | Not in automatic operation, with no emergency stop and no fault (stopped) |
Rows 167–168 branch one circuit to two coils, Y8 and Y11.
The sample wiring and ladder data can be downloaded fromGitHuband loaded with "Load wiring" and "Load ladder" in the simulator.
Key points