2025-03-09 11:26 AM
Hello,
We are working on an induction heater design using an STM32G4 MCU, where we need to measure the coil current via the ADC. The system operates with a half-bridge switching frequency of 30kHz.
At lower frequencies, the current waveform is triangular, while near the resonant frequency, it becomes sine-shaped.
We attempted to calculate the RMS current by finding the peak from ADC readings and applying the formula
but it's not giving consistent results due to waveform shape variations as well as ADC sampling is synchronized with the PWM cycle, and we're still facing inconsistencies in RMS measurement.
Questions:
What is the best method to accurately calculate RMS current from ADC samples for both triangular and sinusoidal waveforms?
Any recommendations for ADC configuration or data processing techniques to improve measurement accuracy?
Any guidance or code references would be greatly appreciated!
Thank you.
2025-03-09 12:15 PM
RMS is "Integral value", so the more points in data pull over specified period of time - the better. Run ADC as fast as possible, calculate sum over period of measured freq. Oversampling inside ADC is a good feature to save uCPU workload