Author Topic: Custom Firmware for gpp 4323?  (Read 2503 times)

0 Members and 1 Guest are viewing this topic.

Offline TmaxElectronicsTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
    • My random (and very empty) electronics blog
Custom Firmware for gpp 4323?
« on: April 08, 2022, 09:12:10 pm »
So I've teated myself to a gpp4323 power supply last year and have been pretty happy with all but one thing about it: the slow output current update rate without and low pass filtering. I often built things that have small power peaks and almost no draw otherwise and with them the current display is just completely useless.

Has anybody looked into writing some custom firmware or modifying the existing one to make the update rate faster or at least add a low pass filter? It would be a stretch unless somebody reversed the code somehow, but with the thing running on an arm CPU there might be a chance for using fairly standard reversing tools (provided one could read out the flash somehow). Otherwise it would pretty much be down to writing ones own software for the thing which i guess in not viable with all the features that thing has.

The CPU is an nxp lpc1788fbd208 incase somebody is wondering.

EDIT: I just spend some more minutes on the web and got the firmware file from the gwinstek website. I've attached it to this post incase somebody who knows more about ghidra or ida pro wants to have a look at it. Binwalk and a quick look with strings seems to suggest its an uncomressed flash image and the size matches that of the MCUs flash memory. (original extension was .bin)
« Last Edit: April 08, 2022, 09:54:18 pm by TmaxElectronics »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Custom Firmware for gpp 4323?
« Reply #1 on: April 08, 2022, 10:56:29 pm »
A PSU is the wrong tool for profiling peak current consumption. You'll never get an accurate reading. You'll need a current consumption profiling tool. This can be as simple as a current shunt resistor which you measure using an oscilloscope.

However, the display on a PSU will always show the average current.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TmaxElectronicsTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
    • My random (and very empty) electronics blog
Re: Custom Firmware for gpp 4323?
« Reply #2 on: April 08, 2022, 11:05:15 pm »
Quote
However, the display on a PSU will always show the average current.
Well thats the issue... the meter on the GPP (at least mine) does not. It only shows whatever the ADC read at the time. And I'm not trying to get some super accurate power reading here or anything, I just want to get a rough average instead of a dice roll every time the display updates ;)
Especially since the front end has a 100uA resolution.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Custom Firmware for gpp 4323?
« Reply #3 on: April 08, 2022, 11:07:36 pm »
Quote
However, the display on a PSU will always show the average current.
Well thats the issue... the meter on the GPP (at least mine) does not. It only shows whatever the ADC read at the time. And I'm not trying to get some super accurate power reading here or anything, I just want to get a rough average instead of a dice roll every time the display updates ;)
Especially since the front end has a 100uA resolution.
In that case a you can try to read the PSU remotely and average the values. If your PSU has the network adapter, this could be of interest: https://www.eevblog.com/forum/testgear/open-source-lxi-tools-v2-0-released/
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Re: Custom Firmware for gpp 4323?
« Reply #4 on: April 09, 2022, 08:48:06 am »
A PSU is the wrong tool for profiling peak current consumption. You'll never get an accurate reading. You'll need a current consumption profiling tool. This can be as simple as a current shunt resistor which you measure using an oscilloscope.
There are specialized power supplies, like the Keithley 230x and HP/Agilent/Keysight 663xx battery simulators, that are designed to measure peak power level with a bandwidth in the order of a few (10?) kHz. They might be better tools in some way than a scope + shunt with a better dynamic range and a lower output impedance.

Your general purpose power supply is indeed very unlikely to sample fast enough, however, and no firmware modification is going to help this.

Offline TmaxElectronicsTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
    • My random (and very empty) electronics blog
Re: Custom Firmware for gpp 4323?
« Reply #5 on: April 10, 2022, 06:23:22 pm »
You guys are misunderstanding me... i like the power supply and do not want any other one. I have other ways of precicely profiling power consumption and am NOT looking for my power supply to replace those. But even my cheap high current supply has some sort of low pass filtering on the current range so I highly doubt it is impossible to add this to the gpp. At the moment it feels like there is literally no low pass filter on it at all and with the 2hz readout rate its just completely useless. I'd love to see an adc that is limited to 2sps...
 

Offline Kean

  • Supporter
  • ****
  • Posts: 2092
  • Country: au
  • Embedded systems & IT consultant
    • Kean Electronics
Re: Custom Firmware for gpp 4323?
« Reply #6 on: June 30, 2022, 01:28:46 pm »
FWIW, someone has started reverse engineering the hardware/firmware on the GPP4323 to the point of running DOOM

https://github.com/jwise/gpp-hax
 
The following users thanked this post: AVGresponding

Offline TmaxElectronicsTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
    • My random (and very empty) electronics blog
Re: Custom Firmware for gpp 4323?
« Reply #7 on: July 23, 2022, 04:03:48 pm »
uhh interesting, I'll be sure to take a good look at that once I have the time. Thanks for the info :)
 

