Hiland Power Supply Kit Voltage Spike - Page 1
Forum section: electronics / beginners

author: The_Boots
author_rank: Contributor
timestamp: May 22, 2018, 02:38:08 am
content: So I built this power supply kit from Banggood:https://www.banggood.com/0-28V-0_01-2A-Adjustable-DC-Regulated-Power-Supply-DIY-Kit-Short-Circuit-Current-Limiting-Protection-p-1060253.htmlNow, I wasn't expecting it to be amazing or anything-- I mostly got it because I wanted a kit to start with and I needed a power supply anyways. The only real issue I had with the kit was that when I first powered it on, one of the diodes let out the smoke and tripped the breaker on the transformer (and before you ask, yes it was in the correct orientation), but when I replaced it with another of the same kind, it worked with no other obvious problems.Everything seemed all well and good until I tried to power something with it (it was a cheap DMM) and... RIP. The meter died without any real warning. No smoke or anything.Cut to a few days later and I had the bright idea to start troubleshooting with my USB Scope, and I found something I can't really explain. At threespecificvoltage settings, the output is suddenly spiking to 32-38V.At 3.9-4V the voltage spikes and exponentially decays back to the correct voltage in about 2.5ms.At 12.4-12.5V it also spikes and returns in a similar curve, taking about 840 us.Finally, at 20.9V the spike returns to normal in about 410 us.The spikes can almost always be triggered by moving from a higher voltage down to the troubled one, with the spike happening right as I hit it, however sometimes the voltage will spike repeatedly if I leave it at that set level. The 12.5V level seems particularly susceptible to this kind of behavior.These spikes ONLY occur at these three voltages, and the time I gave to return to normal is actually pretty consistent. There are some hints of a pattern in the timing (3x voltage normalizes in 1/3 the time). This suggested to me that whatever is happening is not a random glitch, but then-- why these specific voltages? I feel like there's a pattern I'm missing.Note that I am NOT really asking for help fixing it or making it somehow not cheap junk. I've already bought a prebuilt power supply (the Korad KA3005 that people seem to think isn't too awful). I'm far more interested in learning what components and designs might be the culprit.Does anyone have any hints or suggestions about what causes spikes like these? I'm still very much a beginner at this, so I'd appreciate any advice!

author: ledtester
author_rank: Super Contributor
timestamp: May 22, 2018, 03:40:31 am
content: I would check the resistors in the R2R ladder to make sure they are all good and have the right values.My understanding is that this supply uses a microcontroller in the voltage control loop. The micro emits digital signals into an R2R ladder to essentially control the pass transistor.The R2R ladder are those 10K and 20K resistors next to the Atmega8.That said, I wouldn't expect a lot from this kit. Because it uses a micro in the control loop it's going to respond very slowly to changes in the load. And it looks like it only has an 8-bit R2R ladder which only gives you 256 control steps across the entire 28V range (and they may not even be uniformly distributed).But if you want to try to fix it I would first make sure the R2R is working. There might even be a way you can troubleshoot the microcontroller board by itself - perhaps just using a pot connected to one of the ADC pins to simulate the voltage sense. Then again, it might not really be worth your time.

author: ledtester
author_rank: Super Contributor
timestamp: May 22, 2018, 04:04:07 am
content: btw, here are some articles which I believe (although I may be wrong) describe the circuit or at least an earlier version of it:-http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml-http://linuxfocus.org/English/June2005/article379.shtml

author: The_Boots
author_rank: Contributor
timestamp: May 22, 2018, 01:12:44 pm
content: Since it's controlled digitally, do you think it could be a pure software thing? Where the code in charge of reading feedback is freaking out at these specific levels and takes a while to bring the voltage back down(is that slew rate? Sorry, I'm still learning)?I'll look at the R2R tonight, though. I'm guessing they all need to be desoldered to check, so that sounds like it'll take a while! I'll also look at the articles you linked to see if I can figure anything out there, as well.Like I said, I care less about having a functional power supply at the end than understanding what about this circuit causes the problem. I primarily bought the kit to learn, not to have an amazingly reliable and useful power supply! In some ways (other than cooking the DMM) it's almost better that it's had a glitch like this, since you don't learn as much if everything goes smoothly! It gave me a perfect use case for why oscilloscopes are so darn useful and forced me to learn a lot of the basics about how to use them.Thanks for the tips!

