Problem one. At 20MHz, as per the manual, min HPWM freq you can get is 1221Hz
You are trying to run at 400, so its probably screwing up the internal math.

To change motor speed you change duty cycle.

As to noise, The motor windings are vibrating at roughly the PWM freq and this is what you hear. To get rid of the whine, you need to use a freq that is out of hearing range ( so above 16KHz or below 50Hz ).

As to oscillator, try using yr 20MHz first ( with Define OSC 20 )
then use
HPWM 1, 150, 16000
HPWM 2, 150, 16000
see how that runs.
Andrew