Design of an Automatic Control Algorithm for Energy-Efficient ...
Design of an Automatic Control Algorithm for Energy-Efficient ...
Design of an Automatic Control Algorithm for Energy-Efficient ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
11 Matlab implementation 115<br />
tion are given by function pointers. This allows easy integration <strong>of</strong> additional objectives<br />
or different system simulations. The objective <strong>an</strong>d system functions are called by the<br />
IMEA_evaluateObjective function. The data structures <strong>an</strong>d the complete code <strong>of</strong> the<br />
optimiser is found in Appendix E.<br />
The disturb<strong>an</strong>ce estimator is integrated directly into one S-function. The carbon<br />
dioxide concentration simulation is programmed graphically in Simulink since it only<br />
contains st<strong>an</strong>dard elements, which allows a faster execution.<br />
11.4 Real-time requirements<br />
Matlab Simulink is mainly designed as a simulation tool. However, with special in- <strong>an</strong>d<br />
output blocks the models c<strong>an</strong> be compiled with a tool called Real-Time Workshop <strong>an</strong>d<br />
used on micro-controllers <strong>an</strong>d other targets. This allow fast testing <strong>an</strong>d implementations<br />
<strong>for</strong> prototypes.<br />
The model built <strong>for</strong> the MUTE car has a sample time <strong>of</strong> 0.01 seconds. Running<br />
all subsystems at this speed would most certainly lead to overruns, i.e. longer calculation<br />
times th<strong>an</strong> one sample. Sensor signals are read at a slower speed. There<strong>for</strong>e, a suitable<br />
sample time has to be found <strong>for</strong> each system. These c<strong>an</strong> be assigned to every subsystem<br />
marked as “atomic” as well as to external S-functions.<br />
For the climate controller a general sample time <strong>of</strong> 0.1 second was chosen. Input<br />
values are updated at this frequency via the CAN bus. The optimiser does not need<br />
to run that <strong>of</strong>ten. Since the timescale <strong>of</strong> the cabin-system is in the r<strong>an</strong>ge <strong>of</strong> several<br />
seconds (see Section 3.1.5), a sample time <strong>of</strong> two seconds was chosen. The speed <strong>for</strong> the<br />
disturb<strong>an</strong>ce estimator is also set independently. Here, one second was chosen in order to<br />
run slower th<strong>an</strong> the rest but include all new values that are coming from the multiplexer<br />
every 0.8 seconds. To connect these systems running at different speeds, rate tr<strong>an</strong>sition<br />
blocks are needed. They assure the data tr<strong>an</strong>sfer by providing zero-order-hold or a delay<br />
functionality depending on the sample time difference.