Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of Parameter Range #3025

Open
demenzio opened this issue Apr 6, 2024 · 11 comments
Open

Change of Parameter Range #3025

demenzio opened this issue Apr 6, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@demenzio
Copy link

demenzio commented Apr 6, 2024

The Feature

In an earlier version, there was no limit for the value entered in the “Analog/Digital Transition Start” item.

Now I have tweaked the configuration again. But now I have the problem, that I can no longer enter the correct value for me, because the allowed limit is between 6.0-9.9.

For me, however, it is now the case that the first digit before the decimal point starts to rotate at 0.50 and finishes rotating at 0.59/0.60.

That's why from 0.6+ I get one m^3 too much and later a negative value.

@demenzio demenzio added the enhancement New feature or request label Apr 6, 2024
@SybexX
Copy link
Collaborator

SybexX commented Apr 6, 2024

You can edit/remove this limitation by editing the edit_config.html with a text editor.
Then simply set the two values ​​to your desired ones.
AnalogDigitalTransitionStart

@caco3
Copy link
Collaborator

caco3 commented Apr 6, 2024

Or even easier, edit the config file directly.

I understand that the limitation is annoying for you, but it is there as a guidance for less experienced users.
How ever I could accept to change the min value from 6.0. to 5.0.

@demenzio
Copy link
Author

demenzio commented Apr 9, 2024

Well that would have been a way faster way. Next time I will do that. :)
I changed the following files as shown above:

  • edit_config.html
  • edit_config_template.html

It is not my main problem. I just thought it would be the main cause of the false post-processing.

I waited for it to go up to 0.5+ and that happened to day, but it is still the same issue:

Values

As you can see, it calculates a wrong value in post-processing. It needs to be corrected to 299, because the first digit is already fully turned (turning cycle between 0.5-0.6).

An now I don't know what setting to set.

Found someone with a similar issue

Config:

[TakeImage]
;RawImagesLocation = /log/source
WaitBeforeTakingPicture = 5
;RawImagesRetention = 15
Demo = false
Brightness = 0
Contrast = 0
Saturation = 0
Sharpness = 0
LEDIntensity = 22
ImageQuality = 12
ImageSize = VGA
Zoom = false
ZoomMode = 0
ZoomOffsetX = 0
ZoomOffsetY = 0
Grayscale = false
Negative = false
Aec2 = false
AutoExposureLevel = 0
FixedExposure = false

[Alignment]
InitialRotate = 184.4
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
AlignmentAlgo = default
FlipImageSize = false
/config/ref0.jpg 167 247
/config/ref1.jpg 303 92

[Digits]
Model = /config/dig-cont_0620_s3_q.tflite
CNNGoodThreshold = 0.5
;ROIImagesLocation = /log/digit
;ROIImagesRetention = 3
main.dig1 211 157 20 36 false
main.dig2 241 157 20 36 false
main.dig3 271 157 20 36 false
main.dig4 301 157 20 36 0
main.dig5 331 157 20 36 0

[Analog]
Model = /config/ana-cont_1208_s2_q.tflite
;ROIImagesLocation = /log/analog
;ROIImagesRetention = 3
main.ana1 399 217 71 71 false
main.ana2 363 300 71 71 false
main.ana3 279 334 71 71 false
main.ana4 190 296 71 71 false

[PostProcessing]
main.DecimalShift = 0
main.AnalogDigitalTransitionStart = 5
PreValueUse = true
PreValueAgeStartup = 720
main.AllowNegativeRates = false
main.MaxRateValue = 0.3
;main.MaxRateType = AbsoluteChange
main.ExtendedResolution = false
main.IgnoreLeadingNaN = true
ErrorMessage = true
CheckDigitIncreaseConsistency = false

@SybexX
Copy link
Collaborator

SybexX commented Apr 9, 2024

Once you have edited the edit-config.html, you don't need to change anything in the config.ini
edit_config_template.html is only needed to build the edit_config.html and is not used/required by the ESP32-Cam

@Slider0007
Copy link
Collaborator

Slider0007 commented Apr 10, 2024

It is not sufficient to change limits in HTML part only because it's limited in firmware as well.

if ((eval_predecessors>=6 && (numeral_preceder>analogDigitalTransitionStart || numeral_preceder<=0.2) && roundedUp)) {

I did some tests with this part of logic in this branch:
https://github.com/jomjol/AI-on-the-edge-device/commits/analog-digit-early-digit-test/
I lowered the limit to 3 for testing purpose. Additionally I added some logic to potentially handle such a situation where last digit zero crosses to early: #3028

@haverland: This could be evaluated further and possibly added to firmware. While the lenghty discussion with rainman I added some test cases in the branch mentioned above. Maybe you can have a look to it.

@haverland
Copy link
Collaborator

It is not sufficient to change limits in HTML part only because it's limited in firmware as well.

if ((eval_predecessors>=6 && (numeral_preceder>analogDigitalTransitionStart || numeral_preceder<=0.2) && roundedUp)) {

I did some tests with this part of logic in this branch: https://github.com/jomjol/AI-on-the-edge-device/commits/analog-digit-early-digit-test/ I lowered the limit to 3 for testing purpose. Additionally I added some logic to potentially handle such a situation where last digit zero crosses to early: #3028

@haverland: This could be evaluated further and possibly added to firmware. While the lenghty discussion with rainman I added some test cases in the branch mentioned above. Maybe you can have a look to it.

Looks good. All tests are fine. I found no uncommented test cases. So I think it should be ok.

But I don't understand what it means when analogDigitalTransitionStart can take any value between 0 and 10.

@SybexX
Copy link
Collaborator

SybexX commented Apr 15, 2024

@Slider0007
Copy link
Collaborator

Slider0007 commented Apr 16, 2024

@haverland

But I don't understand what it means when analogDigitalTransitionStart can take any value between 0 and 10.

To be on the safer side I'd suggest to release only from 3-10. This is how the branch is prepared. I assume most meter should be covered with this range.

BTW: Unfortunately the parameter name is a bit misleading, because actually it is and was already programmed differently (Not the start of transition is relevant (like the name suggests), but when last digit reaches uncertainty region > x.8). Therefore in my opinion at least the documentation should be adpated as well.

@haverland
Copy link
Collaborator

Any suggestion for another name. Technically its correct, because we need to know the start of the transition phase of the digit.

@Slider0007
Copy link
Collaborator

Slider0007 commented Apr 16, 2024

Any suggestion for another name.

That's a good question :-) Maybe more generic "Analog Digit Sync Value".

Technically its correct, because we need to know the start of the transition phase of the digit.

This is what I also thought but as far I can see it's seems not coded like this, because the respective part of code is only active whenever the digit reaches >=x.8 due to the roundedUp flag.

Code in actual develop:

if ((eval_predecessors>=6 && (numeral_preceder>analogDigitalTransitionStart || numeral_preceder<=0.2) && roundedUp)) {

@haverland
Copy link
Collaborator

"Analog Digit Sync Value" is good. Alternatively "Analog Digit Shift" ?

Yes the code should not work, but it did in the test cases. I will have a deeper look on it next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants