Skip to main content
Associate
Solved

STPM32 – settling time after reset (RMS, DC-removal HPF, ZCR)

Hello,

 

we plan to power the STPM32 only briefly at each measurement (every ~2 s),

so we need its settling time after power-up/reset, which is not in the

datasheet (DS10272 Rev 14).

 

On the EVALSTPM32 (12 V AC 50 Hz on L/N, default configuration after a

global reset) we measured:

- V1 RMS within 1% after ~400 ms, with or without the DC-removal HPF;

- with the HPF enabled, a DC of ~2 V (at the input) in V1 Data that decays

 to < 0.1 V only after ~1.7 s, although the datasheet states -3 dB at 8 Hz;

- the same DC shifts the ZCR edges (rising and falling in opposite

 directions) until it has decayed.

 

Questions:

1. After power-up (EN) or a global reset, how long should we wait before the

  RMS values and the ZCR output are accurate? Is there a typical or

  guaranteed value?

2. The DC-removal filter is specified at -3 dB at 8 Hz, but at start-up it

  takes ~1.7 s to remove a ~2 V offset. Why is it so slow? Does the offset

  come from the analog front end settling after reset? Is there a setting

  to make it faster?

3. When the filter is bypassed (BHPFV1 = 1), does it keep running in the

  background? In our tests, when we re-enabled it, the offset disappeared

  immediately.

 

Thank you!

Didier HERROUIN
Didier HERROUINBest answer
ST Technical Moderator

Dear CMehm,

Concerning the RMS value, the period of time used to calculate RMS value is a sliding window of 200ms. And at initial starting, it will take 200ms setting time from 10 to 90% of the steady levels (according to commonly used definition of rise and fall times for asymptotic curves) and the 0.1% RMS accuracy is reached in 400ms.

Nevertheless, I recommend at least 1s before getting a stable value.
I did not test the use case with a DC present at start-up, but there is no way to make it faster. I will test the ZCR behavior and I will let you know.

When BHPFV is disabled, it does not run in the background, I assume that it is quicker because all the internal block are already in a steady state. Note that BHPFV should not be disabled if you want to measure AC signals, as the ADC intrinsic offset will introduce an error in the calculated energy.

Best regards,

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.

6 replies

Didier HERROUIN
Didier HERROUINBest answer
ST Technical Moderator

Dear CMehm,

Concerning the RMS value, the period of time used to calculate RMS value is a sliding window of 200ms. And at initial starting, it will take 200ms setting time from 10 to 90% of the steady levels (according to commonly used definition of rise and fall times for asymptotic curves) and the 0.1% RMS accuracy is reached in 400ms.

Nevertheless, I recommend at least 1s before getting a stable value.
I did not test the use case with a DC present at start-up, but there is no way to make it faster. I will test the ZCR behavior and I will let you know.

When BHPFV is disabled, it does not run in the background, I assume that it is quicker because all the internal block are already in a steady state. Note that BHPFV should not be disabled if you want to measure AC signals, as the ADC intrinsic offset will introduce an error in the calculated energy.

Best regards,

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
CMehmAuthor
Associate

Hello,

thank you, your RMS figures match our measurements. Looking forward to
your results on the ZCR.

Best regards,

Didier HERROUIN
ST Technical Moderator

Dear CMehm,

I am confused about ZCR measurement.

Indeed, at power up, using the default configuration as you mentioned, you will not get the zero-crossing signal on CLKOUT/ZCR pin but the sampling clock (7.8125 kHz).  If you want to get the ZCR signal, you must first configure the register DSP_CR3, so there will be a delay in all cases.

Note that in steady conditions, the ZCR will always be delayed by 5.1ms vs the original 50Hz zero-crossing.

Best regards,

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
CMehmAuthor
Associate

Thank you for the clarification. We already enable the ZCR in DSP_CR3 right after power-up, and we also measured the 5.1 ms delay.

My question was about the DC at start-up: while the high-pass filter is still settling after power-up, can the residual DC shift the ZCR edges? If so, how long after power-up are the ZCR edges stable?

A confirmation would be very useful for us.

Best regards,

Didier HERROUIN
ST Technical Moderator

Dear CMehm,

After testing 12VAC + 2VDC on L-N inputs we couldn’t reproduce the issue. The ZCR switched almost instantly after the ZCR_OUT command and without any sign shift.

Best regards,

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
CMehmAuthor
Associate

Dear  Didier HERROUIN,
thank you very much for the test. This confirms that the ZCR is usable right after enabling it, even while the DC offset is still settling.
Best regards,