Machines
Pick & Place is one of the most fundamental automation tasks. Master it and you'll understand axis coordination, timing, gripper control, and state machine design that applies across all automation.
A Pick & Place system moves parts from a source to a destination. Even complex robots follow the same fundamental 7-step cycle. Understanding this cycle is the foundation of all automation sequencing.
Control the robot: run the full auto-cycle, step through states manually, or trigger an E-Stop.
// Ready — press ▶ Auto Cycle to start.
Draw a sequence diagram before writing code. This shows every axis and I/O over time — revealing timing gaps, interlocks, and parallel actions.
Implement the sequence with a single integer variable state. One CASE block handles everything — safe, readable, and easy to extend.
VAR_GLOBAL CONSTANT
ST_HOME : INT := 0; ST_MV_PICK : INT := 1;
ST_GRIP : INT := 2; ST_LIFT : INT := 3;
ST_MV_PLACE: INT := 4; ST_RELEASE : INT := 5;
ST_RETURN : INT := 6;
END_VAR
CASE state OF
ST_HOME:
IF cycle_start AND part_present THEN
state := ST_MV_PICK;
END_IF;
ST_MV_PICK:
x_setpoint := PICK_X; z_setpoint := PICK_Z;
IF x_in_pos AND z_in_pos THEN state := ST_GRIP; END_IF;
ST_GRIP:
gripper_close := TRUE;
grip_timer(IN := TRUE, PT := T#300ms);
IF grip_timer.Q THEN
IF gripper_feedback THEN state := ST_LIFT;
ELSE alarm_no_part := TRUE; state := ST_HOME;
END_IF;
END_IF;
ST_LIFT:
z_setpoint := LIFT_Z;
IF z_in_pos THEN state := ST_MV_PLACE; END_IF;
ST_MV_PLACE:
x_setpoint := PLACE_X;
IF x_in_pos THEN state := ST_RELEASE; END_IF;
ST_RELEASE:
gripper_close := FALSE;
release_timer(IN := TRUE, PT := T#200ms);
IF release_timer.Q THEN
parts_placed := parts_placed + 1;
state := ST_RETURN;
END_IF;
ST_RETURN:
x_setpoint := HOME_X; z_setpoint := HOME_Z;
IF x_in_pos AND z_in_pos THEN state := ST_HOME; END_IF;
END_CASE;
(* Safety: E-Stop always takes priority *)
IF emergency_stop THEN
gripper_close := FALSE;
state := ST_HOME;
END_IF;
Add a vision quality check after GRIP. If part_ok = FALSE, route to a reject bin. What constant name should you add following the existing naming convention?