Machines & mechanisms

Mechanism Constraint Solver

Solves a planar mechanism sketched as up to 9 points joined by links and sliders, with one optional crank: counts its degrees of freedom by the Gruebler-Kutzbach rule, places every point in closed form where the mechanism builds up from two-link groups (on the side the sketch draws it), runs a 15-step damped least-squares solver from the sketch as the snap, finds the true degree of freedom and the redundant constraints by Gram-Schmidt rank, and turns the crank through a 37-frame closed-form sweep with the slider stroke. Five scored challenges are included. For learning mechanism kinematics; not a machine design tool.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Points (row k is point k: its sketch position and its role; leave all three cells blank for no point) (required)
About this input

Up to 9 points: row k is point k with its sketch x and y in m (-2 to 2) and its role, Free or Ground (1 to 3 ground and 1 to 6 free points). Ground points stay where they are drawn; free points are where the solver starts. Leave all three cells blank for no point; two points may not share a spot.

Default 5 rows
ColumnRange or allowed values
x (m) -2 to 2
y (m) -2 to 2
Role Free, Ground
Your prediction (challenge 1) (required)
About this input

Your prediction for challenge 1 of what the counting rule gives: Not yet predicted, Zero or less, One, Two or Three or more. The counts and the sweep of challenge 1 stay hidden until you predict. Not used outside challenge 1.

Default Not yet predicted Allowed Not yet predicted, Zero or less, One, Two, Three or more
Sweep start (required)
About this input

The first crank angle of the 37-frame sweep, -180 to 180 degrees.

Unit deg Default 0 Range -180 to 180
Sweep span (required)
About this input

The width of the sweep, 10 to 360 degrees; with 360 the last frame repeats the first.

Unit deg Default 360 Range 10 to 360
Solver damping power (required)
About this input

The solver starts with a damping of 10 to this power, -6 to 1: a larger damping takes shorter, safer steps.

Default -3 Range -6 to 1
Constraints (row c is constraint c: a link holds two points at a length, a slider holds point A on a rail through ground point B; a blank length or rail angle means as drawn) (required)
About this input

Up to 10 constraints: row c is a Link (points A and B held at a length, 0.01 to 5 m) or a Slider (free point A held on a straight rail through ground point B at a rail angle, -180 to 180 degrees). A blank length or rail angle means as drawn. A link must touch a free point. Leave a row blank for no constraint.

Default 5 rows
ColumnRange or allowed values
Type Link, Slider
Point A 1 to 9
Point B 1 to 9
Length (m) 0.01 to 5
Rail angle (deg) -180 to 180
Challenge number (required)
About this input

Selects a challenge: 0 for none, 1 to 5 for a predefined challenge, which replaces the sketch except the cells it leaves to you.

Default 0 Range 0 to 5
Crank (constraint number) (required)
About this input

The constraint row that is the crank, a link from a ground point to a free point whose angle you set (its free end is the crank tip); 0 for no crank.

Default 1 Range 0 to 10
Crank angle (required)
About this input

The crank angle from +x, counterclockwise positive, -180 to 180 degrees.

Unit deg Default 45 Range -180 to 180

Outputs

The solver steps from the sketch (the snap): every point, the largest mismatch, the damping, whether the step was accepted and the fit class of each constraint
About this output

The solver steps from the sketch: 16 rows, step 0 to 15, with every point's x and y, the largest mismatch (m), the damping (blank after the settle row), whether the step was accepted (blank for a row that took no step) and each constraint's fit class (0 within a millionth of the drawing size, 1 within 5%, 2 beyond; 0 for the crank). The canvas plays these rows as the snap.

No unit declared
The points: role, sketch position, the position shown, how far it moved and the pass that placed it
About this output

