To see how the sf_aircontrol
model works, you can run a completed,
tested version, which includes the Stateflow® chart you will build. Here's how to do it:
Start MATLAB® software.
If you need instructions, consult your MATLAB documentation.
Type sf_aircontrol
at the command line.
This command starts Simulink® software and opens the sf_aircontrol
model:
Double-click the Air Controller block to open the Stateflow chart.
Double-click the Scope block to display the changes in temperature over time as the model runs.
Tip
Position the Air Controller chart and the Scope window so they are both visible on your desktop.
Start simulation in the Air Controller chart by selecting Run.
As the simulation runs, the chart becomes active (wakes up) in the
PowerOff
state. Notice in the Scope that until
PowerOn
becomes active, the temperature rises unchecked.
After approximately 350 seconds into the simulation, a rising edge signal
switches power on and the fans become active.
Note
Simulation time can be faster than elapsed time.
When the temperature rises above 120 degrees, FAN1
cycles
on. When the temperature exceeds 150 degrees, FAN2
cycles on
to provide additional cooling. Ultimately, FAN1
succeeds in
maintaining the temperature at 120 degrees until a falling edge signal switches
power off again at 500 seconds. Then, the temperature begins to rise
again.
The Scope captures the temperature fluctuations:
Close the model.
Where to go next. Now you are ready to start building the Air Controller chart. Begin at phase 1 of the workflow: Implementing the Interface with Simulink.