Enabling ADC Averaging for ADC Conversion

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

Enabling ADC Averaging for ADC Conversion

1,665 Views
derekcook
Senior Contributor I

Hello, 

I am wanting to try enabling ADC averaging instead of the instantaneous sample for the Phase Current and DC Bus ADC channels. I see averaging is enabled during configuration, but then disabled. I would like to try enabling averaging to see if it cleans up some of my ADC sampling. 

Is this even possible, or will it impact the timing of KMS? 

Labels (1)
0 Kudos
3 Replies

1,361 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

The ADCx_SC3[AVGE][AVGS] can be used to enable and configure hardware average function.

hardware average.png
The Hardware average function will increase resulting conversion time, you need to notice whether the time delay between two ADC sample will affect motor control.

31.4.3.6.2 Long conversion time configuration.png

I don't know why you want to use hardware average function. If you are troubled by accuracy problem, AN4373 Cookbook for SAR ADC Measurements maybe help.

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,361 Views
linestream-adam
Senior Contributor I

I don't recommend setting up averaging on the ADC samples. By increasing the amount of time between the A & B samples of the ADCs, this will cause some imbalance since the phase currents are further separated in time. On the whole I don't expect it will have much impact on the general timing of PWM, ADC, ISR. Where you will see an issue is at high modulations. When you are running in higher and higher modulations there is less and less time available to sample the currents. So if you are taking longer to sample the currents this will raise the minimum modulation where a valid sample can be gathered.

It is enabled is when the ADC is calibrated at power up and not at run time. If you want to go down this road you will need to setup averaging in the ADC registers (in ADCS_init & ADCS_getUserSamples [when the ADC is re-configured]) and increase the PDB delay between the A & B samples.  

Are you still concerned about the slight imbalance in the phase current RMS? I think you need to look at the electrical side of the problem first. Additionally, you should capture the raw phase current samples and manually calculate the RMS on that (using the more typical method). This should confirm that there is no underlying issue with the KMS system and merely an RMS calculation problem.

0 Kudos

1,361 Views
derekcook
Senior Contributor I

Hey Adam, 

The imbalance was also found on the ADC inputs. After investigation, it seems that we have a layout issue with our Analog Phase A, B and C current. 

Thanks for the help!

0 Kudos