34
Chapter 3 Type, Number, and Dimensional Synthesis The science of mechanism kinematics is roughly divided in two divergent topics: analysis and synthesis. Analysis typically involves a defined mechanism and Figure 3.1: 4R four-bar mechanism. predicting how either the coupler or the follower will react to specific motions of the driver. For example, in Figure 3.1: determine the position of a reference point on the coupler in the fixed frame Σ given input angle ψ and all the link lengths (distances between revolute centers); determine the pose (position and orientation) of reference frame E that moves with the coupler in terms of fixed frame Σ for a given input ψ; determine the change in follower angle φ for a change in input angle ψ; or the kinematic equivalent, determine the motion of follower frame F expressed in Σ given an input ψ. 55

Ch3JH

Embed Size (px)

DESCRIPTION

asdsfg

Citation preview

Page 1: Ch3JH

Chapter 3

Type, Number, andDimensional Synthesis

The science of mechanism kinematics is roughly divided in two divergent topics:analysis and synthesis. Analysis typically involves a defined mechanism and

Figure 3.1: 4R four-bar mechanism.

predicting how either the coupler or the follower will react to specific motionsof the driver. For example, in Figure 3.1: determine the position of a referencepoint on the coupler in the fixed frame Σ given input angle ψ and all the linklengths (distances between revolute centers); determine the pose (position andorientation) of reference frame E that moves with the coupler in terms of fixedframe Σ for a given input ψ; determine the change in follower angle φ for achange in input angle ψ; or the kinematic equivalent, determine the motion offollower frame F expressed in Σ given an input ψ.

55

Page 2: Ch3JH

56 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

We will look at analysis later on in the context of robot kinematics. Theproblems are innately geometric, hence we shall adopt a geometric approach.

A fundamentally different problem is that of kinematic synthesis. But, aswe shall see, with some geometric insight, we can use the same approach as foranalysis. By kinematic synthesis we mean the design or creation of a mechanismto attain specific motion characteristics. In this sense synthesis is the inverseproblem of analysis. Synthesis is the very essence of design because it representsthe creation of new hardware to meet particular requirements of motion: dis-placement; velocity; acceleration; individually or in combination. Some typicalexamples of kinematic synthesis include:

1. Guiding a point along a specific curve. Examples include Watt’s “straight”line linkage, post-hole diggers, etc. See Figure 3.2.

Figure 3.2: Point C is guided along the curve to sequential positions C1 to C5.

2. Correlating driver and follower angles in a functional relationship: theresulting mechanism is a function generator. In essence the mechanismgenerates the function φ = f(ψ), or vice versa. See Figure 3.3. The

Figure 3.3: Function generator.

classic example of a function generator is a four-bar steering linkage. Thefunction is the steering condition, and is defined by:

S(∆ψ∆φ) ≡ sin(∆φ−∆ψ)− ρ sin(∆ψ) sin(∆φ) = 0. (3.1)

Page 3: Ch3JH

57

In the steering condition ∆ψ and ∆φ are the change in input and outputangles, respectively from the input and output dial zeroes, α and β, re-spectively (i.e., ψ = 0 and φ = 0 are not necessarily in the direction of thex-axis, they are offset). The quantity ρ is the length ratio b/a, with a thedistance between axles and b the distance between wheel-carrier revolutes,see Figure 3.4.

Figure 3.4: The steering condition.

3. Guiding a rigid body through a finite set of positions and orientations, asin Figure 3.5. A good example is a landing gear mechanism which mustretract and extend the wheels, having down and up locked poses (positionand orientation) with specific intermediate poses for collision avoidance.See Figure 3.6. Synthesis for rigid body guidance is also known as theBurmester Problem, after Ludwig Burmester (1840-1927), Professor ofDescriptive Geometry and Kinematics. His book Lehrbuch der Kinematik(1888), is a classic systematic and comprehensive treatment of theoreticalkinematics.

4. Trajectory Generation: Position, velocity, and/or acceleration must becorrelated along a curve. Examples include film transport mechanisms inmotion picture projectors. Another example is the 4-bar linkage designedto emulate a rack-and-pinion drive, shown in Figure 3.7. If the input

Page 4: Ch3JH

58 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Figure 3.5: Rigid body guidance (motion generation).

Figure 3.6: Landing gear.www.aerospace-technology.com/contractor images/finnair/LandingGear 5s.jpg

pinion angular velocity is constant then the linear velocity of the rack willalso be constant along a straight line. The displacement of the rack istimed to that of the pinion. The linkage shown in the Figure 3.8 producesapproximately straight line motion along a section of its coupler curve.Moreover the position of the coupler point R is approximately timed toinput angle ψ along the “straight” section, hence ψ is linearly proportionalto R on that section.

Note that the coupler curve is endowed with central line symmetry (twohalves are reflected in a line). The coupler point R generating this sym-metric coupler curve is on a circle centered at C and passing though A.The coupler point is on the same circle ⇒ |AC| = |CR| = |CD|.

The design of a device to achieve a desired motion involves three distinctsynthesis problems: type, number, and dimensional synthesis. These three prob-

Page 5: Ch3JH

59

Figure 3.7: Rack-and-pinion drive.

Figure 3.8: The line generating linkage where ψ is proportional to R along theline. The coupler curve is central line symmetric. This implies the coupler andfollower have the same length: distance between centers A and C is equal to thedistance between C and D. This is also equal to the distance between C andcoupler point R, while A, C, and R are collinear.

