Is it plausible to add an comparator after the pwm capture to ensure the stability of real-time testing?

Is it plausible to add an comparator after the pwm capture to ensure the stability of real-time testing?

Maybe I have solved the stupid question, what you should do is simply change your IGBT/MOSFET module with a sub-cycle average module