第三周作业二

快速地达到并且电流不大于三倍,所以尝试用三倍电流进行计算

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";

 

Resistance R4"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 Tl = 29.2"Load Torque";

 

parameter Real i1=48.6"Maximum Current";

 

parameter Real i2=17.8"Minimum Current";

 

equation

 

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

 

Tm= Kt * i;

 

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

 

if time <= 0.1 then

 

u = 0;

 

R_ad = 0;

 

else

 

u = 240;

 

R_ad = 0;

 

end if;

 

if time <= 1.7 then

 

R1=2.123;

 

 

else

 

R1=0;

 

end if;

 

if time <= 2.55 then

 

R2=1.194;

 

else

 

R2=0;

 

end if;

 

if time <= 3.05 then

 

R3=0.705;

 

else

 

R3=0;

 

end if;

 

if time <= 3.35 then

 

R4=0.416;

 

else

 

 

R4=0;

 

end if;

 

end motor1;

 

达到稳定时间为4S左右

 

posted @ 2016-03-15 22:32  蔡诗旭  阅读(131)  评论(0编辑  收藏  举报