I've modified a previous PI controller of a design team on that is working on high speed motor applications to include the D, which didn't solve this issue. The PID loop takes actual speed, and adjusts PWM to meet a target speed. My team wants to keep things are as under wraps as possible, so I'll hold off on giving away too much information and provide additional details if that helps you clarify your answer.
It follows a pretty standard PID algorithm, similar to what can be found here:
What happens is, no matter how large of a battery we use (which can affect how much effort it takes for the motor to reach a speed, i.e. a small battery will need a higher PWM to achieve the same speed than what a larger battery would need) the motor makes a horrible, inconsistent grinding sound at a very specific PWM range. We haven't been able to pinpoint where exactly it comes from, as there are a few gears between the motor and the final output, since it is a sealed off system.
From our output analysis, we've found that when the motor grinds, the PWM duty cycle varies significantly more vs. at non grinding PWM duty cycles, and the actual speed seems to constantly miss the target speed by larger margins, which makes the PID loop overcorrect each time so we're in a constant cycle of missing the target speed, which could potentially be causing the noise.
Does anyone have any thoughts on things I can potentially look at to see if it changes/fixes this behavior? We've ruled out resonance as the grinding happens at a specific PWM range rather than a certain speed.