LPV simulations: from the mass to the car

Two simulations of the same principle. The first is the example of the documentation, simple enough for its small calculations to be done by hand. The second applies the same method to the active suspension of a car, and shows what scheduling buys.

Read the technical documentation

1The example of the documentation: a mass, a spring, a damper

The documentation builds everything on a deliberately simple system: a mass mm, tied to a wall by a spring of varying stiffness k(ρ)k(\rho) and a damper cc, which must follow a reference rr. It has only two states, position and speed. That is small enough for the calculations behind the proofs and the intuition to be done by hand: the LFT, the stored energy, its balance, the range in which the mass alone stays stable.

The controller itself is not computed by hand: it comes out of a problem of matrix inequalities solved offline, and the page only runs its matrices. Move the parameter ρ\rho and leave the range stated by the synthesis.

∣ρ∣≤1.17|\rho| \le 1.17: inside the range shown

y(t)y(t) vs r(t)r(t) [m]

u(t)u(t), control effort [N]

ρ(t)\rho(t), parameter

yy axis
uu axis

Mass-spring-damper system

Visualizing LPV dynamics

m

m y¨+c y˙+k(ρ(t)) y=um\,\ddot{y} + c\,\dot{y} + k(\rho(t))\,y = u

k(ρ(t))=10(1+0.4ρ(t))k(\rho(t)) = 10(1 + 0.4\rho(t)) is the varying stiffness.

Observe how stiffness affects system response.

Blue background: ∣ρ∣≤1.17|\rho| \le 1.17, a range covered by the certificate for the unsaturated model. The background turns copper when the parameter crosses the displayed limit.

Tip: with a mouse, drag vertically on the yy or uu plot to rescale, Shift+drag to pan, double-click to reset. The buttons below the plots do the same by keyboard and touch.

2The same principle on the suspension of a car

A car drives. The driver sets the stiffness of its air springs, k(ρ)k(\rho), with the parameter ρ\rho; an actuator in the strut applies the force uu between the body and the wheel.

The dotted curves follow the same car with a fixed controller, computed the same way for the normal setting only.

∣ρ∣≤1.17|\rho| \le 1.17: within the reference band

z¨s(t)\ddot{z}_s(t), body acceleration [m/s²]: comfort

Load of the front tyre, as a share of the static load: road holding

u(t)u(t), force of the actuator [kN]

ρ(t)\rho(t), stiffness setting

Solid: the drawn car, with the engaged controller. Dots: fixed controller from the start. Dashes: no actuator.

z¨s\ddot{z}_s axis
uu axis

Active suspension of a car

The front strut, in a cutaway view

Motorway · 108 km/h

u−u

Arrows along the strut: force uu of the actuator, on the body and, in reaction, on the wheel. Arrow under the front wheel: load of the tyre. Displacements to scale.

ms z¨s=−k(ρ) (zs−zu)−c (z˙s−z˙u)+umu z¨u=k(ρ) (zs−zu)+c (z˙s−z˙u)−kt (zu−zr)−u\begin{aligned} m_s\,\ddot{z}_s &= -k(\rho)\,(z_s - z_u) - c\,(\dot{z}_s - \dot{z}_u) + u \\ m_u\,\ddot{z}_u &= k(\rho)\,(z_s - z_u) + c\,(\dot{z}_s - \dot{z}_u) - k_t\,(z_u - z_r) - u \end{aligned}

k(ρ)=25 (1+0.4 ρ) kN/mk(\rho) = 25\,(1 + 0.4\,\rho)\ \mathrm{kN/m}: stiffness of the air spring. ms=400 kgm_s = 400\ \mathrm{kg}, mu=40 kgm_u = 40\ \mathrm{kg}, c=1.5 kN⋅s/mc = 1.5\ \mathrm{kN{\cdot}s/m}, kt=200 kN/mk_t = 200\ \mathrm{kN/m}.

Road
Stiffness chosen by the driver

Blue band: ∣ρ∣≤1.17|\rho| \le 1.17. This band contains the three suspension settings available on the road. On the test bench, the sliders let you explore values beyond it.

On the z¨s\ddot{z}_s and uu plots: drag vertically to rescale, Shift+drag to pan, double-click to reset; or use the buttons below the plots.

3What is simulated, and how

The mass

Plant
m=1 kgm = 1\ \mathrm{kg}, c=2 N⋅s/mc = 2\ \mathrm{N{\cdot}s/m}, k(ρ)=10(1+0.4ρ) N/mk(\rho) = 10(1 + 0.4\rho)\ \mathrm{N/m}
Discretization
Explicit Euler for the mass, Ts=1 msT_s = 1\ \mathrm{ms}, 20 steps per displayed frame. The controller is synthesized in discrete time on this sampled model, whereas the documentation reasons in continuous time (Section 5.8)
Controller
Gain-scheduled, 4 states, LFT dependence on ρ\rho. Matrices computed offline, certified level γ=0.85\gamma = 0.85
Reference
Square wave between 0.2 m and 0, switching every 2 s
Parameter
ρ(t)=ρ0+Aρsin⁡(2πfρt)\rho(t) = \rho_0 + A_\rho \sin(2\pi f_\rho t), adjustable above
Saturation
±20 N\pm 20\ \mathrm{N} on the control input, outside the synthesis model

