Engee documentation
Notebook

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:

absbrake_1708524133239.png

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.

$$\omega_v = \frac{V}{R} \mbox{ (равна угловой скорости колеса, если нет пробуксовки)}$$

The equation block

$$ \omega_v = \frac{V_v}{R_r}$$

$$slip=1-\frac{\omega_w}{\omega_v}$$

Where:

  • $\omega_v - \mbox{ скорость транспортного средства, деленная на радиус колеса,}$
  • $V_v - \mbox{линейная скорость транспортного средства,}$
  • $R_r - \mbox{ радиус колеса,}$
  • $\omega_w - \mbox{угловая скорость колеса.}$

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:

In [ ]:
using Plots
gr()
Out[0]:
Plots.GRBackend()

Initial conditions that determine whether the ABS is switched on or off:

In [ ]:
ctrl = 1.0; # АБС включена

Loading and starting the model:

In [ ]:
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
Building...
Progress 100%
Out[0]:
Dict{String, DataFrames.DataFrame} with 2 entries:
  "slp"                 => 1501×2 DataFrame…
  "stopping distance.1" => 1501×2 DataFrame

Allocating data describing braking distance and sliding from the simout variable:

In [ ]:
sleep(5)
data1 = collect(simout)
Out[0]:
2-element Vector{WorkspaceArray}:
 WorkspaceArray("absbrake/stopping distance.1")
 WorkspaceArray("absbrake/slp")

Defining data from the model into the relevant variables:

In [ ]:
slp1 = collect(data1[2])
stop_distance1 = collect(data1[1])
Out[0]:

1,501 rows × 2 columns

timevalue
AnyAny
10.00.0
20.010.88
30.021.76
40.032.64
50.043.52
60.054.4
70.065.28
80.076.15999
90.087.03998
100.097.91997
110.18.79996
120.119.67994
130.1210.5599
140.1311.4399
150.1412.3198
160.1513.1998
170.1614.0797
180.1714.9596
190.1815.8396
200.1916.7194
210.217.5993
220.2118.4792
230.2219.359
240.2320.2389
250.2421.1187
260.2521.9984
270.2622.8782
280.2723.7579
290.2824.6376
300.2925.5173

Visualising the magnitude of the time slip:

In [ ]:
plot(slp1[:,1],slp1[:,2])
Out[0]:

Running the model with ABS off

In [ ]:
ctrl = 0.0;

Changing a model parameter:

In [ ]:
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
Building...
Progress 100%
Out[0]:
Dict{String, DataFrames.DataFrame} with 2 entries:
  "slp"                 => 1501×2 DataFrame…
  "stopping distance.1" => 1501×2 DataFrame

Extracting data describing braking distance and sliding from the simout variable:

In [ ]:
sleep(5)
data2 = collect(simout)
Out[0]:
2-element Vector{WorkspaceArray}:
 WorkspaceArray("absbrake/stopping distance.1")
 WorkspaceArray("absbrake/slp")

Defining data from the model into the relevant variables:

In [ ]:
slp2 = collect(data2[2])
stop_distance2 = collect(data2[1])
Out[0]:

1,501 rows × 2 columns

timevalue
AnyAny
10.00.0
20.010.88
30.021.76
40.032.64
50.043.52
60.054.4
70.065.28
80.076.15999
90.087.03998
100.097.91997
110.18.79996
120.119.67994
130.1210.5599
140.1311.4399
150.1412.3198
160.1513.1998
170.1614.0797
180.1714.9596
190.1815.8396
200.1916.7194
210.217.5993
220.2118.4792
230.2219.359
240.2320.2389
250.2421.1187
260.2521.9984
270.2622.8782
280.2723.7579
290.2824.6376
300.2925.5173

Visualising the magnitude of the time slip:

In [ ]:
plot(slp2[:,1],slp2[:,2])
Out[0]:

Comparison of braking distance calculation results with and without ABS:

In [ ]:
plotlyjs()
plot(stop_distance1[:,1], stop_distance1[:,2]./3.28084, label="Торможение с АБС", xlabel="Время, с", ylabel="Тормозной путь, м")
plot!(stop_distance2[:,1], stop_distance2[:,2]./3.28084, label="Торможение без АБС")
Out[0]:

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.