lems will be individually discussed in the following three sections.

Page 6: Ch3JH

60 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

3.1 Type Synthesis

Machines and mechanisms involve assemblies made from six basic types ofmechanical components. These components were identified by the Germankinematician Franz Reuleaux in his classic book from 1875 Theroetische Kine-matik, translated into English in 1876 by Alexander Blackie William Kennedy(of Aronhold-Kennedy Theorem fame) as Kinematics of Machines. The sixcategories are:

1. Eye-bar type link (the lower pairs).

2. Wheels, including gears.

3. Cams in their many forms.

4. The screw (which transmits force and motion).

5. Intermittent-motion devices (rachets).

6. Tension-compression parts with one-way rigidity such as belts, chains, andhydraulic or pneumatic lines.

The section of the type of mechanism needed to perform a specified motiondepends to a great extend on design factors such as manufacturing processes,materials, safety, reliability, space, and economics, which are arguably outsidethe field of kinematics.

Even if the decision is made to use a planar 4-bar mechanism, the type issueis not laid to rest. There remains the question: “What type of 4-bar?”. Shouldit be an RRRR? An RRRP? An RPPR? There can be 16 possible planar chainscomprising R- and P-Pairs. Any one of the four links joined by the four jointscan be the fixed link, each resulting in a different motion. See Figure 3.9.

We will look at an interesting result for type synthesis, otherwise we willleave it alone.

Figure 3.9: 16 distinct ways to make a planar 4-bar using only R- and P-pairstaken 4 at a time. The extreme cases RRRR and PPPP are shown.

Page 7: Ch3JH

3.2. NUMBER SYNTHESIS 61

3.2 Number Synthesis

Number synthesis is the second step in the process of mechanism design. Itdeals with determining the number of DOF and the number of links and jointsrequired. See Figure 3.10. If each DOF of the linkage is to be controlled in a

Figure 3.10: Linkages with 0,1,and 2 DOF, requiring 0,1,and 2 inputs to controleach DOF.

closed kinematic chain, then an equal number of active inputs is required. If thelinkage is a closed chain with 2 DOF then actuators are required at two joints.If more actuators are used the device is redundantly actuated, if less are used,the device is under actuated with uncontrolled DOF.

Open kinematic chains require that each joint be actuated. A 7R planaropen chain has 3 DOF, but requires 7 actuators to control the 3 DOF, althoughit is still said to be redundantly actuated. See Figure 3.11. Note that in the

Page 8: Ch3JH

62 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Figure 3.11: Planar 7R with 3 DOF, even though CGK says 7 DOF.

7R open planar chain example, the CGK formula predicts 7 DOF:

3(8− 1)− 7(2) = 21− 14 = 7DOF,

6(8− 1)− 7(5) = 42− 35 = 7DOF.

The 7 DOF in E2 and E3 are indeed real, but linearly coupled. There is amaximum of 3 DOF in the plane, and a maximum of 6 DOF in Euclideanspace.

3.3 Dimensional Synthesis

The third step in mechanism design is dimensional synthesis. We will con-sider three distinct problem classes in dimensional synthesis mentioned earlier,namely: function generation; rigid body guidance; and trajectory generation.

3.3.1 Function Generation

Dimensional synthesis boils down to solving a system of synthesis equationsthat express the desired motion in terms of the required unknown dimensions.These unknowns include, among other things, the link lengths, relative locationsof revolute centers, and in particular for function generators, a zero or homeconfiguration.

Page 9: Ch3JH

3.3. DIMENSIONAL SYNTHESIS 63

There is an old joke that goes: The way to tell the difference between amathematician and an engineer is to give them a problem. The engineer willimmediately proceed to seek a solution; the mathematician will first try toprove that a solution exists. Engineers laugh at mathematicians and vice versawhen the joke is told. The history of mathematics contains many stories ofwasted effort attempting to solve problems that were ultimately proved to beunsolvable. Problems of existence should not be ignored.

The existence of a solution must be examined for linear systems before weproceed to attempt to solve. We must ask two questions:

1. Is the system consistent; does at least one solution exist?

2. If one solution exists, is it unique?

We can always represent a set of m linear equations in n unknowns as:

~Xm×1 = Am×n~xn×1 (3.2)

~X is an m× 1 column vector, A is a matrix with m rows and n columns, and ~xis an n× 1 column vector. In general, we can make the following claims:

1. If there are fewer equations than unknowns (m < n), then if one solutionexists, and infinite number of solutions exist.

2. If the number of equations equals the number of unknowns (m = n), thenif a solution exists it is unique.

3. If there are more equations than unknowns (m > n), then, in general, nosolutions exists.

3.3.2 Basic Linear Algebra Concepts

Vector, Array, and Matrix Operations

While Chinese mathematicians had developed algorithms for solving linear sys-tems by 250 BC, linear algebra as we know it was first formalized by Germanmathematician and Sanskrit scholar Hermann Grassmann (1808-77). The newalgebra of vectors was presented in his book Die Ausdehnungslehre (1844).

Linear Dependence

Consider three equations linear in three unknowns of the form:

Ax = b

One way to test if the three equations are linearly independent (no line commonto all three planes) is to look at the coefficient matrix A. The system is linearlydependent if at least two rows (or two columns) are scalar multiples of eachother. 5 −1 2

−2 6 9−10 2 −4

xyz

=

7018

,

Page 10: Ch3JH

64 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Solutions to Linear Systems

Finding the solution(s) of m equations linear in n unknowns boils down to thefollowing three classes:

