Pick-and-place with a 6-axis arm
DH setup, workspace IK, and a state machine sequencing the cycle.
You'll set up a serial manipulator from DH parameters, drive its TCP in Cartesian space, and sequence a full pick-place cycle, the three deepest features of the product working together.
1. The arm
Create a serial manipulator. Enter your robot's DH table (datasheet, or the generic 6R example from the kinematics reference); set joint limits from the datasheet.
Fix the base first: rotate the object's world pose X by -90° so the arm stands up (why). Verify each joint with a temporary variable before continuing, J1 should yaw the whole arm, J2 shoulder-pitch, etc.
2. Workspace control
Switch the arm's control mode to Workspace and create six variables: TCP_X/Y/Z and TCP_Roll/Pitch/Yaw, each bound in the arm's workspace variable slots. Give them Constant configs at a comfortable home pose, the arm should stand there when you simulate.
Pick the workspace frame: global if your targets are scene coordinates (this tutorial), local if a controller will supply them.
3. The stations
Two simple objects: an infeed with a product on it, an outfeed. A product object with a visibility variable at each station lets us fake the transfer: Product_AtInfeed, Product_InGripper (child of the arm's last link!), Product_AtOutfeed, one visible at a time.
4. The sequence
One state machine owning the TCP variables via Position actions (trapezoid moves on TCP_X/Y/Z):
Home → ToPickHover → ToPickDown → Grip(timer 0.3s: AtInfeed=0, InGripper=1)
→ ToPlaceHover → ToPlaceDown → Release(timer: InGripper=0, AtOutfeed=1)
→ Home → (loop)Every arrow is a positionDone transition. Hover-then-down split per station gives the classic safe approach; tune max velocity / acceleration per move for realistic dynamics.
5. Run and refine
Simulate. Typical fixes on the first run:
- Arm folds strangely between targets → targets too close to workspace edges; pull them in, or adjust joint limits.
- Elbow flips mid-move → the IK crossed a configuration boundary; adjust hover heights so paths stay in one configuration.
- Product floats →
Product_InGripperisn't parented to the last link.
Going online
Two options, both real workflows: map the six joint variables to the robot controller's actual axes (joint-space mode) to mirror a real robot, or keep workspace mode and map the TCP targets to PLC setpoints to preview commanded motion. See Mapping PLC tags.