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

DDS238-2 Reactive Power wrong value #12283

Closed
12 of 14 tasks
sebitnt opened this issue Jun 3, 2021 · 4 comments
Closed
12 of 14 tasks

DDS238-2 Reactive Power wrong value #12283

sebitnt opened this issue Jun 3, 2021 · 4 comments
Assignees
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended

Comments

@sebitnt
Copy link

sebitnt commented Jun 3, 2021

PROBLEM DESCRIPTION

Hello,
I am using 9.4.0(sensors) with an DDS238-2 attached via Modbus. Everything is working as expected except for the Reactive Power which is displayed wrong (much too high). It seems to me that it is an issue with an 16bit value being rolled over. Thank you for your help in advance!

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): ESP07
  • Tasmota binary firmware version number used: 9.4.0
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: OTA
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Not necessary.

  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
 None

  • Provide the output of this command: Status 0:
  Not necessary.

  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Not necessary.

TO REPRODUCE

See description.

EXPECTED BEHAVIOUR

Calculate and show the correct value.

SCREENSHOTS

Tasmota_Reactive

ADDITIONAL CONTEXT

Nothing

(Please, remember to close the issue when the problem has been addressed)

@ascillato2 ascillato2 added the troubleshooting Type - Troubleshooting label Jun 3, 2021
@schrej-zz
Copy link

Hi,
I wonder, that noone already replied.
For me, it looks like we have a negative value overflow here.
Due to some effect like rounding, the value is negative, but the variable only expects positive values.
Haven't looked into the code yet, but I suggest to set the value to zero, when it becomes negative.
A negative value doesn't make sense indeed.
Joerg

@chaveiro
Copy link

chaveiro commented Jun 14, 2021

Check if this is the reason : #12114

@sebitnt
Copy link
Author

sebitnt commented Jun 17, 2021

I have done a few tests. The problem is only present when the power flow is backwards through the meter. Connecting it the other way, tasmota is reporting correct values. This seems to me to be a overflow of a unsigned variable. Reactive power might be negative but tasmota does not expect this.

@arendst
Copy link
Owner

arendst commented Jun 19, 2021

Thx for the investigation.

Tasmota does negative reactive power as can be seen here:

image

The issue is with the DDS2382 driver (xnrg_09_dds2382.ino - line 70) which decodes reactive power like:

      Energy.reactive_power[0] = (float)((buffer[33] << 8) + buffer[34]);

You might want to try the below change dline:

      Energy.reactive_power[0] = (float)(int16_t)((buffer[33] << 8) + buffer[34]);

@arendst arendst self-assigned this Jun 19, 2021
@arendst arendst added the fixed Result - The work on the issue has ended label Jun 20, 2021
@ascillato2 ascillato2 added bug Type - Confirmated Bug and removed troubleshooting Type - Troubleshooting labels Jun 21, 2021
Jason2866 added a commit to Jason2866/Tasmota that referenced this issue Jun 23, 2021
* Use Tasmota Core32

* Use Tasmota core 32

* Tasmota core32

* use esptoolpy V.3.1.0

* esptoolpy v.3.10 for solo1

* LITTLEFS is a lib in Tasmota core32

* Update platformio_tasmota32.ini

* Berry fix #102

* Fix wrong Json with PCF8574 sensor

Fix wrong Json with PCF8574 sensor (arendst#12088)

* Update RELEASENOTES.md

* Remove CCLoader from zigbee binary

* Enable CCLoader in binary tasmota-zigbee

* Esp32c3 fix wrong baudrate

* Esp32c3 fix template command and Web UI

* Add command ``MqttWifiTimeout 100..20000``

Add command ``MqttWifiTimeout 100..20000`` to control MQTT Wi-Fi connection timeout default set to 200 mS (arendst#12222)

* Berry report bug fix #106

* Fix NEO_RGBW

* Allow Captive Portal to be optional

* Fix Berry documentation link

* Improve behavior of color2 for unlinked RGBW and RGBWW lights

* LVGL

* tasmota32-lvgl.bin

* Remove exceptions in build flags

* No exceptions to build flags

* Use really new core

* Enable exceptions for bluetooth

* Fix BT build (need exceptions)

* Remove exceptions from BLE

* Berry improve inheritance #107

* RM exceptions extra handling BT

solved with PR arendst#12384

* Rm BT exceptions

* Bump version 9.5.0.1

* remove speed settings

* Force ESP32 defines Force ESP32 defines USE_UFILESYS, GUI_TRASH_FILE and #define GUI_EDIT_FILE

* FSMan: add file deletion confirmation

* fix RO translation file

* Update xsns_05_ds18x20_esp32.ino

* rm upload speed

* rm upload speed

* Add 4M board variants

* rm upload speed

* rm upload speed

* Try with override env:tasmota32_base

* rm duplicate lib_extra_dirs

* Override via [env]

* Create esp8266_zbbridge.json

* Use esp8266_zbbridge board

* Update platformio_override_sample.ini

* rm outdated info

* Update pt_BR.h

Update labels (Translate new ones and correct some old ones). Adjust to brazilian portuguese

* Ethernet fix for ESP32

* #define USE_WS2812 for lvgl build

* Fix GUI console initial update time

* Fix s2

* Berry added I2C_Driver class and patches

* Updated MPUxxx driver

* Add Partition Manager v0 in Berry

* Added features

* Speed up initial GUI console refresh

* Fix ESP32 Webcam add boundary marker before sending mjpeg image (arendst#12376)

* Update

* Fix DDS238-2 wrong reactive power value (arendst#12283)

* Remove ProgramFlashSize from ESP32 Gui

* Fix compilation when USE_UFILESYS is not defined

* Simplified configuration for ir-full, tasmota-ircustom no more needed

* Remove unwanted files

* Update changelog

* Fix build

* Fix build

* Berry simplify Driver class

* Add ESP-NOW hooks

* make override possible for flags

* More refactor Platformio

* wrong link to platform

Co-authored-by: Stephan Hadinger <stephan.hadinger@gmail.com>
Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Co-authored-by: Adrian Scillato <35405447+ascillato@users.noreply.github.com>
Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Barbudor <barbudor@barbudor.net>
Co-authored-by: Serge <60098151+Xjeater@users.noreply.github.com>
Co-authored-by: Jansen Arruda <jansen.arruda@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

5 participants