Hi,
I am trying to read current values from a Mauch Sensor with a custom STM32-based board for some project, but under motor load, the current values seem to jump with large errors.
However, when I hook the sensor to my Pixhawk Cube Orange, the current values are stable and reliable.
I am thinking that I might be misconfiguring my ADC.
Can anyone please let me know the following details:
What is the ADC clock frequency used for the current measurement battery monitor?
Does AP uses single measurement mode or continuous measurement mode?
What is the sampling rate used in terms of ADC cycles? For eg, 7.5 ADC cycles or what?
There is an awful lot of noise on the output from most current sensors created by motor switching. I usually add a lowpass filter with a pole frequency of around 5 Hz to the current sensor output.
not sure off hand but I’m pretty sure most of the peripherals, including the ADC, is fed an 80MHz system clock.
continuous
not sure
it uses DMA anywhere it possibly can, including ADC.
Back to your original problem, you’ll want to do a simple LowPassFilter (LPF) in analog and then likely also another one in digital that is much slower. How fast are you trying to sample?