This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: ADC sampling frequency different from feedback control loop frequency

Part Number: TMS320F280025C

I developed a code in which ePWM SOC is set to trigger ADC at a constant rate. ADC generates an interrupt upon conversion of the signal, and that interrupt is associated with an interrupt service routine (ISR) in which all the control calculations and PWM updates are performed. Actually, the problem is related with regulating the output voltage of DC-DC converter; output voltage is sensed through on chip ADC and PWM updates are performed through a PI controller in the feedback loop.

The issue is that noise level in the feedback signal is quite large hence ADC readings are not stable. In my control algorithm ADC generates an interrupt after each sample and control calculations are performed. But I want to average out certain number of ADC samples to remove the noise and then perform control action. One solution I came up with is to put a counter in the ISR  and add ADC readings in the previous value and then find average after certain number of samples let's say 100. 

Is there a more efficient way of doing this, i.e., read n ADC samples and then perform control action. In other words, what is the more efficient way of setting the sampling frequency of ADC and control loop frequency independently?

  • Hi,

    One approach could be to use the available 16 SOCs in an ADC instance to sample single channel and the 16 SOC result can then be averaged to get filtered output. The next trigger should be configured just after the 16th conversion is complete to enable sampling at regular intervals.

    Thanks

    Vasudha