Because many factors affect kiln operational stability and NOx generation rates, an automatic control loop is programmed to adjust the ammonia injection rate based on actual emissions and minimize the amount of ammonia released to the atmosphere.