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

DPH5005 Amperage shown 10x too high #8

Open
waweic opened this issue Jun 29, 2020 · 3 comments · May be fixed by #11
Open

DPH5005 Amperage shown 10x too high #8

waweic opened this issue Jun 29, 2020 · 3 comments · May be fixed by #11

Comments

@waweic
Copy link

waweic commented Jun 29, 2020

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

@jirislaby
Copy link

jirislaby commented Oct 29, 2020

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.

@sanchosk
Copy link

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 :)

@Sylensky Sylensky linked a pull request Feb 25, 2022 that will close this issue
@jnettlet
Copy link

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))

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

Successfully merging a pull request may close this issue.

4 participants