rdserialtool icon indicating copy to clipboard operation
rdserialtool copied to clipboard

DPH5005 Amperage shown 10x too high

Open waweic opened this issue 4 years ago • 3 comments

Setting:  4.20V,  1.000A (CC)
Output (on) :  3.67V, 10.02A,   3.67W
Input: 29.27V, protection: good
Brightness: 4.0/5, key lock: on
Model: 5205.0, firmware: 16.0
Collection time: 2020-06-29 17:35:37.914103

This just doesn't add up. I may have a look into it later, can't say for sure

waweic avatar Jun 29 '20 17:06 waweic

Seeing the very same on 3005:

Setting: 10.50V,  0.015A (CC)
Output (on) :  9.41V ,  0.14A ,   0.13W 
Input: 37.02V , protection: good
Brightness: 4.0/5, key lock: off
Model: 3005.0, firmware: 14.0
Collection time: 2020-10-29 08:56:42.323426

The device's display shows 0.014 A.

jirislaby avatar Oct 29 '20 07:10 jirislaby

I found the root cause on 6006. In the file rdserialtool/rdserial/dps/init.py find the lines 'amps': { 'description': 'Output amps', 'register': 0x03, **_simple_int(100), }, change the **_simple_int(100) to **_simple_int(10). Do sudo setup.py clean followed by sudo setup.py install and voila - your current shows and logs OK :)

sanchosk avatar Jun 14 '21 19:06 sanchosk

Just for posterity's sake I was seeing an incorrect Amp output reading on my DPS5005 and firmware version reporting with firmware revision 1.4. I have no idea if this is firmware specific, or device specific.

Here is my diff to fix the output

diff --git a/rdserial/dps/__init__.py b/rdserial/dps/__init__.py
index 042533f..28751bc 100644
--- a/rdserial/dps/__init__.py
+++ b/rdserial/dps/__init__.py
@@ -45,7 +45,7 @@ class DPSDeviceState:
             'amps': {
                 'description': 'Output amps',
                 'register': 0x03,
-                **_simple_int(100),
+                **_simple_int(1000),
             },
             'watts': {
                 'description': 'Output watts',
@@ -90,7 +90,7 @@ class DPSDeviceState:
             'firmware': {
                 'description': 'Device firmware',
                 'register': 0x0c,
-                **_simple_int(),
+                **_simple_int(10),
             },
             'group_loader': {
                 'description': 'Group loader',
diff --git a/rdserial/dps/tool.py b/rdserial/dps/tool.py
index 39d23f0..b3cd2b0 100644
--- a/rdserial/dps/tool.py
+++ b/rdserial/dps/tool.py
@@ -159,7 +159,7 @@ class Tool:
             device_state.setting_amps,
             ('CC' if device_state.constant_current else 'CV'),
         ))
-        print('Output {:5}: {:5.02f}V{}, {:5.02f}A{}, {:6.02f}W{}'.format(
+        print('Output {:5}: {:5.02f}V{}, {:5.03f}A{}, {:6.02f}W{}'.format(
             ('(on)' if device_state.output_state else '(off)'),
             device_state.volts,
             self.trend_s('volts', device_state.volts),
@@ -178,7 +178,7 @@ class Tool:
             'on' if device_state.key_lock else 'off',
         ))
         if hasattr(device_state, 'serial'):
-            print('Model: {}, firmware: {}, serial: {}'.format(device_state.model, device_state.firmware, device_state.serial))
+            print('Model: {}, firmware: {:2.01f}, serial: {}'.format(device_state.model, device_state.firmware, device_state.serial))
         else:
             print('Model: {}, firmware: {}'.format(device_state.model, device_state.firmware))
         print('Collection time: {}'.format(device_state.collection_time))

jnettlet avatar Dec 12 '22 09:12 jnettlet