Algorithm Search⌘K

Problemcore

Setup planning

Also called setup minimization.

Group the machining features of a part into setups, each a fixed orientation on the machine, so few setups are needed and tolerances between features hold.

Setup planning groups the machining features of a part into setups. A setup is one way of holding the part on the machine: a fixed orientation, a fixture and a datum, with the part not moved until all its features are cut. Each setup costs time to load, align and fix the part, and each move of the part to a new setup adds a positioning error. So the aim is to use few setups, and to make features whose relative position has a tight tolerance in the same setup. A feature can be made in a setup only if the tool can reach it from the spindle direction of that setup. Setup planning differs from fixture planning in scope: setup planning decides which features are made in which orientation, and fixture planning decides how the part is held in one of those setups. This page states the problem, shows that its combinatorial core is set cover, and so that it is NP-hard.

In plain words

A three-axis milling machine cuts only from above. To cut a hole in the side of a block, the operator must stop, turn the block, clamp it again and find its position again. Each turn takes time, and each new clamping moves the part a little, so two features cut in different setups are less precisely placed relative to each other than two features cut in the same one.

So a planner asks, for each feature, from which sides a tool can reach it. A hole in the top face can be drilled only from above. A slot that runs across an edge can be cut from above or from the side. The planner picks as few sides as possible so that a tool reaches every feature, and keeps features that must line up closely in the same setup.

Definition

There is no standard formal statement of setup planning. The following version captures the parts of it that the cited work shares: access, setup count and tolerance.

Input.

  • A set F={f1,…,fm}F = \{f_1, \dots, f_m\} of machining features, from feature recognition on the part model.
  • A finite set SS of candidate setups. For a three-axis machine, a setup is an orientation of the part, given by the direction dsd_s of the tool relative to the part, often one of the six directions ±x,±y,±z\pm x, \pm y, \pm z of a prismatic part.
  • For each feature ff, the set C(f)⊆SC(f) \subseteq S of setups in which a tool can reach and cut ff. Geometrically, s∈C(f)s \in C(f) when dsd_s is in the accessibility cone of ff and the tool and holder do not collide with the part.
  • A set TT of tolerance relations: pairs (f,g)(f, g) with a tolerance tfgt_{fg} on their relative position, and a model of the error. In the simplest model, two features made in the same setup have a relative error of at most e1e_1, and two features made in different setups have a relative error of at most e2>e1e_2 > e_1, where e2−e1e_2 - e_1 is the error of moving the part.
  • A precedence relation on FF: f≺gf \prec g when ff must be cut before gg, for example because ff is the datum of gg or because gg is cut into a face that ff makes.

Output. An assignment σ:F→S\sigma : F \to S and an order of the setups used, such that

  1. σ(f)∈C(f)\sigma(f) \in C(f) for every feature ff (access);
  2. σ(f)=σ(g)\sigma(f) = \sigma(g) for every (f,g)∈T(f, g) \in T with tfg<e2t_{fg} < e_2 (tolerance);
  3. if f≺gf \prec g and σ(f)≠σ(g)\sigma(f) \ne \sigma(g), then the setup σ(f)\sigma(f) comes before the setup σ(g)\sigma(g) (precedence).

Objective. Minimize the number ∣σ(F)∣\lvert \sigma(F) \rvert of setups used.

A tight tolerance makes a hard constraint in this model. Other versions make it a cost: a penalty for each tolerance pair split across two setups, added to the setup count with a weight.

Variants

  • Fixed directions. Three-axis machining of prismatic parts with the six directions ±x,±y,±z\pm x, \pm y, \pm z. Then ∣S∣=6\lvert S \rvert = 6.
  • Indexing tables and five-axis machines. A rotary table or a five-axis head gives more tool directions per setup. Then a setup is a set of directions, and a feature can be made in a setup if its accessibility cone meets that set.
  • Simply fixturable parts. Sarma and Wright (1996) study parts that a universal fixture can hold in any orientation, so fixturing does not limit the plan, and minimize the setups and then the tool changes.
  • Setups with datums. Each setup also picks a datum, the faces that locate the part in the fixture, and a tolerance is measured from the datum. Zhang and Lin (1999) and Huang and Xu (2003) build a graph of the tolerance and datum relations between features and use it to group features.
  • Joint setup and fixture planning. Each setup must also have a valid fixture, so a setup is feasible only if fixture planning succeeds for it.
  • Weighted objective. Minimize total time: setup time, plus tool change time, plus a penalty for split tolerance pairs. This joins setup planning with operation sequencing.

Examples

Six features and three directions. A block has six features. The candidate setups are +z+z (tool from the top), −z-z (tool from the bottom) and +x+x (tool from one side).