author: ledtester
author_rank: Super Contributor
timestamp: May 22, 2018, 04:09:15 pm
content: I could be a software issue, but since this is a popular kit I would imagine the kind of problem you are seeing would have been spotted already.Because the problem happens at specific voltages I suspect a problem with the R2R ladder or with one of the digital IO pins controlling it.Here is a possible scenario... Suppose the IO pin associated with bit 4 of the R2R ladder is defective and can't output a high value, and suppose you have set a voltage where the microcontroller has set the R2R ladder outputs to 0x0F. If you slightly increase the desired output voltage, the microcontroller will try to set the R2R ladder output to 0x10, but because bit 4 is defective the actual output will be 0x00 causing the output voltage to drop precipitously. Sensing this the software will overcorrect and set the R2R ladder output to some high value (perhaps even 0xFF) causing a spike in the output voltage. Over time the voltage will settle down to the correct value as you have observed.Since you see this at three specific voltages, perhaps it is actually bit 5 which is defective. That is, you'll see the problem happening when the R2R ladder output is 0x1F, 0x5F and at 0x9F - the bit patterns being 0001.1111, 0101.1111, and 1001.1111.The recovery time will be longest for the 0x1F point (because the software has to bring the R2R ladder output from 0xFF down to around 0x1F) and shortest for the 0x9F point. In fact, there might actually be fourth voltage where the spike happens - at the 0xDF point - but the recovery time is so quick that your don't see it.Of course - this is just wild speculation - but it's the first thing that came to mind.

author: mikerj
author_rank: Super Contributor
timestamp: May 22, 2018, 06:07:29 pm
content: I'd be interested to see what happens with periodic load fluctuations above the Nyquist frequency for the control loop. There are no anti-aliasing filters in the design, so I can imagine some quite damaging behaviour could occur.

author: The_Boots
author_rank: Contributor
timestamp: May 22, 2018, 08:24:35 pm
content: QuoteSounds great!...But what does that mean? Sorry-- I'm really a beginner!I'm just going to take a guess that you're saying that if I were to create a load that cycled on/off at a high enough specific frequency that the microcontroller could essentially only see low loads when it sampled the output and not the high loads (with the high loads happening in the dead time between samples), and think "oh my god! Better get that voltage up!!" Something like that? If that's what you're talking about, how would I make such a load? I mean, "quite damaging behaviour" sounds like fun, so long I can make sure the stuff getting damaged isn't expensive (or me!!).QuoteThat actually makes a TON of sense and seems totally plausible. I'll definitely check that. Would it make sense then to hook some of the pins up to a scope and watch their behavior as I adjust the voltage then, before ripping out the resistors to test them? If so, then I'm doubly bummed out that the new scope I ordered was out of stock! I bet I can manage that with my USB one, though.Thanks again for the great ideas!

author: mikerj
author_rank: Super Contributor
timestamp: May 22, 2018, 09:12:04 pm
content: Quote from: The_Boots on May 22, 2018, 08:24:35 pmThat's pretty much exactly what I mean. It's a discrete time control scheme, i.e. the microcontroller samples the voltage and current feedback at some frequency which is then processed and a corrective value applied to the output controller (pass transistor). This will only work correctly for periodic input frequencies (line or load changes in this case) up to half the sample rate (the Nyquist-Shannon sampling theory), so a well designed system would usualy have an analog filter in place to attenuate frequencies above this value. Without the filter, periodic signals above half the sample rate cause something called aliasing, one possible effect of which you have described very well.You could test this by using a transistor to switch a suitable resistor load across the output of your supply, and drive the transistor base/gate with a signal generator. Put a scope on the output and see what happens as you increase the the frequency. One of the web pages linked above mentions 104us sample period, which would be around 9600Hz. You could expect things to start misbehaving at around 4800Hz if this is the case.

