A microprocessor-based controller is provided for generated heat in at various locations in an exhaust system of an engine by changing the heat generation technique utilized. In one case, some cylinder air-fuel ratios are modulated between stoichiometry and rich, while others are modulated between stoichiometry and lean. Another approach operates some cylinder lean, while others are modulated between a first rich, and a second, less rich, value. Further, compensation based on engine airflow is also provided. Finally, various methods are described for temperature control and for controlling modulation of air-fuel ratio.