1. Underdetermined: (m < n) If a finite solution exists, it is not unique. Infact, if one exists, then an infinite number exists.

2. Overdetermined: (m > n) A finite solution(s) may exist, but not in gen-eral.

3. Determined System: (m = n) A unique solution may exist, although itmay not be finite. Additionally there may be infinitely many, or no finitesolutions.

In 3D Euclidean space, every system of linear equations has either: no solution(the system is inconsistent); exactly one solution (the system is consistent); orinfinitely many solutions (the system is consistent). For now we shall concen-trate on determined systems: three equations linear in three unknowns. Geo-metrically, one linear equation in three unknowns (x, y, z) represents a plane inthe space of the unknowns.

Taking the three equations to represent three planes in Euclidean 3D space,solutions to the system are bounded by Euclid’s parallel axiom: Given a lineL and a point P , not on L, there is one and only one line through P that isparallel to L (and two parallel lines do not intersect). Extending this axiom toplanes, three planes either:

1. have no point in common;

2. have exactly one point in common;

3. have infinitely many points in common (the planes have a line in common,or are all incident)

If we extend 3-D Euclidean space to include all points at infinity, thingschange. Now every parallel line intersects in a point on a line at infinity, andevery parallel plane intersects in a line on the plane at infinity. In this sense,there are five possibilities for a system of three equations linear in three un-knowns:

1. unique finite solution;

2. infinite finite solution;

3. double infinity of finite solutions;

4. unique solution at infinity;

5. infinite solutions at infinity (occurs in two ways).

Page 11: Ch3JH

3.3. DIMENSIONAL SYNTHESIS 65

1: Unique Finite Solution: Consider the linear system:

5x− y + 2z = 7,

−2x+ 6y + 9z = 0,

−7x+ 5y − 3z = −7.

This system can be represented (Ax = b) as: 5 −1 2−2 6 9−7 5 −3

xyz

=

70−7

.Solution (using Matlab “\” operator):

x = A \ b

xyz

= (1/13)

2110−2

,There is only one possible solution, the three planes intersect at a commonpoint. See Figure 3.12.

Figure 3.12: One real solution.

2: Infinite Solutions Along a Finite Line: Consider the linear system:

5x− y + 2z = 7,

−2x+ 6y + 9z = 0,

15x− 3y + 6z = 21.

Page 12: Ch3JH

66 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

This system can be represented (Ax = b) as: 5 −1 2−2 6 915 −3 6

xyz

=

7021

,Solution:

x = A \ b xyz

= (1/4)

6− 3t2− 7t

4t

,

Figure 3.13: Infinitely many real solutions. One parameter family of points.

Two of the three planes are superimposed as shown in Figure 3.13. Therewill be an infinite number of solutions along the line of intersection betweenthe superimposed planes and the third, intersecting plane.

3: Infinite Solutions on a Finite Plane: Consider the linear system:

5x− y + 2z = 7,

10x− 2y + 4z = 14,

−15x+ 3y − 6z = −21.

This system can be represented (Ax = b) as: 5 −1 210 −2 4−15 3 −6

xyz

=

714−21

,Solution:

x = A \ b → 5x− y + 2z = 7

Page 13: Ch3JH

3.3. DIMENSIONAL SYNTHESIS 67

Figure 3.14: Infinitely to the power 2 solutions.

All three planes are superimposed as in Figure 3.14. There will be aninfinite number of solutions: a two parameter family of lines covering theentire plane.

4: Infinite Solutions at Infinity: Consider the linear system:

5x− y + 2z = 7,

−10x+ 2y +−4z = −5,

15x− 3y + 6z = −5.

Figure 3.15: One solution where the line at infinity of the blue and yellow planesintersects the grey plane.

Page 14: Ch3JH

68 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

This system can be represented (Ax = b) as: 5 −1 2−10 6 −415 −3 6

xyz

=

7−5−5

,Solution:

x = A \ b xyz

=∞,

Three parallel non-coincident planes as in Figure 3.15. The three planesall intersect the plane at infinity in the same real, but not finite line: aline on the plane at infinity.

5: No Finite (One Infinite) Solution: Consider the linear system:

5x− y + 2z = 7,

−2x+ 6y + 9z = 0,

−10x+ 2y − 4z = 18.

This system can be represented (Ax = b) as: 5 −1 2−2 6 9−10 2 −4

xyz

=

7018

,Solution:

x = A \ b

5x− y + 2z = 7,

5x− y + 2z = −9.

There are two parallel (linearly dependent, but not coincident) planes,intersecting a third plane as in Figure 3.16. There will never be a finitepoint/line/plane where the system of equations will intersect.

6: No Finite Solution: Consider the linear system:

5x− y + 2z = −12,

−2x+ 6y + 9z = 0,

8y + 14z = 8.

This system can be represented (Ax = b) as: 5 −1 2−2 6 90 8 14

xyz

=

−1208

,

Page 15: Ch3JH

3.3. DIMENSIONAL SYNTHESIS 69

Figure 3.16: Lines of intersection of each pair are parallel. One unique solutionat infinity. One solution where the line at infinity of the blue and yellow planesintersects the grey plane.

Solution: Three non-intersecting planes as shown in Figure 3.17. The lineof intersection of each pair of planes is parallel to the third. The parallellines intersect in a real point at infinity.

Figure 3.17: No Finite Solution: three non-intersecting planes.

3.3.3 Dimensional Synthesis Continued

