Could someone clarify 3 to 2 phase conversion in Analog Sensing for AC Motors eTPU function?

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

Could someone clarify 3 to 2 phase conversion in Analog Sensing for AC Motors eTPU function?

Jump to solution
487 Views
peterdufault
Contributor III

I'm still struggling to get AN3206 working on my own hardware.  Could someone clarify page 2 "Processes phase currents of a 3-phase motor." function description?

When I try to close the current loop on my motor it thinks it is generating torque (the D component is 0, the Q component is fixed) but the motor isn't turning.  There are four stationary locations where the motor will sit.  The first is at about -pi/5 from the 0 electrical position of the motor.   I can twist it by hand and get it spinning because it keeps falling into the next quadrant but it's obviously not working properly.

The alignment state now works fine.  I've also added a thread that sends a sine and cosine to the D and Q component in the align_start state and the motor will rotate and the three currents i_abc.{a,b,c} look OK - so it appears to be sensing the current OK.

If I see the {a,b,c} currents while it is rotating open-loop as above in the align_start state then do I have the ASAC function working OK?

I've tried FS_ETPU_ASAC_PHASE_CURR_USE_ALL, FS_ETPU_ASAC_PHASE_CURR_USE_AB_CALC_C, and FS_ETPU_ASAC_PHASE_CURR_USE SECTOR.  The final I use in conjunction with FS_ETPU_ASAC_CFIFO_UPDATE_ON.

I'm confused about when and how this UPDATE mode is used.  In my case there are shunt resistors for measuring all three legs of the current, and they swing both positive and negative, so I'm unclear as to why one needs the CFIFO slots changed.  I can understand wanting to use FS_ETPU_ASAC_PHASE_CURR_USE_AB_CALC_C to get a synchronous sample of {A, B, C}, but not what the "update" business is about.

I've attached a plot of what I'm seeing.   First is the alignment phase, and that looks correct.  Then there are what is going on at theta=0-pi/5 and other places.  The plot is the same for {0, 180} and {90, 270}.  Finally I've shown what happens if I force the motor to start to rotate when in this situation.

My setup works fine with BLDC commutation.  I've read back many of the signals, and the quadrature encoder, the angle calculation, the sector calculation, etc look fine.  It feels to me like some mess-up in calculating the third phase current, but the fact that I see all three phases OK when driving the motor open-loop by spinning the D-Q outputs is confusing.

Any help with explaining the ASAC Update mode or further suggestions on how to puzzle out what's up would be greatly appreciated.

0 Kudos
1 Solution
383 Views
peterdufault
Contributor III

The problem with my setup was that the B and C phases needed to be swapped.  The quadrature encoder theta was the opposite of the electrical theta.  Someone suggested it is wye versus delta winding - I don't know, but know things are behaving much better.

View solution in original post

0 Kudos
2 Replies
383 Views
peterdufault
Contributor III

I'll partially reply with what I've figured out so far.

I've set the ASAC function to use FS_ETPU_ASAC_PHASE_CURR_USE_SECTOR and FS_ETPU_ASAC_CFIFO_UPDATE_ON and then started spinning the motor by putting it in start_align state and then manually rotating the D-Q vector as a function of time.  I then read back nice sinusoids for the i_abc.{a,b,c} currents.  By dumping the location of the command queue I can see it cycling through the ADC commands:

[/wee] # mdump 0xc3fc8408 16 4

0xc3fc8408 01011700 03111800-01211900 81210F00 .........!...!..

[/wee] # mdump 0xc3fc8408 16 4

0xc3fc8408 01111800 03211900-01011700 81210F00 .....!.......!..

[/wee] # mdump 0xc3fc8408 16 4

0xc3fc8408 01211900 03011700-01111800 81210F00 .!...........!..


This corresponds to the sequence {ADC0-chanA, ADC1-chanB, ADC0-chanC}, {ADC0-chanB, ADC1-chanC, ADC0-chanA}, {ADC0-chanC, ADC1-chanA, ADC0-chanB}.  So it is properly cycling through the channels and calculating the third channel from the first two, since the currents I'm seeing look appropriate and the motor is nicely rotating (open loop, though). 

I think this open-loop test verifies the currents are being read properly, the angle and sectors are being calculated properly, and the PWM outputs are being created properly.

I've requested up-to-date versions of the source code from Freescale, since the versions from Ashware are obviously out of date.  Those older versions don't have many of the documented options in the new interfaces.  It will make it a lot easier if Freescale responds.

0 Kudos
384 Views
peterdufault
Contributor III

The problem with my setup was that the B and C phases needed to be swapped.  The quadrature encoder theta was the opposite of the electrical theta.  Someone suggested it is wye versus delta winding - I don't know, but know things are behaving much better.

0 Kudos