SMPS charger hack
I had a battery charger for an electric bicycle. It is rated at: 220V (AC) in and 48V DC 2A. Now that I have lost interest in the electric bicycle, I have disassembled the battery pack (12V X 4 (in series) = 48V ) and am using it for back-up power supply for lighting purpose. Since one of the battery was damaged, and I required 1 battery for my electronics desk as a DC power supply, I was left with only two batteries for the back-up Power supply. I wired them in parallel (be careful though), and I am charging them through 35 Watts solar panel and its controller. However, During cloudy days, the battery can't get enough charge, and during load-shedding hours at the evening we are left in the dark. So, I need to make a provision to charge the batteries through the incoming AC power during the cloudy days. Before I make any intelligent circuit to find out if the sun will shine that day, I need a charger first. And this brings us to the main point of this post: Hack the 48(V) DC 2A charger to provide 12V DC preferably 8A, at least 4A.
The first step, obviously, is to open up the cover, which I did easily. This is what I got inside.
I was fearing that the board would be heavily populated with all sorts of SMD components. But fortunately the board was quite sparsely propulated, so tracing should be easy. After quite a research about SMPS circuits, I now understand that all SMPS circuits first rectify the incoming AC voltage into DC and place a big 400V DC filter capacitor to smooth out the DC voltage, which at 230V AC (rms) would be around 325V DC. Then the SMPS circuit will drive the DC325V through the primary of a transformer with ferrite core (ferrite core to enable high-frequency operation. Ordinary Iron cores would have ridiculous hysteresis loss at high frequency), switching at high frequency. The output voltage (be it step-up or step-down) is obtained from the secondary winding of the transformer after rectification.
This random image I found in google search can help illustrate my point.
Much can be learned about SMPS circuits from the following two application notes by Microchip (the maker of PIC microcontroller, m̶y̶ ̶f̶a̶v̶o̶r̶i̶t̶e̶ the only microcontroller I have used).
But, real world circuits are little more complicated than the basic design. If I want to change the charger into something new, I must first know how its working now. For this, I need to trace its circuits.
I have tried to trace circuits previously, and its really annoying to look a component, then flip-over the circuit and look at the traces to figure out which component is connected to which component. Sometimes, I loose hold of the component leg during flipping. Constant flipping of circuit to look at the PCB trace and the component is cumbersome. So, I came up with this idea: why not duplicate the circuit: one will be placed component side up and the other with the PCB side up. Well, until scientists develop hardware duplicator, we would have to do with a basic photo-replica of the circuit. But here is one gotcha: a simple photo won't do because, when flipping the circuit, the leg of a component on the left edge of the board will be on the right edge after flipping. But we can easily get over this by mirroring the image. Here is the concept.
Now, its easy (still not so easy, though.) to trace the circuit. You look at the trace, then look at the image to find out which component's trace is it, then draw.
I still have a long way to go to achieve my goal of modifying the charger. But I think, eventually I would have to re-wind the transformer to give 12V output instead of 48V and possibly change the power mosfet. But, since the power mosfet is in the primary (325V DC side), and since I am not changing power output, the input current should be the same. Hence, the power mosfet shouldn't need to be changed. Lets see.
I got bored of tracing the circuit quite fast, so I instead googled for the datasheet of the main controller chip (at the primary side). It is UC3842. Its called current mode PWM controller. Not much can be understood from its datasheet. A datasheet of similar part NCV3843 is much more revealing.
I will keep posting more. Done for now.
Back again. — Jan 30
It was still quite tiresome to trace the circuit, having to constantly switch between front and back view (between tablet and real hardware. So, I just combined the image, like this:
Its much easier to trace the circuit after this. I got the following traces:
Its apparant from the trace that the topology used is of Fly-back convertor. In the primary side there are two coils. One is the main coil of the flyback convertor. The other coil is to provide power to the PWM chip: NCV3843 . This chip is called High performance fixed frequency current mode controller chip. It takes in both voltage feedback (of the output) and current feedfack (of the primary mosfet) and sets the duycycle.
The output voltage sensing is done from the auxiliary 12V winding (which is also the power supply for the secondary side sensing circuits). (I am wrong on this: see below), and the 48V winding just passively supplies the current to the battery through a current sense resistor. So, I can just take out the 48V winding and re-wind it (with N/4 turns, where N is the original number of turns) to produce 12V winding and leave everything as it is to achieve my objective. I did just that:
—Whoo wait: Before I do anything with this charger, let me first check its working:
(There is a relay on the output to the battery. Its function is to cut-off output voltage until some power source (like battery) is connected as load. I just shorted out the terminals of the relay so that, it doesn't matter whether the relay turns on or not)
A applied 220V AC to input side and measured the output voltage: It was 57V DC. The voltage from the 12V auxiliary windings were 13V DC.I then connected a 220V 1KW heater as the load on the output. It was rightly sized to consume around 1.43A at 57V. To change the output load current, I just shorted out a portion of the heater thereby reducing the current. As I varied the current from 1.43A to 2.3A the output voltage remained stable at 57V. As soon as I shorted even more length of the heater to increase current, the current didn't increased but stayed at 2.3A and the output voltage started to decrease. So, 2.3A was the maximum current of the charger and 57V was the maximum voltage. I need to change this to 14.4V maximum voltage and 6.9A maximum current. To achieve this, I will just unwind the 48V winding, then wind only N/4 turns to decrease voltage. But I should wind 3 of such N/4 turns and then parallel them to increase current capacity. I will have to then reduce by 1/3 the current sensing resistor so that it will produce the same sense voltage at 6.9A as it was producing at 2.3A. Since, all of the voltage sensing is done from the auxiliary winding and I am not changing them, nothing else needs to be changed.
Time to de-solder the transformer.
The auxiliary primary winding was at the top. It was 9 turns. The main primary winding was was connected as series of two wining. I then un-wound one of them. It was 35 turns and wound as two parallel wires. Then came the main secondary 48V winding. It was also 34 turns and wound as three parallel wires. I needed to re-wind it as 34/4 = 8.5 turns and 3*3 = 9 parallel wires. I wound it up as 9 turns with 9 parallel wires. And then when I was about to re-wind back the 35 turns 220V primary winding, my brother, who is a civil engineer by profession and electronics hobbyist, brought of this question: What about the coil polarity? Oh! damn it, I didn't think about it. I then set to test the coil polarity
I applied AC 13V from the transformer on the primary side and commoned one of the secondary winding with primary and tested the coil polarity (A separate blog someday for testing coil polarity). When I tried to measure voltage, whoa! the primary side reads only 1.13V! where is the 13V I applied? And then I realized, the coil DC resistance is really low and is sucking max current from the supply AC 50Hz transformer. This charger's flyback transformer is meant to work at high frequency (> 30 Khz), so the magnetizing current would be low then. But I am supplying 50Hz, which is why there is very high current and hence low voltage. I moved on any-way. The secondary induced voltage as around 0.11V. By testing whether the voltage add up or subtract I was able to determine coil polarity. Please note that, although the number of turns in the primary and secondary was same (35 turns) in my case, the terminal voltage at primary was 1.13V but the terminal voltage at the secondary was 0.11V. This is because, the secondary is open circuit, so the voltage measured is the internal emf of the Coil. But the terminal voltage at the primary is the sum of internal emf of the transformer coil (pure inductor) plus the IR drop of the transformer winding resistance. Since, resistance is dominating at this 50hz frequency, large part of the terminal voltage is constituted by the IR drop.
So, after all these, time to put back the transformer and test the circuit
A puzzle to solve.
Bye bye for now.