Setting up scaling etc. for PMSM vector control on eTPU with customer motor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting up scaling etc. for PMSM vector control on eTPU with customer motor

430 Views
peterdufault
Contributor III

I'm trying to control a customer motor using the approach in AN3206, but I'm having trouble scaling the quantities and setting things up.

I have controlled the setup as a BLDC motor using Hall detectors, so the setup is working, but I can't get past the ALIGN part of the example.

The ADC Vref is set to 2.5V, so below 0V corresponds to 2.5V VREF.

The currents come in with {-3.125A ... 0 ... 3.125A} mapped to {-2.5 ... 0V ... 2.5}

The bus voltage is 24V and is comes in with {0V ... 24V} mapped to {0V ... 2.4V}.

The way I thought this should work is:

  • Phase current range in mA: 3125 (3.125A is 7FFFFF);
  • DC bus voltage range in mA: 25000 (25.0V is7FFFFF);
  • Phase current option should be FS_ETPU_ASAC_PHASE_CURR_USE_AB_CALC_C (I assume the demo board uses 2 shunt resistors?)
  • CFIFO update should be FS_ETPU_ASAC_CFIFO_UPDATE_OFF (since I'm calculating C from A and B)
  • Sign extension should be turned on in the ADC conversion?  It isn't in the example program.
  • Negate phase currents should be FS_ETPU_ASAC_PHASE_CURRENTS_POS (example program is NEG).

However, I never get any output during the ALIGN_START ... ALIGN_FINISH  steps.  The duty cycle is always 50%.

The u_dq D output is a reasonable value, but the u_ab output is always {0, 0}.

Any suggestions on how to debug this or additional info I can give?

0 Kudos
2 Replies

348 Views
peterdufault
Contributor III

I said:

"However, I never get any output during the ALIGN_START ... ALIGN_FINISH  steps.  The duty cycle is always 50%.

The u_dq D output is a reasonable value, but the u_ab output is always {0, 0}.

Any suggestions on how to debug this or additional info I can give?"


The second PMSMVC thread that does the backward park transformation and the DC bus elimination isn't running.  That might explain why I see u_dq non-zero but u_ab zero.  If I then force an align finish I see the second thread run, but of course the motor isn't aligned.


What lets the second thread run?

0 Kudos

348 Views
peterdufault
Contributor III

I said:

"The second PMSMVC thread that does the backward park transformation and the DC bus elimination isn't running.  That might explain why I see u_dq non-zero but u_ab zero.  If I then force an align finish I see the second thread run, but of course the motor isn't aligned.

What lets the second thread run?"


I found the source code for the eTPU function at the Ashware site and see that when PMSMVC_PID_OFF is in effect it jumps directly to the PMSMVC_INV_PARK_TRANSFORMATION section of the code in the first thread, so all work is done in a single thread.  I'm still stuck with the 50% duty cycle during the ALIGN_START state of the application.


Any suggestions would be greatly appreciated.

0 Kudos