Skip to content

[Tests] Check FourPostSim force closure on every output row - #60

Open
raorjun wants to merge 1 commit into
mainfrom
test/fourpost-closure
Open

raorjun wants to merge 1 commit into
mainfrom
test/fourpost-closure

Conversation

@raorjun

@raorjun raorjun commented Oct 28, 2026

Copy link
Copy Markdown
Member

Why

Tests/modelica_physics_baseline.csv checks only the final row. A FourPostSim closure residual grew linearly with time to 3.8 N at 118 s, and no test caught it until #48 fixed it. This test checks every output row, so a drift like that fails CI.

What changes

  • Add Tests/test_four_post_closure.py. It simulates BobLib.Experiments.Standards.FourPostSim over its default 0 to 118 s heave and roll sequences.
  • On every row, per axle, the world-vertical contact-patch forces plus <axle>KnC.jackingForce must sum to less than 1e-3 N. The test resolves <axle>AxleDW.<side>CP.f to world z through R.T. Tire Fz is clamped at zero during lift-off (t = 42 to 56 s), so Fz cannot show closure on those rows.
  • On rows where all heave, roll, fx and fy commands are zero, <axle>ChassisActuator.sprungLoads.frame_a.f[1] and f[2] must be below 1e-3 N, and t[1] must be below 1e-3 N·m.
  • The test_*.py wildcard puts it in make test-additional (the OpenModelica Component Contracts job). No makefile, CI or model changes.

Evidence

  • The tolerances are about 1e-6 of the 1 kN static axle load. The measured floor on main is 2.7e-12 N or less for closure, 2.3e-13 N or less for f[1] and f[2], and 2.3e-10 N·m or less for t[1].
  • On 2065e2b, the parent of the [Architecture] Integrate configurable axles and nested vehicle calibration #48 fix, the test fails: "fr vertical closure = 3.823e+00 at t = 118.0 s".
  • On main 7363fc1 it passes in 171 s. Most of that is translation. The simulation takes about 2 s.
  • make lint and make modelica-lint pass. Measured with OMC 1.27.1, MSL 4.1.0 and VI 2.0.2.

Limits

  • It covers the default FourPostSim record and architecture (DWBCStabar) only.
  • It adds about 3 minutes to the component job.
  • The full make test-additional was not run locally. CI runs it.
  • Finding along the way: at heave +22.9 to +38.1 mm the tires lift off, and the fixture pulls the wheels down with up to 1553 N of jacking force. Reported Fz is 0 there.

The physics baseline checks only the final row, so a closure drift that
grew with time went unseen until #48. Simulate FourPostSim over its full
heave and roll sequences and assert, on every output row, that the
world-vertical contact forces and the jacking force sum to zero per
axle. On zero-command rows, also assert that the chassis reaction has no
in-plane force and no roll moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant