Target behavior
With the start button, coordinate the 3 servo axes, cylinder, suction pad, and rotary table to take the 3 workpieces from the supply tray, turn them on the rotary table, and line them up on the discharge tray
What you will learn
This model transfers workpieces using three servo motor axes.
It is close to real equipment and requires complex control. It is a difficult problem, but give it a try!
Pick up a workpiece with the suction pad, rotate it 90° on the rotary table, and carry it to the discharge tray.
The following points are registered for the three servo motors.
| Axis | Point No. | Position [mm] | Speed [mm/s] | Acceleration [mm/s²] | Description |
|---|---|---|---|---|---|
| Axis 1 Supply | 1 | 25 | 100 | 400 | Workpiece 1 to the pick-up position |
| 2 | 80 | 100 | 400 | Workpiece 2 to the pick-up position | |
| 3 | 135 | 100 | 400 | Workpiece 3 to the pick-up position | |
| Axis 2 Transfer | 1 | 4 | 200 | 800 | Above the supply tray (pick-up position) |
| 2 | 239 | 200 | 800 | Above the rotary table | |
| 3 | 474 | 200 | 800 | Above the discharge tray (place position) | |
| Axis 3 Discharge | 1 | 135 | 100 | 400 | Left pocket of the discharge tray to the place position |
| 2 | 80 | 100 | 400 | Center pocket of the discharge tray to the place position | |
| 3 | 25 | 100 | 400 | Right pocket of the discharge tray to the place position |
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 Supply | Axis 2 Transfer | Axis 3 Discharge |
|---|---|---|---|---|
| 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 from 1 → 2 → 3.| Axis | Role | Points |
|---|---|---|
| Axis 1 Supply | Moves the supply tray to bring workpiece N to the pick-up position | P1 to P3 = workpieces 1 to 3 |
| Axis 2 Transfer | Carries the suction head left and right | P1 above the supply tray / P2 above the rotary table / P3 above the discharge tray |
| Axis 3 Discharge | Moves the discharge tray to bring pocket N to the place position | P1 to P3 = pockets 1 to 3 |
The relays of axis n are the axis 1 numbers plus 400×(n−1) (e.g. servo ON: axis 1 R305 / axis 2 R705 / axis 3 R1105).
| Step | Description | Condition to advance | Main outputs |
|---|---|---|---|
MR0 | Preparing | MR30 running, X1 raised end, R6600 operable, 3 axes servo ready | - |
MR1 | Homing | Homing complete on 3 axes | R310/R710/R1110 ON |
MR2 | Cycle start | MR30 running (DM0 +1) | - |
MR3 | Supply axis to workpiece N | Axis 1 start ack + positioning complete | Axis 1 → P[DM0] |
MR4 | Transfer axis to pick-up position | Axis 2 start ack + positioning complete | Axis 2 → P1 |
MR5 | Pick-up lowering | X0 lowered end | Y0 ON |
MR6 | Pick-up suction | X2 suction confirmed | Y0 ON, Y1 SET |
MR7 | Pick-up raising | X1 raised end | - |
MR8 | Transfer axis to rotary table | Axis 2 start ack + positioning complete | Axis 2 → P2 |
MR9 | Place on table: lowering | X0 lowered end | Y0 ON |
MR10 | Place on table: release | T0 0.5 s and X2 OFF | Y0 ON, Y1 RES, Y3 ON |
MR11 | Place on table: raising | X1 raised end | - |
MR12 | Rotate 90° | X4 after rotation | Y2 SET |
MR13 | Pick from table: lowering | X0 lowered end | Y0 ON |
MR14 | Pick from table: suction | X2 suction confirmed | Y0 ON, Y1 SET |
MR15 | Pick from table: raising | X1 raised end | - |
MR16 | Rotate back / discharge axis to pocket N | Axis 3 complete and X3 before rotation | Y2 RES, Axis 3 → P[DM0] |
MR17 | Transfer axis to place position | Axis 2 start ack + positioning complete | Axis 2 → P3 |
MR18 | Place on discharge tray: lowering | X0 lowered end | Y0 ON |
MR19 | Place on discharge tray: release | T1 0.5 s and X2 OFF | Y0 ON, Y1 RES, Y3 ON |
MR20 | Place on discharge tray: raising | X1 raised end → MR2 if DM0 is 1 or 2 / MR21 if 3 | - |
MR21 | 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 | Cylinder lowered end |
X1 | Cylinder raised end |
X2 | Suction confirmed |
X3 | Before rotation |
X4 | After rotation |
X5 | Start |
X6 | Stop |
| Outputs | |
Y0 | Cylinder down |
Y1 | Vacuum valve |
Y2 | Rotary table rotate |
Y3 | Vacuum break valve |
| Internal relays | |
MR0 | Preparing |
MR1 | Homing |
MR2 | Cycle start (waits here when stopped) |
MR3 | Supply axis to workpiece N |
MR4 | Transfer axis to pick-up position |
MR5 | Pick-up lowering |
MR6 | Pick-up suction |
MR7 | Pick-up raising |
MR8 | Transfer axis to rotary table |
MR9 | Place on table: lowering |
MR10 | Place on table: release |
MR11 | Place on table: raising |
MR12 | Rotate 90° |
MR13 | Pick from table: lowering |
MR14 | Pick from table: suction |
MR15 | Pick from table: raising |
MR16 | Rotate back / discharge axis to pocket N |
MR17 | Transfer axis to place position |
MR18 | Place on discharge tray: lowering |
MR19 | Place on discharge tray: release |
MR20 | Place on discharge tray: raising |
MR21 | All workpieces done |
MR30 | Automatic operation |
| Timers | |
T0 | Place on table: release wait |
T1 | Place on discharge tray: release wait |
| Data memory | |
DM0 | Workpiece number |
| Positioning unit | |
R0 | Operation enable |
R200 | Axis 1 Positioning start |
R305 | Axis 1 Servo ON |
R310 | Axis 1 Homing request |
R600 | Axis 2 Positioning start |
R705 | Axis 2 Servo ON |
R710 | Axis 2 Homing request |
R1000 | Axis 3 Positioning start |
R1105 | Axis 3 Servo ON |
R1110 | Axis 3 Homing request |
R6600 | Operable |
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 | First scan ON |
The row numbers in the figures match the row numbers in the simulator's ladder window.
CR2008 (first scan pulse) is a special relay that is ON only for the first scan after RUN starts. It SETs the first step MR0 (preparing).R0 and servo ON for the 3 axes (R305/R705/R1105).MR30 (automatic operation) holds itself with start X5, and the hold is broken by the N.C. contact of stop X6. It is the self-holding circuit of Problem 2 with a stop condition added.
MR30 is checked in only two places: "preparing → homing" and "cycle start → next workpiece". So even if stop is pressed midway, the workpiece being carried is placed first, and the machine stops at the cycle start (MR2) (cycle stop). Pressing start again resumes from the next workpiece.
INC DM0 (0 → 1 for the first workpiece)MR3→MR4: the supply axis has reached workpiece N (R6800, R6802)MR4→MR5: the transfer axis has reached above the supply tray (R7200, R7202)MR5→MR6→MR7: lower → suction → raise (same as Problem 8)MR7→MR8→MR9: after raising, move the transfer axis above the rotary table, then lower when it arrivesMR9→MR10: at the lowered end, go to suction releaseAs in Problem 12, positioning completion is judged by both "start acknowledged" and "positioning complete".
MR10→MR11: after 0.5 seconds of vacuum break (T0) and the workpiece coming off (X2 OFF), raise (same as Problem 9)MR11→MR12: at the raised end, rotate the table 90°MR12→MR13: when after-rotation X4 turns ON, lower againMR13→MR14→MR15→MR16: suction → raiseRotation is done only while the head is at the raised end, so the suction pad and workpiece do not collide.
MR16→MR17: proceed when both the rotary table return (before rotation X3) and the discharge axis move to pocket N (R7600, R7602) are finished. The two motions are done at the same time to save time.MR17→MR18→MR19→MR20: transfer axis above the discharge tray → lower → vacuum breakDM0 is 1 or 2, go back to cycle start MR2 for the next workpieceDM0 is 3, go to all workpieces done MR21Row 052 places = DM0 1 and = DM0 2 in parallel (OR) with a vertical line.
U_WRPPNT 1 DM0, using the value of the workpiece number DM0 directly as the point number. If DM0 is 1 it goes to P1, if 2 to P2, and so on, so the same ladder handles all 3 workpieces.R600 ONY0 (cylinder down) is ON during the 8 steps of lowering and working at the lowered end (suction, release). In other steps it is OFF and the cylinder rises.
Y1 in the two suction stepsY1 and turn the vacuum break valve Y3 ONT0/T1Y2 in the 90° rotation step and RES it in the rotate-back stepThe sample wiring and ladder data can be downloaded fromGitHuband loaded with "Load wiring" and "Load ladder" in the simulator.
Key points
T0 and T1 instead of sharing one across two steps because writing TMR with the same device in two places is a double coil.