Engee documentation
Notebook

Spring-loaded buffer system with regulator

We will build a system in which a force acts on the mass from a force source controlled by a regulator, and to which a spring and a damper are connected, which creates a complex mode of movement of the system.

Model Features

A pulse signal with a period of 5 seconds is applied to the input of the system, after which there is a PID controller that transmits a control signal to the system.

The initial velocity of the mass block is 10 m/s.

image.png

The controller controls the source, which acts on the mass with a force proportional to the difference between the control signal and the position of the mass block according to the sensor.

Launching the model and analyzing the results

In [ ]:
model_name = "mass-spring-damper-with-controller";
model_name in [m.name for m in engee.get_all_models()] ? engee.open(model_name) : engee.load( "$(@__DIR__)/$(model_name).engee");
res = engee.run( model_name );
In [ ]:
Fпружина = collect( res["Пружина.F"] );
Fдемпфер = collect( res["Демпфер.F"] );
ctrl = collect( res["PID Controller.1"] );
Fисточник = collect( res["Force Source.F"] );
Pмасса = collect( res["Relative Translational Motion Sensor.2"] );
In [ ]:
gr()
plot(
    plot( Pмасса.time, Pмасса.value, label="Положение" ),
    ( plot( Fисточник.time, Fисточник.value, label="Источник" ); 
      plot!( Fпружина.time, Fпружина.value, label = "Пружниа" ); 
      plot!( Fдемпфер.time, Fдемпфер.value, label="Демпфер" ) ),
      layout=(2,1), lw=3
)
Out[0]:

Conclusion

The parameters of this PID controller can be adjusted manually or during an automated procedure. You can also change the parameters of the mechanical part, but the guideline remains the same: to reduce the discrepancy between the system response and the control signal.