Field oriented control : ADC sample delay

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

Field oriented control : ADC sample delay

486 Views
JeremyC
Contributor I

Hello,

I work on the example design MBDT AN13902. This motor algorithm works at 10kHz, so ADC and PWM are synchronous.

The AN13767 is the same SW without MBDT. And in this application note, we can see the ADC samples are processed directly during the ""FOC calculation". So, during the same 100µs time.

 

JeremyC_1-1770042316284.png

I added a comparator on the same ADC input to trig a GPIO when the signal is above its middle value. And see a delay of 224µs between the theoretical trigger (the physical signal) and the output GPIO signal, so more than 2 loop times. (We know a GPIO can rise and fall multiple times in the same 100µs, so its rise time is almost negligible)

JeremyC_3-1770042712982.png

This time is the minimal time achievable, because the input ADC signal is not synchronous to the ADC, the real delay varies from 224µs to 324µs. But keep in mind 224µs is the real delay.

Do you know a reason which could explain this ?

Best regards

Jérémy

 

0 Kudos
Reply
1 Reply

376 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

from the description I am not fully sure how your measurement is done, which signals are used.
According AN13767 and its project setting, The BCTU list contains 4 items, 2 parallel conversions are done on ADC0/ADC1. This is triggered by eMIOS0 ch4 flag, at falling edge of ch4 output signal. The Bctu_FIFO1_WatermarkNotification is called after those 4 conversions are done and result stored onto FIFO1. So you can add some GPIO setting/toggling into this notification and measure this with respect of eMIOS0 ch4 output. This should be within 100us period and notification delay much less.

BR, Petr

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2304712%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EField%20oriented%20control%20%3A%20ADC%20sample%20delay%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2304712%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20work%20on%20the%20example%20design%20MBDT%20AN%3CSPAN%20class%3D%22%22%3E13902.%20This%20motor%20algorithm%20works%20at%2010kHz%2C%20so%20ADC%20and%20PWM%20are%20synchronous.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20AN13767%20is%20the%20same%20SW%20without%20MBDT.%20And%20in%20this%20application%20note%2C%20we%20can%20see%20the%20ADC%20samples%20are%20processed%20directly%20during%20the%20%22%3CSPAN%3E%22FOC%20calculation%22.%20So%2C%20during%20the%20same%20100%C2%B5s%20time.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JeremyC_1-1770042316284.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JeremyC_1-1770042316284.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JeremyC_1-1770042316284.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F375172iEA3B70066EDC5A21%2Fimage-dimensions%2F700x489%3Fv%3Dv2%22%20width%3D%22700%22%20height%3D%22489%22%20role%3D%22button%22%20title%3D%22JeremyC_1-1770042316284.png%22%20alt%3D%22JeremyC_1-1770042316284.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20added%20a%20comparator%20on%20the%20same%20ADC%20input%20to%20trig%20a%20GPIO%20when%20the%20signal%20is%20above%20its%20middle%20value.%20And%20see%20a%20delay%20of%20224%C2%B5s%20between%20the%20theoretical%20trigger%20(the%20physical%20signal)%20and%20the%20output%20GPIO%20signal%2C%20so%20more%20than%202%20loop%20times.%20(We%20know%20a%20GPIO%20can%20rise%20and%20fall%20multiple%20times%20in%20the%20same%20100%C2%B5s%2C%20so%20its%20rise%20time%20is%20almost%20negligible)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JeremyC_3-1770042712982.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JeremyC_3-1770042712982.png%22%20style%3D%22width%3A%20317px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22JeremyC_3-1770042712982.png%22%20style%3D%22width%3A%20317px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F375173i28C063DBFECD3282%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JeremyC_3-1770042712982.png%22%20alt%3D%22JeremyC_3-1770042712982.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20time%20is%20the%20minimal%20time%20achievable%2C%20because%20the%20input%20ADC%20signal%20is%20not%20synchronous%20to%20the%20ADC%2C%20the%20real%20delay%20varies%20from%20224%C2%B5s%20to%20324%C2%B5s.%20But%20keep%20in%20mind%20224%C2%B5s%20is%20the%20real%20delay.%3C%2FP%3E%3CP%3EDo%20you%20know%20a%20reason%20which%20could%20explain%20this%20%3F%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EJ%C3%A9r%C3%A9my%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2315537%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Field%20oriented%20control%20%3A%20ADC%20sample%20delay%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2315537%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Efrom%20the%20description%20I%20am%20not%20fully%20sure%20how%20your%20measurement%20is%20done%2C%20which%20signals%20are%20used.%3CBR%20%2F%3EAccording%26nbsp%3B%3CSPAN%3EAN13767%20and%20its%20project%20setting%2C%20The%20BCTU%20list%20contains%204%20items%2C%202%20parallel%20conversions%20are%20done%20on%20ADC0%2FADC1.%20This%20is%20triggered%20by%20eMIOS0%20ch4%20flag%2C%20at%20falling%20edge%20of%20ch4%20output%20signal.%20The%26nbsp%3BBctu_FIFO1_WatermarkNotification%20is%20called%20after%20those%204%20conversions%20are%20done%20and%20result%20stored%20onto%20FIFO1.%20So%20you%20can%20add%20some%20GPIO%20setting%2Ftoggling%20into%20this%20notification%20and%20measure%20this%20with%20respect%20of%26nbsp%3BeMIOS0%20ch4%20output.%20This%20should%20be%20within%20100us%20period%20and%20notification%20delay%20much%20less.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBR%2C%20Petr%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E