Very strange failure mode in programmable DC power supply - Page 1
Forum section: electronics / testgear

author: cowana
author_rank: Frequent Contributor
timestamp: December 17, 2013, 03:06:01 pm
content: I've got a programmable DC power supply that I've had for about 8 years. It's not branded - but I bought mine under Rapid's own label. It's also available from NDP (manual:http://tinyurl.com/omovgfg).It's a 90W supply, and is available in a few voltage/current combinations. Mine is the 18v, 5A variety.A couple of years ago, I moved it in a car journey, and powered it up a few days later. I found that it had totally lost accuracy - the voltage was actually about 30% less than set/read back, and the current was 100% more than set/read back.I replaced it with a different, new supply, and put it on a shelf for a 'rainy day'.So, a few days ago I thought I would tackle it, and see what might have broken and how I could fix it! There's no schematic available, but it's a pretty simple and standard design. Two PCBs - one power and regulation for the internal circuits (12v, 5v, -12v) - and the other control and monitoring (the front PCB).The front PCB has the usual UI stuff - multiplexed 7 segment displays, a column/row keypad to scan, opto-isolated serial/USB - all driven by an ATmega. It then has a 14-bit ADC and 12-bit DAC for monitoring and setting voltage and currents.It's a long story of how I worked out what has failed in the supply - but the interesting thing is it is entirely software rather than hardware. Rather than the 18v/5A supply that it is, my unit thinks it is the next unit up in the series - a 30v/3A supply. As this supply has different components/scaling in the analogue section to make full use of the ADC/DAC range, this explains why the set/measured voltages are different to reality. Voltage is actually lower (very roughly 18/30 of what it thinks), and current is actually higher (very roughly 5/3 of what it thinks).I've mapped out all the pins of the ATmega, and there aren't any spare pins which it could be using to detect the version - it must have been set in memory in the factory. Somehow this memory has been corrupted, thus it thinks it's something it isn't.This does mean you can set the output to 30v - however due to the transformer limitations, it won't actually go any higher than about 25v (pass transistor fully on). It also means the current can't be set any higher than 3A any more (although 3A set currently means 6A actual).So, how to fix it? One option would be to replace the analogue section's components with those that would work with the 30v/3A firmware - however this limits the current to 3A, and decreases the resolution of setting voltage. I've now added a socket for the ATmega - my plan is replace it with a new AVR, and write my own custom firmware for it. I've wanted to do a power supply project for a while - as well as fixing it, this will give me a chance to add some new functionality (eg logging, power measurements, energy readouts (mAh/Ah), presets, etc). I use my new power supply for every-day stuff, so if this takes me a few weeks it won't be an issue.What do you guys think? I'd be interested to hear your thoughts on what could have caused this fault, or if you've heard of anything like this happening before. Are there any neat features I should think about adding if I write new firmware for it? I've thought about replacing the 7-segment screen with something better (LCD/VFD/oLED) - what do you reckon looks good in a power supply?Any comments/ideas welcomeAndyPS - in the attached (rough) schematic, the vertical bottom left resistor is the current shunt resistor. Unknown resistance - less than 0.1 ohm. The top set of opamps control voltage; the bottom set do current. 'Control' goes off to the base of the main pass transistors.

author: Rufus
author_rank: Super Contributor
timestamp: December 17, 2013, 05:27:15 pm
content: The model type and calibration information is probably held in the processor EEPROM.Hopefully the EEPROM information is checksummed and when corruption is detected it will initialise with some default values. That is probably what happened to your supply.Don't know what features that processor has for EEPROM programming. It may be possible to copy EEPROM from a working unit although calibration would be off.There is probably some obscure protocol on the serial interface to configure and calibrate it. If you can read the program you might be able to reverse engineer some clues about that. Otherwise it sounds like scrap.You could use it as a development platform for a DIY power supply, but, if you are putting a lot of work into a controller it would be good to be controlling hardware that can be easily reproduced.Edit: didn't notice the manual has calibration information - did you try calibrating? It might be the calibration has sufficient range for all models.

author: cowana
author_rank: Frequent Contributor
timestamp: December 17, 2013, 05:39:02 pm
content: The calibration information can be accessed through the menus - it's not a high precision supply, and I've calibrated it before with my Fluke 87v (which is more than accurate enough for what I need).The calibration values I had set in the EEPROM don't seem to be affected by whatever happened - from what I can see only the field which determines the model has changed (although who knows what other unknown parts may be different). I'd agree that without having an identical working unit to clone, it's not worth trying to find the ID value that has changed - as well as the effort to work out which value it is in EEPROM, there may be other registers that have changed that do important stuff.The hardware is nothing unusual or special, and means I can use it as a development platform without having to spend any money on a case/transformer/heatsinks/etc. The ADC and DAC are both Burr-Brown and use SPI, which shouldn't be too much issue to get working.

author: thm_w
author_rank: Super Contributor
timestamp: December 18, 2013, 02:08:27 am
content: I wouldn't be surprised if the first byte of EEPROM determines the model number. It is the most likely to corrupt (since the write pointer is pointed to it by default). I've seen this way too many times.But yeah without having a known reference, its going to be a lot of: program value, check result, repeat. Although, if thats an ISP header I see (the 5pins) it would make it a lot easier.

author: cowana
author_rank: Frequent Contributor
timestamp: December 18, 2013, 08:50:15 am
content: Yep - that 5 pin header is an ICSP header. In addition, the AVR doesn't appear to have code protection enabled - I was able to read out the contents of the chip, and pass the hex file through AVR Studio's disassembler (although the code doesn't make a lot of sense to me). The value of the lock bits on the device is 0x3C.I'm hesitant to start modifying this chip (it's handy to have working code to check timings with a logic analyser) - I might see if I can find another ATmega16 to copy the code on to and experiment.Contents of flash and EEPROM attached - the EEPROM file was originally .eep (but renamed for the forum).

author: muvideo
author_rank: Frequent Contributor
timestamp: December 18, 2013, 09:24:31 am
content: Hello, it looks like it's protected.

author: cowana
author_rank: Frequent Contributor
timestamp: December 18, 2013, 10:29:23 am
content: Very true! I hadn't actually looked at the data before uploading it here.Both the Flash and EEPROM don't look like code - it must be protected (which you would expect).Oh well, back to rolling my own firmware!

author: Hydrawerk
author_rank: Super Contributor
timestamp: December 18, 2013, 11:41:08 am
content: I wonder if yourRapidPSU was manufactured by Manson, because it has a very similar keyboard.

author: Rufus
author_rank: Super Contributor
timestamp: December 18, 2013, 02:33:06 pm
content: Quote from: Hydrawerk on December 18, 2013, 11:41:08 amThey are badged Manson PSUs.

author: cowana
author_rank: Frequent Contributor
timestamp: December 18, 2013, 03:52:19 pm
content: Good spot - here's the same unit with a Manson badge on it:

author: Hydrawerk
author_rank: Super Contributor
timestamp: December 18, 2013, 04:30:08 pm
content: I think that Manson PSUs are quite decent, but not so cheap.