Algorithm Search⌘K

Problemcore

Function generation

Also called function generation synthesis.

Find a linkage whose output angle is a given function of its input angle, exactly at precision points and approximately in between.

Function generation is the kinematic synthesis task in which the output link of a mechanism must turn by an angle that is a given function of the angle of the input link. A given relation y=f(x)y = f(x) is mapped to angles by two linear scales, and the goal is a mechanism, usually a four-bar linkage, whose output angle follows the scaled function. A four-bar has only a few free dimensions, so it meets a general function exactly only at a few precision points, and the difference in between is the structural error. This page states the problem; the methods that solve it are linked from Known algorithms.

In plain words

You want a machine part that turns in a fixed relation to another part. When the first part turns by some amount, the second part must turn by an amount that a formula gives. Before computers, linkages of this kind did calculations, for example a square root or a logarithm, in gun sights and other instruments.

A four-bar linkage has only a few lengths to choose. It cannot follow most formulas exactly. You pick a few values where it must be exact, and accept a small error between them. The design question is how to choose the lengths, and where to put the exact values, so that the error stays small over the whole range.

Definition

Input.

  • A function ff on an interval [x0,x1][x_0, x_1], with y0=f(x0)y_0 = f(x_0) and y1=f(x1)y_1 = f(x_1), y0≠y1y_0 \ne y_1.
  • An input range: a start angle φ0\varphi_0 and a sweep Δφ\Delta\varphi.
  • An output range: a start angle ψ0\psi_0 and a sweep Δψ\Delta\psi.
  • A type of mechanism, usually the four-bar, sometimes the slider-crank (with a slide in place of the output angle) or a six-bar.

The scales map the variable and the value of ff to angles:

φ(x)=φ0+x−x0x1−x0 Δφ,ψd(x)=ψ0+f(x)−y0y1−y0 Δψ.\varphi(x) = \varphi_0 + \frac{x - x_0}{x_1 - x_0}\,\Delta\varphi, \qquad \psi_d(x) = \psi_0 + \frac{f(x) - y_0}{y_1 - y_0}\,\Delta\psi.

Output. The dimensions of the mechanism. For the four-bar in the notation of the four-bar page these are the input aa, coupler bb, output cc and ground dd, with the input pivot at O2=(0,0)O_2 = (0, 0), the output pivot at O4=(d,0)O_4 = (d, 0), and both angles counterclockwise from the ground line. One length sets the scale, so d=1d = 1 can be fixed.

Error. Let ψ(φ)\psi(\varphi) be the output angle of the mechanism on one fixed branch of its assembly. The structural error is

e(x)=ψ(φ(x))−ψd(x),x0≤x≤x1.e(x) = \psi(\varphi(x)) - \psi_d(x), \qquad x_0 \le x \le x_1.

It is the error of an ideal mechanism with exact dimensions; the error from tolerances and clearances (the mechanical error) is a separate question.

Two forms of the problem.

  • Precision points. Given x1<x2<⋯<xnx_1 < x_2 < \cdots < x_n in the interval, find a mechanism with e(xj)=0e(x_j) = 0 for all jj, assembled on one branch over the whole range.
  • Approximation. Find a mechanism that minimizes max⁡x∣e(x)∣\max_x |e(x)| (the uniform or minimax form) or ∫e(x)2 dx\int e(x)^2\,dx (the least squares form), with the same assembly condition.

The transmission angle and the link length ratios are usually constrained too.

Variants

  • Fixed or free ranges. With φ0\varphi_0, ψ0\psi_0, Δφ\Delta\varphi, Δψ\Delta\psi fixed, the four-bar has three free ratios. With the start angles free there are five unknowns, so up to five precision points.
  • Output as a slide. A slider-crank turns an angle into a linear position s(x)s(x).
  • Infinitesimal precision points. Ask that ee and some of its derivatives vanish at one value of xx, so that the mechanism matches ff, f′f' and f′′f'' there.
  • Multiple loops. Six-bars and geared linkages give more dimensions and so more precision points, at the cost of a harder system.
  • Function generation by inversion. Seen from the input link, the output link makes a rigid motion, so the task is a case of motion generation for the output link relative to the input link.

Examples

Exact generators. A few functions are generated with zero structural error. For the four-bar with a=ca = c and b=db = d, Freudenstein's equation has the constants K1=K2=k=d/aK_1 = K_2 = k = d/a and K3=1K_3 = 1, and its half-angle quadratic factors. The two roots are

tan⁡ψ2=tan⁡φ2andtan⁡ψ2=1+k1−ktan⁡φ2.\tan\frac{\psi}{2} = \tan\frac{\varphi}{2} \qquad\text{and}\qquad \tan\frac{\psi}{2} = \frac{1 + k}{1 - k}\tan\frac{\varphi}{2}.

The first is the parallelogram, which generates ψ=φ\psi = \varphi. The second is the antiparallelogram, which for a=1a = 1, d=2d = 2 generates tan⁡(ψ/2)=−3tan⁡(φ/2)\tan(\psi/2) = -3\tan(\varphi/2) exactly. Both pass through the change point where all four pins are on one line, at φ=0\varphi = 0 and φ=180°\varphi = 180°. There the linkage can switch from one function to the other, which is why a physical parallelogram needs a guard at those points.

