« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Enhanced Control Systems
Remotely Control a Cooling Fan
The model for controlling a ventilation fan can include several delays.
In[1]:=
X
{fan, sensing, actuator, com, controller} = {StateSpaceModel[{{{-(1/10)}}, {{1}}, {{1/ 10}}, {{0}}}, SamplingPeriod ->None, SystemsModelLabels -> None], TransferFunctionModel[Unevaluated[{{E^(-s \[Delta])}}], s, SamplingPeriod ->None, SystemsModelLabels -> None], TransferFunctionModel[{{{E^(Rational[-1, 10] s)}}, 1}, s, SamplingPeriod -> None, SystemsModelLabels -> None], TransferFunctionModel[{{{E^(Rational[-1, 2] s)}}, 1}, s, SamplingPeriod -> None, SystemsModelLabels -> None], TransferFunctionModel[Unevaluated[{{(25 + 22 s)/s}}], s, SamplingPeriod ->None, SystemsModelLabels -> None]};
A controller that works on the fan directly may fail when delays are present.
In[2]:=
X
y0 = OutputResponse[ SystemsModelFeedbackConnect[ SystemsModelSeriesConnect[controller, fan]], UnitStep[t - 2], {t, 0, 20}]; Plot[y0, {t, 0, 20}, PlotRange -> All]
Out[2]=
In[3]:=
X
remotesys = SystemsModelSeriesConnect[actuator, SystemsModelSeriesConnect[fan, sensing]]; comsys = SystemsModelSeriesConnect[ SystemsModelSeriesConnect[com, remotesys], com]
Out[3]=
In[4]:=
X
remotesys = SystemsModelSeriesConnect[actuator, SystemsModelSeriesConnect[fan, sensing]]; comsys = SystemsModelSeriesConnect[ SystemsModelSeriesConnect[com, remotesys], com]; y1 = OutputResponse[ SystemsModelFeedbackConnect[ SystemsModelSeriesConnect[controller, comsys /. \[Delta] -> 1/5]], UnitStep[t - 2], {t, 0, 10}]; Plot[%, {t, 0, 10}, PlotRange -> All]
Out[4]=
The closed-loop fan with a Smith predictor has the same characteristics as the delay-free fan.
In[5]:=
X
smith = SmithDelayCompensator[comsys, controller]; cl2 = SystemsModelFeedbackConnect[ SystemsModelSeriesConnect[smith, comsys]];
In[6]:=
X
responses = Prepend[Table[ OutputResponse[cl2 /. {\[Delta] -> del}, UnitStep[t - 2], {t, 0, 20}], {del, {1/5, 5, 10, 15}}], y0];
In[7]:=
X
Plot[responses, {t, 0, 20}, PlotRange -> All, PlotStyle -> Prepend[Table[Dashed, {4}], Thick], ImageSize -> Medium]
Out[7]=