I'd like to extend the ADC (anain) module to use both ADC simultaneously. So the list of analog inputs is distributed over both ADCs
Code: Select all
ANA_IN_ENTRY(throttle1, GPIOC, 1) \
ANA_IN_ENTRY(throttle2, GPIOC, 0) \
ANA_IN_ENTRY(udc, GPIOC, 3) \
ANA_IN_ENTRY(tmpm, GPIOC, 2) \
ANA_IN_ENTRY(tmphs, GPIOC, 4) \
ANA_IN_ENTRY(uaux, GPIOA, 3) \
ANA_IN_ENTRY(il1, GPIOA, 5) \
ANA_IN_ENTRY(il2, GPIOB, 0)
Code: Select all
ANA_IN_ENTRY(throttle1, GPIOC, 1) \
ANA_IN_ENTRY(throttle2, GPIOC, 0) \
ANA_IN_ENTRY(il1_1, GPIOA, 5) \
ANA_IN_ENTRY(il2_1, GPIOB, 0)
ANA_IN_ENTRY(udc, GPIOC, 3) \
ANA_IN_ENTRY(tmpm, GPIOC, 2) \
ANA_IN_ENTRY(il1_2, GPIOA, 5) \
ANA_IN_ENTRY(il2_2, GPIOB, 0)
ANA_IN_ENTRY(tmphs, GPIOC, 4) \
ANA_IN_ENTRY(uaux, GPIOA, 3) \
ANA_IN_ENTRY(il1_3, GPIOA, 5) \
ANA_IN_ENTRY(il2_3, GPIOB, 0)
Now that both ADCs are running I'd also oversample the resolver. Like sin on ADC1, cos on ADC2, both sampled 4 times (or just 3 if the first sample is noisy again). And again simultaneously.
In FOC I'd try running the forward transformation 3 times (ilx_1-3) and take the average or median of the result. I think that can be more useful than filtering the AC values