Engee documentation
Notebook

Car suspension modelling

This example demonstrates the modelling of the car suspension when hitting an obstacle.

The obstacle is defined as a rectangular signal using the Signal Generator block. Using a velocity source, the derivative of the signal (velocity) is fed to port C of the Translational Spring block, which describes the elastic properties of the wheel.

The Translational Spring, in turn, is coupled to the mass, which characterises the inertial properties of the wheel.

The wheel is attached to suspension elements, shock absorber and shock absorber spring, which are represented by Damper and Spring blocks.

The "quarter" of the vehicle itself is attached to other ports of the Damper and Spring blocks.

The wheel has a mass of 50kg and the vehicle "quarter" has a mass of 350kg.

The obstacle has a height of 5 cm.

Schematic diagram of the model:

suspension_physmod_1727789568075.png

Define the function to load and run the model:

In [ ]:
function start_model_engee()
    try
        engee.close("suspension_physmod", force=true) # закрытие модели 
        catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
            m = engee.load("$(@__DIR__)/suspension_physmod.engee") # загрузка модели
        end;

    try
        engee.run(m) # запуск модели
        catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
            m = engee.load("$(@__DIR__)/suspension_physmod.engee") # загрузка модели
            engee.run(m) # запуск модели
        end
end
Out[0]:
start_model_engee (generic function with 1 method)

Running the simulation

In [ ]:
try
    start_model_engee() # запуск симуляции с помощью специальной функции, реализованной выше
    catch err
    end;

Allocating data from simout to a variable:

In [ ]:
sleep(5)
result = simout;
res = collect(result)
Out[0]:
4-element Vector{WorkspaceArray}:
 WorkspaceArray("suspension_physmod/Положение колеса")
 WorkspaceArray("suspension_physmod/Перегрузка")
 WorkspaceArray("suspension_physmod/Препятствие")
 WorkspaceArray("suspension_physmod/Положение машины")

Writing wheel and vehicle movement and overload data to variables:

In [ ]:
wheel_pos = collect(res[1])
car_pos = collect(res[4])
overload = collect(res[2]);

Visualising simulation results

In [ ]:
using Plots
plot(wheel_pos[:,1], wheel_pos[:,2], linewidth=3, label="Положение колеса, м")
plot!(car_pos[:,1], car_pos[:,2], linewidth=3, label="Положение автомобиля, м")
Out[0]:
In [ ]:
plot(overload[:,1], overload[:,2], linewidth=3, label="Перегрузка, м/(с^2)")
Out[0]:

By analysing the graphs we can see that the overload (the ratio of the acceleration of the body to the acceleration of free fall) that occurs when hitting an obstacle, with a value of just over 2 $м/с^2$, affects a quarter of the car in less than 50 ms.

This overload is not large and will not have a dangerous effect on a person, nor will it affect passenger comfort.

Conclusion:

This example demonstrates the modelling of the car suspension performance during a sudden collision with an obstacle. The motion parameters of a quarter of the car are analysed, as well as the value of overloading, which can affect the safety and comfort of passengers.