Unexpected sampling results in ADC using TC234

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AirXing
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hello! I am using TC234 (PG-TQFP-144-27 Package) for FOC of PMSM. Two AD channels are used for phase current sampling. A confusing problem occurs when testing the AD sampling results with 0 current.

In fact, two hall sensors are used as the current sensors. They offer 2.5V voltage to pin-35 and pin-51 of the chip (configured as AN0 and AN12) with 0 current. The voltage has been tested using oscilloscope, which is quite stable.

If the ADC queue entry immediately leads to a conversion request, the sampling results are stable, as shown in the following picture. The sampling results are 10000 continuous reading results of one ADC channel recorded by an array.

AirXing_0-1659594143201.png

 

However, some unexpected fluctuations were observed in the ADC sampling results if the ADC queue entry is triggered by GTM. 

AirXing_1-1659594241661.png

The difference in register configuration between the two tests are as follows:

AirXing_3-1659594739579.png

Other than this, all hardware and software status are the same. Please help me figure out the reasons. If this problem is not caused by software reasons, please tell me and I will deal with the problem with my hardware engineering. 

Thank you very much. Sincerely.

 

0 Likes
7 Replies
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

please could you also provide your channel and group configuration?
Why are you using GTM as trigger source?

Best regards,

TBencher

0 Likes

Thank you for your response.  We use GTM to generate the PWM signals, so it will contribute to the accuracy of phase current sampling if the trigger source is from GTM.

My ADC group and channel configuration is as follows:

AirXing_0-1659606296129.png

AirXing_1-1659606373318.png

AirXing_2-1659606533855.png

The related configuration in GTM is as follows:

AirXing_3-1659606638782.png

Thank you for your help!

 

 

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

This is way more information 😉 I assume there are no further loops involved.?

Best regards,

TBencher

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi again,

there some things which I currently not understand quite well. Both groups are masters and have highest priority...for example...

But if you setup your *_addToQueue function you use *_REFILL and (or) the *_EXT_TRIGGER option in your buggy out commented snippets. As far as I understand it, the REFILL option converts a series of input channels permanently and the EXT_TRIGGER option just upon request. Please try using just the EXT_TRIGGER option instead, just to see what happens....

 

Best regards,

TBencher

 

0 Likes

Thank you for your response. We have cancelled the REFILL option and retained the EXT_TRIGGER option as follows:

AirXing_0-1659678154441.png

With this configuration, the AD conversion was conducted just once. Similar description can be found in the manual. 

AirXing_1-1659678322017.png

As for your confusion about my configuration, we think the master group is just for the AD group which is configured, meaning that different AD group can have different master group. So it is OK to use the group itself as its master group.

AirXing_2-1659678583810.png

Besides, the priority is used for arbitration among different converting request source, rather than different groups. 

AirXing_3-1659678740208.png

In fact, I am not an experienced developer, so maybe I have some misunderstanding for the manuals. It is my great pleasure to communicate with you. And the unexpected sampling results are still bothering me. Looking forward to your further advice. Thank you very much.

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Hi,

I assume you put the out commented portions back into your program for testing. Anyway, I went through your program again. Having groups where all of them should be master, still surprise me, honestly. We should disassemble your program in order to get rid of everything which might not related to the problem. Hence, pls do the following:

1. Just define one group
2. Just use Queued Mode (no slot scan or background scan enabled), pls comment out your complete adcGroupConfig1
3. Don't use an array for your channel config, you don't use it elsewhere
4. Regarding queue enabling: Where did you put the adcGroupConfig.arbiter.requestSlotQueueEnabled = TRUE command in... I did not find it, but you surely need it
5. Where did you define your gating mode for queue request ?: e.g. adcGroupConfig.queueRequest.triggerConfig.gatingMode = ...

As for my understanding the queue must be started manually. I am not quite sure if this is also the case for external trigger mode, but give it a try: IfxVadc_Adc_startQueue(&yourGroup)

If this also doesn't help, please change trigger source for testing it. If this will work, we can go ahead and look for your GTM implementation.

Hopefully that helps.

 

Best regards,

TBencher

0 Likes
TBencher
Level 6
Level 6
25 solutions authored 25 likes received 5 questions asked

Please could you also provide the portion of code where you read out the conversion results?

Best regards,

TBencher

0 Likes