feature description C(f)C(f)
f1,f2f_1, f_2 slots in the top face that run out through the +x+x side {+z,+x}\{+z, +x\}
f3f_3 a blind hole in the top face {+z}\{+z\}
f4,f5f_4, f_5 slots in the bottom face that run out through the +x+x side {−z,+x}\{-z, +x\}
f6f_6 a blind hole in the bottom face {−z}\{-z\}
  • No tolerance relation. The setups {+z,−z}\{+z, -z\} reach every feature, and one setup cannot, since f3f_3 needs +z+z and f6f_6 needs −z-z. So the minimum is 2. The rule "pick the setup that reaches the most features first" picks +x+x, which reaches four features, and then still needs +z+z for f3f_3 and −z-z for f6f_6: 3 setups. This is the greedy rule of set cover, and the example shows that it is not optimal.
  • A tight tolerance. Now the top slot f1f_1 and the bottom slot f4f_4 must line up within t=0.01t = 0.01 mm, and assume that moving the part adds an error of 0.050.05 mm, so t<e2t < e_2. Then f1f_1 and f4f_4 need one setup in C(f1)∩C(f4)={+x}C(f_1) \cap C(f_4) = \{+x\}. With f3f_3 in +z+z and f6f_6 in −z-z, the minimum is now 3. The tolerance costs one setup.

The example has three candidate setups, so a check of all 23−1=72^3 - 1 = 7 nonempty subsets finds both minima.

Known algorithms

  • Search over subsets. For ∣S∣=k\lvert S \rvert = k candidate setups, try the subsets of SS in order of size and test each in O(km+∣T∣)O(k m + \lvert T \rvert) time. This takes O(2k(km+∣T∣))O(2^k (k m + \lvert T \rvert)) time, which is fast for the six directions of three-axis machining.
  • Greedy set cover. Pick the setup that reaches the most unassigned features, and repeat. By the reduction below, this is greedy set cover, with its approximation guarantee. Many rule-based planners use this rule, with ties broken by datums and tolerances.
  • Graph methods. Sarma and Wright (1996) model all feasible plans of a simply fixturable part as one graph and search it for plans with few setups and then few tool changes. Zhang and Lin (1999) group features with a graph of tolerance and datum relations.
  • Integer programming and metaheuristics. A 0-1 variable for each pair of a feature and a setup, and one for each setup used, give an integer program. Later papers also use genetic algorithms and particle swarm methods for larger weighted versions.

There are no standard benchmarks for setup planning. Papers test their methods on example parts of their own, so their results cannot be compared from paper to paper.

Bounds

NP-hardness. The decision version, "is there a plan with at most kk setups", is NP-complete when SS and the sets C(f)C(f) are part of the input. It is in NP, since a plan is checked in polynomial time. For hardness, reduce from set cover, which is NP-complete (Karp 1972): map each element to a feature, each set to a setup, and let C(f)C(f) be the sets that contain the element of ff, with no tolerance or precedence relation. Then plans with kk setups are exactly set covers with kk sets.

The reduction keeps the objective value, so the approximation limits of set cover carry over to this combinatorial version.

What the reduction does not show. The reduction needs arbitrary access sets C(f)C(f). The cited sources do not show that every set system arises from the accessibility cones of the features of a real part on a given machine. With a constant number of candidate setups, such as six, the search over subsets is polynomial in mm. So the hardness concerns machines and parts with many candidate setups.

Reductions

  • From set cover. As above. The reduction also works from hitting set, which is the same problem with the roles of elements and sets swapped: choose setups (elements) that hit every set C(f)C(f).
  • To set cover, with tolerances. Join the features of each tight tolerance pair, and take the connected components of these pairs. A component KK must go to one setup, in ⋂f∈KC(f)\bigcap_{f \in K} C(f). Replace each component by one feature with this access set. If some intersection is empty, there is no plan. Otherwise, with no precedence relation, a plan is a set cover of the components. Precedence adds a test that the chosen setups can be ordered with no cycle among the precedence pairs that cross setups.

Applications

  • Process planning. Setup planning is one step of computer-aided process planning, after the processes are chosen and before the operations are ordered and the fixtures are designed.
  • Design feedback. The minimum number of setups is a measure of manufacturability: a feature that forces an extra setup is a candidate for a change in the design.
  • Tolerance analysis. The assignment of features to setups decides which tolerances depend on the error of moving the part, so it feeds the tolerance stack-up of the plan.

References

  1. Sanjay E. Sarma and Paul K. Wright, Algorithms for the minimization of setups and tool changes in simply fixturable components in milling, Journal of Manufacturing Systems 15(2), 1996, 95 to 112, the graph model of the feasible plans of a part whose fixturing can be ignored, the choice of an access face for each feature, and the algorithms that minimize setups and then tool changes
  2. Hong-Chao Zhang and Enhao Lin, A hybrid-graph approach for automated setup planning in CAPP, Robotics and Computer-Integrated Manufacturing 15(1), 1999, 89 to 100, the graph of features with the tolerance and datum relations between them, used to group features into setups
  3. S. H. Huang and N. Xu, Automatic set-up planning for metal cutting, an integrated methodology, International Journal of Production Research 41(18), 2003, 4339 to 4356, setup planning that groups features by approach direction and by tolerance requirements, and selects the datum of each setup
  4. Richard M. Karp, Reducibility among combinatorial problems, in Complexity of Computer Computations, Plenum, 1972, 85 to 103, the NP-completeness of set cover, the source problem of the reduction on this page

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a known algorithm
  • a contract.yaml