author: ledtester
author_rank: Super Contributor
timestamp: May 22, 2018, 10:02:26 pm
content: You could probe the R2R digital output pins when the voltage is set at (or as close as you can get it) the "bad" voltage values to see if there is a discernible pattern (like a lot of the low-order bits are 1).Hopefully your method of probing won't disrupt the R2R ladder output. I'm pretty sure it would be safe to use your oscilloscope for this.It would also be interesting to know what the R2R control word is when the voltage is set to it's highest value. Perhaps you are not seeing the 0xDF spike because the control word never gets that high.

author: Audioguru
author_rank: Super Contributor
timestamp: May 23, 2018, 12:48:22 am
content: I think this cheap Chinese power supply kit replaces a defective copy of a 15 years old Greek power supply kit that I helped fix at Electronics-Lab.com.Isn't its voltage adjusted with a pot that might be intermittent?

author: ledtester
author_rank: Super Contributor
timestamp: May 23, 2018, 01:37:47 am
content: Quote from: Audioguru on May 23, 2018, 12:48:22 amI don't think so. This one uses a microcontroller instead of op-amps in the voltage control loop.Link to this kit:https://www.banggood.com/0-28V-0_01-2A-Adjustable-DC-Regulated-Power-Supply-DIY-Kit-Short-Circuit-Current-Limiting-Protection-p-1060253.htmlThe one I think you are referring to:https://www.banggood.com/0-30V-2mA-3A-Adjustable-DC-Regulated-Power-Supply-DIY-Kit-p-958308.html

author: The_Boots
author_rank: Contributor
timestamp: May 23, 2018, 03:04:54 am
content: Quote from: Audioguru on May 23, 2018, 12:48:22 amI think this is a different design. I've seen the one you're talking about (with the TL081s that are being driven too hard, right?). There is a trimmer pot used for initial calibration, but the actual voltage control is entirely through the two front encoders and the Atmega.Quote from: ledtester on May 22, 2018, 10:02:26 pmSo I probed at the R2R ladder and tried to get the sense for it, but it seems a bit weird. The pins don't seem to be behaving in traditional base-2 patterns with respect to the voltage, so it's a bit hard to track which is which. However, when I got it to a problem spot, not only a single spot went nuts-- they all did together! And it was the pins themselves. The controller is going nuts at these voltages (you were right, btw, there were other problem voltages). However, the common thread was the pin that I would expect to be the MSB (right by the output) always was due to change state right around the problem voltage.I'm posting two pictures: one showing two pins going high together, and one showing the voltage compared to a pin going high at higher speed. That noise is pretty impressive, but it also read as 33MHz, and my scope is only 25MHz/100MSpS, so I don't know how accurate that really is.I guess it's also worth noting that Ch1 in that high speed image is going almost to 10V, when it's one of the digital out pins, and in the other picture of the two digital pins, channel two is going to -5V... I didn't think they were supposed to do that. Probes were grounded to the same spot and hooked in right between the resistor and microcontroller. Probes both set to 10X.

author: ledtester
author_rank: Super Contributor
timestamp: May 23, 2018, 12:34:54 pm
content: Just a quick comment on "channel 2 going to -5V"... note that CH2 is AC coupled, so it's probably going from +5 to 0.