The car

Plant
Two-mass quarter car: body ms=400 kgm_s = 400\ \mathrm{kg}, wheel mu=40 kgm_u = 40\ \mathrm{kg}, air spring k(ρ)=25 (1+0.4ρ) kN/mk(\rho) = 25\,(1 + 0.4\rho)\ \mathrm{kN/m}, damper c=1.5 kN⋅s/mc = 1.5\ \mathrm{kN{\cdot}s/m}, tyre kt=200 kN/mk_t = 200\ \mathrm{kN/m}, actuator of force uu between the body and the wheel. Front and rear are two independent quarter cars, without pitch or roll
Measurements
Strut deflection and vertical speed of the body
Objective
Rejection of the road, for a road rising or falling at 0.1 m/s: limit the body acceleration (0.7 m/s² below 8 Hz), the strut travel (8 cm), the variation of the tyre load (20% of the static load) and the effort (3 kN)
Discretization
Zero-order hold, Ts=1 msT_s = 1\ \mathrm{ms}; the synthesis is made on this sampled model
LPV controller
Gain-scheduled, 6 states, LFT dependence on ρ\rho, shaded reference range ∣ρ∣≤1.17|\rho| \le 1.17
Fixed controller
The same synthesis without the parameter channel, for the normal setting only, ρ=0\rho = 0. This nominal controller is used for comparison.
Parameter
On the road, the setting of the driver, ρ∈{−1,0,1}\rho \in \{-1, 0, 1\}; on the bench, ρ(t)=ρ0+Aρsin⁡(2πfρt)\rho(t) = \rho_0 + A_\rho \sin(2\pi f_\rho t)
Saturation
±4 kN\pm 4\ \mathrm{kN} on the force, outside the synthesis model
End stops
Stops at 7 cm in compression and 9 cm in extension, a tyre that can leave the road, a rim that can touch it. The simulation adds these mechanical effects to the linear design model

Display: 400 samples for each simulation, a sliding window of 8 s.

Technical decisions

Numerical cores separated from the display
The calculations live in modules with no interface. The tests reproduce the reference trajectories of the mass with its original controller. For the new mass and car controllers, they compare the simulation matrices against the synthesis data.
SVG drawings updated directly
The simulations update the curves and drawings on each frame without asking React to render the entire page again.
Equations rendered on the server with KaTeX
They appear without JavaScript and stay readable by assistive technologies.

4Good to know

A run without divergence does not prove stability, and leaving the stated range does not imply instability: these limits are conservative. For the mass, the certified limit of the unsaturated discrete model is 1/γ≈1.176471/\gamma \approx 1.17647. The figure rounds this limit down to 1.171.17.

The simulation represents a change in air-spring volume by changing stiffness at a fixed ride height. It omits pressure and airflow dynamics. The parallel actuator can supply energy to the suspension. A semi-active damper adjusts how much energy it dissipates.

5Controller data

Show the matrices of the controller of the mass

Values run by this page, with the certified level γ=0.85\gamma = 0.85. The controller LFT depends on ρ\rho through a single channel, wθ=ρ zθw_\theta = \rho\, z_\theta, like that of the mass.

AK=[0.9999934390.0009994849520.0000120784719−7.00937762×10−7−0.1018254260.9900469680.1704954090.04837711811.58515014×10−141.24461440×10−150.9999400021.69385469×10−15−0.928691984−0.08043453211.724334570.857164714]\mathbf{A}_K = \begin{bmatrix} 0.999993439 & 0.000999484952 & 0.0000120784719 & -7.00937762 \times 10^{-7} \\ -0.101825426 & 0.990046968 & 0.170495409 & 0.0483771181 \\ 1.58515014 \times 10^{-14} & 1.24461440 \times 10^{-15} & 0.999940002 & 1.69385469 \times 10^{-15} \\ -0.928691984 & -0.0804345321 & 1.72433457 & 0.857164714 \end{bmatrix}
BK1=[−2.03558726×10−70.0003409379080.001999940000.00344899101]\mathbf{B}_{K1} = \begin{bmatrix} -2.03558726 \times 10^{-7} \\ 0.000340937908 \\ 0.00199994000 \\ 0.00344899101 \end{bmatrix}
BKθ=[8.23818292×10−90.00195011766−2.02210435×10−17−0.000156596983]\mathbf{B}_{K\theta} = \begin{bmatrix} 8.23818292 \times 10^{-9} \\ 0.00195011766 \\ -2.02210435 \times 10^{-17} \\ -0.000156596983 \end{bmatrix}
CK1=[−91.8230679−7.95284726170.49107048.3773690]\mathbf{C}_{K1} = \begin{bmatrix} -91.8230679 & -7.95284726 & 170.491070 & 48.3773690 \end{bmatrix}
DK11=[0.341013965]\mathbf{D}_{K11} = \begin{bmatrix} 0.341013965 \end{bmatrix}
DK1θ=[−0.0154832988]\mathbf{D}_{K1\theta} = \begin{bmatrix} -0.0154832988 \end{bmatrix}
CKθ=[−2.034989700.00000104771396−0.00002457013160.00000142585264]\mathbf{C}_{K\theta} = \begin{bmatrix} -2.03498970 & 0.00000104771396 & -0.0000245701316 & 0.00000142585264 \end{bmatrix}
DKθ1=[4.14084396×10−7]\mathbf{D}_{K\theta 1} = \begin{bmatrix} 4.14084396 \times 10^{-7} \end{bmatrix}
DKθθ=[−1.67569712×10−8]\mathbf{D}_{K\theta\theta} = \begin{bmatrix} -1.67569712 \times 10^{-8} \end{bmatrix}
Show the matrices of the LPV controller of the car

