Engee documentation
Notebook

Measurement of transient time in RL circuit

In this example, an RL circuit in which a transient occurs and a subsystem for measuring the transient time are assembled.

Model description

At time $t=0$ the current source Controlled Current Source (block ControlledCurrent) receives a step signal of amplitude 6V. A transient process starts in the circuit, which we will see thanks to the sensor Current Sensor.

We are interested in the moment when the value at the output of the sensor enters the 5% accuracy tube, i.e. when the signal exceeds the value of 0.95 * 6 V.

image.png

A set of blocks Switch and Delay are responsible for storing information about the simulation time (block Clock) elapsed from the start of the model run until the signal exceeds a threshold value. After that, the output value of blocks Switch and Delay is frozen. We can see it in the graph panel in tabular form, where it is displayed in microseconds.

image.png

Before the tube reaches 95% accuracy, the transient should take approximately $3 \tau$ seconds, where $\tau = \frac{L}{R}$ (time constant). In our case, the time constant is 1 µs, and this is consistent with the observed transient duration: 2.995 µs.

Running the model

Let's run the model RL_circuit_transition_time using software control tools:

In [ ]:
# Загрузим модель, если она еще не открыта на холсте
if "RL_circuit_transition_time"  getfield.(engee.get_all_models(), :name)
    engee.load( "$(@__DIR__)/RL_circuit_transition_time.engee");
end

model_data = engee.run( "RL_circuit_transition_time" );

Plot the graph:

In [ ]:
iL = model_data["Il"].value

plot( model_data["Il"].time, iL, xlabel="Время, с", label="Ток через катушку, A", lw=2 )
vline!( [model_data["t_finish_us"].value[end] ./ 1e6], label="Длительность переходного процесса" )
hline!( [0.95 .* (iL[end] - iL[1])], linecolor=3, ls=:dash, label="Порог ± 5%" )
hline!( [1.05 .* (iL[end] - iL[1])], linecolor=3, ls=:dash, label=:none )
Out[0]:

We can see that the model has measured the duration of the transient very accurately, because it is at the point marked by the red line on the graph that the measured process falls within the ± 5% accuracy tube.

Conclusion

We have easily built a model to study the transient in an RL circuit and with the help of a few additional blocks we have obtained the transient duration as another signal within the model, which can be visualised or used, for example, for its optimisation.

Blocks used in example