author: The_Boots
author_rank: Contributor
timestamp: May 23, 2018, 12:41:00 pm
content: Quote from: ledtester on May 23, 2018, 12:34:54 pmAck! You're right, of course. The scope doesn't remember configurations between uses, and I'd disconnected it in the middle. That explainsa lotof the weird behavior I saw at the end. Still too new to remember to check it! I'll redo it tonight making sure it's DC.You know, after sleeping on it another thing occurred to me: I don't think there CAN be a 1-1 relationship between the R2R ladder and displayed voltage. If I understand it, it's basically an 8-bit DAC, right? That means 2^8 = 256 possible configurations. The display goes from 0-28.0 in 0.1V increments. That's 281 possible settings. Do you think that for the extra settings, the digital output oscillates around the set voltage if it there's no DAC output configuration within the allowed error for that given voltage?How does voltage detection happen in the first place, since Vout could be (if it were working correctly) a max of 28V? Does the circuit attenuate or divide the voltage somewhere, and if so, is that a potential place to look?Still wishing I had more channels to monitor more pins at once... It'd be nice to see all 8 at once. Could a cheap logic analyzer do that?Thanks again to all who are helping me along. I really appreciate the explanations! Tracking this down is actually proving to be a lot of fun.

author: ledtester
author_rank: Super Contributor
timestamp: May 23, 2018, 05:37:04 pm
content: One of those simple USB based 8CH analyzers you can get for < $10 should work.If you get one, make sure it is usable with sigrok:https://sigrok.org/

author: Audioguru
author_rank: Super Contributor
timestamp: May 23, 2018, 06:36:08 pm
content: I cannot open a DOC file. Can somebody look at it to see if there is a schematic?There are two potentiometers shown as parts that might set the output voltage and current? The voltage pot might be intermittent?

author: ledtester
author_rank: Super Contributor
timestamp: May 23, 2018, 06:47:16 pm
content: Quote from: Audioguru on May 23, 2018, 06:36:08 pmI used this site to view the DOC file:https://www.onlinedocumentviewer.com/Viewer/default.aspxbut I didn't see any schematic.It is possible the problem is with the voltage pot. Substituting it with a different one would be a good test.

author: The_Boots
author_rank: Contributor
timestamp: May 23, 2018, 08:04:43 pm
content: I don't have any extra pots lying around, but is it really that likely? I'm not saying I shouldn't try it, but the trimmer is the only pot there is as far as I can tell, and I haven't touched it since I first calibrated it. The normal adjustments are all made with the two rotary encoders-- one for voltage and one for current.Honest question: what is it about the pot that's suspect? Is it just that pots are often the problem, or something specific about its location in the circuit?Although I really should try tweaking it to see if that changes the freakout points...

author: ledtester
author_rank: Super Contributor
timestamp: May 23, 2018, 10:57:09 pm
content: Doh! This kit uses rotary encoders not pots for setting the voltage and current.

author: The_Boots
author_rank: Contributor
timestamp: May 25, 2018, 01:56:11 am
content: Well, I tried futzing with the calibration trim pot and the voltage spikes followed the ACTUAL voltage, not the voltage displayed on the display.Even though the display said 4.1V, it still spiked when it crossed 4V heading down.It's also interesting that even if the display says that it's both set to and reading some other voltage, the circuit itself knows better.I actually also got it to go into constant freakout mode just by messing with the trimmer pot and tweaking the voltage to sit at 12.4V. It was freaking out enough to give my scope a continuous trigger! There's about a 250 ns lag between the pin going high and the beginning of the voltage spike. The spike itself is about twice that.So if I can get it to freak out only by messing with the real voltage, no matter what the display says the controller is reading, then doesn't that suggest that the microcontroller is probably not the issue? Also, not the R2R DAC-- it seems more like the victim than the culprit here...

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 25, 2018, 05:00:52 am
content: It seems likely / plausible that you damaged more than the single diode at power up.Measuring such a high frequency oscillation during a voltage step does seem to indicate that there is a serious flaw in your circuit. But I can not tell if it is by design, or because of faulty components.How does this circuit perform under load? How fast does it regulate?A common way to torture power supplies is to have a constant load (few 100mA) and a switchable load ( > 1A) and turn that on/off with a beefy MOSfet or transistor.It does seem to be an "improved" version of the tuxgraphics power supply.I bought a few of those long ago, but never bothered to build more than one.The quality was not good enough, and I found the buttons to set voltage / current pretty annoying.The rotaries of this Hiland Kit seems to be a much better user interface.Both designs probably would have improved a lot with the addition of a few opamps.Tuxgraphics uses an R-2R network, but adds a few bits of PWM to the least significant bits.The idea is quite nice. You get the PWM for free, and the R-2R attenuation makes the ripple caused by the PWM very small and easy to filter.

