Driver PWM Frequency

Hello all. I am currently trying to implement closed loop control of a stepper motor with two BTS7960B drivers. Is there any reason why the code works when the driver.pwm_frequency is set to ~8,000 and it doesn’t work when it is left to default at around 50,000 for an ESP32?

bts7960 is not designed to work with anything higher than 10khz. you will fry your setup and hurt yourself. please read the chip specs. even 8 khz is pushing it. also where did you find it, its an old discontinued design from like 20 years ago.