Offline ArcticGeek

  • Regular Contributor
  • *
  • Posts: 99
  • Country: us
Re: Custom Firmware for gpp 4323?
« Reply #8 on: October 02, 2022, 01:38:02 am »
@Tmax

I know exactly what you are talking about - there is absolutely no low pass filtering on the GPP series power supplies.  I have both the GPP-4323 and the GPP-3323 and they act identical.  As you state, unless you are connecting a very static or resistive load the current monitoring is pretty much useless.  For example, the other day I connected a 24V fan to the power supply just to see what current it draws.  Just about any DMM I put inline would average the current and give me a pretty good measurement of the current.  But the Instek supplies just bounce all over the place.  Or if you are trying to find the current consumed by a digital board that has fluctations in the current the power supply is useless.

I've been tempted to send an email to GWInstek to see if they would consider a FW update for this, but I doubt they would do anything.

There are 2 ways to do this - one way is hardware by putting a cap on the resistor divider that goes to the A/D and the other would be software.  I suspect the hardware method will be difficult without a schematic.  The firmware method would be  simple, just average a number of samples.  For example, you could take 10 samples and average them.  It would actually be fairly easy to do 8 samples, sum them, and then shift the accumulator 3 bits to the right.  But Instek would have to be willing to do this.

Best,
 

Offline Pr Utser

  • Contributor
  • Posts: 16
  • Country: nl
Re: Custom Firmware for gpp 4323?
« Reply #9 on: May 31, 2023, 12:19:11 am »
I tried a LCP1788 firmware modification by averaging up to 16 samples. However, because of the sampling frequency of 10Hz is too low, the result was not great. Something with the Nyquist theorem. Not sure if I will put the effort to mod the channel controller firmware instead and try to increase the sampling frequency before averaging. My conclusion so far is that the original low pass filters do not suit the sampling frequency. Adding 10uF caps fixes that issue.

So switching from a firmware mod to a hardware mod:
I have reversed engineered the PCB a bit to find the ADC inputs for voltage and current.
See the attached PCB image with yellow markings around the ADC input capacitors. By adding 10uF (ceramic) caps parallel to the marked caps, the voltage and current measurement with the original firmware smooths up very nicely. With the additional caps, the measurement settling time will be around 1s comparable to my Fluke DMM. This mod should not affect the OVP and OCP response time as it is advertised that it is handled by hardware instead of software.

 

Online Hydron

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: gb
Re: Custom Firmware for gpp 4323?
« Reply #10 on: May 31, 2023, 08:42:03 am »
I believe the 10Hz thing is just the rate at which the readings are sent from the channel processor to the UI one - doesn't mean that the ADC is running at that rate. There is a possibility that they're actually running it much faster and using it for a software defined control loop (rather than just generating setpoints for a hardware loop), in which case padding the cap will result in much poorer transient response. If it's only for measurement then yeah that's different and shouldn't be an issue.

If you have any more schematics from your reverse engineering effort then that would certainly be of interest, and might clear up the method used.
 

Offline Pr Utser

  • Contributor
  • Posts: 16
  • Country: nl
Re: Custom Firmware for gpp 4323?
« Reply #11 on: May 31, 2023, 05:15:17 pm »
It looks like the channel microcontroller handles the OVP and OCP via the same analog inputs as the voltage and current measurement. The low pass filter does affect the OVP and OCP response time. The channel output voltage and current are not affected by the filter (at least not on the short term). I can change the voltage divider ratio to influence the measurement but that does not affect the output voltage or current.

So the only valid option is to modify the channel controller firmware.

Edit: I found that the channel controller firmware needs no modification. At startup, the UI controller sends an initialization command to all channel controllers. One parameter in this command controls the sampling rate of the channel controller. So by patching the command and intercepting and averaging the samples in the UI firmware, the measurement readouts can be improved.

The OVP/OCP handling is processed by the UI controller. Given the claims in the GWInstek brochure (stating that OVP/OCP is implemented in hardware instead of software), I did not expect this. It could have been close to a hardware implementation by letting the channel controllers handle OVP/OCP.

The ADC has a feature to compare the conversion result with a preset threshold level and generate an interrupt if the threshold is crossed. This could have been used to implement a near hardware OVP/OCP solution. I see it as a missed opportunity by GWInstek. They shouldn't lie about it in the brochure though. Unfortunately, the brochure is not as "Simply Reliable" as the company's slogan claims to be.
« Last Edit: October 14, 2023, 09:19:57 pm by Pr Utser »
 

Offline Pr Utser

  • Contributor
  • Posts: 16
  • Country: nl
Re: Custom Firmware for gpp 4323?
« Reply #12 on: October 14, 2023, 08:10:21 pm »
You can now create your own custom firmware for the GPP-4323 :-/O.
See https://www.eevblog.com/forum/projects/firmware-mod-for-gwinstek-gpp-series-lab-bench-power-supply
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf