Skip to content

Fix VehicleSim QSS initialization from FourPost state - #19

Merged
rhorvath02 merged 1 commit into
mainfrom
fix/vehiclesim-qss-initialization
Aug 9, 2026
Merged

Fix VehicleSim QSS initialization from FourPost state#19
rhorvath02 merged 1 commit into
mainfrom
fix/vehiclesim-qss-initialization

Conversation

@rhorvath02

@rhorvath02 rhorvath02 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Problem

VehicleSim did not start from a coupled static suspension pose. The chassis reference frame used a legacy mass-weighted estimate while the four independent lower-arm coordinates started at zero. That combination did not reproduce the settled front/rear spring lengths or tire loads, so the simulation spent its opening transient finding the suspension equilibrium.

The old mass/CG calculation also represented only the supplied left-side axle records. This PR separates that legacy start-pose estimate from the actual complete-vehicle mass properties instead of treating the estimate as the vehicle CG.

QSS initialization

  • Adds a vehicle-owned QSSInitializationRecord containing the reference velocity, chassis position and pitch, four lower-arm coordinates, solved spring lengths, and corner-load targets.
  • Uses gravity-enabled FourPostSim suspension solutions at the settled front and rear corner loads to obtain the physical lower-arm coordinates and spring lengths.
  • Initializes chassis heave and pitch consistently with those four contact-patch states and the compliant ground model.
  • Fixes the selected lower-arm coordinates and initializes their angular velocities to zero in VehicleSim only. Other chassis users retain opt-in defaults.
  • Exposes all four spring lengths in the standard simulation output.
  • Calculates complete-vehicle mass, CG, and inertia from the sprung mass plus both axle sides.

The record is solved for the standard initialVel = 15 m/s; VehicleSim warns when used at another initial velocity.

Post-rebase VehicleSim results

Validated after rebasing onto current main, including the merged wheel alignment, force-frame, aerodynamic, transient-slip, vector-angle, and initialization-gate fixes.

Startup metric Baseline QSS initialization Change
Initial total tire-load error 136.178 N 0.04396 N 99.97% lower
Peak absolute total-load error, first 2 s 249.081 N 17.746 N 92.88% lower
RMS total-load error, first 2 s 52.535 N 6.133 N 88.33% lower
Minimum tire load during maneuver 182.608 N 182.827 N No material change

Initialized spring lengths:

Axle FourPost target VehicleSim at t = 0 Absolute error
Front, both sides 0.175156854189 m 0.175156852337 m 1.85 nm
Rear, both sides 0.244911388707 m 0.244911388690 m 0.017 nm

Initial loads remain left/right symmetric: 710.496 N per front corner and 721.413 N per rear corner. All recorded outputs are finite. Initialization completed without homotopy, and the standard ramp-steer simulation terminated normally at the QSS plateau at 6.140 s.

The corrected complete-vehicle mass properties remain:

  • Mass: 261.07265114 kg
  • CG: {-0.8002708499, 1.511554e-6, 0.2796156784} m

The post-rebase Windows run reported 37.31 s in the simulation stage. End-to-end time was dominated by a fresh OpenModelica backend translation, so runtime is not the primary claim; the material improvement is removal of the artificial suspension startup transient.

Validation

  • Rebased conflict-free for all production Modelica files; the sole Python test conflict was resolved by preserving both the wheel-mirroring and QSS/mass tests.
  • Ruff: pass.
  • Fast Python suite: 31 passed; 108 OpenModelica-dependent cases skipped in that intentionally non-OMC pass.
  • Combined QSS/mass and nonzero wheel-mirroring OpenModelica checks: 6 passed.
  • Initialization audit: 33 unchanged fixtures passed; VehicleSimAnimationOn was rerun exactly and its one affected baseline row was refreshed for four new spring-length outputs and the QSS pose.
  • Full standard VehicleSim ramp-steer run: pass; initialization without homotopy; finite outputs; normal QSS termination.

Out of scope

The remaining initial longitudinal acceleration is associated with drivetrain/controller torque balance. It is separate from the suspension heave/settling issue addressed here.

@rhorvath02
rhorvath02 force-pushed the fix/vehiclesim-qss-initialization branch from 31ceba7 to 78f4fea Compare August 8, 2026 20:05
@rhorvath02
rhorvath02 merged commit e22df7b into main Aug 9, 2026
2 checks passed
@rhorvath02
rhorvath02 deleted the fix/vehiclesim-qss-initialization branch August 9, 2026 03:05
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