The points: 9 rows, point k with its role (Ground, Crank tip or Free), its sketch x and y, its position shown (the drawn assembly, or the solver's last row), how far it moved from the sketch (m) and the pass that placed it (0 for ground points and the crank tip; blank when the mechanism does not break into two-link groups). A point not in use is a blank row; the whole grid is blank when the inputs are not valid.

No unit declared
Solve method
About this output

Two-link groups when every unknown point is placed in closed form, else Iteration only. Blank when the inputs are not valid.

No unit declared
Solver outcome
About this output

How the 15-step solver ended: Settled cleanly, Settled after cut steps, Stuck at a compromise or Not settled in 15 steps. Blank when the inputs are not valid.

No unit declared
Solver result against the drawn assembly
About this output

The largest coordinate difference between the solver's final positions and the drawn assembly, m; blank when there is no drawn assembly. Blank when the inputs are not valid.

Unit m
Slider stroke
About this output

The slider stroke read from the frames, m: the greatest less the least position. Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction. Also blank with no slider or fewer than 2 frames.

Unit m
Drawing size
About this output

The drawing size: the largest target length or absolute sketch coordinate, m; every length tolerance scales with it. Blank when the inputs are not valid.

Unit m
Redundant constraints
About this output

The constraints in use that add nothing new, given the constraints before them. Blank when the inputs are not valid, when the position shown is not solved (status items 14 to 18) or while challenge 1 awaits a prediction.

No unit declared
Sliders
About this output

The sliders in use. Blank when the inputs are not valid.

No unit declared
Slider position, least
About this output

The least position of the first slider along its rail from its anchor over the frames that assemble, m. Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction. Also blank with no slider or fewer than 2 frames.

Unit m
Slider position, greatest
About this output

The greatest position of the first slider along its rail over the frames that assemble, m. Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction. Also blank with no slider or fewer than 2 frames.

Unit m
View x to
About this output

The right edge of the square view, m. Blank when the inputs are not valid.

Unit m
Changes between assembling and not
About this output

The number of changes between a frame that assembles and one that does not, along the sweep. Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction.

No unit declared
View x from
About this output

The left edge of the square view, m, covering the sketch, the position shown, every solver row and every frame that assembles. Blank when the inputs are not valid.

Unit m
View y from
About this output

The bottom edge of the square view, m. Blank when the inputs are not valid.

Unit m
View y to
About this output

The top edge of the square view, m. Blank when the inputs are not valid.

Unit m
Sweep start used
About this output

The sweep start used, degrees. Blank when the inputs are not valid.

Unit deg
Solver steps to settle
About this output

The solver row at which every mismatch first fell below 1E-12 of the drawing size; blank when it never did. Blank when the inputs are not valid.

No unit declared
Largest mismatch after 15 solver steps
About this output

The largest constraint mismatch after the 15 solver steps, m. Blank when the inputs are not valid.

Unit m
Crank sweep available
About this output

Yes when a crank is set and the drawn assembly exists, so the crank can be swept; else No. Blank when the inputs are not valid.

No unit declared
Sweep span used
About this output

The sweep span used, degrees. Blank when the inputs are not valid.

Unit deg
The crank sweep: every point at each of 37 crank angles, the slider position and whether the frame assembles
About this output

The crank sweep: 37 rows, each crank angle with every point's x and y when the frame assembles, the first slider's position along its rail (m) and the frame flag (Assembles, Toggle, Cannot assemble, Undetermined or Does not fit). With no sweep only the angles show; while challenge 1 awaits a prediction rows 1 to 36 are blank.

No unit declared
Formula module versions
About this output

The formula modules the model is built from, with their versions.

No unit declared
Independent constraints (rank)
About this output

The number of constraints that add a restriction (the rank of the constraint rows at the position shown). Blank when the inputs are not valid, when the position shown is not solved (status items 14 to 18) or while challenge 1 awaits a prediction.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
The constraints: target, sketch value, mismatch at the position shown, whether each adds a restriction, and the rail ends of each slider
About this output

The constraints: 10 rows, constraint c with its type, its points, its target (a link's length in m or a slider's rail angle in degrees), its sketch value (the drawn length, or the slider's offset from its rail), its mismatch at the position shown (m), whether it adds a restriction and its independence (blank when not solved or while awaiting a prediction), and for a slider the two ends of its drawn rail. A constraint not in use is a blank row.

No unit declared
Crank used
About this output

The crank used (a challenge sets its own). Blank when the inputs are not valid.

No unit declared
Crank angle used
About this output

The crank angle used, degrees. Blank when the inputs are not valid.

Unit deg
Challenge score
About this output

The challenge score: 100 when met, else 0.

No unit declared
Share of frames that assemble
About this output

The share of the 37 frames that assemble, percent. Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction.

Unit %
Sweep frames that assemble
About this output

The sweep frames, of 37, in which the mechanism assembles (a toggle frame included). Blank when the inputs are not valid, when no sweep is available or while challenge 1 awaits a prediction.

No unit declared
Challenge feedback
About this output

Feedback on the selected challenge: the prediction prompt, the met text or the not-met hint (blank with none).

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the counting rule (1), the true degree of freedom (2), the slider stroke in m (3), the change of constraint 2's length in m (4) or the frames that assemble (5); blank when not valid, while awaiting a prediction or when the value is not defined.

No unit declared
Challenge goal
About this output

The goal of the selected challenge (blank with none).

No unit declared
Links
About this output

The links in use, the crank included. Blank when the inputs are not valid.

No unit declared
Ground points
About this output

The ground points. Blank when the inputs are not valid.

No unit declared
Largest mismatch of the position shown
About this output

The largest constraint mismatch at the position shown, m (about 1E-16 for a solved mechanism). Blank when the inputs are not valid.

Unit m
Model version
About this output

The model version.

No unit declared
Model Status
About this output

NOT VALID with the reason when an input cannot be used; CHECK when the results are shown but need attention (the mechanism cannot be assembled, a point cannot be placed, the solver did not settle cleanly, an ambiguous or toggle position, an under-constrained mechanism, one that does not break into two-link groups, or a solver that reached another assembly); otherwise OK.

No unit declared
Free points
About this output

The free points, the crank tip included. Blank when the inputs are not valid.

No unit declared
Counting rule: 2 x free points - links - sliders
About this output

The counting rule (Gruebler-Kutzbach, point-and-link form): 2 x free points - links - sliders, the crank counted as a link. Blank when the inputs are not valid or while challenge 1 awaits a prediction.

No unit declared
Damping power used
About this output

The damping power used (always yours). Blank when the inputs are not valid.

No unit declared
True degree of freedom
About this output

The true degree of freedom: 2 x free points less the number of constraints that add a restriction at the position shown. Blank when the inputs are not valid, when the position shown is not solved (status items 14 to 18) or while challenge 1 awaits a prediction.

No unit declared
Free motions left
About this output

The true degree of freedom less one for the driven crank: the motions still free. Blank when the inputs are not valid, when the position shown is not solved (status items 14 to 18) or while challenge 1 awaits a prediction.

No unit declared
Counting rule with the crank driven
About this output

The counting rule with the crank driven: one less than the count when a crank is set. Blank when the inputs are not valid or while challenge 1 awaits a prediction.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab solves a planar mechanism that you sketch as up to 9 points joined by up to 10 constraints. A point is a ground point, which stays where it is drawn, or a free point, which the model moves. A constraint is a link, which holds two points at a fixed distance, or a slider, which holds a free point on a straight rail through a ground point. One link from a ground point to a free point may be the crank, whose angle you set. For the mechanism the model returns the degree-of-freedom count by the counting rule, the position of every point, the 15 solver steps from your sketch, the true degree of freedom and the constraints that add nothing new, and a 37-frame sweep of the crank with the slider's travel. Five scored challenges use the same model.

It is a lab for learning mechanism kinematics: how links and sliders take away freedom, why the counting rule can be wrong, why one set of lengths can assemble in two ways, where a mechanism locks at a dead position, and what an iterative solver does when no direct solution exists. It is not a machine design tool. It models geometry only: no masses, forces, friction, clearances or collisions, no joint types other than links and sliders, and only one crank.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: your sketch, the configuration shown, each solver step with its links coloured by how well they fit, the slider rails, and every frame of the crank sweep. The page computes no position, count, rank or stroke itself.

Inputs and units

Coordinates and lengths are in metres (m) and angles in degrees. Angles are measured from the +x direction, counterclockwise positive.

Input Meaning and unit
Points Up to 9 rows. Row k is point k: its sketch x and y, each from -2 to 2 m, and its role, Free or Ground. A mechanism needs 1 to 3 ground points and 1 to 6 free points. A row left fully blank is no point; two points may not share a spot. Free points are where the solver starts.
Constraints Up to 10 rows. Row c is constraint c: its type (Link or Slider) and two point numbers A and B from 1 to 9. A link holds A and B at a length from 0.01 to 5 m and must touch at least one free point. A slider holds free point A on a straight rail through ground point B, at a rail angle from -180 to 180 degrees. A blank length or rail angle means as drawn. A row left fully blank is no constraint. At least one link is needed.
Crank A whole constraint number from 0 to 10 (default 1): the link, from a ground point to a free point, whose angle you set; its free end is the crank tip. 0 means no crank.
Crank angle From -180 to 180 degrees (default 45): the crank's angle from +x.
Sweep start From -180 to 180 degrees (default 0): the first crank angle of the sweep.
Sweep span From 10 to 360 degrees (default 360): the width of the sweep. With 360 the last frame repeats the first.
Solver damping power A whole number from -6 to 1 (default -3): the solver starts with a damping of 10 to this power. A larger damping takes shorter, safer steps.
Challenge number 0 for free exploration, or 1 to 5 to load a challenge.
Your prediction (challenge 1) Not yet predicted, Zero or less, One, Two or Three or more: your prediction of the counting rule in challenge 1.

Where each input is set:

  • On the canvas only: the points, the constraints, the crank, the crank angle and your prediction in challenge 1. Points are added, moved, switched between free and ground and erased with the sketch tools; links and sliders are drawn between points; a tap on a link or slider sets its length or rail angle, makes it the crank or removes it. The Points and Constraints tables on the canvas show the same rows as numbers.
  • Draggable on the canvas: every point, in 0.01 m steps, and the crank handle, in whole degrees.
  • In the input panel: the sweep start, the sweep span and the challenge number, and the solver damping power under Advanced.

Governing relationships

Drawing size. Every length tolerance scales with the drawing size Lref, the largest of every link's target length and the size of every sketch coordinate (at least 0.01 m). A link's target length is its entered length, or its sketch distance when the length is blank. A slider's rail angle is its entered angle, or, when blank, the direction from its anchor B to the sketch position of A.

The counting rule. In the point-and-link form of the Gruebler-Kutzbach count, each free point has two coordinates and each link or slider removes one:

dofCount = 2 x F - links - sliders,

where F is the number of free points (the crank tip included) and the crank counts as a link. With a crank, dofWithCrank = dofCount - 1, the motions left once the crank is driven. The count assumes every constraint takes away a different freedom, which is not always true.

The mismatch of a constraint. At any positions, a link from A to B with target L has mismatch r = |B - A| - L, the distance between its ends less its length. A slider has mismatch r = n · (A - B), the offset of A from its rail, where n is the unit normal to the rail. A constraint fits exactly when r = 0.

The crank tip. With a crank of length L* from ground point G at crank angle t, the tip is (xG + L* cos t, yG + L* sin t). At a multiple of 90 degrees the cosine and sine are taken exactly (1, 0 or -1).

Two-link groups, placed in closed form. The known points start as the ground points and the crank tip. In up to 6 passes, every unknown free point that has two constraints to points already known is placed directly:

  • Two links (circle and circle). With partners C1 and C2 at distance d, and lengths L1 and L2, a = (L1² - L2² + d²) / (2d) and h² = L1² - a². The point lies at a along the line from C1 to C2 and h to one side of it.
  • A link and a slider (circle and rail). With link partner C, rail anchor G, rail direction t and normal n, the point lies on the rail at s = (C - G) · t ± h from G, where h² = L² - ((C - G) · n)².
  • Two sliders (rail and rail). The point is where the two rails cross.

When h² is negative beyond a small band the point cannot reach both partners (Cannot assemble). When h² lies within the band of 1×10⁻¹² x Lref², h is set to exactly 0: the two constraints pull along one line, a dead or toggle position. Two partners on the same spot, or two parallel rails, leave the point undetermined.

The assembly is chosen from your sketch. A circle-and-circle or circle-and-rail group has two solutions. The model takes the one on the side where your sketch draws the point: left or right of the line from C1 to C2, or ahead of or behind C's foot along the rail. When the sketch puts the point within a tie band of 1×10⁻⁶ (relative) of that line, the left-hand or forward assembly is used. The side, once chosen, is kept at every crank angle. A mechanism whose unknown points are all placed this way is built from two-link groups, and its drawn assembly is the configuration shown. A constraint used by no group is an extra constraint; it must fit within 1×10⁻⁹ x Lref.

The solver: damped least squares. The model also runs 15 steps of a damped least-squares (Levenberg) iteration from your sketch. With r the mismatches of the active constraints and J their unit-vector rows (the Jacobian), each step D solves

(JᵀJ + λI) D = -Jᵀr when there are at least as many active constraints as unknown coordinates, or D = -Jᵀ (JJᵀ + λI)⁻¹ r when there are fewer,

where λ is the damping. A step whose largest component exceeds Lref is scaled down (clamped). A trial step is accepted when it lowers the sum of squared mismatches; then λ is divided by 10 (not below 1×10⁻⁹), and otherwise the step is rejected and λ is multiplied by 10 (not above 1×10⁶). A row has settled when its largest mismatch is at most 1×10⁻¹² x Lref; every later row repeats it. For a mechanism built from two-link groups these steps are the snap animation, and their end is measured against the drawn assembly, but they never choose it. For any other mechanism they are the only solve.

Rank, true degree of freedom and redundancy. At the configuration shown, each constraint (the crank included) gives a row of unit-vector components over the free points' coordinates. Taken in table order, each row is orthogonalised against the earlier independent rows by the Gram-Schmidt process, applied twice. The size of what remains is the row's independence; the constraint adds a restriction when it exceeds 1×10⁻⁸, and adds nothing new otherwise. Then

constraintRank = the number of constraints that add a restriction, dofTrue = 2 x F - constraintRank, redundantCount = constraints in use - constraintRank, freeMotionsLeft = dofTrue - 1 with a crank, else dofTrue.

The order matters: of two constraints that duplicate each other, the later one is marked as adding nothing new.

The crank sweep. Frame j, for j = 0 to 36, sets the crank angle to sweep start + sweep span x j / 36, places every two-link group in the same order with the same sides, and flags the frame. The first slider's position is its distance along the rail from its anchor, and the slider stroke is the greatest position less the least.

Calculation sequence

  1. Check the inputs in the order of the status list under Errors and warnings. In a challenge, take the challenge's own points, constraints, crank and sweep, except the values that challenge leaves to you.
  2. Find the roles, the target lengths and rail angles, the drawing size, the crank tip and the counts.
  3. Plan the two-link groups pass by pass from the mechanism's layout, and choose each group's side from the sketch.
  4. Place every group in closed form at the crank angle, and test every extra constraint's fit. This gives the drawn assembly, or the reason it cannot be built.
  5. Run the 15 solver steps from the sketch, and classify how the solver ended.
  6. Take the configuration shown (the drawn assembly when it exists, otherwise the solver's last row) and its largest mismatch.
  7. Find the rank, the true degree of freedom and the constraints that add nothing new at that configuration.
  8. When a crank is set and the drawn assembly exists, sweep the crank through 37 frames and read the slider's travel.
  9. Set the status and, in a challenge, score it.

Outputs and interpretation

  • Counting rule and counting rule with the crank driven: dofCount and dofWithCrank above.
  • True degree of freedom, constraints that add a restriction, constraints that add nothing new and free motions left: from the rank at the configuration shown. When the counting rule and the true degree of freedom differ, some constraint is redundant.
  • Free points, ground points, links and sliders in use.
  • Solve method: Two-link groups when every unknown point is placed in closed form, else Iteration only.
  • Solver outcome: Settled cleanly (it settled, and every step before was accepted at full length), Settled after cut steps (it settled after a rejected or clamped step), Stuck at a compromise (it did not settle, the largest mismatch stays above 1×10⁻⁶ x Lref and hardly fell over the last three steps) or Not settled in 15 steps.
  • Solver row at which it settled, the largest mismatch at the position shown and after the 15 solver steps (m), and the gap to the drawn assembly (m), the largest coordinate difference between the solver's last row and the drawn assembly.
  • Drawing size Lref (m).
  • Sweep available (Yes when a crank is set and the drawn assembly exists), frames that assemble (of 37) and their share in percent, the changes between assembling and not along the sweep, and the least and greatest slider positions and the slider stroke (m).
  • Settings used: the crank, crank angle, sweep start and span and damping power in effect.
  • Tables: the points (role, sketch, position shown, how far each moved, and the pass that placed it); the constraints (target, sketch value, mismatch at the position shown, whether it adds a restriction, its independence, and the rail ends for a slider); the 16 solver rows; and the 37 sweep frames, each flagged Assembles, Toggle, Cannot assemble, Undetermined or Does not fit.

Reading the canvas: your sketch is drawn as a ghost and the configuration shown over it. The solver steps play as the snap from the sketch, each link coloured by its fit in that row: within a millionth of the drawing size, within 5% of it, or off by more. The crank sweep plays the 37 frames; a frame that cannot assemble shows the model's reason instead of the mechanism. The stroke is read from the frames, so it can fall slightly short of the true stroke when the slider's end positions fall between frames.

Challenges

Each challenge replaces your sketch with its own mechanism, except the values it leaves to you; the damping power is always yours. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met.

  1. Count before you solve. Predict what the counting rule gives for a six-bar mechanism before you see it move: two for each free point, minus one for each link. It is met when your prediction names the count.
  2. Lock it with one link. Add exactly one link that makes a four-bar rigid, so that its true degree of freedom is 0. It is met when the configuration is solved, exactly one constraint is in use among rows 4 to 10, it is a link, and the true degree of freedom is 0.
  3. Set the stroke. Choose the crank length of a slider-crank so the slider travels 0.8 m from end to end, within 0.01 m, while the crank turns fully. It is met when all 37 frames assemble and the stroke is within 0.01 m of 0.8 m.
  4. Mend the triangle. Change the length of constraint 2 by as little as you can so the triangle assembles: within 0.05 m of the smallest change that works. The value scored is the change from 0.5 m; it is met when the configuration is solved and the change is at most 0.555 m.
  5. Make the third crank fit. Choose the third crank's length so it fits at every frame of the sweep, even though the counting rule says the mechanism cannot move. It is met when all 37 frames assemble.

Challenge 1 holds back the answer until you predict: while your prediction reads Not yet predicted, the counting rule, the true degree of freedom, the rank, the redundancy, the sweep results and the slider travel are blank, the sweep frames after the first are blank, and the challenge reads NOT MET with a prompt to predict. The mechanism itself still shows, and the status gives nothing away.

What to take from the lab: the counting rule is a quick estimate that assumes every constraint is new; the rank says what the constraints really remove. One set of lengths can assemble in two mirror-image ways, and the model shows the one you drew. Near a dead position small changes move the mechanism a lot.

Validation and status logic

The status reads the first match in the list under Errors and warnings. Items 1 to 6 are checked on the values you entered, even where a challenge replaces them; the later items are checked on the values in use. The NOT VALID items come first, then the CHECK items for a mechanism that cannot be assembled or solved (items 14 to 18), then the CHECK items for a solved configuration that needs attention (items 19 to 24), then OK. The configuration shown is solved under items 19 to 25 and not solved under items 14 to 18.

Assumptions and limitations

  • Planar geometry only: no masses, forces, friction, clearances or collisions. Links and straight sliders are the only constraints, and there is at most one crank.
  • Up to 9 points (1 to 3 ground, 1 to 6 free) and 10 constraints; coordinates within 2 m and lengths from 0.01 to 5 m.
  • Each two-link group keeps the side your sketch draws for every frame of the sweep. Past a change point, such as a parallelogram passing 180 degrees, a group continues on its other assembly, and a redundant constraint can stop fitting there; those frames read Does not fit.
  • A position within about a millionth of the drawing size of a dead position is snapped onto it.
  • A mechanism that does not break into two-link groups is solved only by the 15 damped steps from your sketch. Their convergence is not guaranteed, and a different sketch may reach a different assembly. Near a singular sketch the solver's path is sensitive to rounding in the last digits.
  • The crank sweep needs a crank and a mechanism built from two-link groups that assembles at the crank angle.
  • The slider stroke is read from 37 frames, so it can fall short of the true stroke when the end positions fall between frames.
  • Every test has a stated band (the tie, toggle, coincident, parallel, settle, fit and rank bands above); a value sitting on a band edge can flip a reading.

Restrictions and non-computing states

Under NOT VALID every result and every table is blank, apart from the model version, the challenge status (No challenge selected, or NOT MET when a challenge is selected), a score of 0, and the goal and hint of a selected challenge.

When the configuration shown is not solved (status items 14 to 18), the true degree of freedom, the rank, the redundancy, the free motions left and the two rank columns of the constraints table are blank. With no crank, or no drawn assembly, the sweep is not available: only the frame angles show and the sweep results are blank. The slider positions and stroke are blank with no slider or fewer than 2 frames that assemble.

In challenge 1, until you predict, the results are held back as described under Challenges.

Errors and warnings

The status messages, first match wins (k, j and c are the lowest point or constraint row concerned):

  • NOT VALID: point k needs x and y from -2 to 2 m and a role of Free or Ground: the message goes on to say that a point row left wholly blank (x, y and the role) means no point.
  • NOT VALID: constraint c needs a type of Link or Slider and two whole point numbers from 1 to 9 (leave the row blank for no constraint)
  • NOT VALID: constraint c has a value outside its range: a link takes a length from 0.01 to 5 m and no rail angle, a slider a rail angle from -180 to 180 degrees and no length; a blank value means as drawn
  • NOT VALID: the crank must be a whole constraint number from 0 to 10 (0 for none) and the crank angle from -180 to 180 degrees
  • NOT VALID: the sweep must start from -180 to 180 degrees and span 10 to 360 degrees
  • NOT VALID: the damping power must be a whole number from -6 to 1, the challenge number a whole number from 0 to 5, and the prediction one of the listed choices
  • NOT VALID: points j and k are drawn on the same spot: two points in use have exactly the same x and y.
  • NOT VALID: a mechanism needs 1 to 3 ground points and 1 to 6 free points
  • NOT VALID: constraint c must join two different points that are in use
  • NOT VALID: constraint c breaks a rule: a link must touch at least one free point, and a slider puts a free point (A) on a rail through a ground point (B)
  • NOT VALID: constraint c is drawn shorter than 0.01 m, so it cannot take its length as drawn; type a length
  • NOT VALID: at least one link is needed
  • NOT VALID: the crank must be a link between a ground point and a free point
  • CHECK: this mechanism cannot be assembled: point k cannot reach both points it hangs from with these lengths; the solver's closest compromise is shown
  • CHECK: this mechanism cannot be assembled: constraint c does not fit, because the other constraints already fix its points; the solver's closest compromise is shown
  • CHECK: point k cannot be placed: the two points it hangs from are on the same spot, or its two rails are parallel; the solver's closest attempt is shown
  • CHECK: the solver could not assemble this mechanism: its largest mismatch stays above a millionth of the drawing size, so its closest compromise is shown: not built from two-link groups, and the solver is stuck at a compromise.
  • CHECK: not solved cleanly in 15 steps: this mechanism has no direct solution here, so only the solver's steps are shown; drag the sketch closer to the shape you want: not built from two-link groups, and the solver settled only after cut steps or did not settle.
  • CHECK: point k is drawn on the line through the two points it hangs from, so the assembly is ambiguous and the left-hand one is used; drag the point clearly to one side
  • CHECK: the mechanism is at or near a dead (toggle) position, where two of its constraints pull the same way; small changes move it a lot: a group took the toggle band, or a constraint's independence lies between 1×10⁻¹⁰ and 1×10⁻⁶.
  • CHECK: under-constrained (free motions left: n): this is one of many possible positions, the one the solver reached from your sketch
  • CHECK: this mechanism does not break into two-link groups, so the position shown is the assembly the solver reached from your sketch; a different sketch may reach a different one
  • CHECK: the solver reached a different assembly from the one you drew; the drawn assembly is shown. Drag the sketch closer to the shape you want: the solver settled more than 1×10⁻⁶ x Lref from the drawn assembly.
  • CHECK: the drawn assembly is solved directly, but the solver's steps did not settle cleanly (it had to cut or reject steps); try another damping power or a closer sketch
  • OK: the mechanism is solved and needs no attention.

References

This laboratory is an educational model of planar mechanism kinematics. It counts a mechanism's degrees of freedom by the Gruebler-Kutzbach rule, two for each free point less one for each link or slider, and checks that count against the rank of the constraints, found by Gram-Schmidt orthogonalisation. Where the mechanism builds up from two-link groups it places each point in closed form as the intersection of two circles, a circle and a line, or two lines, on the side the sketch draws it, and sweeps the crank through a full set of positions. It also runs a damped least-squares (Levenberg) iteration from the sketch, which is the only solve for a mechanism that does not break into such groups.

Sources and further reading

  • Mobility of planar mechanisms, Grübler's formula, and the redundant constraints that make the count wrong: Mechanical Engineering, University of Almería, Machine and Mechanism Theory, Lesson 1, Determining the d.o.f. count. University of Almería
  • Position analysis by circle intersections, loop closure, Freudenstein's equation and the slider-crank in closed form, with the two assembly configurations: Mechanical Engineering, University of Almería, Machine and Mechanism Theory, Lesson 2, Position Analysis. University of Almería
  • The intersection of two circles in closed form: P. Bourke, Circles and spheres, section Intersection of two circles, 1997. Paul Bourke
  • The damped least-squares method: K. Levenberg, "A method for the solution of certain non-linear problems in least squares", Quarterly of Applied Mathematics 2(2), 1944, pages 164-168, and its explanation as a blend of the Gauss-Newton step and gradient descent: Harvey Mudd College course notes, Levenberg-Marquardt algorithm. Harvey Mudd College
  • The Gram-Schmidt process for building orthonormal rows: G. Strang, Linear Algebra (18.06SC), MIT OpenCourseWare, Fall 2011, Orthogonal Matrices and Gram-Schmidt. MIT OpenCourseWare

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; it models geometry only, so it says nothing about the forces, strength or wear of a real machine.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms