[Very practical] Hands-on teaching of circuit board debugging skills
[Copy link]
Debugging is a must for junior electronic engineers at the primary stage! So I have combined several debugging articles and my own experience to recommend them to you. Please feel free to give me your advice if there are any shortcomings. Practice shows that even if an electronic device is installed according to the designed circuit parameters, it is often difficult to achieve the expected effect. This is because people cannot fully consider various complex objective factors (such as component value errors, device parameter dispersion, and the influence of distributed parameters) when designing. They must discover and correct the shortcomings of the design through testing and adjustment after installation, and then take measures to improve it so that the device can reach the predetermined technical indicators. Therefore, the skill of debugging electronic circuits is indispensable for people engaged in electronic technology and related fields. Common instruments for debugging include: voltage stabilized power supply, multimeter, oscilloscope, spectrum analyzer, signal generator, etc. The debugging of electronic circuits includes two aspects: testing and adjustment. The meaning of debugging is twofold: one is to make the electronic circuit reach the specified indicators through debugging; the other is to discover the defects in the design and correct them through debugging. 1. General steps of electronic circuit debugging Traditional Chinese medicine emphasizes "look, smell, ask, and feel" when treating patients. In fact, the same is true for debugging circuits. First, "look", that is, observe the soldering of the circuit board. Mature electronic products usually have problems with soldering; second, "smell", haha, this does not mean to smell the circuit board first, but to listen to whether the circuit board makes abnormal noises after power is turned on, and whether it makes noises that should not be made and does not make noises that should be made; third, "ask", if it is your first time debugging, and it is not your own design, you should ask what the power supply is? Has someone else debugged it? What are the problems? Fourth, "feel", are the components fully soldered, is the chip soldered correctly, and are the solder joints that are not easy to observe soldered well? Generally, doing these steps before debugging can find many problems. Depending on the complexity of the electronic circuit, debugging can be carried out in steps: For a simpler system, the debugging steps are: power supply debugging → single board debugging → joint debugging. For a more complex system, the debugging steps are: power supply debugging → single board debugging → extension debugging → host debugging → joint debugging. From this, we can make three points clear: (1) Regardless of whether the system is simple or complex, debugging starts with the power supply; (2) The debugging method is generally to debug the local (unit circuit) first and then the whole, and to debug the static first and then the dynamic; (3) Generally, it is necessary to go through a repeated process of measurement → adjustment → re-measurement → re-adjustment; for complex electronic systems, debugging is also a process of "system integration". After the unit circuit debugging is completed, the system joint debugging can be carried out. For example, the data acquisition system and control system are generally composed of analog circuits, digital circuits and microprocessor circuits. During debugging, these three parts of the circuit are often debugged separately. After reaching the design indicators respectively, they are added into the interface circuit for joint debugging. Joint debugging is to test and adjust the performance indicators of the total circuit. If it does not meet the design requirements, the reasons should be carefully analyzed and the corresponding units should be found for adjustment. It is not ruled out that the parameters of multiple units need to be adjusted or adjusted multiple times, and there is even the possibility of a correction plan. 2. Specific steps for debugging electronic circuits (1) Power-on observation: After powering on, do not rush to measure electrical indicators, but observe the circuit for any abnormalities, such as smoke or unusual odors, and touch the integrated circuit package to see if it is hot. If any abnormality occurs, turn off the power immediately and power on again after troubleshooting. (2) Static debugging: Static debugging generally refers to the DC test performed without adding input signal or only adding fixed level signal. The potential of each point in the circuit can be measured by a multimeter. By comparing with the theoretical estimated value and combining the analysis of the circuit principle, it is possible to determine whether the DC working state of the circuit is normal and timely discover components in the circuit that are damaged or in critical working state. By replacing components or adjusting circuit parameters, the DC working state of the circuit can meet the design requirements. (3) Dynamic debugging: Dynamic debugging is based on static debugging. Appropriate signals are added to the input end of the circuit. The output signals of each test point are detected in sequence according to the direction of the signal flow. If any abnormal phenomenon is found, the cause should be analyzed and the fault should be eliminated. Then debugging should be carried out until the requirements are met. During the test, you cannot rely solely on your feelings or impressions. You must always use instruments for observation. When using an oscilloscope, it is best to set the signal input mode of the oscilloscope to the "DC" position. Through DC coupling, the AC and DC components of the measured signal can be observed simultaneously. Through debugging, finally check whether the various indicators of the functional blocks and the whole machine (such as signal amplitude, waveform shape, phase relationship, gain, input impedance and output impedance, sensitivity, etc.) meet the design requirements. If necessary, further propose reasonable corrections to the circuit parameters. 3. Some issues in electronic circuit debugging (1) According to the working principle of the system to be debugged (schematic diagram and PCB), formulate debugging steps and measurement methods, determine the test points, mark the positions on the drawings and boards, draw debugging data record tables, etc. (2) Set up a debugging workbench, and equip the workbench with the required debugging instruments. The instruments should be easy to operate and observe. Students often do not pay attention to this problem. When making or adjusting the machine, the workbench is very messy, and tools, books, clothes, etc. are mixed with instruments, which will affect debugging. Special reminder: When making and debugging, be sure to keep the workbench clean and tidy. This is "sharpening the knife does not delay the chopping of wood." (3) For hardware circuits, measuring instruments should be selected for the system being debugged, and the accuracy of the measuring instruments should be better than that of the system being tested; for software debugging, microcomputers and development tools should be equipped. (4) The debugging sequence of electronic circuits is generally carried out according to the signal flow direction. The output signal of the previously debugged circuit is used as the input signal of the next level to create conditions for the final unified debugging. (5) When using programmable logic devices to implement digital circuits, you should complete the input, debugging and downloading of the programmable logic device source files, and connect the programmable logic devices and analog circuits into a system to perform overall debugging and result testing. (6) During the debugging process, you should carefully observe and analyze the experimental phenomena, keep good records, and ensure the integrity and reliability of the experimental data. 4. Work before debugging After the circuit is installed, it is usually not advisable to rush to power it on. You should check it carefully first. The inspection contents include: (1) Whether the connection is correct: Check whether the circuit connection is correct, including wrong wiring (one end of the connection is correct and the other end is wrong), missing wires (wires completely missed during installation) and extra wires (both ends of the connection do not exist on the circuit diagram). There are usually two ways to check the line: 1) Check the installed line according to the circuit diagram: This method is characterized by connecting the lines according to the circuit diagram and checking the installed lines one by one in a certain order, so that it is relatively easy to find wrong lines and missing lines. 2) Check the line according to the actual line against the principle circuit: This is a method of checking the line with components as the center. Check the connection of each component (including device) pin at a time, and check whether each location exists on the circuit diagram. This method can not only find wrong lines and missing lines, but also easily find multiple lines. In order to prevent mistakes, the checked lines should usually be marked on the circuit diagram. It is best to use the "Ω×1" block of a pointer multimeter or the buzzer of the "Ω block" of a digital multimeter to measure, and the component pins should be measured directly, so that poor contact can be found at the same time. (2) Component installation Check whether there is a short circuit between the pins of the components; whether there is poor contact at the connection; whether the polarity of the diodes, transistors, integrated devices and electrolytic capacitors are connected correctly. (3) Check whether the power supply (including polarity) and signal source connection are correct. (4) Check whether there is a short circuit between the power supply and the ground. If the circuit has passed the above inspection and is confirmed to be correct, you can proceed to debugging. 5. Debugging method Debugging includes two aspects: testing and adjustment. The so-called debugging of electronic circuits is a series of repeated processes of measurement → judgment → adjustment → re-measurement for the purpose of achieving circuit design indicators. In order to make the debugging go smoothly, it is best to indicate the potential value of each point, the corresponding waveform diagram and other main data on the designed circuit diagram. The debugging method usually adopts separate adjustment first and then joint adjustment (total adjustment). We know that any complex circuit is composed of some basic unit circuits. Therefore, when debugging, we can follow the flow of signals and adjust each unit circuit step by step so that its parameters basically meet the design indicators. The core of this debugging method is to debug each functional block (or basic unit circuit) that makes up the circuit first, and then gradually expand the debugging scope on this basis, and finally complete the debugging of the whole machine. The advantage of using separate debugging first and then joint debugging is that problems can be discovered and solved in time. This method is generally used for newly designed circuits. This method should be used for debugging electronic devices that include analog circuits, digital circuits, and microcomputer systems. Because only after the three parts are debugged separately and the design indicators are achieved respectively, and after passing through the signal and level conversion circuits, can the whole machine be debugged. Otherwise, due to the mismatch between the input and output voltages and waveforms required by each circuit, blindly conducting joint debugging may cause a large number of device damages. In addition to the above methods, one-time debugging can also be used for finalized products and products that need to cooperate with each other to operate. 6. Notes on debugging Whether the debugging result is correct is largely affected by the measurement accuracy and measurement precision. In order to ensure the debugging effect, the measurement error must be reduced and the measurement accuracy must be improved. To this end, please note the following points: (1) Correctly use the ground terminal of the measuring instrument."]When measuring with an electronic instrument whose ground terminal is connected to the housing, the ground terminal of the instrument should be connected to the ground terminal of the amplifier. Otherwise, the interference introduced by the instrument housing will not only change the working state of the amplifier, but also cause errors in the measurement results. According to this principle, when debugging the emitter bias circuit, if VCE needs to be measured, the two ends of the instrument should not be directly connected to the collector and emitter, but VC and VE should be measured to the ground respectively, and then the two should be subtracted to obtain VCE. If a multimeter powered by a dry cell is used for measurement, since the two input terminals of the meter are floating, it is allowed to be directly connected between the measurement points. (2) The input impedance of the instrument used to measure voltage must be much larger than the equivalent impedance of the measured point. If the input impedance of the measuring instrument is small, it will cause shunting during measurement, which will bring great errors to the measurement results. (3) The bandwidth of the measuring instrument must be larger than the bandwidth of the circuit being measured. For example, the operating frequency of the MF-20 multimeter is 20 to 20,000 Hz. If the amplifier's fh = 100 kHz, we cannot use MF-20 to test the amplifier's amplitude-frequency characteristics. Otherwise, the test results will not reflect the amplifier's true condition. (4) Correctly select the measurement point. When the same measuring instrument is used for measurement, the error introduced by the instrument's internal resistance will be different if the measurement point is different. For example, for the circuit shown in Figure 1, when measuring the voltage VC1 at point C1, if e2 is selected as the measurement point and VE2 is measured, the result obtained according to VCl=VE2+VBE2 may be much smaller than the error of VC1 obtained by directly measuring point Cl. This happens because Re2 is small and the measurement error introduced by the internal resistance of the instrument is small.
(5) The measurement method should be convenient and feasible[/ color] When it is necessary to measure the current of a circuit, it is usually better to measure the voltage instead of the current, because measuring the voltage does not require changing the circuit being measured, and the measurement is convenient. If you need to know the current value of a branch, you can get it by measuring the voltage across the resistor in the branch and converting it. (6) During the debugging process, we should not only observe and measure carefully, but also be good at recording. The recorded content should include experimental conditions, observed phenomena, measured data, waveforms and phase relationships, etc. Only with a large number of reliable experimental records and comparing them with theoretical results can we discover problems in circuit design and improve the design plan. 7. Solutions to faults during debugging We should carefully find the cause of the fault. We must not remove the line and reinstall it when the fault cannot be solved. Because the reinstalled line may still have various problems, if it is a problem in principle, even reinstalling it will not solve the problem. We should regard finding faults and analyzing the causes of faults as a good learning opportunity, and use it to continuously improve our ability to analyze and solve problems. [color=rgb(51, 51,(51)](1) General method of checking faults A fault is an unexpected but inevitable abnormal working condition of a circuit. Analyzing, finding and troubleshooting faults are essential practical skills for electrical engineers. For a complex system, it is not easy to quickly and accurately find faults among a large number of components and circuits. The general fault diagnosis process is to start from the fault phenomenon, make analysis and judgment through repeated tests, and gradually find the cause of the fault. (2) Fault phenomena and causes of faults 1) Common fault phenomena: The amplifier circuit has no input signal but has an output waveform. The amplifier circuit has an input signal but no output waveform, or the waveform is abnormal. The series-connected voltage-stabilized power supply has no voltage output, or the output voltage is too high and cannot be adjusted, or the output voltage stabilization performance deteriorates, the output voltage is unstable, etc. The oscillation circuit does not oscillate. The counter output waveform is unstable, or it cannot count correctly. The radio has a "buzzing" AC sound and a "pa pa" steamboat sound, etc. The above are some of the most common fault phenomena. There are many strange phenomena, which are not listed here one by one. 2) Causes of the fault: There are many reasons for the fault, and the situation is very complicated. Some are simple faults caused by one reason, and some are complex faults caused by the interaction of multiple reasons. Therefore, it is difficult to simply classify the causes of the fault. Only some rough analysis can be carried out here. If a finalized product fails after a period of use, the cause of the failure may be damage to components, short circuit or open circuit in the connection (such as poor soldering of solder joints, poor contact of connectors, poor contact of variable resistors, potentiometers, semi-variable resistors, etc., oxidation of the contact surface coating, etc.), or changes in usage conditions (such as grid voltage fluctuations, over-cold or over-heated working environment, etc.) that affect the normal operation of the electronic equipment. For a newly designed and installed circuit, the cause of the failure may be: the actual circuit does not match the designed schematic diagram; the components are welded incorrectly, the components are used improperly or are damaged; the designed circuit itself has some serious shortcomings and does not meet the technical requirements; the connection is short-circuited or open-circuited, etc. Failures caused by improper use of instruments, such as abnormal or no waveform caused by improper use of an oscilloscope, interference introduced by improper grounding problems, etc. Faults caused by various interferences. (3) General methods for checking faults The order of fault finding can be from input to output, or from output to input. The general methods of fault finding are: 1) Direct observation method: Direct observation method refers to the use of human vision, hearing, smell, touch, etc. as means to discover problems, find and analyze faults without using any instruments. Direct observation includes power-off inspection and power-on observation. Check whether the selection and use of instruments are correct; whether the level and polarity of the power supply voltage meet the requirements; whether the polarity of electrolytic capacitors, the pins of diodes and transistors, and the pins of integrated circuits are connected incorrectly, missed, or touched; whether the wiring is reasonable; whether the printed circuit board is broken; whether the resistors and capacitors are burnt or cracked, etc. Turn on the power and observe whether the components are hot or smoking, whether the transformer has a burnt smell, whether the filaments of the electron tubes and oscilloscope tubes are bright, and whether there is high voltage sparking. This method is simple and effective. It can be used for preliminary inspection, but it is powerless for more hidden faults. 2) Check the static operating point with a multimeter The power supply system of the electronic circuit, the DC working state of the semiconductor transistor and integrated circuit (including the components, device pins, power supply voltage), and the resistance value in the circuit can all be measured with a multimeter. When the measured value is significantly different from the normal value, the fault can be found after analysis. By the way, the static operating point can also be measured using the oscilloscope's "DC" input method. The advantages of using an oscilloscope are: high internal resistance, the ability to simultaneously see the DC operating state and the signal waveform at the measured point, as well as possible interference signals and noise voltages, which is more conducive to fault analysis. 3) Signal tracing method For various more complex circuits, a signal of a certain amplitude and appropriate frequency can be connected to the input end (for example, for a multi-stage amplifier, a sine signal of f=1000 Hz can be connected to its input end). Use an oscilloscope to observe the changes in waveform and amplitude from the front stage to the back stage (or vice versa). If any stage is abnormal, the fault is at that stage. This is a method for in-depth inspection of the circuit. 4) Comparison method When you suspect a circuit has a problem, you can compare the parameters of this circuit with the parameters of a normal circuit with the same working state (or the current, voltage, waveform, etc. analyzed in theory) to find out the abnormal situation in the circuit, analyze the cause of the fault, and determine the fault point. 5) Component replacement method [font=-apple-system-font, BlinkMacSystemFont, Sometimes the fault is more hidden and cannot be seen at a glance. If you have an instrument of the same model as the faulty instrument, you can replace the parts, components, plug-in boards, etc. in the instrument with the corresponding parts in the faulty instrument to narrow the scope of the fault and further find the fault. 6) Bypass method When there is a parasitic oscillation phenomenon, you can use a capacitor of appropriate capacity, select an appropriate checkpoint, and temporarily bridge the capacitor between the checkpoint and the reference ground point. If the oscillation disappears, it means that the oscillation is generated near this point or in the previous circuit. Otherwise, it is at the back, and you can move the checkpoint to find it. It should be pointed out that the bypass capacitor should be appropriate and not too large, as long as it can better eliminate harmful signals. 7) Short-circuit method 7) Short-circuit method It is a method of temporarily short-circuiting a part of the circuit to find the fault. The short-circuit method is most effective for checking open circuit faults. However, it should be noted that the short-circuit method cannot be used for the power supply (circuit). 8) Breaking method The circuit breaking method is the most effective for checking short circuit faults. The circuit breaking method is also a method to gradually narrow down the scope of suspected fault points. For example, a voltage stabilizer is connected to a circuit with a fault, causing the output current to be too large. We take the approach of disconnecting a branch of the circuit in turn to check the fault. If the current returns to normal after disconnecting the branch, the fault occurs in this branch. During actual debugging, there are many ways to find the cause of a fault. The above only lists a few commonly used methods. These methods can be used flexibly according to equipment conditions and fault conditions. For simple faults, one method can be used to find the fault point, but for more complex faults, multiple methods must be used to complement and cooperate with each other to find the fault point. In general, the conventional way to find faults is to first use direct observation to eliminate obvious faults. Then use a multimeter (or oscilloscope) to check the static operating point. The signal tracing method is a simple and intuitive method that is generally applicable to various circuits and is widely used in dynamic debugging. It should be pointed out that it is more difficult to diagnose faults within the feedback loop. In this closed loop, as long as one component (or functional block) fails, faults often exist everywhere in the entire loop. The method of finding faults is to first disconnect the feedback loop to make the system an open-loop system, then connect an appropriate input signal, and use the signal tracing method to find the faulty components, devices (or functional blocks) one by one.
|