I designed a custom board for the tms320f28069M 80 pin microcontroller and I've been using modified code from the BOOSTXL-DRV8301 motorware labs.
I used different ADC voltage and phase connections than the defaults so I updated those values in hal.c. I also updated the filter pole settings and iq and ADC full scale values according to the user guide. I changed the current feedback polarity to use positive feedback according to the UG. I kept the PWM outputs exactly the same.
I did the motor ID on a launchpad + BOOSTXL demo board so all the values are correct.
If I have the software recalculate current and voltage bias values, they are correct when compared with the expected values from the UG. However, when I try to run the motor, it takes much more current than it should and the motor heats up significantly and jerks back and forth instead of spinning.
I set the software to output constant duty cycle PWM for debugging by modifying value_sat in HAL_writePwmData using period over some value to set the duty cycle. I noticed that it had an inverted waveform from what I expected from the code. I removed the constant output PWM code and instead modified value_sat to use (period - value) to un-invert the waveform manually. This allows the motor to spin smoothly and draws a reasonable amount of current. The reported feedback is in the opposite direction as the reference though. I've rechecked the connections multiple times and I used the same EPWM1A high, 1B low, etc as in the BOOSTXL board.
I'm using a different mosfet driver but I've probed the connections and it's not inverting the outputs.
Do you know why this would happen? My fix seems more like a hack than a good solution. Also the oscilloscope output waveform has glitches every once in awhile and the motor doesn't start up consistently from 0 when I set the current reference positive instead of negative. And RSrecalc returns values that are much too low.
I tried using forceangle to start the motor which prevented the motor from starting at all until I modified the code to reverse the starting direction with respect to the reference. Now it starts about as well with forceangle as without it. If I give it a positive current reference it usually just vibrates instead of turning and displays feedback of 0.5krpm until I spin it up with my fingers.
Thanks,
Matthias