MICROCRE / OPTICAL METROLOGY400-812-7833  ·  SHANGHAI
研润 WHW
MICROCREPRECISION IN EVERY ANGLE
Home / Least-Squares Reference Evaluation
MEASUREMENT METHOD

Least-Squares Reference Evaluation

Provide a unique and stable evaluation reference for line and surface profiles, widely used in data analysis and statistical process control. The least-squares reference has a closed-form solution that is easy to implement and audit. Its result generally lies between the endpoint and minimum-zone values and suits routine reporting.

Principle

Among all candidate references the least-squares reference minimises the sum of squared residuals. For a line, the parameters follow uniquely from the means and covariance of the coordinates; for a plane it is a two-variable linear regression. The peak-to-valley residual range serves as the profile error. Because squaring magnifies outliers, a single anomalous point pulls the reference; data quality must be checked first.

Preparation

Prepare the point data in a common frame and screen for obvious outliers. Verify the regression formulas and weighting in the spreadsheet or script; equally and unequally spaced data differ. Document data provenance and any exclusion decisions for traceability.

Workflow diagram

01Check the data02Means and covariance03Solve parameters04Compute residuals05Report peak-to-valley06Report the fit

Procedure

  1. Assemble coordinates and heights; check units, numbering and outliers.
  2. Compute means and covariances (second-order for a plane).
  3. Solve the reference: slope b=Sxy/Sxx and intercept a=ȳ−b·x̄.
  4. Compute residuals ri=zi−(a+b·xi) and verify the orthogonality conditions Σri=0 and Σri·xi=0.
  5. Take the residual peak-to-valley f=max(ri)−min(ri) as the error value.
  6. Report the parameters, residual plot and value, identified as a least-squares result.

Calculation

Line reference: b=Sxy/Sxx and a=ȳ−b·x̄, with Sxx=Σ(xi−x̄)² and Sxy=Σ(xi−x̄)(zi−z̄). Residuals ri=zi−a−b·xi give f=max(ri)−min(ri). A plane reference z=a+b·x+c·y is solved from the normal equations. The conditions Σri=0 and Σri·xi=0 serve as program checks.

Illustrative example

Schematic · not measured data
Schematic: least-squares reference and residual distribution; values illustrative.

Teaching data, not measured: five points at 100 mm spacing with heights [0, 0.5, 1.5, 1.0, 2.0] μm. The fit gives b=0.45 μm per station and a=+0.10 μm; residuals are [−0.10, −0.05, +0.50, −0.45, +0.10] μm with a peak-to-valley of 0.95 μm (demonstration). This is not a minimum-zone value.

Limitations

  • Using the residual peak-to-valley as a minimum-zone value for acceptance.
  • Fitting with an unchecked outlier that visibly biases the reference.
  • Applying equal-spacing shortcut formulas to unequally spaced data.

Reporting

Retain raw data, datum definition, temperature, repeatability, algorithm and uncertainty. Illustrations are not test results.

Method reference ↗ Method reference ↗ 
STEP BY STEP

Understand the measurement step by step

Principle schematic · not to scale
1 / 5
  1. Side view of the beam with 11 stations along 3 m as the base steps forward.
  2. The angular readings accumulate into an arch-shaped curve, high in the middle.
  3. A least-squares line threads through the curve with both ends above it.
  4. Perpendicular distances to the line are drawn and coloured by sign.
  5. A containment band of 10.1 μm is stretched between the extreme residuals.

Teaching animation: follow the stations and reference directions. Do not read dimensions or angles from the schematic.

WORKED EXAMPLE

Least-squares straightness of a 3000 mm gantry-mill cross-beam guideway

Teaching example with assumed data, not a customer project, instrument accuracy claim or acceptance result.

Example task

