I would simply sent the data to the serial monitor as well as the PWM output to see if the issue is in the calculations or a hardware limit.
I would simply sent the data to the serial monitor as well as the PWM output to see if the issue is in the calculations or a hardware limit.