Modelling of the anti-lock braking system
This example will demonstrate the modelling of an anti-lock braking system (ABS). The model simulates the dynamic behaviour of a vehicle under hard braking conditions and represents a single wheel that can be replicated several times to create a multi-wheeled vehicle model.
General view of the model:

The wheel rotates with an initial angular velocity that corresponds to the speed of the vehicle before the brake pedal is depressed. We use two speeds to calculate the slip, which is defined in the equation block. The vehicle speed is expressed as angular velocity.
The equation block
Where:
From these expressions we see that slip is zero when the wheel speed and vehicle speed are equal, and slip is one when the wheel is locked. The target slip value is 0.2, which means that the wheel RPM should be 0.8 times the unbraked mode RPM at the same vehicle speed. This maximises tyre grip and minimises braking distance with existing friction.
The coefficient of friction between the tyre and the road surface, mu, is an empirical function of slip known as the mu-slip curve. We created the mu-slip curves by passing MATLAB variables into a flowchart using a Simulink lookup table. The model multiplies the coefficient of friction, mu, by the weight of the wheel to get the frictional force acting on the circumference of the tyre. The frictional force is divided by the mass of the vehicle to obtain the deceleration, which the model integrates to obtain the velocity.
In this model, we have used an ideal anti-lock braking controller that uses control based on the difference between actual and desired slip. We set the desired slip to the amount of slip at which the mu-slip curve reaches its maximum value, which is the optimal value for minimum braking distance (see note below).
Note: In a real vehicle, slip cannot be measured directly, so this control algorithm is impractical. In this example, it is used to illustrate the conceptual construction of such a simulation model. The real engineering value of such a simulation is to show the potential of the control concept before specific implementation issues are addressed.
Running the model with ABS enabled
Connecting backend - method of graphics display:
using Plots
gr()
Initial conditions that determine whether the ABS is switched on or off:
ctrl = 1.0; # АБС включена
Loading and starting the model:
try
engee.close("absbrake", force=true) # закрытие модели
catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
m = engee.load("/user/start/examples/controls/absbrake/absbrake.engee") # загрузка модели
end;
try
engee.run(m, verbose=true) # запуск модели
catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
m = engee.load("/user/start/examples/controls/absbrake/absbrake.engee") # загрузка модели
engee.run(m, verbose=true) # запуск модели
end
Allocating data describing braking distance and sliding from the simout variable:
sleep(5)
data1 = collect(simout)
Defining data from the model into the relevant variables:
slp1 = collect(data1[2])
stop_distance1 = collect(data1[1])
Visualising the magnitude of the time slip:
plot(slp1[:,1],slp1[:,2])
Running the model with ABS off
ctrl = 0.0;
Changing a model parameter:
try
engee.close("absbrake", force=true) # закрытие модели
catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
m = engee.load("/user/start/examples/controls/absbrake/absbrake.engee") # загрузка модели
end;
try
engee.run(m, verbose=true) # запуск модели
catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
m = engee.load("/user/start/examples/controls/absbrake/absbrake.engee") # загрузка модели
engee.run(m, verbose=true) # запуск модели
end
Extracting data describing braking distance and sliding from the simout variable:
sleep(5)
data2 = collect(simout)
Defining data from the model into the relevant variables:
slp2 = collect(data2[2])
stop_distance2 = collect(data2[1])
Visualising the magnitude of the time slip:
plot(slp2[:,1],slp2[:,2])
Comparison of braking distance calculation results with and without ABS:
plotlyjs()
plot(stop_distance1[:,1], stop_distance1[:,2]./3.28084, label="Торможение с АБС", xlabel="Время, с", ylabel="Тормозной путь, м")
plot!(stop_distance2[:,1], stop_distance2[:,2]./3.28084, label="Торможение без АБС")
Conclusion:
In this example, simulation of anti-lock braking system has been demonstrated. The comparison of braking distance results with and without ABS showed that braking with ABS is the most effective.