ngscopeclient / scopehal

Test and measurement hardware abstraction library and protocol decodes. This is the library only. Most users should use scopehal-apps.
BSD 3-Clause "New" or "Revised" License
190 stars 86 forks source link

Manson (BK Precision) power supplies #858

Open rgov opened 6 months ago

rgov commented 6 months ago

The BK Precision 9103/9104 power supply supports a serial protocol described in the Programming Manual.

The protocol uses CR line endings. Each successful command receives a reply of OK\r. Volts and amps are multiplied by 100. Here are examples of the basic commands. Note the magic 3, more on that below.

These can be tested at the command line with:

$ picocom -b 9600 --echo --omap lfcr --imap crcrlf /dev/cu.usbserial-0001
Command Example output Explanation
SOUT 1 Set output on
SOUT 0 Set output off
GOUT 0 Output is 0=off, 1=on
GETD 1002 0045 0 Presently outputting 10.02V, 0.45A, 0=CV mode vs 1=CC mode
GETS 3 1000 0050 Present settings (whether outputting or not) are 10.00V, 0.50A
VOLT 31000 Set present voltage setting to 10.00V
CURR 30021 Set present current setting to 0.21A
GOVP 4270 Upper limit of voltage is 42.70V
GOCP 2040 Upper limit of current is 20.40A
ENDS Unlock the button panel before disconnecting

The max power output for the 9103/9104 is 320W. The two models just vary by their voltage/current limits. I do not know how to identify which the device is.

Other models of BK Precision power supplies use a similar protocol but there are variants like, "current value will have one decimal place for models 1687B, 1688B, 1900B, 1901B, and 1902B, and two decimal places for Model 1685B."


Above I've ignored the "preset" feature of the power supply, which is complicated, but in brief: Many of the command operands take a prefix of 0-3, where 3 means "the value it is set to now" and 0-2 mean "the stored value for preset A, B, or C". For example: VOLT 01000 sets Preset A voltage to 10.00V, whereas VOLT 31000 sets the output voltage to 10.00V.

Presets can also be used to create a program that switches between presets automatically at intervals.

rgov commented 6 months ago

I think there's an undocumented command GMOD which returns some kind of model identifier. Their PSCS program has some logic that tries to identify the model using the first digit. Pseudocode:

      if (response.startsWith("8"))
        return "SSP" + response; 
      if (response.startsWith("6"))
        return "KPS" + response; 
      if (response.startsWith("NTP5"))
        return "NTP" + response.substring(3); 
      if (response.startsWith("SDP"))
        return "SDP" + response.substring(3); 
      return response.startsWith("-", "");

My model returns 8320 which would translate to the model SSP8320 which points to (drumroll) the Manson SSP-8320. Gasp!

This Python project (N.B.: GPLv3) has more info about all the Manson models and which ones are resold as BK Precision.

azonenberg commented 6 months ago

Doesn't look too complicated, I can try to throw something together quickly when I get a chance. But it's always tricky to develop without having hands on the hardware.