第三周仿真作业

model motor1 "An DC Motor Model"

type Voltage=Real(unit="V");

type Current=Real(unit="A");

type Resistance=Real(unit="Ohm");

type Speed=Real(unit="r/min");

type Torque=Real(unit="N.m");

type Inertia=Real(unit="kg.m^2");

Torque Tm"Torque of the Motor";

Speed n"Speed of the Motor";

Current i"Armature Current";

Voltage u"Voltage Source";

Resistance R_ad"External Resistance";

Resistance R1"Start-up Resistance";

Resistance R2"Start-up Resistance";

Resistance R3"Start-up Resistance";

parameter Real J = 1"Total Inertia";

parameter Real R = 0.6"Armature Resistance";

parameter Real Kt = 1.8"Torque Constant";

parameter Real Ke = 0.189"EMF Constant";

parameter Real i1=48.6"Maximum Current";

parameter Real i2=17.8"Minimum Current";

parameter Real Tl = 29.2"Load Torque";


equation

Tm-Tl = J * der(n) * 6.28 / 60;

Tm= Kt * i;

u= i * (R+R_ad+R1+R2+R3) + Ke * n;

if time <= 0.1 then

u = 0;

R_ad = 0;

else

u = 240;

R_ad = 0;

end if;

if time <= 5.0 then

R1=3.67;

else

R1=0;

end if;

if time <=7.4 then

R2=1.65;

else

R2=0;

end if;

if time <= 10 then

R3=0.74;

else

R3=0;

end if;

end motor1;

四、仿真结果:

原文地址:https://www.cnblogs.com/364696a/p/5273248.html