Search This Blog

Saturday 16 February 2013

Debug–Binary Search

Sometimes, debugging of complicated circuits is an unavoidable task. To ease this process, some concept about binary search will proves to be helpful.
The idea about debugging using binary search as follow:
  • For a know series of circuit block that give un-expected result - always try to determine which half the the series that cause the problem
  • Repeat the iteration till faulty block found
For example:
In the diagram shown below, let x be the input, and output of each block be yn, where n is the block number, and block 15 coloured in red is the faulty block.
image
start: y16/x is not expected
  1. confirm y8/x is expected or not
  2. since y8/x is expected, we know the faulty block should be some where from block 9 to block 16, evaluate y12/y8
  3. since y12/y8 is working, faulty block should be some where from block 13 to block 16, evaluate block y14/y12
  4. y14/y12 is still working, faulty block should be some where from block 15 to block 16
thus regardless of where the faulty block is, the search terminate fast. In this example, if you were to use linear search method by evaluating from block #1 , block #2… , it will take you more time.

Sunday 3 February 2013

Debug – Inverting Op Amp

image
Let’s say you measured Vin = –1V, but Vout way off +1V, now what can be wrong? How do you debug it? Below are some suggestions for you to consider:
  • check the supply to see if the supplies are correct
  • visual inspect for
    • wrong polarity
    • wrong part (if manual assembly involved)
    • missing solder or “cold” solder
  • check if wrong resistors being loaded - power down – measure resistance of R1, R2 to see if any of R1, R2 is larger than 1KOhm – since this is in-circuit measurement – we don’t expect to see 1KOhm, but we definitely expect 1KOhm or less, since parallel resistance of any resistors is the minimum of those.
  • check if oscillation occurs - if everything looks good – get hold of a scope and confirmed there’s no oscillation on either pins mentioned above
  • check if op-amp already sourcing too much current - lift output pin, insert a small resistance resistor from pin to pad, measure the voltage drop to see if the amp is sourcing or sinking more that datasheet stated. It is possible that the next stage is demanding more current than expected.
So good luck with your troubleshooting Smile