author: The_Boots
author_rank: Contributor
timestamp: May 26, 2018, 02:23:58 pm
content: Quote from: Doctorandus_P on May 25, 2018, 05:00:52 amOh I'd be shocked if I didn't. Because of the breaker on the transformer, I had to run it a few times before I could trace the magic smoke back to its source.Quote from: Doctorandus_P on May 25, 2018, 05:00:52 amI actually just got a few 10W resistors yesterday to try to set up some kind of dummy load to test it under load. I wasn't willing to risk any more devices I cared about. I don't have a stock of MOSfets, but I have some old electronics lying around. Any suggestions on which to peek into to see if I can salvage something appropriate?Quote from: Doctorandus_P on May 25, 2018, 05:00:52 amOH MY GOODNESS. The comment about PWM makes a TON of sense given what I'd been seeing on the first few pins! I just got a $10 Logic analyzer so I could finally watch all 8 pins together and the ways the lines were changing made almost no sense to me. Pins 0 and 1 are definitely prone to going bonkers at certain levels, but it makes sense to swap out "bonkers" for "PWM". On the other hand SOMETHING is making almost all the pins go bonkers in exact unison. Also, when any line is about to change state in the next tick, that's when things (either that specific line, or most of them together) show this behavior. I'll try to read the Tuxgraphics stuff much more carefully. Thanks!One other think I noted: there are 5 lines connecting the logic/display board to the main power board. +5 and G are obvious. I and V also seem pretty clear (V rises smoothly from 0-2.8ishV in neat 10mV increments. I assume the main board has a 10x amplification somewhere).But then there's line "K". Lacking any other explanation, this seems like it might be some feedback/monitoring line. When I probe this with a DMM it immediately triggers the spiking, no matter what the set voltage is. It's a 10 MOhm DMM, but whatever is still leaking through is enough to cause the system to spasm. I'm going to do some other tests on this tonight, I think...

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 26, 2018, 05:27:11 pm
content: Quote from: The_Boots on May 26, 2018, 02:23:58 pmThis seems to be very close to the cause of your problem.It could be an intermittent connector/wire, bad solder joint or blown up component that changes properties under mechanical stress.If the uC gets bad feedback from the output (Voltage / current) then the control algorithm goes haywire and outputs bad data.(If the software was "smart" it could detect this, but I doubt that so much attention has been given to it.)

author: toxuin
author_rank: Newbie
timestamp: June 01, 2018, 03:06:43 pm
content: I am not sure if my issue is related to this one, but my unit has voltage spikes as well. A little bit different mode though.Once I connect a load, voltage goes up to 12-17V for a brief moment and then goes back to specified voltage. I was testing with 5V, 0.2A and a 10Ω 5W resistor, attached a DMM across the load on V DC MAX mode and was connecting and disconnecting the power supply. In this setup I was reading 12V, almost every time I was connecting the load DMM would beep indicating a voltage overshoot.I did not test however if that happens over certain voltages or constantly, as topic starter did, so I am not really sure if I am observing a same or similar error.

author: mikerj
author_rank: Super Contributor
timestamp: June 04, 2018, 09:24:19 am
content: Quote from: toxuin on June 01, 2018, 03:06:43 pmThe low sample rate and the crude digital control loop (just a simple integrator) means this supply will inevitably have poor transient response. However I am a little surprised that applying a load makes the voltage go up, I would expect this to happen with the load is removed.

author: toxuin
author_rank: Newbie
timestamp: June 18, 2018, 04:32:52 am
content: Is there anything to look into to mitigate the voltage spikes? I don't think I should be using a supply with such behaviour at all – could easily damage stuff.