User:Jstapko/EngLab/PSRepair

=PC Power Supply Repair=

HCC's lab has lots of non functioning PC power supplies. The goal of this project is to learn how to identify common problems and perform simple tests and repair.

websites
Datasheets for UC3843B, the PWM controller for the W12NK95Z: Figure 33 of the ONSemiconductor datasheet explains how to use pin 1, COMP. Basically, if for any reason pin 1 is above 4.4 volts (2 diode drops plus the comparator clamp diode multiplied by the voltage divider ratio), the current sense comparator's output goes low. This means it DOES NOT trigger the reset of the output flip flop, so it allows output to stay on. If the error amp output drops, for whatever reason, the curr. sense comp's inverting input causes its output to go high, which resets the output flip flop, turning the output off. Loop compensation means putting a resistor and capacitor in paralell from pin 1 to pin 2 (error amp in) to slow down any changes. If the error amp input, pin 2, goes high suddenly, the output pin 1 goes low. However, the capacitor from pin 2 to pin 1 draws a charging current from pin 1, and produces a voltage drop at the charging resistor at pin 2. This has the effect of simultaneously pulling pin 1 up and 2 down, which would smoothe out the appearance at the output of rapid changes at the input. The original explaination of figure 33 is on page 9 of the datasheet, "Error Amplifier." System General SG6105 "power supply supervisor" alldatasheet SD6105D
 * old work done by HCC project teams
 * great website introducing how pc power supplies work, common problems, and how to test for them
 * website that describes an ATX power supply tester Also gives techniques for basic testing, but not useful for internal repairs.
 * electronicrepairguide.com Shows how to lubricate fan and says to remove old glue from the PCB to make the psu last longer. Also tips for repairing other things, like LCD tv's
 * systematic procedure for checking fuse, switches, caps, secondary diodes, etc. looks very useful, include high quality, labeled images
 * add for program/book teaching power supply repair Includes well labeled images; introduces concept of shottkey, or high speed diode for secondary side rectifiers, and includes sample schematics.  Mostly it's just an add for the book though.
 * hardwaresecrets.com discussion of power factor correction This website points out that pfc equipped power supplies do not have line voltage switches. The block diagram in figure 3 shows that line voltage is selected by either putting a voltage doubler in circuit, or bypassing it.  Includes an excellent walkthrough of power suppl;y circuits, including images, plain language circuit descriptions, and schematics.  Really one of the best tutorials found so far.
 * block diagram of typical SMPS, non power factor corrected
 * 200W ATX power supply schematic No line voltage selector.
 * schematics for several different psu's showing diferent circuit types
 * schematics with descriptions in German
 * diyaudio.com discussion with links to schematics and other discussions
 * schematic including a line voltage selector switch I still don't understand how this circuit works, and think it may be drawn wrong because it looks like the switch shorts out the AC line.
 * datasheet for TNY278PN, a switching control chip found on an example power supply
 * datasheet for a W12NK95Z, the power MOSfet on the example power supply
 * ON semiconductorST MicroTexas InstrumentsFairchild (one I'm using at home)
 * ZWA surface mount transistor This is the pass transistor that supplies voltage to the 3843B
 * website explaining markings and pinouts of 817B optoisolators The 817B optoisolator controls the ZWA transistor that feeds the 3843B PWM controller. So far, I think the problem is somewhere in here.
 * Sharp pc112 Photocoupler datasheet. This photocoupler is used on a 1990's Tandy psu from home, instead of the 817B's used on the ATX's.  Same thing, different package/specs.
 * page on building a tester for optoisolators
 * datasheets for an SG6105D "Power Supply Supervisor" chip found on a different style of power supply, one which had no 3843 pwm chip. This was my first clue to the function of the PS224 chip, for which I could not find a datasheet during initial searches.  I did eventually, however; see below.
 * Silicon Touch, Inc. PS224, "4 channel monitoring IC" This chip was found in ATX's, and according to this datasheet is supposed to take analog inputs from both output voltage and current sensing, as well as AC power circuits, and shut down the UC3843 PWM controller if there is a problem. One pin so far has been found to connect to the input of an 817B optocoupler that supplies Vcc to the 3843 via a PNP surface mount transistor, type ZWA. (ZWA datasheet is above) It remains to be seen whether this chip controlls the other photocouplers.
 * interesting website about SMPS troubleshooting I found this while searching for data on the PS224 secondary monitoring IC. Major points include:
 * a partial schematic showing pin designations of a PS224 monitoring IC
 * analysis of a power supply that killed a mother board
 * using an inductance meter to measure transformer characteritics
 * careful disassembly and detailed photographs showing transformer conduction
 * some transformer secondaries consist of ribbon, not wire, wound in spirals around the form. He claims that current capacity is added by wrapping two separate ribbons and connecting them in parallel, and he believes this causes unbalanced voltages, recirculating currents, and premature failure

websites found 5/10:
 * description of ATX power supply connections  Includes links to schematics.
 * Schematic of Sunny Technologies ATX-230
 * xruna.net Delta GPS-300AB photos website is in russian, but it might be helpful with Google Translator.
 * tutorial on converting TL494 based power supplies into regulated varieable supplies Does not cover UC3843 based supplies
 * repairfaq.org's page on repairing SMPS's
 * RepairFAQ's page on transformer troubleshooting and repair This might help determine if PSU # 3 was destryoed by a short in its transformer's primary

videos watched so far
jerseyj69's excellent tutorial on converting pc power supplies to ham radio power suppliesː
 * video showing how to identify and replace defective capacitors in pc psus
 * part 1
 * part 2
 * Alwaysafix.com's tutorial on identifying and replacing defective caps. Also says to check/replace inline fuse and to use a capacitance meter to check for open or high resistance caps

videos to watch later

 * http://www.youtube.com/watch?v=hMP_zqlgzDc
 * http://www.youtube.com/watch?v=i4jTHhXuKLA
 * http://www.youtube.com/watch?v=ngA4k32jLGc
 * http://www.youtube.com/watch?v=-zRFwJdTBdw
 * http://www.youtube.com/watch?v=rk9BsjgjpqE
 * http://www.youtube.com/watch?v=qdsFf_S525s
 * http://www.youtube.com/watch?v=wItq_T52hdM
 * http://www.youtube.com/watch?v=_b1LvaB_36s
 * http://www.youtube.com/watch?v=KWknRqJQJ3U
 * http://www.youtube.com/watch?v=Z3XIDwnNZhI
 * http://www.youtube.com/watch?v=z2oSFpKh_Uw
 * http://www.youtube.com/watch?v=R6XBWI93fBU
 * http://www.youtube.com/watch?v=o8GoFUwDM4M
 * http://www.youtube.com/watch?v=kWIF5TPHA0M
 * http://www.youtube.com/watch?v=r6IcC_NeFtY
 * http://www.youtube.com/watch?v=TQbQXpJTio0
 * http://www.youtube.com/watch?v=sM6CcxLuw90
 * http://www.youtube.com/watch?v=0PzBeoI6EA4
 * http://www.youtube.com/watch?v=3LBsFrbPzb8
 * http://www.youtube.com/watch?v=3s9_19ZqWv4
 * http://www.youtube.com/watch?v=I7S2kPYm-Iw
 * 1942 TBW radio transmitter - not related, buyt came up in search results
 * http://www.youtube.com/watch?v=E3M4XJLg59M
 * "A Well Made PC power supply"
 * "Tower of Power, pc psus placed in series"
 * http://www.youtube.com/watch?v=jwjkOXWu2zk
 * http://www.youtube.com/watch?v=Z6An-IRTQbo
 * http://www.youtube.com/watch?v=KWknRqJQJ3U
 * http://www.youtube.com/watch?v=BlAb7hZtAps&list=PLvXC3weIaha1o5LI2LajCWgCxv7hG6xM2

arduino code
analogRead syntax:

analogRead(pin#);

pin# must be prefixed with an A to indicate analog in, followed by an integer on the interval [0,5], Example: analog Read(A4);

analogwrite syntax: analogWrite(pin#,pwm value);

pin number can only be one of: {3,5,6,9,10,11} (on duemilanove) value is an integer (int datatype) on the interval [0,255]

arduino page describing data types

code I started writing: Didn't work:

Does work, but uses if statement instead of while loop:

Refined code: works according to plan on serial monitor; no provision for feedback sensor failure, which could cause runaway; has not been tested on an actual PSU yet.

const int refPin = A0, sensePin= A1, outputPin = 3; volatile int storage_vars[] = {0,0}, rate = 0, adj_direct = 0, PWM_value = 0, volt_reference = 0, volts_output = 0;  //places to keep pin readings

void setup{ // Serial.begin(9600);         //optional Serial output monitor pinMode(refPin,INPUT); pinMode(sensePin,INPUT); pinMode(outputPin,OUTPUT);

} void loop{                   //start main loop getData;                   //calls readPins and comparePins if (rate > 0) {    adjustVolts;              //modifies PWM_value based on output and reference voltages }  analogWrite(outputPin,PWM_value);  //sends modified output to power supply }                              // end main loop

/* This function uses a for loop to collect analog values from pins ssent to it, and stores those values in an array*/

void readPins(int aPin, int bPin) {              // start readPins function

int pins[]= {aPin, bPin};   //pins to read     //this array holds the pins we need to read for(int i = 0; i < 2; i++){                   //start for loop; read pin voltage, dump result into array, repeat. storage_vars[i] = analogRead(pins[i]);        // storage_vars[i] holds the voltage readings. }                                             //end for loop }                                                //end readPins

/* this function puts all sorts of internal variables on the serial monitor. These were important for debugging, but you don't want to call this function during normal operation because it will slow processing down.*/ void printOutputs{ Serial.print("ref voltage is:"); Serial.println(storage_vars[0]); Serial.print("output voltage is:"); Serial.println(storage_vars[1]); Serial.print("pwm val is "); Serial.println(PWM_value); Serial.print("rate is "); Serial.println(rate); } /*This function generates error correction signals, one for which way to adjust voltage and another for how quickly to adjust it, depending on how far the output is from the desired voltage.*/ void comparePins{ adj_direct =(storage_vars[0] - storage_vars[1]);   //if this is greater than 0, pull output voltage up; otherwise, drop down. rate = abs(storage_vars[0] - storage_vars[1]);     //function adjustRate uses this in a multi way if-else  statement. } /*calls readPins and comparePins together, so I only have to type one command each time I need to do that*/ void getData{ readPins(refPin,sensePin);    // read pin values comparePins; // printOutputs;             //uncomment this to use the printOutputs function } /* This function determines the amount by which adjustVolts changes the PWM value (which changes output voltage) in a given loop cycle. The idea is that if the output is very far from the input voltage, you want to very quickly change its value to prevent damage/overload, etc, while if it is near the desired voltage, you only want to make a minor correction. This is analogous to running a motor fast when it is far away, then slowing down near the destination to come to a smoothe, precisely determined stop. */ int adjustRate{                   //start adjustRate int R;    if(500 < rate && rate <= 1024)    //if far away from target {     R = 125;                        //adjust a lot }   else if (240 < rate && rate <= 500)  //if nearer to target {     R = 60;                            //adjust less }   else if (100 < rate && rate <= 240)  //and so on. . .   {      R = 25; }   else if (20 < rate && rate <= 100) {     R = 10; }      else                                 //until you're really close to the target {     R = 1;                             //adjust just a tiny bit to get maximum precision }   return R;                           //return the adjustment value to the voltage controlling function }                                    //end adjustRate /* if comparePins and the main loop determine that there is an error in the output, this function modifies the output signal to correct the error. The modified output signal is then sent out by the main loop. */   void adjustVolts{ if (adj_direct > 0) {     PWM_value += adjustRate; }   else {     PWM_value -= adjustRate; }   PWM_value = constrain (PWM_value,0,255); }

references/external links
(see also "prior Work", above)