Thursday 3 March 2016

Lab Power Supply - PCBs

After a long wait the PCBs came from Seeed. I started assembling one and tracking down all the problems. So far nothing I can't fix or work around but I learned many lessons!

Actually I began writing this entry quite some time ago but work on this project has been sporadic due to work commitments and other things going on.

Staged Assembly

Some of the components I am using are expensive (maybe $10 per item) so I really didn't want to assemble the whole board at once in case there was a fatal flaw in the design. I wasn't sure I could harvest the parts off the board again and so I decided to work on a section at a time.

The process has been to test
  • Just the internal supply rails so the 5V, 28/40V and 24V supplies. Because the parts are either cheap or removable and because they would be hard to solver in later I also soldered in all the pre-regulator parts and the output MOSFET and bulk capacitors. These checked out although I couldn't test the so I moved onto the next step
  • The micro-processor. This might seem odd but I need this component to set the output. Also as it is relatively fine pitch, if the soldering goes wrong I didn't want to have too much extra on the board. I placed the micro-controller, the transistor that controls the winding switching relay and, bypass capacitors, ceramic resonator and the ICSP header. At this point I could connect my programmer and blow the software onto the micro and see it starts. After some soldering headaches (see below), I connected it up and successfully programmed the chip. It took quite some time to figure out that it was running as I couldn't see any signals on the oscillator lines nor the serial output. Turns out I had a big delay in the code so the serial output was just taking a while.
  • My plan was to place the USB parts next as then I could see the debugging from the micro more easily. I placed all the capacitors etc and was about to place the USB to UART converter chip when I realized I had the wrong one. The unit I bought was a SOIC but the footprint I designed was the TSSOP. I quickly placed an order for the TSSOP part. 
  • At this point I decided to go for broke and placed all the analog control parts and the DAC. I probably should have done just the DAC first but got impatient.

Soldering

I used solder paste for the first time on this board. For the resistors, capacitors and diodes my approach was to work on a section at a time and to place a dot on each pad and then  place the component. I then apply hot air (250C) generally to the board area and then in a more concentrated fashion to each component. Initially the paste will go a light-gray colour and then when the heat gets to the right place it goes shiny and pulls in. I found that if I apply the heat nozzle to the middle of the component so it heats both sides to melting then the component will naturally pull into the centre of the pad. Excess solder wasn't much of a problem even for the tiny SOD-323 pads. Transistors were similarly easy.

The tiny LT1716 was also pretty easy. I used a similar technique and placed a dot on each pad, placed the component (carefully aligning it) and applying heat.

Buoyed by my success I used the same technique on the QFP32 microcontroller. Putting a dot on each pad was impossible as the pitch is too fine. I placed (what I thought was) a thin line down each line of pads, placed the component carefully and applied heat. I thought the component would pull into the middle like others did but it didn't. It could be my nozzle was too fine. If anything it moved enough to skew the alignment. Also there was too much solder so I removed some by applying liquid flux and solder braid with the soldering iron. When I did I realized how bad the alignment was and had to remove the part. I used hot air to soften it up and spread my tweezers wide to grab the part and pluck it off.

I had to clean up the pads with flux with solder wick after removing the microcontroller. I managed to damage a couple but luckily they were unused pads (or perhaps they are more fragile because they are not connected?). The trick is dabbing the wick rather than wiping it as otherwise it moves the pads. I put on solder paste (much less this time) but I put it more to the middle of the pads so when I placed the component I could see the alignment better. I held the component down with tweezers this time as I applied heat so it wouldn't float off. This sort-of worked and with just a little bit of mucking around with wick I got it near enough.

My procedure for checking the soldering is to use my fine SMD probes and my DMM on continuity mode. I check that I have continuity between the chip lead and the pad (being careful not to put too much pressure on the lead as then it bends down and touches anyway)  and checking I don't have shorts between adjacent pins.

After the horror of soldering the micro-controller I did some Google searching and found videos of other people hand soldering these. The trick seems to be to apply some flux, place the component to get a good alignment and then use a soldering iron to tack a couple of leads in place. You put solder on the iron and the liquid flux will allow it to wick off the solder tip onto the lead. Then you can put paste on the other leads and use the hot-air to finish the job.

Even this wasn't that easy as the alignment is really hard and it is easy to over apply the solder. I thought I had everything done and then at some point I was getting weird problems with reliability. At one point I couldn't program the board unless I pushed on a particular spot. I ended up applying flux and solder (via the iron) to re-do some joints and this fixed it. For fine-pitch components the best approach seems to be to apply solder via the iron rather than using paste.

Board Faults

For the most part the board was Ok however there were a number of faults. Unfortunately one turned out to be a killer that means I need to re-spin the board
  1. The footprints for the PTC and the MOVs are mirrored. I think I must have looked at them from the component side when designing the footprint. As they are two legged components you can solder them in but they just don't sit right.
  2. The spacing between the main MOSFET and the last LM317 means the boards don't quite fit on the heat-sink. I can get around this by screwing the LM317 down somewhere else and running leads to the PCB. Not sure if I will fix this as it is a bit of stuffing around
  3. (The killer) The SSOP MCP2200 finally came and I went to fit it. Unfortunately this doesn't fit either as the package is a wide SSOP not the standard size. Dammit. It was a tiny bit too wide too so I tried soldering it in place but with no luck.

Design Faults

