A method and apparatus for controlling a vehicle HVAC system to
automatically defog a windshield glass and to prevent fogging or
condensation of the windshield glass. The ambient air temperature and
vehicle speed are measured and used to determine a windshield glass
temperature. The in-cabin air temperature and relative humidity are
measured and used to determine a dewpoint. An dewpoint margin is
calculated to compensate for sensor accuracy and fog predictability. A
fog margin, which is based upon calculated windshield glass temperature
and dewpoint, is calculated and used, in conjunction with the dewpoint
margin, to control the HVAC system to anticipate potential fogging
conditions and to scale the intensity of the HVAC system response based
upon the severity of fogging conditions.