RobotGuide

Hardware & electrical · topic E13 · 25 hours

Instruments & electrical debugging

The hardest faults to hunt in electronics control are not «does not work» but «occasionally does not work». Multimeter, oscilloscope, and logic analyzer each answer different questions; the wrong tool burns three days on guessing.

Engineering stage · Intermediate
System software · Aware Embedded & controls · Proficient Mechanical · Aware

Tools
Tools

What to learn

  • Multimeter: continuity, voltage, current, diode mode — practical usage and common misreadings
  • Oscilloscope: bandwidth and sample rate should be ≥ 5× the signal's highest frequency; the difference between 1× and 10× probes; why the ground spring is mandatory
  • Reading four kinds of waveforms: PWM with dead time, phase currents, bus ripple, differential comms signals
  • Triggering: edge, pulse width, runt, serial; using single-shot capture to catch intermittent faults
  • Logic analyzer: I2C / SPI / UART decoding, timing measurement, protocol triggering
  • Current measurement: shunt resistor + differential probe, current probes, handling common-mode interference
  • Noise introduced by measurement itself: lengthen the probe ground lead and the waveform turns to fuzz — suspect the measurement before the circuit
  • Safety: high-voltage differential, floating measurements, isolation transformers — and «never clip the scope's ground lead to a non-ground potential»

The lesson · plain words

Instruments are the hardware engineer's ears and eyes. This page covers the three most used — multimeter, oscilloscope, logic analyzer — plus one core concept: triggering.

The oscilloscope's soul: triggering

Without a trigger, every frame starts at a different point and the screen «rolls into a blur» forever. A trigger = start drawing each sweep from «the signal crosses the set level», and the waveform instantly steadies. Watch the figure and drag the trigger level: the moment the trace crosses that line is the start of every frame.

Two advanced triggers to master: pulse-width trigger (catching abnormally narrow pulses — glitches) and serial trigger (decoding I2C/SPI/CAN directly). Catching «intermittent anomalies» depends on clever trigger conditions, not luck.

Interactive figure · drag it and see

What this figure shows: an oscilloscope screen in two states — untriggered, where the waveform rolls forever and everything is a blur, versus triggered, where the trace is rock steady; a draggable trigger-level line sets where each sweep starts. Takeaway: a trigger always restarts drawing from «the signal crosses this level» — a stable trace is the precondition of every scope measurement.

Probes and bandwidth: the precondition of measuring accurately

Probe basics: a 10:1 probe needs compensation calibration (overshoot on the square wave = overcompensated); use a short ground lead for high-speed signals (a long ground lead is inductance = fake ringing); when measuring supply ripple, set the bandwidth limit to 20 MHz (otherwise the probe's detected high-frequency noise will scare you).

Bandwidth choice: probe bandwidth ≥ 3–5× the signal's highest frequency. A 100 MHz scope already struggles with a 50 MHz clock. The logic analyzer is the opposite: it only sees 0/1, and 16 channels watching timing relationships beat the scope — the two tools complement each other.

The logic analyzer: the protocol-watching blade

I2C bus stuck (a slave holding SDA and refusing to let go), SPI mode misconfigured (CPOL/CPHA), wrong UART baud — one logic-analyzer decode and the answer falls out. An LA1010 costing a couple dozen yuan plus PulseView is enough.

Workflow: four channels on SDA/SCL/A/B respectively, set the decode protocol, capture a stretch of traffic, and check it byte by byte against the protocol manual. 90% of hardware comms problems are solved at this step; the remaining 10% are power and ground.

The hardware edition of debugging methodology

The hardware triad: measure power first (are the voltages right, how big is the ripple?), then clock (did the crystal start oscillating?), then comms (does the waveform match the protocol?). Three steps cover 80% of «the board does not work».

Record-keeping: save a screenshot of every measurement, annotated with test point and conditions. Hardware problems «happen occasionally»; only with baseline records can you spot «what is different this time».

Three questions — do you really get it?

1. A waveform «rolling into a blur» on the scope means?

  • AThe signal is too weak
  • BThe probe is broken
  • CNo trigger is set; every frame starts inconsistently
Show answer

C. A trigger restarts every sweep from the same event; only then can the waveform hold still.

2. Why enable the 20 MHz bandwidth limit when measuring supply ripple?

  • ATo protect the scope
  • BTo reject the probe's irrelevant high-frequency detection and see the true supply ripple
  • CTo save power
Show answer

B. The ripple spec is defined at 20 MHz. At full bandwidth, the probe-detected high-frequency noise misleads the judgment.

3. The most likely cause of a stuck I2C bus (SDA held low)?

  • APull-up resistor too large
  • BA slave is waiting for clocks — the master sent half a clock too few around an ACK bit
  • CVoltage too high
Show answer

B. The classic nine-clock problem. A logic analyzer makes it obvious; the fix is clocking out the extra pulses or resetting the bus.

Keep going deeper

Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.

How it fails in the field

  • Measuring PWM duty cycle with a multimeter: it reads an average, which has no direct relation to duty cycle
  • Using a long alligator ground lead on the probe: it injects ringing, and everything you see is noise from outside the system under test
  • Watching only one channel: PWM and phase current must be seen together, or cause and effect never line up
  • Insufficient scope bandwidth: the «clean waveform» you see is a filtered illusion

You have learned enough when

Answer three questions within 30 minutes with screenshot evidence: ① the dead time of this PWM ② how far the bus voltage dips at motor start ③ whether this I2C's rise time exceeds spec (is the bus capacitance too large). All three answers must be waveform readings, not «about».

The Chinese edition carries the full topic page for Instruments & electrical debugging, including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/E13/.