5.real-Time Drive Cycle Simulation of CCU
5.real-Time Drive Cycle Simulation of CCU
5.real-Time Drive Cycle Simulation of CCU
tem
Anand Pitchaikani, Kingsly Jebakumar S, Shankar Venkataraman, S. A. Sundaresan
Emmeskay, Inc
47119 Five Mile Road, Plymouth, MI 48170, USA
[email protected] [email protected] [email protected]
2 Tool-chain
The plant models were developed using the Mod-
elica language in the Dymola 6.1 environment. The
development re-used most of the components from
Figure 1 System Architecture
the Modelica Standard Library (MSL). The special
needs were satisfied by creating additional custom 3.1 Vehicle System Models
models in Modelica. The Dymola-Simulink interface
is used to create the S-function of the developed
plant models. The controller S-function and plant
3.1.1 Driver
model S-function are integrated in MATLAB® The driver model generates the input signals like
R2006b version. The integrated model is converted throttle, brake and clutch commands. The driver
to a real-time model by using RT-LAB™ 8.1.7. This model takes advantage of the acausal nature of the
real-time model is downloaded into the TestDrive™ Modelica language for setting up the inverse prob-
system that operates on QNX® 6.3. The real-time lem: taking the drive cycle vehicle speed command
simulation is carried out in the above mentioned as input and then computing the clutch, accelerator
TestDrive system. The above tools were used based pedal and brake pedal commands required to follow
on their applicability to the automotive domain. the desired drive cycle input. In other words, the
model is “backward driven” (at least with respect to
the longitudinal vehicle dynamics). The model is
3 Plant Models built with the capability of idling the engine when
the vehicle is at rest. These driver command signals
The goal of this work was to model a convention- are sent to the controller through the driver bus.
al engine driven vehicle with engine driven HVAC
system. The vehicle subsystems (driver, controller, 3.1.2 Controller
engine, transmission and chassis) and the vehicle air- The controller model processes the driver com-
conditioning subsystems (compressor drive, HVAC mands and plant sensor outputs and generates control
systems, cabin and atmosphere) are modeled in this signals for the engine, transmission and the HVAC
work. Most of these models are developed using system. As a simple engine model is used in this
simple formulations keeping the real-time require- study, the engine control logic is a simple pass
ments in mind. The overall plant model architecture through in the controller model. The climate system
(Figure 1) in Modelica is made such that all the main controller is a part of the controller model. The con-
subsystems are replaceable. This architecture trol signals are sent to the plant through the system
provides flexibility to choose different implementa- bus. The system bus is an expandable connector
tions for each subsystem. In this way, the same mod- from which all other components can access the re-
el can be configured to model different vehicle sys- quired control signals. In the case of a “forward-driv-
tems easily. However, only the real-time capable en” model, the controller model would quite be com-
configuration is described in this paper. plex and play an important role in driver inputs like
throttle, brake, clutch and gear command. Because
of the “backward driven” driveline model, most of
the complexity in the controller model is related to
control of the HVAC components.
heatr
3.1.3 Engine level so that the separate interfaces used for air and
refrigerant are not visible at the top-most level.
_c..
compres...
The engine model delivers torque based on com-
manded throttle from the driver. This model incor-
porates performance maps in the form of look-up
tables. The torque-speed map which provides a min- system_bus system_bus
imum and maximum limit of the torque for every cabin_air_out
speed is used where minimum corresponds to 0 blow er inlet_door
throttle and maximum corresponds to 1 throttle. The
fuel consumption map is based on the torque and
speed. This formulation will be very useful for fuel atm_out
system_bus
cabin_air_in
The transmission model is a six-speed manual compres... mixer
type encompassing clutch, synchronizers and final
drive. The gear, clutch and inertia models of MSL Figure 2 Climate Control System Models
are used to construct the transmission model. The
current gear selection is given by a gear-shift map 3.2.1 Cabin
based on throttle command and engine speed. A The single zone cabin is modeled as a closed
simple gear selector model is included in the trans- thermal volume surrounded by a metal frame mass.
mission model. This model includes a shift map that Solar heating effects are included in the model. The
consists of threshold speed limits for upshifts and amount of solar heating will vary with the ambient
downshifts, at the given throttle. Based on the conditions chosen for the simulation. The heat capa-
throttle and engine speed, the gear selector will se- city of the cabin metal mass is captured in the model.
lect a gear number and engage the appropriate syn- The heat transfer from metal frame to the interior is
chronizer. The final drive is modeled as a simple through convection. For typical closed cabin climate
gear. A simple clutch model is used to represent the control systems, it was felt that relative humidity ef-
clutch that engages and disengages the engine from fects will not be significant and hence were not
the driveline. This model will capture the torque ra- modeled. Air flow inside the cabin is modeled using
tio introduced by the transmission and effective iner- custom made air flow connectors.
tia of the transmission based on the gear engaged.
3.2.2 Atmosphere
3.1.5 Chassis The atmosphere is modeled as an infinite source-
The chassis model handles the longitudinal dy- sink model which fixes the vehicle ambient condi-
namics of the vehicle by modeling vehicle mass, tions like temperature, pressure, air density etc. This
aerodynamic drag and rolling resistance. The driver reference data is used in the HVAC models to com-
brake command is converted to brake torque and is pute the heat transfer and related variables associated
sent to the wheels. Drag and rolling resistance are with air flow over the condenser and evaporator. For
modeled using representative equations. The chassis the sake of simplicity, the mass flow rate of air that
model gets the torque generated in the engine model blows over the condenser is set as a constant in the
through the transmission and final drive. The vehicle atmosphere model itself. The mass flow rate of air
speed from the chassis model is put on to the system that blows over the evaporator will be fixed by the
bus. blower model and the atmosphere or the cabin will
supply that air flow based on the recirculation com-
3.2 Climate Control System Models mand.
The climate control model includes the cabin, at- 3.2.3 Auxiliary Drive
mosphere, auxiliary drive and HVAC components as
shown in Figure 2. The climate control components The auxiliary drive model captures the gearing
handle air flow as well as refrigerant flow. Expand- and clutch between the engine shaft and the HVAC
able HVAC connectors are used in the subsystem compressor drive shaft. It represents the engine-driv-
en compressor configuration in which a portion of
the engine power is used to drive the HVAC com- m - Refrigerant flow rate (kg/s)
pressor. The compressor off signal from the climate ω - Compressor rotational speed (rad/s)
system controller will disengage the clutch modeled ρsuction – Refrigerant density at suction side (kg/m3)
in the auxiliary drive. This model captures the load M – compressor torque (Nm)
applied by the HVAC system on the engine which is r – Pressure ratio
crucial in estimating the fuel economy accurately. Psuction – Suction pressure (N/m2)
γ – Ratio of specific heat capacities of the refriger-
3.2.4 HVAC ant
The HVAC components form the core of the cli- Vd – Displacement volume (m3)
mate control system. They include models for refri- ηv – Volumetric efficiency
geration cycle, refrigerant properties, blower, inlet ηisen – Isentropic efficiency
door and heater as shown in Figure 2 and Figure 3. ηmech – Mechanical efficiency
The refrigeration cycle models include the vapor-
cycle refrigeration components like evaporator, ex- 3.2.4.2 Condenser and Evaporator
pansion valve, condenser and compressor. The refri- The condenser and evaporator are modeled as
gerant expansion, compression and heat transfer pro- lumped volume elements to emulate the heat ex-
cesses have been captured in the models. The refri- change between the refrigerant medium and air (see
gerant flow and air flow interact thermally by using Figure 4). This model incorporates the two important
thermal connectors of MSL. heat exchange mechanisms as given below.
• Convection between refrigerant and pipe wall
• Convection between pipe wall and air
The convective heat transfer coefficients on the
inertia refrigerant side are estimated based on the refrigerant
J=0.1
flange_a
quality and other thermal coefficients [7]. The pipe
Condenser
PID
damper wall heat capacity is captured in the model. The con-
d=0.05
f ixed=0
vective heat transfer coefficient is modeled to have
PID
Ti=1e6 expan...
compre...
Vd two values – one for low air mass flow rates and an-
-1
pres...
other for high air mass flow rates. The pressure loss
+
+1 k=210e3
Evaporator inside the heat exchangers is assumed to be negli-
add
gible and hence the entire heat exchanger volume is
const1 lumped into a single volume. We accepted these as-
sumptions as reasonable in order to achieve real-time
performance.
Figure 3 HVAC Components
3.2.4.1 Compressor
HVAC compressor is modeled using isentropic
relationships as shown below. Compressor is charac- Refrigerant volume
terized by its volumetric efficiency and isentropic ef- tw oPort...
Enthalpy (J/kg)
dt
mvol – Mass of refrigerant in the volume (kg)
mi – Refrigerant inlet mass flow rate (kg/s)
mo – Refrigerant outlet mass flow rate (kg/s)
hvol – Specific enthalpy of refrigerant in the
volume(J/kg)
Pvol – Pressure of refrigerant in the volume (N.m2)
νvol – Specific volume of refrigerant in the volume Temperature (K)
(m3/kg)
Figure 5 R134a Enthalpy Vs Temperature
hi – Specific enthalpy of incoming refrigerant flow
(J/kg)
ho – Specific enthalpy of outgoing refrigerant flow 3.2.4.5 Blower
(J/kg) The blower delivers the air required by the cabin.
Ui – Refrigerant side convection heat transfer coeffi- Blower mass flow rate is computed by a 2-D look-up
cient (W/m2K) table based on fan setting and outlet door position.
Uo – Air side convection heat transfer coefficient (W/ Both of these inputs are set by the climate system
m2K) controller. The blower blows the air over the evapor-
Tvol – Refrigerant temperature in the volume (K) ator. The data driven model for the blower is chosen
Tw – Pipe wall temperature (K) keeping the real time requirements in mind.
Tamb – Ambient air temperature (K)
C – Specific heat capacity of pipe (J/K) 3.2.4.6 Inlet door
The inlet door can re-circulate air from the cabin
3.2.4.3 Expansion Valve or take fresh air intake. The inlet door model takes in
The expansion valve is modeled based on empir- a Boolean signal which indicates the recirculation
ical relationship for flow as a function of pressure setting ON or OFF. Based on the re-circulation com-
drop [3]. It can handle the choked mass flow based mand from the climate system controller, this door
on sub-cooled entry conditions. The expansion valve model allows the fresh air to enter into the cabin or
is modeled as a variable area flow device. The valve re-circulates the cabin air back to the cabin through
area is an input to the model. A PID controller is the blower.
used to control the flow area to maintain near con-
stant suction pressure. This will ensure a proper 3.2.4.7 Heater
functioning of the compressor model. The heater core element of the HVAC system
takes heat from the engine coolant and heats the air
3.2.4.4 Refrigerant Properties going into the cabin. The amount of heating can be
The refrigerant type considered in this work is regulated by adjusting the mixer door that controls
R134a. The refrigerant properties are generated us- the amount of air flow that gets exposed to the heat-
ing property relationship curves available in the liter- er. The exposed and unexposed air mixes in the re-
ature [6] and used in the evaporator and condenser gion next to the heater. The heating effect of the
models. The refrigerant properties were represented heater core is implemented using an efficiency term.
by data tables created from the complex empirical This heat flow efficiency is given by a look-up table
relationships (see Figure 5). The tables specify the based on the mixer door open ratio. The heater core
enthalpy, pressure and quality (mass fraction) for the will be at a temperature dictated by the coolant tem-
given density and temperature. The resulting model perature. The rate at which the air flow gets heated
is computationally less intensive and hence capable by the heater is controlled by a time constant and the
for real-time simulation. heater efficiency term.
3.3 Testing of Models like input/output signals list of the controller. In
many cases, the plant model developer may not get
The vehicle subsystems and the climate control access to the source code of the controller. This
system models are integrated in the Dymola environ- method of using the object code for the controller
ment and fundamental validation tests checks were will be very useful in such cases. Except for a few
performed. The vehicle was run at a constant speed definition files (headers), the object code (binary)
and the HVAC compressor was switched on and off. was sufficient to download the controller model
The effect of this switching was observed in the cab- along with the plant models into the target processor/
in temperature. In another test, the time required by machine.
the cabin to reach a target temperature at a particular
ambient condition with the vehicle being stationary
was determined. These tests helped to ascertain the 6 Real-time Simulation
fidelity of the models developed and the correspond-
ing parameterization made. The first level target of achieving a closed loop
simulation of the developed models is accomplished
by performing a dynamic simulation of plant and the
4 Real-time Adaptations controller in Simulink. The next level will make sure
that the plant models developed in Modelica can be
The HVAC components models can become very directly used in any Hardware-in-the-Loop testing.
complex. The calculation of the refrigerant proper- There are many practical scenarios where the climate
ties in the HVAC component models is itself a com- system controller hardware needs to be tested in a
putationally expensive calculation. The equations real vehicle environment which might not always be
used in the reference [6] are highly non-linear. When possible. This validation testing will trigger the need
the property calculations are written as non-linear for HIL simulation where the developed climate sys-
functions, differentiating these functions becomes a tem controller hardware will run with the vehicle and
significant issue. To overcome this problem, tables climate system components as models in a real-time
were made that take density and temperature of the environment.
refrigerant as inputs and output the enthalpy, pres-
sure and vapor quality. The condenser and evaporat-
or models can be constructed using an array of refri-
gerant volumes and refrigerant flow resistance mod-
els. Such models were found to be computationally
very complex. To avoid this complexity and the as-
sociated computational effort, the condenser and
evaporator were modeled as single volumes after it
was found that the results that were produced with
the vehicle model were satisfactory. It was ensured
that all the vehicle subsystem models were of the ap-
propriate level of detail to characterize the actual
vehicle.
5 Climate System Controller Model Figure 6 Turn around time of the model
The climate system controller model was avail- The simulations were carried out for Japanese 10-
able as a Simulink S-function. The controller exer- 15 mode drive cycle data. The most important metric
cises its control action over various components of to be measured for judging the real time capability of
the HVAC system to maintain the cabin at a set tem- models is turn around time. The turn around time for
perature. As the controller is of production standard, this simulation is well below the chosen sample time
only the object code of the source was available. A of 10 ms as seen in Figure 6. The plant model results
successful integrated simulation of the developed are shown for two different ambient conditions of
plant models with the controller itself will mark a 40°C and -10°C. In both the conditions, the control-
milestone. There were no details available about the ler is able to bring the cabin to the set temperature of
precise control logic used in the controller. The in- 25°C. In the 40°C case, the HVAC compressor is
tegration is done based on the available information
switched on and off to control the temperature to The real-time simulation of this integrated model
25°C (See Figure 7). in the TestDrive platform confirms that the de-
veloped models are amenable to Hardware-in-the-
Loop simulations. It can be said that the level of fi-
delity that is captured in these plant models is suffi-
cient for testing climate control logic, fuel economy
studies and alternate vehicle configuration sensitiv-
ity. These models in the TestDrive hardware can be
tested with any climate system controller with suit-
able input/output connections. In terms of plant mod-
eling, the scope can be increased to add an e-HVAC
powered by a battery instead of an engine. The im-
pact of e-HVAC on conventional and hybrid vehicles
can also be studied.
8 Acknowledgment
Figure 7 Results for 40°C ambient case
This work in parts was supported by Mr. Yutaka
In the -10°C case, the heater comes in to play and Kato of NEAT Co. Ltd., Japan and Dr. Yasunori
heats the ambient air to the required 25°C. In this Yokojima. Authors wish to thank Dr. Michael Tiller
case, the HVAC compressor was hardly switched on for his guidance and support throughout this work.
by the controller (see Figure 8).
References
[1] Öner ARICI, Song-Lin YANG, Daniel
HUANG and Emin ÖKER. Computer Model
for Automobile Climate Control System
Simulation and Application. Int.J. Applied
Thermodynamics, Vol.2, (No.2), pp. 59-68,
June-1999.
[2] Torge Pfafferott and Gerhard Schmitz. Im-
plementation of a Modelica Library for Sim-
ulation of Refrigeration Systems. pp. 197-
206. Proceedings of the 3rd International
Modelica Conference, Linköping, November
3-4, 2003.
Figure 8 Results for -10°C ambient case [3] Kim, Y. 1993. Two-Phase Flow of HCFC-22
and HFC-134a Through Short-tube Orifices.
Ph.D. dissertation, Texas A&M University.
7 Conclusions [4] Hilding Elmqvist, Sven Erik Mattsson, Hans
Olsson, Johan Andreasson, Martin Otter,
The exercise of running the closed loop model es-
Christian Schweiger and Dag Brück. Real-
tablishes the compatibility between the developed
time Simulation of Detailed Automotive
Modelica plant models with the chosen controller.
Models. pp. 29-38. Proceedings of the 3rd In-
The closed loop simulation is very beneficial for the
ternational Modelica Conference, Linköping,
following reasons:
November 3-4, 2003.
• Validation of control strategies and functionality
of control elements like heater, inlet door, etc. [5] J. Bäckman and M. Edvall. Using Modelica
and Control Systems for Real-time Simula-
• Comparison of different control strategies tions in the Pulp. pp. 579-583. Proceedings
• Fuel economy prediction of the 4th International Modelica Confer-
ence, Hamburg, March 7-8, 2005.
[6] Tillner-Roth, R., Baehr, H.D. An internation-
al standard equation of state for the thermo-
dynamic properties of 1,1,1,2-tetrafluoroeth-
ane (HFC-134a) for temperatures from 170 K
to 455 K at pressures up to 70 MPa. J. Phys.
Chem. Ref. Data 26 (1994) 657-729.
[7] Corberan, J.M. and Melon, M.G. 1998. Mod-
eling of plate finned tube evaporators and
condensers working with R134a, Int. J. Re-
frigeration, Vol. 21, No. 4, pp. 273-284.
[8] M. Tiller, "Introduction to Physical Modeling
with Modelica", Kluwer Academic Publish-
ers, ISBN 0-7923-7367-7
[9] Dymola. Dynamic Modeling Laboratory,
Dynasim AB, Lund, Sweden, http://www.-
Dynasim.se
[10] Modelica, http://www.Modelica.org.
[11] OPAL-RT, http://www.opal-rt.com.