This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8301 shunt amplifier gain programming

Other Parts Discussed in Thread: DRV8301, BOOSTXL-DRV8301, MOTORWARE

Where in the Instaspin libraries is the DRV8301 shunt amplifier gain configured?  I am experimenting with a new board which uses pretty much the same schematic as the BOOSTXL-DRV8301 but with components spec'd similarly to the DRV8301 High Current EVM.  Just to test this out I'm running lab 2c on it but I need to change the amplifier gain to 20.  Also, I am seeing massively erroneous Rs_ohm estimates (~2e+08) which may be because I haven't adjusted programmable gains yet while the external amplifier has a fixed gain.  I am attaching my user.h file in case it becomes useful.  I have only changed the voltage and current scaling - otherwise this is the same file I used to successfully identify this motor using the BOOSTXL-DRV8301.  Thanks in advance.

1488.user.h

  • Max,

    The default project for DRV8301 EVM (60V/40A) does NOT use the amplifier gain of the DRV8301. It uses external fixed amplifiers to have 3 matching gain circuits for current.

    The default project for DRV8301 BoosterPack DOES use the two amplifier gains of the DRV8301, plus a third external OPA (to enable over modulation if desired).

    Like most things in MotorWare, follow the circular path :)

    Essentially everything in the proj_lab##.c is independent of any MCU or Inverter configuration.  These are handled in the modules and drivers, and your first stop with these (if it isn't obviously somewhere else) is the

    hal.c / hal.h

    files under modules.  This is the interface file that ties the source code to the MCU to peripheral drivers to the Inverter.

    it will be worth your time to search the hal files for "drv" and "8301" and see what you find....you should find functions called in hal files that reside in the drivers\drvic\ path that help you understand how things are configured.  You can also DIFF the hal files for drv8301 EVM and drv8301 BOOST to see how these configurations might be different.

     

  • Thanks Chris.  Your response reminded me to update to Motorware 12 because I didn't yet have the hal files.  So now I have another question:

    I found the relevant parameter "GATE_ShuntAmpGain_10VpV" and changed it and then compiled and ran lab 2c in debug mode.  I tried to set Enable to 1 but for some reason it will either not enable or the variables do not update.  Switching back to Motorware 11 I found that Enable still works like usual.  Why might this be?  I am fine with using Motorware 11 for now but I want to make sure I don't have something screwed up in 12.

    Also, after updating to 20VpV I still had the problem and I realized the ADC inputs for current measurement from the DRV8301 amplifiers were ~0.  The external amplifier ADC value was reading as it should.  I seem to have some kind of hardware issue with the DRV8301 that I need to sort out.

  • Max,

    If using the DRV8301 EVM, changing the AmpGain will have NO effect, because the DRV8301 AMPS are not used at all. If nothing happens when you Enable it is likely because you have an Error. In MW _12 we added an error checking function regarding scaling/limits that doesn't allow you to run if it calculates an error.  Note the new documentation, load the proper proj_lab##.js into the expressions view, and you'll see the UserErrorCode variable.

    If you're a UNIVERSAL GUI user I'm in process of updating the GUI to incorporate this and a few other items.

     

  • Sorry Chris, I wasn't clear.  I do not have a DRV8301 High Current EVM.  I have a BOOSTXL-DRV8301 and a custom board which is the same as the BOOSTXL-DRV8301 in architecture but uses components spec'd adequately to match the voltage and current capability of the High Current EVM.  I know that the EVM doesn't avail itself of the on board amps. I have been comparing the behavior of the BOOSTXL and my board and finding that my board has not yet behaved quite right.

    I did have an error (I was seeing 11000000000 in the SPI RXBUF) and it's from the hardware issue which I think I have located.  So your explanation sounds like the right one.  Will try it out tomorrow.  Hopefully with that sorted out and the updated gain setting I should be functional, or at least asking new questions.  Thanks again, I'm going to call these mysteries solved.

  • Sorry Chris, have to revisit this one.  I have resolved the hardware issue I had and the DRV8301 is no longer faulting.  However, the motorware 12 version is not allowing me to turn System Enable on.  Edit:  The error I am seeing is USER_ErrorCode_RoverL_estFreq_Hz_High but I have the same parameters in user.h as I had when I successfully identified this motor with the BOOSTXL-DRV8301 before.  Seems odd.

  • Did you check the gMotorVars userErrorCode?

  • Yeah sorry I had amended my post above to include the error code (USER_ErrorCode_RoverL_estFreq_Hz_High) but I'm guessing you just saw the email update text.  I will also add that this error shows up with the BOOSTXL board or my own board.

  • You can search user.c to understand the logic of this error. You obviously have a very low full scale Frequency set. Have you followed the spreadsheet on how  to update the user.h scaling?

    What max speed is your motor (in Hz)?

    Set your RoverL to (100) for <= 1000 Hz full scale freq.

  • As usual, you are correct. And yes, I am using your spreadsheet but somehow I missed the R/L frequency parameter.  Got that in and fixed a few little hardware mistakes and this new board seems to work just like the BOOSTXL board.  I am seriously impressed that it still does a good job identifying a low inductance RC motor despite being set up for high current.  It actually gets a more accurate measurement of phase resistance than the boostxl board did.  I measured phase resistance at 74 mohms with a current-limited power supply and the new board matches that.  The BOOSTXL board would always estimate 49 mohms for some reason.

  • Our Rs is line to neutral, so it should be about half of your line to line. Measuring same as line to line makes me worried that you missed something in HW or configuration.

  • Actually I converted my line to line number I measured (150 mohms) to line to neutral for comparison purposes.  I am not measuring the same as line to line.