@@ -151,21 +151,27 @@ Since 0.3.0 all midpoint functions return the actual midPoint.
151151
152152- ** uint16_t setMidPoint(uint16_t midPoint)** sets midpoint for the ADC conversion.
153153Parameter must be between 0 and maxADC/2, otherwise midpoint is not changed.
154- - ** uint16_t autoMidPoint(float frequency = 50, uint16_t cycles = 1)** Auto midPoint,
155- assuming zero DC current or any AC current.
156- The function takes the average of many measurements during one or more full cycles.
157- Note the function therefore blocks for at least 2 periods.
158- By increasing the number of cycles the function averages even more measurements,
159- possibly resulting in a better midPoint. Idea is that noise will average out.
160- This function is mandatory for measuring AC.
161- - 0.2.2 frequencies other than 50 and 60 are supported.
162- - 0.2.8 the parameter cycles allow to average over a number of cycles.
163154- ** uint16_t getMidPoint()** read the value set / determined.
164155- ** uint16_t incMidPoint()** manual increase midpoint, e.g. useful in an interactive application.
165156Will not increase if midpoint equals macADC.
166157- ** uint16_t decMidPoint()** manual decrease midpoint.
167158Will not decrease if midpoint equals 0.
168159- ** uint16_t resetMidPoint()** resets the midpoint to the initial value of maxADC / 2 as in the constructor.
160+ - ** uint16_t autoMidPointDC(uint16_t cycles = 1)** Auto midPoint for DC only.
161+ Assuming zero DC current. To reduce the noise cycles must be increased even up to 100.
162+ This method is typically much faster for DC than the ** autoMidPoint(freq, cycles)**
163+ for the same number of cycles. (See issue #35 )
164+ - ** uint16_t autoMidPoint(float frequency = 50, uint16_t cycles = 1)** Auto midPoint, for any AC current or zero DC current.
165+ For DC one can use a high frequency e.g. 1000 Hz to reduce the time blocking.
166+ The function takes the average of many measurements during one or more full cycles.
167+ Note the function therefore blocks for at least 2 periods which is about
168+ 40 ms for 50 Hz.
169+ By increasing the number of cycles the function averages even more measurements,
170+ possibly resulting in a better midPoint. Idea is that noise will average out.
171+ This function is mandatory for measuring AC.
172+ - 0.2.2 frequencies other than 50 and 60 are supported.
173+ - 0.2.8 the parameter cycles allow to average over a number of cycles.
174+
169175
170176Since version 0.3.0 there is another way to determine the midPoint.
171177One can use the two debug functions.
@@ -393,23 +399,34 @@ The examples show the basic working of the functions.
393399
394400#### Must
395401
402+ - test more
403+ - other than the 20A module
404+ - 5, 10, 30, 50 ...
405+ - need to buy extra hardware
406+
396407
397408#### Should - 0.3.x
398409
410+ - investigate ** estimateMidPoint(confidence)** See issue #35
411+ - is less blocking by spreading the sampling over many calls.
412+ returning a confidence level.
399413- investigate noise suppression #21 (0.3.1 and later)
400414- investigate blocking calls:
401415 - ** mA_AC()** blocks for about 20 ms at 50 Hz.
402416 This might affect task scheduling on a ESP32. Needs to be investigated.
403417 Probably need a separate thread that wakes up when new analogRead is available?
404418 - RTOS specific class?
405- - ** detectFrequency(float)** blocks pretty long.
419+ - investigate ** detectFrequency(float)** blocks pretty long.
406420
407421
408422#### Could
409423
410424- merge ** mA_AC()** and ** mA_AC_sampling()** into one. (0.4.0)
411425 - or remove - depreciate - the worst one
412426- add range check to (all) set functions?
427+ - add unit test for ** autoMidPointDC()** (needed?)
428+ - ** setMidPoint()**
429+ - Q: could midpoint be set beyond maxADC? is there any use case?
413430
414431
415432#### Won't (unless requested)
0 commit comments