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

How is POW calibration working? #223

Closed
jdpiguet opened this issue Mar 18, 2017 · 3 comments
Closed

How is POW calibration working? #223

jdpiguet opened this issue Mar 18, 2017 · 3 comments
Labels
bug Type - Confirmated Bug help needed Action - Asking for help from the community

Comments

@jdpiguet
Copy link

jdpiguet commented Mar 18, 2017

Hi all,

I'm using Tasmota rev. 4.0.6
I have read the wiki about the POW calibration.
The indicated voltage was 220 Volts, the measured one (multimeter) was 235.
I have send the command:
mosquitto_pub -h domoticz.lan -i testPublish -t cmnd/powe8a718/HlwUcal, -m '10'
Now the console log is showing:tele/powe8a718/INFO3 {"Started":"Fatal exception:0 flag:2 (EXCEPTION) epc1:0x40107345 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x000

What should be the value for the HlwUcal in my case?
How to calculate the other calibration values?
Is it possible to reset the configuration to "factory defaults"?

Regards, Jacques-D.

PS1: After try and test I have use the value "2050" which gives now a voltage value near the measured one (< 1 Volt difference), but to get it by calculation?
PS2: @arendst if you need I could help updating the wiki...

@khcnz
Copy link

khcnz commented Mar 18, 2017

Just had a quick look in source - I think the answer is:

The default scaling value is
#define HLW_UREF_PULSE 1950 // was 1666us = 600Hz = 220V

So, if sonoff is reporting 220v for an actual 235 the scaling would therefore be (1950*235/22) that answers to 2082.

And yes, it would be great to start a page on the wiki

@jdpiguet
Copy link
Author

Thanks @khcnz , it's a good hint.
Actually, after roughly 1 hour of measurement/correction cycles, I have reach the value 2039
Measurements were oscillating between 230 and 238 Volts
I'm still a bit confused on the formula.
I'm waiting for a second POW and will put results here....

@arendst
Copy link
Owner

arendst commented Mar 18, 2017

@jdpiguet yes feel free to update the wiki with your valued information. I've updated the wiki too with default and (future - released in next version) minimum values.

To prevent further exceptions I'll update the minimal values for hlwpcal, hlwucal and hlwical.

@arendst arendst added help needed Action - Asking for help from the community bug Type - Confirmated Bug labels Mar 18, 2017
arendst added a commit that referenced this issue Mar 19, 2017
4.0.7 20170319
* Increased Sonoff Led PWM frequency from 432 to 1000
* Fix possible watch dog reboot after changing module type on web page
* Fix reporting of GPIO usage from web page
* Fix Sonoff Led blank during firmware upgrade
* Fix Sonoff Led flicker and possible flash corruption by using latest
Arduino-esp8266 versions
*   of pwm core files included in sonoff library (#211)
* Add PWM output control with commands PWM1 to PWM5 using user
selectable GPIOs (#211)
* Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal
(1000) and HlwICal (2500) (#223)
* Add Switch state to sensor status (#227, #233)
* Add user configuarble GPIO to module Sonoff Touch (#228)
* Add define WEB_PORT to user_config.h to change default web server port
from 80 (#232)
* Fix failed Ota Firmware upgrade started from Web page (#235)
@arendst arendst closed this as completed Mar 23, 2017
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
4.0.7 20170319
* Increased Sonoff Led PWM frequency from 432 to 1000
* Fix possible watch dog reboot after changing module type on web page
* Fix reporting of GPIO usage from web page
* Fix Sonoff Led blank during firmware upgrade
* Fix Sonoff Led flicker and possible flash corruption by using latest
Arduino-esp8266 versions
*   of pwm core files included in sonoff library (arendst#211)
* Add PWM output control with commands PWM1 to PWM5 using user
selectable GPIOs (arendst#211)
* Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal
(1000) and HlwICal (2500) (arendst#223)
* Add Switch state to sensor status (arendst#227, arendst#233)
* Add user configuarble GPIO to module Sonoff Touch (arendst#228)
* Add define WEB_PORT to user_config.h to change default web server port
from 80 (arendst#232)
* Fix failed Ota Firmware upgrade started from Web page (arendst#235)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug help needed Action - Asking for help from the community
Projects
None yet
Development

No branches or pull requests

3 participants