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.
However, some unexpected fluctuations were observed in the ADC sampling results if the ADC queue entry is triggered by GTM.
The difference in register configuration between the two tests are as follows:
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.
please could you also provide your channel and group configuration?
Why are you using GTM as trigger source?
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:
The related configuration in GTM is as follows:
Thank you for your help!
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....
Thank you for your response. We have cancelled the REFILL option and retained the EXT_TRIGGER option as follows:
With this configuration, the AD conversion was conducted just once. Similar description can be found in the manual.
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.
Besides, the priority is used for arbitration among different converting request source, rather than different groups.
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.
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.