You might use a PID loop to track the resonant frequency by using the phase as a reference.
Essentially the Set point for the PID is the resonant frequency phase difference that you want to maintain.
Problems that you will encounter are the PID settings and the overall loop response time.