Engee documentation
Notebook

Simulation of a malfunction of an armature winding of an electric motor

This example simulates the operation of a DC motor with an armature winding malfunction.

Model diagram:

simple_motor_armature_winding_fault--1751288866661.png

A malfunction of the armature winding of a DC motor is simulated using the Engee Function block, in which, in the Step method code section, a function in the Julia programming language is built in. The function takes two arguments, the angle of rotation and the fraction of a revolution with a malfunction, and returns signals 1 or 0, which characterize a serviceable or faulty condition, respectively.

image.png

The signal from the Engee Function unit enters the Key unit, opening and closing the motor armature circuit.

Defining the function to load and run the model:

In [ ]:
function start_model_engee()
    try
        engee.close("simple_motor_armature_winding_fault", force=true) # closing the model
        catch err # if there is no model to close and engee.close() is not executed, it will be loaded after catch.
            m = engee.load("$(@__DIR__)/simple_motor_armature_winding_fault.engee") # loading the model
        end;

    try
        engee.run(m) # launching the model
        catch err # if the model is not loaded and engee.run() is not executed, the bottom two lines after catch will be executed.
            m = engee.load("$(@__DIR__)/simple_motor_armature_winding_fault.engee") # loading the model
            engee.run(m) # launching the model
        end
end
Out[0]:
start_model_engee (generic function with 1 method)

Running the simulation

Simulation without malfunction:

In [ ]:
start_model_engee();

Isolation of rotation speed, current and voltage signals from the simout variable:

In [ ]:
result = simout;
res1 = collect(result)
Out[0]:
5-element Vector{WorkspaceArray}:
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Ток, А")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Скорость вращения, об/мин")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Напряжение, В")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Блок имитирующий 
неисправность обмотки якоря.1")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Ideal Rotational Motion Sensor.2")

Malfunction of the armature winding:

In [ ]:
engee.set_param!("simple_motor_armature_winding_fault/Доля оборота
 characterizing
 неисправность", "Value" => 0.0833)

Starting a simulation with an armature winding malfunction:

In [ ]:
engee.run("simple_motor_armature_winding_fault");

Isolation of rotation speed, current and voltage signals from the simout variable:

In [ ]:
result = simout;
res2 = collect(result)
Out[0]:
5-element Vector{WorkspaceArray}:
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Ток, А")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Скорость вращения, об/мин")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Напряжение, В")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Блок имитирующий 
неисправность обмотки якоря.1")
 WorkspaceArray{Float64}("simple_motor_armature_winding_fault/Ideal Rotational Motion Sensor.2")

Writing signals to variables:

In [ ]:
w_1 = collect(res1[2])
w_2 = collect(res2[2]);

Visualization of simulation results

Graph of the motor speed without malfunction and with malfunction of the armature winding:

In [ ]:
using Plots
Plots.plot(w_1[:,1], w_1[:,2], label="Rotation speed of a serviceable DPT, rpm", linewidth=3)
Plots.plot!(w_2[:,1], w_2[:,2], label="Rotation speed of the faulty DPT, rpm", linewidth=2)
Out[0]:

It can be seen that the steady rotation speed has become lower with the introduction of the malfunction.

In [ ]:
Plots.plot(w_1[:,1], w_1[:,2], label="Rotation speed of a serviceable DPT, rpm", linewidth=3)
Plots.plot!(w_2[:,1], w_2[:,2], label="Rotation speed of the faulty DPT, rpm", linewidth=2, xlim=(6.15, 6.50), ylim=(3400, 3700))
Out[0]:

By zooming in on the graph, you can see an unstable engine speed with an armature winding malfunction.

Conclusions:

Analysis of the simulation results shows that the DC motor reaches a stable rotational speed close to the nominal value (at rated load) within a few seconds after starting; when the fault is activated in steady state, the speed decreases to a new stable value, less than the initial value.