After assembly, the cross-beam guideway of a 3000 mm-travel gantry mill is re-checked with an autocollimator in the vertical plane, with a residual plot required. The instrument sits on a bracket at the column side, the reflector base span is 300 mm, and the run covers 10 segments and 11 stations. Self-weight makes the beam sag, so the profile is low at both ends and high in the middle.

Setup and preparation

  • Clean the guideway, mark 11 stations from 0 to 3000 mm at 300 mm pitch and confirm that the base span matches the pitch.

  • Mount the autocollimator on an adapter plate on the column side with the axis parallel to the guideway; tap-test the bracket to prove it is rigid.

  • Step the reflector base in one direction only, never reversing and never crossing the relief holes at the beam joint.

  • Warm up for 30 min, zero, then make a dry run confirming a maximum reading of 2.6″ inside the ±300″ range.

  • Record 20.4 °C and stop the overhead crane during the run to keep vibration off the beam.

Example data and records

  • Segment 1 (0→300 mm): -2.20″

  • Segment 2 (300→600 mm): -1.50″

  • Segment 3 (600→900 mm): -0.40″

  • Segment 4 (900→1200 mm): +0.60″

  • Segment 5 (1200→1500 mm): +1.50″

  • Segment 6 (1500→1800 mm): +2.20″

  • Segment 7 (1800→2100 mm): +2.60″

  • Segment 8 (2100→2400 mm): +1.80″

  • Segment 9 (2400→2700 mm): +0.70″

  • Segment 10 (2700→3000 mm): -0.90″

  • Cumulative heights at the 11 stations +0.00 → -3.20 → -5.38 → -5.96 → -5.09 → -2.91 → +0.29 → +4.07 → +6.69 → +7.71 → +6.40 μm (zero at 0 mm)

  • Last station repeated twice, cumulative heights differ by 0.06 μm, mean used

Calculation steps

Scale factor k=300×π/648000×1000=1.454 μm per arcsec, height steps -3.20 → -2.18 → -0.58 → +0.87 → +2.18 → +3.20 → +3.78 → +2.62 → +1.02 → -1.31 μm and cumulative heights +0.00 → -3.20 → -5.38 → -5.96 → -5.09 → -2.91 → +0.29 → +4.07 → +6.69 → +7.71 → +6.40 μm. Least-squares datum: x̄=1500 mm, h̄=+0.238 μm, Sxx=9900000 mm², Sxy=41189.8 mm·μm, slope b=0.00416 μm/mm (+0.86″) and intercept a=-6.003 μm. Residuals rᵢ=zᵢ−(a+b·xᵢ)=+6.00 → +1.55 → -1.87 → -3.70 → -4.08 → -3.15 → -1.20 → +1.34 → +2.71 → +2.48 → -0.08 μm. Orthogonality checks: Σr=+0.000 μm≈0 and Σr·x=0.0 mm·μm (sign depends on the origin)≈0, so the fit is correct. The peak-to-valley residual is f=max−min=+6.00−(-4.08)=10.08 μm, with the largest positive residual at station 1 (0 mm) and the largest negative at station 5 (1200 mm). The same data evaluated against the end-point line gives 9.8 μm, 0.3 μm away from the least-squares value; the two datums must not be mixed and the report must name the one used.

Interpretation

Least-squares straightness 10.1 μm over the full 3000 mm, slope +0.86″. This passes the 0.02 mm full-length tolerance with 9.9 μm margin.

Verification and pitfalls

  • Both orthogonality conditions must hold: Σr=+0.000 μm and Σr·x=0.0 mm·μm are zero to within rounding.

  • Do not force the end residuals to zero; both are positive here, which is exactly the self-weight sag signature, and forcing zero would hide error.

  • A single outlier pulls the least-squares datum noticeably, so inspect the residual plot and re-measure suspect stations before reporting.

  • The slope unit is μm/mm; converting to arcsec needs arctan and 206265, otherwise the value is off by a factor of 1000.

  • Always state the datum. Least-squares values are usually smaller than end-point values and the two must not be mixed.