The synthesis equations for a 4-bar function generator that are currently usedwere developed by Ferdinand Freudenstein in his Ph.D thesis in 1954. Considerthe mechanism in the Figure 3.18. The ith configuration is governed by:

k1 + k2 cos(φi)− k3 cos(ψi) = cos(ψi − φi). (3.3)

Page 16: Ch3JH

70 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Figure 3.18: Elements of the Freudenstein parameters for a planar 4R linkage.

Where the k’s are the Freudenstein Parameters which are the following linkratios:

k1 ≡ (a21 + a22 + a24 − a23)

2a2a4,

k2 ≡ a1a2,

k3 ≡ a1a4,

⇒ a1 = 1,

a2 =1

k2,

a4 =1

k3,

a3 = (a21 + a22 + a24 − 2a2a4k1)1/2. (3.4)

These distinct sets of input and output angles (ψ, φ) define a fully determinedset of synthesis equations, implying that if there is a solution of k1, k2, k3 thatsatisfies the three equations, it will be unique. Thus, we can determine the linklength ratios (k1, k2, k3) that will exactly satisfy the desired function φ = f(ψ).Of course for a function generator we only require ratios of the links becausethe scale of the mechanism is irrelevant.

What happens if you need a function generator to be exact over a continuousrange of motion of the mechanism? Sadly, you can’t have it. A solution, in gen-eral, does not exist! Now do you hear the gentle chuckles of the mathematicians?To be exact in greater than three configurations results in an over-determinedsystem (more equations than unknowns), which in general has no solution. Wecould try to make an improvement by formulating the problem so that there

Page 17: Ch3JH

3.4. DESIGN ERROR 71

were more unknowns. Recall the steering condition, reproduced here:

S(∆ψ∆φ) ≡ sin(∆φ−∆ψ)− ρ sin(∆ψ) sin(∆φ) = 0. (3.5)

Define the dial zeroes to be α and β such that:

ψi = α+ ∆ψi,

φi = β + ∆φi, (3.6)

The synthesis equation now becomes:

k1 + k2 cos(β + ∆φi)− k3 cos(α+ ∆ψi) = cos ((α+ ∆ψi)− (β + ∆φi)) . (3.7)

Now five sets of (∆ψi,∆φi) will produce five equations in five unknowns. Thismeans that the function will be generated exactly for five inputs only. There isno guarantee about the values in between the precision input-output values ofthe function. If this was how steering linkages were designed we would wear outour tires very fast, and have difficulty cornering.

Note, the design constant ρ must be selected, where ρ = b/a, with b =track (distance between wheel carrier revolutes), and α = wheelbase (distancebetween axle center-lines). A typical value for a car is ρ = 0.5. We will use thisvalue in the following example shown in Figure 3.19. To resolve the problem,we resort to approximate synthesis, instead of exact synthesis. This involvesover-constraining the synthesis equation. We generate a set of m equations inn unknowns with m � n. In our case n = 5. Two questions immediatelyarise: What value should be given to m? And how should the input data bedistributed? The answer to both questions depends on context, and usuallyrequires some experimentation.

Assuming we have selected m and a distribution for the m input-output(I/O) values, we want a solution that will generate the function with the leasterror. The design and structural errors are two performance indicators used tooptimize approximate synthesis.

3.4 Design Error

Given an over-constrained system of linear equations (an over-abundance ofequations compared to unknowns), in general the system is inconsistent. If dialzeroes α and β have been determined, then we have the three unknown Freuden-stein parameters [k1, k2, k3]T = ~k that must satisfy the m� 3 equations. Since,

in general, no ~k can satisfy all the equations exactly, the design error is definedas:

~d = ~b− S~k. (3.8)

Page 18: Ch3JH

72 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Figure 3.19: The steering condition.

where for the m equations S is an m× 3 matrix (called the synthesis matrix)

S =

1 cos(φ1) − cos(ψ1)1 cos(φ2) − cos(ψ2). . .. . .1 cos(φm) − cos(ψm)

~b is the m× 1 vector

~b =

cos(ψ1 − φ1)cos(ψ2 − φ2)

.

.cos(ψm − φm)

(3.9)

~k is the 3 × 1 vector of unknown Freudenstein parameters, and ~d is the m × 1design error vector. The Euclidean norm of ~d is a measure of how well the

Page 19: Ch3JH

3.5. GENERAL VECTOR SPACES 73

computed ~k satisfies the vector equation

S~k = ~b

The objective function is

z = (1/2)(~dTW ~d). (3.10)

which must be minimized over ~k. The quantity (~dTW ~d)1/2 is the weightedEuclidean norm. This requires a few words of explanation.

The matrix W is a diagonal matrix of positive weighting factors. They areused to make certain data points affect the minimization more, or less, thanothers depending on their relative importance to the design. We usually startby setting W = I (the identity matrix).

Vector norms serve the same purpose on vector spaces that the absolutevalue does on the real line. They furnish a measure of distance. More precisely,the vector space Rn together with a norm on Rn define a metric space. Sincewe will be comparing metric and non-metric geometries, we’d better have adefinition of metric space.

Cartesian Product: Of any two sets S and T , denoted S×T , is the set of allordered pairs (s, t) such that s ∈ S and t ∈ T .

Definition of a Metric: Let S be any set. A function d from S×S into R(theset of real numbers)

R = d(S × S) ≡ dsisjis a metric on S if:

1. dxy ≥ 0, ∀ (x, y) ∈ S;

