Title: Adaptive spark control with knock detection