L2 · PAI-150

Assembly sequencing

Produce a feasible assembly order for a multi-part product and explain at least one constraint (access, fastening, fit) that forbids an alternative order.

01
Challenge

Try this first — before any explanation.

Sequence a 6-part robot gripper (base_plate, servo, servo_horn, finger_left, finger_right, cover) into slots 1..6 and Run Assembly. Fill all six with an order that runs to completion — no blocked-access, no-fit, no-fastening failure. Put the cover before the screws it hides, or a finger before the horn its slot engages, and the twin throws a concrete physical failure. That failure is the lesson.

The Bench

The precedence feasibility checker from the Bench spec — a part is placeable iff all its precedence-parents are placed. Edit your order and run.

'.join(my_order))\nprint('feasible:', ok, '|', reason)\n# Name the discovered constraint + reason-class for Step C:\nmy_constraint = ('finger_left', 'cover') # EDIT to a true edge\nmy_reason_class = 'FASTEN' # ACCESS | FIT | FASTEN","label":"3 — Your order (EDIT)"},{"code":"VALID_CLASS = {'FASTEN','ACCESS'} # the bolted-cover edge is fasten/access, not FIT\nproblems = []\nif not ok:\n problems.append(reason + ' - move it earlier.')\nif set(my_order) != set(PARTS) or len(my_order) != 6:\n problems.append('every one of the 6 parts must appear exactly once.')\nedge_ok = tuple(my_constraint) in PRECEDENCE\nif not edge_ok:\n problems.append('the named constraint is not a true precedence edge.')\nif my_reason_class not in VALID_CLASS:\n problems.append(f'reason-class {my_reason_class} rejected - the cover bolts pass THROUGH the finger tabs (ACCESS/FASTEN).')\n\nif ok and edge_ok and my_reason_class in VALID_CLASS and len(my_order)==6:\n print('PASS - feasible order, all 6 placed, 0 blocked. You named the finger->cover '\n 'fastening constraint with the right reason-class. Sequencing mastered.')\nelse:\n print('FAIL - ' + ' '.join(problems[:2]))","label":"4 — Autograder (seed 4001)"}],"intro":"The precedence feasibility checker from the Bench spec — a part is placeable iff all its precedence-parents are placed. Edit your order and run.","key":"manufacturing/assembly-sequencing","kind":"python","title":"Assembly sequencing"}">
PYTHON · NUMPY · IN-BROWSER

Assembly sequencing

The precedence feasibility checker from the Bench spec — a part is placeable iff all its precedence-parents are placed. Edit your order and run.

02
Model

The idea, built visually.

You can't bolt through a lid you already closed — obvious, and it's the whole idea behind assembly sequencing. Six parts is six factorial, 720 orders, and most are impossible. Every forbidden order traces to one of three things: ACCESS (a later part blocks the tool that fastens an earlier one), FIT (a part mates with a feature that must already be there), or FASTENING (the fastener needs both parts present and reachable). Each is an arrow: this before that.

Collect every arrow and you get a precedence graph; a feasible order is any path that never points backward — a topological sort. There's always at least one, unless you've drawn a cycle, which means you've designed something that can't be built.

▣ Stage animation: Six parts become nodes; arrows accrete (servo→servo_horn FIT, M2_screws→cover ACCESS) into a directed graph that flattens into one valid left-to-right order, with a backward arrow flashing warm before resolving.

03
Guided practice

Build it up, step by step.

  1. Step A (worked): with three given constraints, construct base_plate → servo → servo_horn → finger_left → finger_right → cover and it passes.
  2. Step B (completion): full constraint list, empty tray; use Lint-my-order to find the first backward arrow before running physics.
  3. Step C (independent): the cover becomes bolted through the finger tabs (a hidden new constraint: fingers before cover) — discover it by running and reading the failure, then re-sequence and name the constraint's reason-class.
04
Feedback

How the Bench grades your run.

PASS WHEN is_feasible(order) True for the perturbed precedence set, all three failure counters 0 on Run Assembly, and the named constraint is a true edge with a correct reason-class (ACCESS/FASTEN), on seed 4001.

  • Step 4 places finger_left, but servo_horn (its FIT parent) isn't placed yet. Move servo_horn earlier.
  • cover at step 3 blocks tool access to the M2 screws (still un-fastened) — the screws need servo+base_plate seated first; place the cover last.
  • servo has no body to drop into: base_plate must be placed before servo (ACCESS).
  • Order is feasible, but the new cover constraint isn't FIT — nothing mates into a feature; the bolts pass THROUGH the finger tabs (ACCESS/FASTEN). Re-classify.
05
Retrieve & space

Bring back what you've already mastered.

  • From M3.3: shaft Ø4.00±0.02 vs horn bore Ø3.97±0.02 — is the worst-case fit guaranteed interference? Compute the worst-case clearance.
  • From M2.3: what is the analogue of a 'datum surface' in an assembly precedence graph? → a part with no incoming arrows / the base part.
  • From M1.1: name one DFM change to the cover that removes the finger→cover arrow (decouples it). → snap-fit, or bolts into base_plate not through tabs.
06
Mastery gate

What you must demonstrate to advance.

In sim, submit a feasible order for the perturbed 6-part gripper (is_feasible True, all failure counters 0) AND state one true constraint with a correct reason-class (ACCESS/FIT/FASTEN). Unlocks 4.2.

07
Project

How this feeds your build.

Feeds the capstone by making each product an ordered set of assembly operations with known cycle costs — the per-station work content that 4.2/4.3 distribute across a line and M5 turns into yield and cost.