Engee documentation
Notebook

Simulation of a simplified gearbox

Introduction:

In this example, the modelling of torque variation in a simplified gearbox using command control of the model will be considered.

image.png

The general view of the model is shown in the figure.

A sinusoidal signal is applied to the input of the torque source, as a result of which a torque is generated in the source to rotate the masses connected to the source.

The masses are connected to each other by a single-stage gearbox with a gear ratio of 2.

With the help of torque sensors the data are plotted in the visual modelling interface, with the help of "To CSV" blocks they are output to this script.

Realisation of the model run in Engee using software control:

Loading the model:

In [ ]:
Pkg.add(["CSV"])
In [ ]:
modelName = "gear_torque";
gear_model = modelName in [m.name for m in engee.get_all_models()] ? engee.open( modelName ) : engee.load( "$(@__DIR__)/$(modelName).engee");

Running a loaded model:

In [ ]:
results = engee.run( modelName );

Load and visualise the data generated by the simulation

The change in torque during the simulation lies in the results variable:

In [ ]:
using CSV, DataFrames
torque_before_gear = results["Torque before gear"]; #загрузка данных о моменте до коробки передач
torque_after_gear = results["Torque after gear"]; #загрузка данных о моменте после коробки передач

Connection of the library for plotting:

In [ ]:
using Plots

Plotting a graph describing the change in torque:

In [ ]:
plot(torque_before_gear.time, torque_before_gear.value, xlabel="Время, с", ylabel="Момент, Н*м", title="Изменение крутящего момента", linecolor =:red, bg_inside =:white, line =:dashdot, label = "before gearbox")
plot!(torque_after_gear.time, torque_after_gear.value, xlabel="Время, с", linecolor =:blue, bg_inside =:white, line =:solid, label = "after gearbox")
Out[0]:

Conclusion:

This example has demonstrated the calculation of the change in torque before and after the gearbox.

Software model control was used to run the model and download the results.

The data from the simulation was processed and visualised using a graphical library.