lrswss/esp8266-wifi-power-meter

Revolutions not counted when using > 500 Watts

Closed this issue · 0 comments

Hi Lars,

I finally managed to get the power meter working correctly!

The final issue I ran into was revolutions not being counted when using a high amount of electricity.

Because calibration was working fine I figured the problem had to be in the rising edge detection.

Commenting out the two lines on row 105-106 of src/ferraris.cpp and using a 15ms sample rate fixed my problem.

I guess this is caused by my very fast spinning meter.

// try to find a rising edge in previous analog readings
static bool findRisingEdge() {
    uint16_t i, belowThresholdTrigger;
    uint8_t s = 1;
    uint16_t belowTh = 0;
    uint16_t aboveTh = 0;

    // reading interval min. 50ms
    //if (50 / settings.readingsIntervalMs > 1)
    //    s = 50 / settings.readingsIntervalMs;

    // min. number of pulses below threshold required to detect a rising edge
    belowThresholdTrigger = (settings.pulseDebounceMs / 2) / settings.readingsIntervalMs;

    i = ferraris.index > 0 ? ferraris.index : ferraris.size - 1;

I don't know how (or if) you want to resolve this issue, maybe a button on the advanced settings panel? Or turning off the minimum interval of 50ms when a fast spinning meter is configured?

Just let me know and I'll try to come up with a pull request.

Jelle