2. dxy = dyx, ∀ (x, y) ∈ S;

3. dxy = 0 iff x = y;

4. dxz + dzy ≥ dxy, ∀ (x, y, z) ∈ S.

Metric Space: A metric space is a non-empty set S, together with a metric ddefined on S. For example, the Euclidean distance function for orthogonalx-y-z system:

d12 = d21 =√

(x2 − x1)2 + (y2 − y1)2 + (z2 − z1)2.

3.5 General Vector Spaces

Definition: Let V be an arbitrary non-empty set of objects on which twooperations are defined: addition and multiplication by scalars (real numbers).If the following axioms are satisfied by all objects ~u,~v, ~w in V and all scalars kand l then V is a vector space and the objects in V are vectors:

1. if ~u,~v ∈ V , then ~u+ ~v ∈ V ,

Page 20: Ch3JH

74 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

2. ~u+ ~v = ~v + ~u,

3. ~u+ (~v + ~w) = (~u+ ~v) + ~w,

4. ∃ ~0 ∈ V such that ~0 + ~v = ~v +~0 = ~v,

5. ~u+ (−~u) = (−~u) + ~u = ~0,

6. k~u ∈ V, ∀ k ∈ R and ∀ ~u ∈ V ,

7. k(~u+ ~v) = k~u+ k~v,

8. (k + l)~u = k~u+ l~u,

9. k(k~u) = (kl)~u,

10. 1~u = ~u.

3.5.1 Vector Norms

A useful class of vector norms are the p-norms defined by:

||~x||p = (|x1|p + ...+ |xn|p)1/p. (3.11)

Of these the 1,2, and ∞ norms are frequently used:

||~x||1 = |x1|+ ...+ |xn|;||~x||2 = (|x1|2 + ...+ |xn|2)1/2

= (~x � ~x)1/2

= (~x T~x)1/2;

||~x||∞ = max1<i<n |xi|.

Example: Consider the vector in a four dimensional vector space:

x =

21−24

,||~x||1 = 2 + 1 + 2 + 4 = 9,

||~x||2 = (4 + 1 + 4 + 16)1/2 = 5,

||~x||∞ = 4.

The 2-norm is the generalized Euclidean distance and is geometrically veryintuitive. Back to the objective function for minimizing ~d over ~k:

z = (1/2)~d T W ~d.

Typically, one half of the square of the weighted 2-norm is used. The weighted2-norm (Euclidean norm) of ~d over ~k can be minimized, in a least-squares sense

Page 21: Ch3JH

3.5. GENERAL VECTOR SPACES 75

by transforming S using householder reflections, or singular value decomposition(SVD). We will discuss these later on.

Briefly, in MATLAB householder orthogonalization is invoked when a rect-angular matrix is divided by a vector, using the syntax

k = s \ b.

Be warned that this symbolic matrix division is literally symbolic: the opera-tion does not exist! The backslash operator invokes an algorithm that employsHouseholder orthogonalization of the matrix. Using SVD is somewhat moreinvolved, but information on how well each element of ~k has been estimated isa direct, and extremely useful output of the decomposition.

Page 22: Ch3JH

76 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Design Error:~d = ~b− S~k

S =

1 cosφ1 − cosψ1

. . .

. . .1 cosφm − cosψm

,~k =

k1k2k3

,~b =

cos(ψ1 − φ1)

.

.cos(ψm − φm)

.Objective Function:

z ≡ (1/2)(~d T W ~d) ⇒ minimize with respect to ~k.

Normality Condition:

dz

d~k= 0 ⇒

(δz)/(δk1)(δz)/(δk2)(δz)/(δk3)

= 0.

Chain rule:dz

d~k⇒ dz

dki=

dz

ddj

ddjdki

⇒ dz

d~k=

(d~d

d~k

)Tdz

d~k.

Thus:

dz

d~k= −ST W ~d,

= −ST S(~b− s~k) = 0,

⇒ −ST W~b+ ST W S~k = 0 ⇒ Normal Equations,

⇒ (ST W S)(3×3)~k(3×1) = (ST W )(3×m)~b(m×1).

Hence,~kopt = (ST W S)−1ST W~b.

Because W > 0 ⇒ ST W S > 0 ⇒ Kopt minimizes z. The term

(ST W S)−1ST W in the above equation is called the Moore-Penrose Gen-eralized Inverse (M-PGI) of S.

Page 23: Ch3JH

3.6. STRUCTURAL ERROR 77

Calculating the Moore-Penrose Generalized Inverse conceptually leads to ~kopt,

however, this is generally not the case numberically, form� n, (ST W S)−1ST W

is typically ill-conditioned

(σmaxσmin

≈ ∞)

.

We must resort to a numerical approximation that is insensitive to the con-ditioning of the M-PGI of S. Geometrically, we must find ~k whose image underS is as close possible to ~b. This implies the use of Householder Reflections (morelater). See Figure 3.20.