Matrices used in the simulation. The controller receives the strut deflection and the body speed and returns the force uu in kN; its LFT depends on ρ\rho through a single channel, wθ=ρ zθw_\theta = \rho\, z_\theta, like that of the spring.

AK=[0.8063062370.0143565741−0.0170819214−0.001144889690.0002093107690.003058310250.6718071950.9258014950.1116394750.00480209113−0.001252680280.0102378888−0.2173309760.04093592600.9657102000.0006295223900.0006999417660.012630630918.2581390−1.73106704−1.424620180.989637997−0.0384455155−0.8167270474.10961609−0.4357190300.7309917820.03627610760.9426925060.100495342−0.853221276−0.2129842540.9941359310.0107201781−0.009338759170.793062443]\mathbf{A}_K = \begin{bmatrix} 0.806306237 & 0.0143565741 & -0.0170819214 & -0.00114488969 & 0.000209310769 & 0.00305831025 \\ 0.671807195 & 0.925801495 & 0.111639475 & 0.00480209113 & -0.00125268028 & 0.0102378888 \\ -0.217330976 & 0.0409359260 & 0.965710200 & 0.000629522390 & 0.000699941766 & 0.0126306309 \\ 18.2581390 & -1.73106704 & -1.42462018 & 0.989637997 & -0.0384455155 & -0.816727047 \\ 4.10961609 & -0.435719030 & 0.730991782 & 0.0362761076 & 0.942692506 & 0.100495342 \\ -0.853221276 & -0.212984254 & 0.994135931 & 0.0107201781 & -0.00933875917 & 0.793062443 \end{bmatrix}
BK1=[0.211440077−0.00830683808−0.8353499900.04023811270.331817464−0.0127138977−21.14395150.810065768−5.257416620.2067580210.228941766−0.0107327137]\mathbf{B}_{K1} = \begin{bmatrix} 0.211440077 & -0.00830683808 \\ -0.835349990 & 0.0402381127 \\ 0.331817464 & -0.0127138977 \\ -21.1439515 & 0.810065768 \\ -5.25741662 & 0.206758021 \\ 0.228941766 & -0.0107327137 \end{bmatrix}
BKθ=[0.0000438021818−0.001096316360.000268722457−0.00103740786−0.008209811800.000602745920]\mathbf{B}_{K\theta} = \begin{bmatrix} 0.0000438021818 \\ -0.00109631636 \\ 0.000268722457 \\ -0.00103740786 \\ -0.00820981180 \\ 0.000602745920 \end{bmatrix}
CK1=[−10.9435124−2.7317600812.75089970.137498215−0.1197799799.61764183]\mathbf{C}_{K1} = \begin{bmatrix} -10.9435124 & -2.73176008 & 12.7508997 & 0.137498215 & -0.119779979 & 9.61764183 \end{bmatrix}
DK11=[2.93643294−0.137658998]\mathbf{D}_{K11} = \begin{bmatrix} 2.93643294 & -0.137658998 \end{bmatrix}
DK1θ=[0.00773088722]\mathbf{D}_{K1\theta} = \begin{bmatrix} 0.00773088722 \end{bmatrix}
CKθ=[22.54939680.320595530−0.440405772−0.003751151020.004704249580.0652420025]\mathbf{C}_{K\theta} = \begin{bmatrix} 22.5493968 & 0.320595530 & -0.440405772 & -0.00375115102 & 0.00470424958 & 0.0652420025 \end{bmatrix}
DKθ1=[5.24578315−0.206860683]\mathbf{D}_{K\theta 1} = \begin{bmatrix} 5.24578315 & -0.206860683 \end{bmatrix}
DKθθ=[0.00108301477]\mathbf{D}_{K\theta\theta} = \begin{bmatrix} 0.00108301477 \end{bmatrix}

An opportunity, a research collaboration, or a project to develop? Tell me about the context and what you would like to discuss.

get in touch