raplin / DPS-1200FB

Python code to read status from the DPS-1200FB power supply
MIT License
125 stars 33 forks source link

Wrong temperature scaling, wrong MIN_AMPS_IN (maybe ?) #6

Open vankxr opened 3 years ago

vankxr commented 3 years ago

Hello, I recently got my hands in two HSTNS-PL18 (750W version of the PSU) and started reading out data and experimenting with this code. First thing I noticed is that the register named MIN_AMPS_IN should in fact be MAX_AMPS_IN. I guess you should have suspected it since the other two (power in & out) are also the maximum, and it makes no sense (for me) to keep track of the minimum input current. The second thing I noticed was the temperature scaling. 32 did not cut it for me, even interpreting the result as degrees Fahrenheit, it was reporting freezing temperatures (~10 C) which is way off. One can easily find the correct scaling factor by taking a close look at the disassembly. here you can see the variable that holds the temperature being multiplied by 0x40 (64) before being copied to the RAM location that corresponds to the temperature register. If you read the register and divide by 64 you will get the temperature in Celsius, which makes much more sense! (25.9 C intake temperature)

I also noticed a couple of other small things, like wrong current and power scaling, but I have yet to confirm those by attaching a big known load to the supply. With the provided input power scaling factor I was getting 25 W quiescent which sounds like a lot for a PSU of this quality, and also did not match with the value I got when dividing the Watt-second energy value by the uptime register value (I get 12.25 W, which is very suspect, close to 25/2), but then again, the scaling for the Watt-second could also be wrong. By, once again, looking at the disassembly we can see that the input power is capped to a minimum of 0x32 (50), I don't know why. Also, I am pretty sure that surprise_more_flags, bit 2 is set when the input power is < 50 and is cleared when > 50, so it may indicate that the supply is not loaded (?). The output power seems to be capped too, at 36, but there isn't a flag to signal that.

Also, since I prefer using NodeJS than Python, I ported the essentials out of this code and uploaded a gist, if anyone is interested https://gist.github.com/vankxr/a7acad10b0ddfe273724b21b2dd46c1d

raplin commented 3 years ago

Good stuff! Thanks

vankxr commented 3 years ago

Hi, in the meantime I also figured that the LSB value of register ON_SECONDS is actually 2s, so an additional /2 is needed to get seconds.