A sine generator. Let f(x)=sin⁡xf(x) = \sin x on [0,π/2][0, \pi/2], with φ\varphi from 90°90° to 210°210° (Δφ=120°\Delta\varphi = 120°) and Δψ=60°\Delta\psi = 60°, and d=1d = 1. Take the three precision points at the Chebyshev spacing xj=π/4−(π/4)cos⁡((2j−1)π/6)x_j = \pi/4 - (\pi/4)\cos((2j - 1)\pi/6), which are 6.03°6.03°, 45°45° and 83.97°83.97° in degrees of xx. The table gives three choices of the output start angle ψ0\psi_0, the four-bar found by Freudenstein's equation for each, and its largest ∣e∣|e| on a grid of 1000 values of xx along the branch through the precision points.

ψ0\psi_0 K1,K2,K3K_1, K_2, K_3 aa, bb, cc max ∣e∣\lvert e\rvert at xx transmission angle
60°60° 2.309582.30958, 1.720531.72053, −0.31839-0.31839 0.43300.4330, 1.29831.2983, 0.58120.5812 0.679°0.679° 00 56.4°56.4° to 91.1°91.1°
75°75° 2.344442.34444, 1.817001.81700, 0.349000.34900 0.42650.4265, 1.14931.1493, 0.55040.5504 0.230°0.230° 00 69.6°69.6° to 109.0°109.0°
90°90° 2.400822.40082, 1.803881.80388, 1.010811.01081 0.41650.4165, 1.00701.0070, 0.55440.5544 0.438°0.438° 1.1271.127 82.4°82.4° to 127.9°127.9°

The precision points are the same in the three rows. Only the start of the output scale moves, and the largest error changes by a factor of three. So ψ0\psi_0, Δφ\Delta\varphi and Δψ\Delta\psi are design variables of the problem, not data. In the row ψ0=75°\psi_0 = 75° the error is −0.230°-0.230° at x=0x = 0, +0.131°+0.131° at x=π/2x = \pi/2, and the inner peaks are +0.135°+0.135° and −0.074°-0.074°. These magnitudes are not equal, so this design is not the minimax design for these ranges.

A count that rules out exactness. With the ranges fixed, the four-bar outputs form a family with three parameters, and with free start angles five. A general ff given at six points is met at all six only for special data. So for most functions the structural error is not zero, and the question is how small it can be made.

Known algorithms

  • Freudenstein's equation gives a 3×33 \times 3 linear system for three precision points. It is exact at the points if the system is regular and the result assembles on one branch.
  • Chebyshev spacing chooses the precision points from the zeros of a Chebyshev polynomial. It lowers the polynomial factor in the usual estimate of the structural error, but does not give the minimax linkage.
  • With free start angles, four or five precision points give a polynomial system, solved by elimination or by homotopy continuation.
  • Least squares on the residual of Freudenstein's equation over many points is linear in K1,K2,K3K_1, K_2, K_3. It minimizes the residual, not ee.
  • Optimization-based dimensional synthesis minimizes max⁡∣e∣\max|e| or a sum of e2e^2 over many points directly, with local or global optimizers. A minimax design can be refined by an exchange of the error peaks, in the spirit of the Remez algorithm, but the linkage problem is not linear in its parameters, so the guarantees of that algorithm do not carry over.

Bounds

  • Exact points. Three precision points for a four-bar with fixed ranges, five with free start angles. A Watt or Stephenson six-bar has more dimensions and so more points.
  • Lower bounds on the error. For a linear family, Chebyshev's equioscillation theorem characterizes the best uniform approximation by the alternation of its error. The four-bar output is not a linear family in its dimensions, so that theorem does not apply directly, and the sources cited here give no general lower bound on the structural error of a four-bar for a given ff.
  • Zeros. A design with nn precision points has at least nn zeros of ee in the interval. It can have more: the error can cross zero at points that were not prescribed.

Reductions

  • To a linear system. For three precision points and fixed ranges, Freudenstein's equation is linear in K1,K2,K3K_1, K_2, K_3.
  • To motion generation. Fix the input link as a new ground. The output link then moves through rigid positions, and a dyad that guides it is the coupler and output of the four-bar.
  • To polynomial interpolation, in an estimate. If the mechanism has enough free parameters and ee is smooth, e(x)e(x) is close to a constant times ∏j(x−xj)\prod_j (x - x_j). This is the analogy with polynomial interpolation that motivates Chebyshev spacing. It is an estimate, not an identity.

Applications

Function generators computed the logarithm, the square, trigonometric functions and ballistic tables in mechanical analog computers and fire control instruments. Today the same task appears in steering linkages (the Ackermann relation between the angles of the two front wheels), throttle and valve linkages, and in any mechanism where an output must turn in a fixed nonlinear relation to an input. The study of linkages that approximate a motion led Chebyshev to his theory of best uniform approximation, which is now the theory on the minimax approximation page.

References

  1. Ferdinand Freudenstein, Approximate synthesis of four-bar linkages, Transactions of the ASME 77(8), 1955, 853 to 861, function generation with precision points, the structural error, and the spacing of the precision points
  2. Robert L. Norton, Design of Machinery, 6th edition, McGraw-Hill, 2019, Section 3.2 (p. 100, function generation as one of the three tasks) and Section 5.13 (p. 267, analytical synthesis of a fourbar function generator)
  3. Arthur G. Erdman, George N. Sandor and Sridhar Kota, Mechanism Design, Analysis and Synthesis, Volume 1, 4th edition, Prentice Hall, 2001, Chapter 8, Introduction to Kinematic Synthesis (function generation, precision points and the structural error)
  4. Richard S. Hartenberg and Jacques Denavit, Kinematic Synthesis of Linkages, McGraw-Hill, New York, 1964, the chapters on function generation and on the accuracy of precision point designs (general locator)

Where this leads

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