In addition to the board faults I found a few errors in the schematic some of these are errors in transcribing from the prototype.
  1. The LDAC pin of the DAC is pulled high not low. I can get around this in software however
  2. PNP transistor in the CC Mode detection circuit was the wrong way round. I  worked around this by soldering in a TO-92 PNP transistor and otherwise this circuit worked.
  3. The output of the comparator in the pre-regulator circuit went through a voltage divider to the SCR gate. This didn't work and in fact by just having a resistor between the comparator and the SCR gate it works fine. I just removed this resistor from the board and the pre-regulator fired up.
  4. The differential amplifier that measures the output voltage didn't quite work. More on this below.
  5. The relay lacked a diode to snub the back-EMF created when it was switched off.
  6. The opamp that buffers the output voltage for the ADC had the V+ and V- inputs exchanged and basically didn't work. I didn't notice this at first as I haven't fitted the AD7705 yet.
  7. The bridge rectifier needs to go on the heatsink (see below).
  8. Despite my calculations, the LM317 that supplies 24V to the relay still gets hot.

Output Voltage Measurement

The idea is to either get the voltage from the front panel or, if sense leads are being used, to read from the device being powered. Using 10K resistors between V+ sense and V+ created a massive voltage divider and so this didn't work. Even reducing these down to 20 ohms meant the resistors introduced a significant error as 20/4.7K is still a significant proportion.

The problem is the input impedance is too low. I figured out if I switch to using 100K resistors this problem is greatly reduced. The problem then is the loop compensation makes the opamp too slow so I also need to reduce the feedback capacitor to 10pF. Another problem is 100K resistors create significantly more Johnson noise (the reason I used small resistors in the initial design) but I don't think I can't avoid this.

I changed the circuit and removed the resistors on the board that connect the voltage sense lines with the voltage output lines and I changed to using 100K resistors and 10pF feedback. The output was stable. Unfortunately if I use sense leads to measure the voltage on the dummy load the output oscillates. I tried twisting the leads and other things but I can't avoid it. I think for now I won't provide external sense inputs and just have two banana plugs per channel.

At that point I did a calibration run using my Keysight 34461A and the voltage output is very stable. I haven't been taking temperature measurements but the temperature in my lab will vary by as much as 15 degrees (no air-conditioning and it is summer in Australia) and the output voltage varies by much less than 1mV

At one point the opamp package that amplifies the DAC output and buffers the output voltage failed (this is how I noticed the buffer problem I described above). The output went to the rail and killed my DAC unfortunately. I think the ground pin of the opamp didn't have enough solder on it and it made a momentary break when I was probing things and killed the opamp. I replaced both packages, re-calibrated and then it was back up again.

It was at this point I noticed the output was varying a lot with load. I spent a long time noting down voltages at different points in the circuit relative to the power ground. I spent quite some scratching my head and then I moved the leads slightly and everything changed. I have banana plugs screwed to a small bit of MDF and the power and sense wires are crimped onto spade lugs screwed to the back of these. The other end are screwed onto the terminal block. When I move the wires the voltage goes all over the place as I think the contact between the V+ and S+ or V- and S- can vary. I think I will solder them together in the final design.

Load Testing

Now that I have it on a PCB I can screw the power devices to the real heat-sink and do some load testing. My dummy load only goes to 4A but for now that is enough.

As I will have multiple channels all on the same heatsink I need to insulate the devices from the heatsink. I use cheap silicon rubber insulators from Jaycar with heat grease. I marked holes for the devices, drilled the holes and tapped them. The location of the devices isn't great as they are behind capacitors so it's hard to screw them down. I managed it but it was not easy.

The LM317s and the P-Channel MOSFETS didn't get very warm however the N channel MOSFET (the main pass element) got practically incandescent (quickly hit 90C). The heatsink however didn't even get slightly warm. I experimented with screwing the device down harder but with no luck.

At about this time I needed to order a replacement DAC (see above) and so I ordered some Aluminium Dioxide insulators. The problem was these are slightly too wide and clash with the adjacent MOSFET. The material is as hard as ceramic so no chance of cutting or drilling it. I managed to mount the transistor with the heat pad side-ways. It provided enough contact so I screwed it down and re-ran the test. Now the MOSFET just touches 60C after running for a while and the heatsink starts to warm up. With a low-speed fan I think this will be perfect.

The bridge rectifier however was pretty dam hot - I measured over 100C at times. The thing is the device is rated for 15A so I was surprised it got so hot with just 4. It turns out it is rated for 3A with no heatsink and 15A with a heatsink. Doh!! Another design change required.

Here is the PCB on the heatsink and surrounded with test gear. The yellow wire is the thermocouple for the MOSFET. Note also the through-hole PNP transistor bodged in there due to the PCB design fault.


Relay Transient

I noticed that when I switch from a voltage in the 15-30V range back to a voltage in the 0-15V range, the relay would click but the voltage wouldn't change. Initially I thought this was a software fault but I found sometimes the output would go to zero. If I change the voltage to some other value it often will then work.

Basically it seemed like the DAC wasn't responding when I switched the relay. I had a bit of an 'aha' moment and realized there was no back-EMF diode on the relay. I put a scope probe on the base of the transistor that switches the relay and capture this mess. The base is seeing transients as low as -8V! Needless to say  - I think I need to fix this!


I added a diode across the windings so it would absorb the back EMF and now it looks much better, In addition I don't have a problem with the DAC command getting lost.

Next

I think I will fit the ADC and reference and continue to test out the design. Better to find all the faults before I spin more boards. At this stage however these boards are totally toast :(

Also as I won't provide sense inputs I only need two MOVs which should save a lot of space. I think I might use the bigger versions of the ADC and MCP chip as they are much easier to solder. I need to do some re-design to mount the bridge on the heatsink. This might mean putting the regulator on smaller heatsinks. But this is all for later...


No comments:

Post a Comment