Figure 3.20: ~k rotates S~k about ~0 = ~0. ~kopt yields smallest distance (dminbetween S~k and ~b.

3.6 Structural Error

The structural error is defined to be the difference between the output as speci-fied by the prescribed and generated values for a given input. Let the structuralerror vector ~s be defined as

~s ≡ [φpres,i − φgen,i], i ∈ 1, 2, ..,m.

To minimize the Euclidean, or 2-Norm, of ~s requires the iterative Gauss-Newtonprocedure. The scalar objective function to be minimized over ~k is

ζ = (1/2)(~sT W~s).

Here, again W is a diagonal matrix of weighting factors.

Minimizing the norm of ~s is a non-linear problem. One way to proceed isto use the Gauss-Newton procedure, using the Freudenstein parameters thatminimize the Euclidean norm of the design error as an initial guess. The guess

Page 24: Ch3JH

78 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

is modified until the normality condition, which is the gradient of ζ with respectto ~k, is satisfied to a specified tolerance. For the exact synthesis we must have

∂ζ

∂~k= ~0

From the normality condition we have

∂ζ

∂~k=

(∂~s

∂~k

)T3×m

∂ζ

∂~sm×1. (3.12)

Lets set W = I. Then

ζ =1

2~sT~s,

=1

2||~s||22 ⇒ min ~k,

which implies∂ζ

∂~s= ~s.

So∂~s

∂~k=

∂~k(~φpres − ~φgen),

prescribed ⇒ constant ⇒ ∂ ~φpres

∂~k= ~0,

⇒ ∂~s

∂~k= −∂

~φgen

∂~k.

3.6.1 Synthesis Equations S~k −~b:

Let

~f = ~f(~φgen,~k; ~ψ) = ~0 (3.13)

~ψ =

ψ1

.

.ψn

,

~f =

f1..fn

.The total derivative of ~f WRT ~k can be written as the sum of the partials:

d~f

d~k=

(∂ ~f

∂~k

)m×3

+

(∂ ~f

∂~φgen

)m×m

(∂~φgen

∂~k

)m×3

= 0m×3. (3.14)

Page 25: Ch3JH

3.6. STRUCTURAL ERROR 79

But, we have shown that

∂~φgen

∂~k= − ∂~s

∂~k.

We have also shown that

∂ ~f

∂~φgen= DIAG

(∂f1

∂φgen,1, ...,

∂fm∂φgen,m

)≡ D.

From Equation (3.14) we have:

∂ ~f

∂~φgen

∂~φgen

∂~k= −∂

~f

∂~k.

Rearranging, we get:

∂~φgen

∂~k= −D−1 ∂

~f

∂~k. (3.15)

Since ~f is linear in ~k

S =∂ ~f

∂~k.

Finally, we have established that

∂~φgen

∂~k= − ∂~s

∂~k.

All the above relations can be used to rewrite Equation (3.15) as:

∂~s

∂~k= D−1S. (3.16)

Sub (3.16) into (3.11)

∂ζ

∂~k= −

(D−1S

)T~s,

= −ST D−1~s,= ~0 (the normality condition)

The Euclidean norm of the structural error ~s attains a minimum value whenD−1~s lies in the nullspace of ST . From equation (3.13) we can write:

~φgen = ~φgen(~k)

But we want~φgen(~k) = ~φpres

Page 26: Ch3JH

80 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Assume we have an estimate for ~kopt, which we call ~kυ obtained from the

υth iteration. We can introduce a correction vector ∆~k so that we get

~φgen(~kυ + ∆~k) = ~φpres. (3.17)

Expand the LHS of equation (3.17) in a Taylor Series:

~φgen(~kυ) +∂~φgen

∂~k|~kυ∆~k +HOT = ~φpres.

We know that

∂~φgen

∂~k= −D−1S.

All this leads to:

D−1S∆~k = ~φgen(~kυ)− ~φpres,= −~s. (3.18)

Find ∆~k as a least squares approximation of equation (3.18) for the υth itera-tion. Stop when

||∆~k|| < ε > 0

∆~k → ~0 ⇒ ST D−1~sυ → ~0

Which is exactly the normality condition. Procedure converges to a minimum ζFor the synthesis equations, we have:

∂f1∂φgen,1

=∂

∂φgen,1[k1 + k2 cos(φgen,1)− k3 cos(ψ1)− cos(ψ1 − φgen,1)] ,

= −k2 sin(φgen,1)− sin(ψ1 − φgen,1),

D =

∂f1

∂φgen,10 0 ...

0 ∂f2∂φgen,2

0 ...

0 ... ... ...

,

D =

d11 0 0 ...0 d22 0 ...0 0 d33 ...... ... ... ...

,

D−1 =

1/d11 0 0 ...

0 1/d22 0 ...0 0 1/d33 ...... ... ... ...

.But we need

~φgen(~k) = ~φpres. (3.19)

Page 27: Ch3JH

3.7. SINGULAR VALUE DECOMPOSITION (SVD) 81

3.6.2 Linear Least-Squares Problem

In a system of linear equations Am×n~x = ~b, when there are more equations thanunknowns (⇒ m > n), and the set is said to be over-determined, there is, ingeneral, no solution vector ~x. The next best thing to an exact solution is the bestapproximate solution. This is the solution that comes closest to satisfying all theequations simultaneously. If closeness is defined in the least-squares sense, thenthe sum of the squares of the differences between the left- and right-hand sidesof Am×n~x = ~b must be minimized. Then the over-determined linear problembecomes a (usually) solvable linear problem: the linear least-squares problem.

Conceptually, we can transform the m × n system to an n × n system bypre-multiplying both sides by AT :

(ATn×mAm×n)~xn×1 = ATn×m~bm×1

These are the normal equations of the linear least-squares problem.It turns out that singular value decomposition can solve the normal equations

(using householder reflections) without explicitly evaluating them. It is alwaysworth repeating that direct solution of the normal equations is usually the worstway to find least-squares solutions.

In summary, given an objective function Z = (1/2)~eT~e to minimize over ~x,in an over-determined set of equations, we get:

The normality condition∂z

∂~x= ~0

The normal equations(AT A)~x− AT~b = ~0

The Naıve Approach~x = (AT A)−1AT~b

3.7 Singular Value Decomposition (SVD)

Consider the matrix equation

Am×n~xn×1 = ~bm×1

The least-squares solution to a suitably large over-determined system involvesthe pseudo of Moore-Penrose generalized inverse of A. Given A and ~b, we canapproximate ~x in a least-squares sense as:

~x = [AT A]−1AT~b. (3.20)

Practically, however, if A has full rank, then householder reflections (HR) areemployed to transform A. They represent a change of basis that do not changethe relative angles between the basis column vectors of A. They are proper

Page 28: Ch3JH

82 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

isometries (reflections, in fact) that do not distort the metric on A. The ith HRis defined such that

HTi Hi = I, det(Hi) = −1

Thus, Hi is orthogonal, but not necessarily symmetric. The dimensions of thesystem are shown in Figure 3.21. n HR’s are required to transform A. Each

Figure 3.21:

HR is an n × m matrix that transforms the system into a set of n canonicalequations as shown in Figure 3.22. Remember: No self-respecting engineer

Figure 3.22:

would ever use the pseudo inverse to approximate ~x, but HR, when A has fullrank. What if A does not? Enter SVD. It is much more than the flavor-of-the-month least-squares numerical approximation algorithm. It is a very powerfultechnique for dealing with sets of equations that are either singular (containlinear dependencies), numerically close to singular, or even fully determinedand well constrained.

Page 29: Ch3JH

3.7. SINGULAR VALUE DECOMPOSITION (SVD) 83

3.7.1 Nullspace, Range, Rank:

The nullspace, range, and rank of a matrix are important concepts. consider

A~x = ~b

Matrix A may be viewed as a map from the vector space ~x to the vector space~b

Nullspace: The nullspace of A is a subspace of ~x that A maps to ~0. It is theset of all linearly independent ~x that satisfy

A~x = ~0

The dimension of the nullspace is called the nullity of A.

Range: The range of A is the subspace of ~b that can be reached by A for the~x not in the nullspace of A

Rank: The dimension of the range is called the rank of A. For an n×n squarematrix, rank + nulity = n. For a non-singular matrix A, rank = n.

The maximum effective rank of a rectangular m× n matrix is the rank ofthe largest square sub-matrix. For m > n, full rank means rank = n andrank deficiency means rank < n

SVD is based on the fact that any (every) m×n matrix A can be decom-posed into the product of the following matrix factors:

Am×n = Um×nΣn×nVTn×n

Full Size : Um×mΣm×nVTn×n

Where:

• Um×n is column-orthonormal (the column vectors are all mutuallyorthogonal unit vectors). In other words

U(:, j) � U(:, k) = 1, j = k

= 0, j 6= k

• Σn×n is a diagonal matrix whose diagonal elements are the singu-lar values,σi of A. The singular values of A are the square rootsof the eigenvalues of AT A. They are positive numbers arranged indescending order:

(AT A)~x = λ~x⇒ (AT A− λI)~x = ~0

σi =√λi

• V is a square orthonormal matrix, i.e.

V V T = I

Page 30: Ch3JH

84 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

SVD is an extremely useful computational linear algebra tool because ofthe numerical information exposed by the decomposition. SVD explicitlyconstructs orthonormal bases for both the nullspace and range of every(any) matrix A

Recall that an m × n matrix A possessing full rank means rank = n. Inthis case, all σi, i = 1...n, are positive, non-zero real numbers. The matrixis (analytically) non-singular. If A is rank deficient then some of the σiare identically zero. The number of σi = 0 corresponds to the dimensionof the nullspace (n � rank(A)). The σi are arranged in Σ on the diagonalin descending order: σ1 ≥ σ2, σ2 ≥ σ − 3, ... , σn−1 ≥ σn

• The columns of u whose same-numbered elements σi are non-zero arean orthogonal set of orthonormal basis vectors that span the rangeof A: every possible product A~x = ~b is a linear combination of thesecolumn vectors of ~U

• The columns of V whose same numbered elements σi = 0 form anorthogonal set of orthonormal basis vectors that span the nullspaceof A: every possible product A~x = ~0 is a linear combination of thesecolumn vectors of V . See Figure 3.23.

Figure 3.23:

MATLAB Note: To get the form of SVD in Figure 3.23, the syntax is

[U, S, V ] = svd(A, 0)

Page 31: Ch3JH

3.7. SINGULAR VALUE DECOMPOSITION (SVD) 85

For Am×n returns Um×n, Sn×n (Singular V alues), Vn×n such that A =U SV T

What computational advantage does this provide? Any (every) matrix,no matter how singular, can be inverted! By virtue of the properties ofU ,Σ,and V , the inverse of any (every) matrix A, square or not, is simply

A−1 = (Um×nΣn×nVTn×n)−1 = Vn×nΣ−1n×nU

Tn×m

Because V and U are orthogonal their inverses are equal to their trans-poses. Because Σ is diagonal, its inverse has elements1/σi on the diagonaland zeroes everywhere else. So we can write explicitly:

A−1n×m = Vn×n[diag(1/σi)]UTn×m

Computational problems can only be caused if any σi = 0, or are so closeto zero that the value of σi is dominated by roundoff error so that 1/σibecomes a very large, but equally inaccurate number, which pushes A−1

towards infinity in the wrong direction. That doesn’t bode well for thesolution ~x = A−1~b.

3.7.2 Numerical Conditioning

The condition number of a matrix is a measure of how invertible or how closeto singular a matrix is. The condition number of a matrix is the ratio of thelargest to the smallest singular values.

k(A) = σmax/σmin

A matrix is singular if k =∞, and is ill-conditioned if k is very large. But, howbig is large? Relative to what? The condition number has the following bounds

1 ≤ k(A) ≤ ∞

Instead, let’s consider the reciprocal of k(A). Let this reciprocal be λ(A)

λ(A) = 1/k(A)

This ratio is bounded both from above and below

0 ≤ λ(A) ≤ 1

Now we can say A is well-conditioned if λ(A) ' 1, and ill-conditioned if λ(A) '0. But, now how small is too close to zero. Well, this we can state with certainty.Too small is the computer’s floating-point precision which is 10−12 for doubleprecision. MATLAB uses double floating-point precision for all computations.Hence, if λ(A) < 10−12, A is ill=conditioned.

Page 32: Ch3JH

86 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

3.7.3 What to do when (if) A is Singular

There are three cases to consider if k(A) =∞.

1. If ~b = ~0, the solution for ~x is any column of V whose corresponding σi = 0.

2. If ~b 6= 0, but ~b is in the range of A. The singular set of equations doeshave a solution vector ~x In fact there are infinite solutions because anyvector in the nullspace (any column of V with corresponding σi = 0) canbe added to ~x in any linear combination. See Figure 3.24.

But hit is where things get really interesting. The ~x with the smallestEuclidean norm can be obtained by setting ∞ = 0!! This, however, is thedesperation mathematic is appears to be at first glance. If σi = 0, set(1/σi) = 1/0 = 0 in Σ−1. Then, the ~x with the smallest 2-norm is

~x = V [diag(1/σi)](UT~b), i = 1, ..., n. (3.21)

Where for all σi = 0, 1/σi is set to zero. (Note, in Figure 3.25 the

equation A~x = ~d is used for this case.)

3. If ~b 6= 0 but is not in the range of A (this is typical in over-determinedsystems of equations). In this case the set of equations are inconsistent,and no solution exists that simultaneously satisfies them. We can stilluse equation (3.21) to construct a solution vector ~x that is the closestapproximation in a least-squares sense. In other words, SVD finds the ~xthat minimizes the norm of the residual, r of the solution, where

r ≡ ||A~x−~b||2

Note the happy similarity to the design error!! See Figure 3.26.

3.8 Numerical Reality

Thus far we have presumes that either a matrix is singular or not. From ananalytic standpoint this is true, but not numerically. It is quite common forsome σi to be very, very small, but not zero. Analytically the matrix is notsingular, but numerically it is ill-conditioned. In this case Gaussian elimination,or the normal equations will yield a solution, but one when multiplied by A verypoorly approximates ~b.

The solution vector ~x obtained by zeroing the small σi and then using equa-tion (3.21) usually gives a better approximation than direct methods and theSVD solution where small σi ar not zeroed.

Small σi are dominated by, and hence are an artifact of, roundoff error. Butagain we must ask “How small is too small?”. A plausible answer is to edit(1/σ− i) if (σi/σmax) < µε where µ is a constant and ε is the machine precision.MATLAB will tell you what ε is on your machine: in the command window,type eps followed by pressing enter. On my desktop ε = 2.2204 × 10−16. It

Page 33: Ch3JH

3.8. NUMERICAL REALITY 87

Figure 3.24: Matrix A is non-singular. Maps one vector space onto one of thesame dimension if A is square. For the m× n case ~x is mapped onto ~b so thatA~x = ~b is satisfied.

Figure 3.25: Matrix A is singular. If A is square it maps a vector space oflower dimension (in the figure A maps a plane onto a line, the range of A).

The nullspace of A maps to zero. The “solution” vector ~x of A~x = ~d consistof a particular solution plus any vector in the nullspace. In this example, thesesolutions form a line parallel to the nullspace. SVD finds the ~x closest to zeroby setting 1/σi = 0 for all σi = 0. Similar statements hold for rectangular A

turns out that a useful value for µ is rank(V ). So we can state the following,easy rule for editing 1/σi:

Set 1/σ − i = 0 if (σi/σmax) < rank(V )ε

At first it may seem that zeroing the reciprocal of a singular value makes a badsituation worse by eliminating one linear combination of the set of equations weare attempting to solve. But we are really eliminating a linear combination ofequations that is so corrupted by roundoff error that it is, at best, useless. Infact, worse than useless because it pushes the solution vector towards infinity in

Page 34: Ch3JH

88 CHAPTER 3. TYPE, NUMBER, AND DIMENSIONAL SYNTHESIS

Figure 3.26: The vector ~c is outside the range of A, so there is no ~x that cansatisfy A~x = ~c. SVD finds the least-squares “best approximation” solutionA~x = ~c′, as illustrated, after all 1/σi =∞ have been zeroed.

a direction parallel to a nullspace vector. This makes the roundoff error worseby inflating the residual r = ||A~x−~b||2.

In general the matrix Σ will not be singular and no σi will have to beeliminated, unless there are column degeneracies in A (near linear combinationsof the columns). The ith column in V corresponding to the annihilated σi givesthe linear combination of the elements of ~x that are ill-determined even by theover-determined set of equations. These elements of ~x are insensitive to thedata, and should not be trusted.