motor_drives

Transmission compliance deserves emphasis because it sets a hard ceiling on control bandwidth.
Motor and load inertias connected by a flexible element form a two-mass resonant system, and a
control loop with bandwidth approaching that resonance excites it and becomes unstable. The
practical limit is roughly a third to a half of the resonant frequency, so a compliant belt drive
with a resonance at eighty hertz limits the loop to perhaps thirty, regardless of how good the
motor and drive are. Improving the response therefore requires stiffening the transmission rather
than tuning the controller, which is a mechanical fix to what presents as a control problem.


motor_drives

Sensing, Motion Profiles, and Transmission

[user] My servo axis oscillates at about 45 Hz when I raise the position loop gain, well before
reaching the performance I need.
[assistant] tool_call motion.tuning_diagnose({"oscillation_hz": 45, "loop": "position",
"transmission": "toothed_belt", "motor_inertia_kgcm2": 0.9, "load_inertia_kgcm2": 12,
"encoder": "motor_side_only", "current_bandwidth_hz": 900, "velocity_bandwidth_hz": 60})
[tool] {"cause": "two_mass_resonance_from_belt_compliance",
"estimated_resonance_hz": 45, "inertia_ratio": 13.3,
"achievable_bandwidth_limit_hz": [15, 22], "recommendations": ["stiffen_transmission",
"notch_filter", "load_side_feedback", "reduce_inertia_ratio"]}
[assistant] You are exciting the mechanical resonance between the motor and the load through the
belt's compliance, and no amount of controller tuning removes it.


motor_drives

Your motor and load inertias, coupled through a compliant belt, form a two-mass system resonating
at about 45 Hz — exactly where you see the oscillation. A position loop with bandwidth approaching
that frequency feeds energy into the mode, and the standard limit is a third to a half of the
resonance, so 15 to 22 Hz is what this mechanical arrangement supports.


motor_drives

Your inertia ratio of 13 to 1 makes it worse, because the resonance is more pronounced when the
load inertia dominates. The motor barely feels the load through the compliance at that frequency,
so the two masses move independently.


motor_drives

Four options, in order of how much they buy.


motor_drives

Stiffen the transmission. This raises the resonant frequency directly and is the only change that
raises the ceiling rather than working beneath it. A wider or shorter belt, a stiffer belt
material, a higher preload, or replacing the belt with a direct coupling or a stiffer gearbox all
help. Doubling the stiffness raises the resonance by about forty percent.


motor_drives

Add a notch filter at 45 Hz in the velocity loop. This attenuates the controller's output at the
resonant frequency so it stops exciting the mode, and it typically permits a fifty to hundred
percent bandwidth increase. It is the standard remedy and it is a workaround rather than a fix —
the resonance is still there and a shift in its frequency, from load change or belt ageing, moves
it out of the notch.


motor_drives

Reduce the inertia ratio, by a different gear ratio or a larger motor. This reduces the
resonance's severity though not its frequency.


motor_drives

Add load-side feedback. You are measuring at the motor, so the loop does not see what the load is
actually doing and the compliance is entirely outside the loop. A second encoder on the load,
used in a dual-loop arrangement, closes the position loop around the actual output. This is the
most capable arrangement and it is more complex to tune, since the compliance is now inside the
loop.


motor_drives

One check first: verify the 45 Hz is mechanical rather than electrical by disconnecting the load
and repeating. If the oscillation disappears, it is the resonance as diagnosed. If it persists, the
velocity loop tuning or a sensor issue is involved and the fix is different.


motor_drives

## Sizing, Thermal, and Diagnostics

Sizing a motor requires the load's torque and speed requirements across the whole duty cycle
rather than at a single operating point. The peak torque requirement, typically during
acceleration, must be within the motor's peak capability. The root mean square torque over the
cycle must be within the continuous rating, since that is what determines the heating. And the
maximum speed must be achievable at the available supply voltage against the back EMF.


motor_drives

The distinction between peak and continuous rating is thermal. A motor's peak torque is limited by
magnetic saturation and by the drive's current capability, and it can be delivered briefly. The
continuous rating is limited by heat — the losses at that current, dissipated through the motor's
thermal path, must reach a steady temperature within the winding insulation's limit. A motor can
therefore deliver several times its continuous torque for seconds and would overheat within
minutes.


motor_drives

Diagnostics benefit from the motor being an accessible sensor of its own condition. Current
consumption reflects the mechanical load directly, so a rising trend at constant commanded motion
indicates increasing friction — a failing bearing, a contaminated guideway, a misalignment.
Following error reflects whether the axis is achieving its command. And the current signature's
frequency content reveals mechanical faults, since a defect in a bearing or a gear produces a
periodic load variation at a frequency determined by the geometry.


motor_drives

Sizing and diagnostics:
  peak torque          acceleration; limited by saturation and drive current
  RMS torque           over the duty cycle; determines heating and must be within
                       the continuous rating
  duty cycle analysis  sizing from a single operating point is the common error
  speed requirement    achievable against back EMF at the supply voltage
  thermal path         winding to stator to housing to mount; the mounting
                       substantially affects the continuous rating
  insulation class     the temperature limit; life halves per ten degrees above it
  derating             for ambient temperature, altitude, and enclosure
  service factor       margin for the unexpected; sizing to exactly the
                       calculated requirement leaves none
  current monitoring   reflects load; a rising trend indicates increasing friction
  following error      command minus actual; the primary health signal
  current signature    frequency content reveals bearing and gear defects at
                       characteristic frequencies
  temperature sensing  in the winding where possible; thermal models estimate it
                       where not
  safe torque off      a hardware path removing the drive's ability to produce
                       torque, independent of the software; the standard
                       functional safety mechanism, and it is not the same as
                       commanding zero


motor_drives

Safe torque off deserves the closing emphasis because the distinction it embodies is a safety
requirement rather than a design preference. Commanding a motor to zero torque relies on the
software, the communication, and the drive all functioning, and none of those can be relied upon in
a safety argument. Safe torque off is a hardware path that removes the gate drive supply
independently of the control system, so no software fault, no communication failure, and no
processor lockup can produce motion. Any machine where unexpected motion could injure someone
requires this rather than a software interlock, and it is the reason the function exists as a
certified capability in industrial drives rather than as something implemented in firmware.


pcb_design

PCB Design and Electronics Manufacturing

## Stackup and Board Construction

A printed circuit board is a laminated stack of conductive copper layers separated by
insulating substrate, and the stackup — how many layers, how thick, and in what arrangement —
is the first design decision and constrains everything after it. A two-layer board is cheapest
and provides no continuous reference plane, which limits it to low-speed work. A four-layer
board with signal, ground, power, and signal layers gives every signal an adjacent reference
plane and is the practical minimum for anything with fast edges or a microcontroller running
above a few tens of megahertz.


pcb_design

The reference plane is the reason layer count matters more than routing space. High-frequency
return current does not take the shortest resistive path back to the source; it takes the path
of least inductance, which is directly beneath the outgoing trace. A continuous plane under
every signal provides that path with a minimal loop area, which keeps emissions low, keeps
susceptibility low, and keeps the trace impedance controlled. Interrupting that plane with a
split, a slot, or a dense field of via antipads forces the return current to detour, creating a
large loop that both radiates and picks up interference.


pcb_design

Material choice affects loss and dimensional stability. Standard FR-4 is a glass-reinforced
epoxy that is inexpensive and adequate to a few gigahertz, with a dielectric constant around
4.3 that varies with frequency and with the glass weave. Low-loss laminates have lower and more
stable dielectric constants and lower dissipation factors, which matters above a few gigahertz
where FR-4's loss becomes significant. Flexible polyimide substrates permit bending, and
rigid-flex construction combines both in one assembly.


pcb_design

Stackup and materials:
  two layer            cheapest; no continuous reference plane; low speed only
  four layer           signal, ground, power, signal; the practical minimum for
                       fast edges
  six and above        more routing layers and more planes; better isolation
  reference plane      continuous, unbroken, directly adjacent to every signal
                       layer
  return current       follows the path of least inductance, directly beneath the
                       trace at high frequency
  plane splits         force return detours; never route a signal across one
  FR-4                 glass-epoxy; Dk ~4.3, adequate to a few GHz
  low-loss laminate    stable Dk, low loss tangent; above a few GHz
  polyimide            flexible; flex and rigid-flex
  copper weight        1 oz is ~35 um; heavier for high current
  controlled impedance  trace width and spacing to the reference set it; specify
                       it to the fabricator rather than calculating alone, since
                       it depends on their actual stackup
  symmetric stackup    balanced copper distribution prevents warping during
                       reflow


pcb_design

Impedance control is worth specifying explicitly rather than computing and hoping. The
characteristic impedance of a trace depends on its width, its height above the reference plane,
the dielectric constant, and the copper thickness, and the fabricator's actual layer thicknesses
differ from nominal. Providing the target impedance as a requirement lets them adjust the trace
width to their stackup, which is the only way to achieve the tolerance that high-speed
interfaces require.


pcb_design

Q: A high-speed signal trace crosses a gap in the ground plane beneath it. The most likely
consequence is:
A. No effect, since the signal path is unbroken
B. The return current must detour around the gap, creating a large loop that radiates and
   raises the impedance discontinuity
C. The trace resistance increases
D. The signal is shorted
Reasoning: At high frequency the return current flows directly beneath the trace. A gap forces
it around, and the resulting loop area produces electromagnetic emission, increased
susceptibility, and a local impedance discontinuity causing reflection. This is one of the most
common and most consequential layout errors, and it is invisible in a schematic. Answer: B.


pcb_design

## Schematic and Layout Practice

The schematic communicates circuit intent and should be organized for a human reader rather
than for the tool. Signals flowing left to right and power flowing top to bottom is the
convention that makes a schematic scannable. Functional blocks kept on separate sheets or in
separate regions with clear boundaries let a reader locate a subsystem. Net names that describe
function rather than tool-generated identifiers make the netlist readable and make debugging
possible.


pcb_design

Component selection at schematic time determines the layout's difficulty and the board's
manufacturability. Package choice affects assembly cost, rework feasibility, and thermal
behaviour. Availability determines whether the design can be built, and designing around a part
with a long lead time or a single source is a schedule risk that surfaces at the worst moment.
Checking availability and lifecycle status before committing is a step that is skipped often
enough to be worth stating.


pcb_design

Layout converts the schematic into physical geometry, and the sequence that works is placement
first, then power distribution, then critical signals, then everything else. Placement
determines most of the routing difficulty, and time spent iterating placement before routing
saves far more time than it costs. Components should be grouped by function, with the parts
associated with a given circuit kept together, and oriented consistently to simplify assembly
and inspection.


pcb_design

Layout sequence and practice:
  placement first      it determines routing difficulty more than anything else
  group by function    keep each subcircuit's parts together
  decoupling adjacent  place the smallest capacitor closest to the supply pin,
                       with the shortest possible loop to the planes
  crystal placement    close to the microcontroller, guard traces, no signals
                       routed underneath
  connector placement  at the board edge, oriented for the enclosure
  thermal placement    hot components spread out, away from temperature-sensitive
                       parts
  keep-out areas       antennas, mounting hardware, moving parts
  trace width          by current; roughly 1 mm per amp on 1 oz outer copper for
                       a 10 C rise, and check a calculator rather than guessing
  differential pairs   route together, matched length, consistent spacing
  length matching      for parallel buses; match to the timing budget, not
                       arbitrarily
  via stitching        connect planes together frequently; reduces plane
                       resonance and provides return paths near layer transitions
  return path vias     when a signal changes layers between different reference
                       planes, place a nearby via connecting those planes, or the
                       return current has no local path
  test points          plan them; probing a finished board without them is
                       difficult and often impossible


pcb_design

Return path vias are the detail most often omitted and most consequential in high-speed
designs. When a signal transitions from one layer to another, its return current must also
transition between reference planes, and it can only do so through a connection between them. If
the two planes are both ground, a stitching via near the signal via provides that path. If one
is ground and one is power, a decoupling capacitor near the transition provides an
alternating-current path. Without either, the return current travels to the nearest available
connection, which may be centimetres away, creating exactly the loop the stackup was designed to
avoid.


pcb_design

## Power Distribution and Signal Integrity

The power distribution network delivers current to every component with acceptable voltage
variation, and its behaviour is a frequency-domain problem rather than a direct-current one. A
digital circuit draws current in pulses synchronized to its clock, so the supply must present
low impedance across a wide frequency range — the bulk capacitors handle low frequencies, the
plane capacitance and small ceramics handle high frequencies, and the region between is where
resonances appear.


pcb_design

Decoupling capacitor selection is governed by inductance rather than by capacitance. Every
capacitor has a self-resonant frequency above which it behaves as an inductor, set by its
capacitance and its parasitic inductance, and that parasitic inductance is dominated by the
mounting geometry rather than by the part. A capacitor placed adjacent to the pin with short
wide traces and vias directly into the planes has perhaps a third the loop inductance of the
same part placed a centimetre away, which moves its useful frequency range up by a corresponding
factor. Placement matters more than value.


pcb_design

Signal integrity concerns whether a signal arrives recognizable, and the threshold for
concern is set by edge rate rather than by clock frequency. A signal whose propagation delay
along the trace exceeds roughly a sixth of its rise time behaves as a transmission line, and
modern logic families have edge rates of a nanosecond or less regardless of how slowly they are
clocked. A 1 MHz signal with a 500 picosecond edge requires the same transmission line treatment
as a 100 MHz one.


pcb_design

Power and signal integrity:
  PDN impedance        must be low across the frequency range the load demands
  bulk capacitors      low frequency; electrolytic or tantalum near the regulator
  ceramic decoupling   high frequency; adjacent to each supply pin
  self-resonance       every capacitor becomes inductive above it
  mounting inductance  dominated by loop geometry, not by the part
  anti-resonance       between capacitors of different values; a peak in
                       impedance where one is inductive and another capacitive
  plane capacitance    thin dielectric between power and ground planes provides
                       excellent high-frequency decoupling
  ferrite bead         isolates noisy sections; check its impedance at the
                       frequency of concern and its DC resistance at the current
  rise time threshold  treat as a transmission line when delay exceeds ~1/6 of the
                       rise time
  series termination   a resistor at the source; the common choice for
                       point-to-point
  reflection           from any impedance discontinuity; stubs, vias, connectors
  crosstalk            reduce by spacing, by a continuous reference, and by
                       avoiding long parallel runs
  ground bounce        from simultaneous switching outputs; spread them across
                       supply pins


pcb_design

[user] My board passes functional test but fails radiated emissions at 240 MHz by 8 dB.
[assistant] tool_call emc.diagnose({"frequency_mhz": 240, "margin_db": -8,
"clock_mhz": 24, "harmonic": 10, "layers": 4, "plane_splits": 2,
"traces_crossing_splits": 3, "cable_length_cm": 45, "connector_filtering": false})
[tool] {"likely_source": "clock_harmonic_common_mode_on_cable",
"contributors": ["traces_crossing_plane_splits", "unfiltered_cable_interface"],
"cable_resonance_mhz": 167, "recommendation_order": ["fix_plane_splits",
"add_common_mode_choke", "clock_edge_rate_control"]}
[assistant] 240 MHz is the tenth harmonic of your 24 MHz clock, and the radiating structure is
almost certainly the 45 cm cable rather than the board itself. Boards are poor antennas at this
frequency; cables are excellent ones.


pcb_design

The mechanism is common-mode current. Something is developing a small voltage between the
board's ground reference and the cable's, and that drives common-mode current along the cable,
which radiates efficiently. Eight decibels over is a moderate failure and is usually fixable
without a respin.


pcb_design

Three things to address, in this order of root cause first.


pcb_design

Your three traces crossing plane splits are the most likely source of the ground voltage
gradient. Each forces return current to detour, developing a voltage across the plane
impedance, and that voltage appears between different points on your ground reference. Reroute
those three traces so they stay over continuous copper, or bridge the split with stitching
capacitors immediately adjacent to each crossing. This is the root cause fix.


pcb_design

Add a common-mode choke at the cable connector. It presents high impedance to common-mode
current while passing the differential signal, and it is the standard remedy for cable-driven
emissions. Choose one with adequate impedance at 240 MHz specifically — many are specified at
100 MHz and are much less effective an octave up.


pcb_design

Slow the clock edges if the driver permits it. Emission amplitude at the tenth harmonic falls
steeply with rise time, and a series resistor of a few tens of ohms at the clock source often
gives several decibels for one component. Verify the signal still meets timing and has adequate
edge quality at the receiver.


pcb_design

Two diagnostics worth running before committing. Use a near-field probe to find where on the
board the 240 MHz energy is strongest, which will confirm or refute the plane split hypothesis
directly. And repeat the emissions measurement with a ferrite clamp on the cable — if the level
drops substantially, the cable is confirmed as the radiator and the choke will work.


pcb_design

## Thermal, Manufacturability, and Assembly

Thermal design on a board is largely a matter of conduction into copper, since convection from
a small package is limited and the board itself is the heatsink for most components. Copper
pours connected to a device's thermal pad spread heat over a larger area from which it can be
convected, and thermal vias beneath the pad conduct it to the opposite side where more copper
area is available. The number and diameter of those vias, and whether they are filled, directly
determines the achievable thermal resistance.


pcb_design

Design for manufacturability means the board can be fabricated and assembled reliably at
reasonable cost, and the constraints come from the fabricator's process capability. Minimum
trace width and spacing, minimum drill size, annular ring, and aspect ratio all have standard
values that cost nothing and tighter values that cost more and reduce yield. Checking a design
against the intended fabricator's capabilities before release avoids the common experience of
receiving a quote with a surcharge for a feature that was unnecessary.


pcb_design

Assembly considerations shape footprint and placement decisions. Surface mount components are
placed by machine and require adequate spacing for the nozzle and for inspection. Component
orientation should be consistent to simplify programming and inspection. Polarity markings must
be present and unambiguous on the silkscreen, since an assembler with an ambiguous marking will
guess. Fiducial marks give the placement machine a reference and are required for fine-pitch
parts.


pcb_design

Thermal, manufacturing, and assembly:
  copper pour          the primary heat spreader; connect thermal pads to it
  thermal vias         conduct to the opposite side; more and larger is better,
                       and filled vias conduct better than open ones
  component derating   ratings fall with temperature; check at the actual
                       operating temperature
  thermal relief       spoke connections to planes for hand-solderable pads;
                       otherwise the plane sinks the heat and the joint does not
                       reflow
  minimum trace/space  standard values are cheap; tighter costs more and yields
                       worse
  annular ring         copper around a drilled hole; too little causes breakout
  aspect ratio         board thickness to drill diameter; limits plating
                       reliability
  solder mask dam      between fine-pitch pads; below a minimum width the
                       fabricator omits it
  paste stencil        aperture design controls solder volume; reduced apertures
                       for large thermal pads prevent floating
  fiducials            placement machine references; global and local for fine
                       pitch
  panelization         multiple boards per panel with breakaway tabs or v-scoring
  tombstoning          a small two-terminal part standing up during reflow from
                       asymmetric heating or pad design; symmetric pads and
                       thermal relief prevent it
  design rule check    run it; and confirm the rules match the actual fabricator


pcb_design

Tombstoning illustrates why footprint details matter. A small chip component with one pad
connected to a large copper pour and the other to a thin trace heats asymmetrically during
reflow, so one end's solder melts first and its surface tension lifts the part upright. The fix
is symmetric thermal connection to both pads, using thermal relief on the pour side, and it is
a footprint and layout decision rather than an assembly one — which is the general pattern for
assembly defects, most of which originate in design.


pcb_design

## Test, Bring-Up, and Documentation

Design for test means the board can be verified, and the effort is repaid the first time
something does not work. Test points on critical nets permit probing without soldering to a
component pin. A programming and debug connector must be accessible after assembly and ideally
after the board is in its enclosure. Boundary scan access permits testing interconnect without
physical probes. Separating power domains with a jumper or zero-ohm link allows each to be
brought up independently and current-limited.


pcb_design

Bring-up is the process of powering a new board for the first time, and doing it in stages
prevents a single fault from destroying multiple components. Inspect visually and check for
shorts between supplies and ground before applying power at all. Apply power through a
current-limited supply set just above the expected draw, so a short manifests as a current limit
rather than as smoke. Verify each supply rail in sequence before enabling the next. Only then
attempt to communicate with the processor.


pcb_design

Documentation is what makes a board maintainable by someone other than its designer, and it
outlives the designer's memory of the details. The schematic with readable net names is the
primary document. A bill of materials with manufacturer part numbers, not just values, is
required for reordering. Assembly drawings show component placement and orientation. A test
procedure states what to check and what constitutes a pass. And a revision history recording
what changed and why prevents the next person from reintroducing a problem that was already
solved.


pcb_design

Test and documentation:
  test points          on supplies, clocks, resets, and critical signals
  debug connector      accessible after assembly and in the enclosure
  boundary scan        interconnect testing without physical access
  power domain jumpers  bring up rails independently
  current-limited bring-up  a short becomes a current limit rather than damage
  staged power         verify each rail before enabling the next
  in-circuit test      bed of nails; production volume justifies the fixture
  functional test      exercise the actual function; catches what ICT cannot
  bill of materials    manufacturer part numbers, not just values
  assembly drawing     placement and orientation
  test procedure       what to check and what passes
  revision history     what changed and why
  errata               known issues and workarounds; write them down when found,
                       because they will be forgotten and rediscovered


pcb_design

The final practical point is to expect at least one revision. Boards rarely work perfectly on
the first attempt, and designs that leave room for correction — spare gates, unpopulated
component footprints at likely filter locations, extra test points, and generous space around
components that may need rework — make the second revision a modification rather than a
redesign. Adding these costs nearly nothing at design time and is consistently regretted when
omitted.


power_electronics

## Converter Topologies

Power electronics converts electrical energy between forms efficiently, and the central idea
is that switching is efficient while linear regulation is not. A linear regulator drops the
voltage difference across a pass element and dissipates it as heat, so efficiency is
approximately the output voltage divided by the input. A switching converter transfers energy in
packets using a switch that is either fully on, where the voltage across it is near zero, or
fully off, where the current through it is near zero — and in both states the dissipated power
is small.


power_electronics

The buck converter steps voltage down. A switch connects the input to an inductor during part
of the cycle, storing energy, and during the remainder the inductor's current continues through a
diode or a second switch, delivering energy to the output. In continuous conduction the output
voltage is the input times the duty cycle, which is the fraction of the period the main switch is
on — a relation that holds independent of load and is what makes the topology so tractable.


power_electronics

The boost converter steps voltage up. The switch shorts the inductor to ground, building
current, and when it opens the inductor's voltage adds to the input, forcing current into the
output at a higher voltage. Its output cannot be lower than its input, and it has a
right-half-plane zero in its control response that fundamentally limits the achievable loop
bandwidth — a control difficulty that the buck topology does not share.


power_electronics

Converter topologies:
  linear regulator     efficiency ~ Vout/Vin; simple, quiet, dissipative
  LDO                  a low-dropout linear regulator; used downstream of a
                       switcher to clean up noise
  buck                 step down; Vout = D times Vin in continuous conduction
  boost                step up; Vout = Vin/(1-D); has a right-half-plane zero
  buck-boost           either direction; inverting in the basic form
  SEPIC and Cuk        non-inverting step up or down; more components
  flyback              isolated, single magnetic component, low to medium power;
                       the workhorse for small isolated supplies
  forward              isolated, better at higher power than flyback
  half and full bridge  isolated, high power; four switches in the full bridge
  resonant / LLC       switches at zero voltage or current; much lower switching
                       loss, higher efficiency at high frequency
  charge pump          capacitors only; small, no inductor, limited current
  synchronous rectification  replace the diode with a transistor; eliminates the
                       diode drop and is essential at low output voltages
  continuous vs discontinuous conduction  whether inductor current reaches zero;
                       the transfer function and the control loop differ between
                       modes


power_electronics

Q: A buck converter is designed for a 5 V output from a 12 V input at 3 A. Replacing the
freewheeling diode with a MOSFET improves efficiency substantially. The reason is:
A. The MOSFET switches faster
B. The diode drops roughly 0.4-0.7 V while conducting most of the cycle, dissipating over a
   watt, whereas a low-resistance MOSFET drops far less
C. The MOSFET has lower capacitance
D. It reduces the inductor size
Reasoning: The diode conducts for the off-time, which here is about 58% of the period, carrying
3 A at a forward drop of half a volt or more — well over a watt of dissipation against a 15 W
output. A MOSFET with a few milliohms of on-resistance drops only tens of millivolts at the same
current. This is synchronous rectification, and its benefit grows as the output voltage falls.
Answer: B.


power_electronics

## Switching Devices and Losses

The switching device determines the achievable frequency, efficiency, and voltage rating. The
MOSFET dominates below a few hundred volts, switching fast with low conduction loss, and its
on-resistance rises substantially with temperature — roughly doubling from 25 to 125 degrees —
which must be accounted for in thermal design since the loss and the temperature reinforce each
other. The IGBT dominates at high voltage and high current with slower switching and a
voltage-drop characteristic rather than a resistance, making it better at high current and worse
at high frequency.


power_electronics

Wide bandgap devices have changed the design space. Silicon carbide and gallium nitride switch
faster with lower losses and tolerate higher temperatures and voltages, permitting higher
switching frequencies which in turn permit smaller magnetics and capacitors. The costs are price,
sensitivity to gate drive details, and the fact that very fast edges generate more
electromagnetic interference and demand far more careful layout.


power_electronics

Losses divide into conduction and switching, and the balance determines the optimal frequency.
Conduction loss is current squared times on-resistance and is independent of switching frequency.
Switching loss occurs during the transitions when voltage and current are simultaneously nonzero
and scales linearly with frequency. Raising the frequency therefore shrinks the passive
components and raises switching loss, and the optimum is where the total is minimized — which is
why wide bandgap devices, having much lower switching loss, move that optimum to a much higher
frequency.


power_electronics

Devices and losses:
  MOSFET               below a few hundred volts; fast, resistive conduction
  on-resistance         roughly doubles from 25 to 125 C; the thermal feedback
                       must be accounted for
  IGBT                 high voltage and current; slower, voltage-drop conduction
  silicon carbide      high voltage, fast, hot; permits higher frequency
  gallium nitride      very fast, low capacitance; extremely layout-sensitive
  body diode           intrinsic in a MOSFET; conducts during dead time, and its
                       slow reverse recovery is a loss and a noise source
  gate charge          the real figure of merit for switching speed; the driver
                       must supply it quickly
  gate driver          supplies peak current to charge the gate; an inadequate
                       driver slows the transition and raises switching loss
                       quadratically
  conduction loss      I squared R; frequency independent
  switching loss       overlap of voltage and current; linear in frequency
  gate drive loss      gate charge times voltage times frequency
  dead time            both switches off, preventing shoot-through; too long
                       forces body diode conduction, too short destroys the
                       devices
  soft switching       switch at zero voltage or current; nearly eliminates
                       switching loss and constrains the operating range
  shoot-through        both switches conducting simultaneously; a short across the
                       supply, and usually fatal


power_electronics

Dead time deserves emphasis because it is where a synchronous converter's reliability is
determined. Both switches in a half bridge must never conduct simultaneously, since that shorts
the input supply through them, so the controller inserts a dead time between turning one off and
the other on. Too little dead time risks shoot-through, which destroys the devices in
microseconds. Too much forces the body diode to conduct during the gap, which is lossy and whose
reverse recovery generates a current spike and substantial electromagnetic interference. The
correct value depends on the gate drive strength and the device capacitances, and it is
frequently the difference between a converter that meets its efficiency target and one that does
not.


power_electronics

## Magnetics and Control

The inductor is usually the largest, heaviest, and least standardized component in a converter,
and its design involves several interacting constraints. Inductance sets the current ripple for a
given voltage and frequency. The core must not saturate at peak current, since a saturated core
loses inductance abruptly and the current rises without limit. The winding must carry the current
without excessive loss, which at switching frequencies involves skin and proximity effects
concentrating current in a fraction of the conductor.


power_electronics

Core loss and copper loss trade against each other through the design. Copper loss falls with
more conductor area and rises with more turns; core loss rises with flux swing and frequency and
falls with a larger core. The balance is roughly equal loss in each at the optimum, and the
design proceeds by choosing a core size, computing the turns for the required inductance,
checking saturation, and iterating.


power_electronics

Control regulates the output against variations in input and load by adjusting the duty cycle,
and the loop must be stable. Voltage mode control compares the output to a reference and adjusts
the duty directly, which is simple and has a two-pole response from the output filter that
requires substantial compensation. Current mode control uses an inner loop regulating the
inductor current, which makes the outer loop see a single-pole response — far easier to
compensate — and provides inherent cycle-by-cycle current limiting.


power_electronics

Magnetics and control:
  inductance           sets ripple current for a given voltage-second product
  saturation           the core loses inductance abruptly; current then rises
                       uncontrolled
  core material        ferrite for high frequency, powdered iron for soft
                       saturation, amorphous and nanocrystalline for high
                       performance
  air gap              raises the saturation current and lowers the inductance;
                       most power inductors are gapped
  fringing             flux escaping around the gap; induces eddy currents in
                       nearby windings and conductors
  skin effect          current concentrates at the conductor surface at high
                       frequency
  proximity effect     adjacent conductors' fields redistribute current; often
                       larger than skin effect in multilayer windings
  litz wire            many insulated strands; mitigates both effects at
                       intermediate frequencies
  core loss            hysteresis and eddy currents; rises with flux swing and
                       frequency
  voltage mode         simple, two-pole response, more compensation
  current mode         inner current loop, single-pole outer response, inherent
                       current limit
  slope compensation   required in current mode above 50% duty cycle, or a
                       subharmonic oscillation appears
  loop bandwidth       typically a fifth to a tenth of the switching frequency
  phase margin         45 degrees or more; less produces ringing on load steps
  right-half-plane zero  in boost and flyback; fundamentally limits bandwidth and
                       cannot be compensated away


power_electronics

The right-half-plane zero deserves explanation because it is a genuine limit rather than a
tuning difficulty. In a boost converter, increasing the duty cycle to raise the output initially
lowers it, because more of the cycle is spent charging the inductor and less delivering to the
output. The output therefore moves the wrong way before moving the right way, which adds phase
lag without attenuation and cannot be cancelled by any compensator. The loop bandwidth must be
kept well below the zero's frequency, which limits transient response — and the zero moves lower
at higher duty cycle and higher load, so the worst case must be used.


power_electronics

[user] My buck converter is stable at light load but oscillates and the output ripples badly
above about 2 A.
[assistant] tool_call power.loop_diagnose({"topology": "buck", "control": "peak_current_mode",
"vin": 12, "vout": 5, "duty": 0.42, "fsw_khz": 400, "load_a": 2.5,
"slope_compensation": false, "observed": "subharmonic_oscillation_at_fsw_over_2"})
[tool] {"issue": "duty_cycle_near_50pct_without_slope_compensation",
"mechanism": "perturbation_growth_in_peak_current_mode_above_50pct_duty",
"fix": "add_slope_compensation", "secondary_check": "output_capacitor_esr"}
[assistant] This is subharmonic oscillation in peak current mode control, and the trigger is
your duty cycle rather than the load directly.


power_electronics

The mechanism: in peak current mode, the switch turns off when the inductor current reaches a
threshold. A perturbation in the starting current propagates to the next cycle scaled by the
ratio of the down slope to the up slope, which equals the duty cycle divided by one minus the
duty cycle. Below 50% duty that ratio is less than one and perturbations decay; above 50% it
exceeds one and they grow, producing an alternating pattern at half the switching frequency. Your
duty is 0.42, close enough that load-dependent variation pushes it over.


power_electronics

The fix is slope compensation — add an artificial ramp to the current sense signal, which
changes the effective slope ratio and restores decay at any duty cycle. Most controllers have
either fixed internal slope compensation or a pin for setting it externally. The standard rule is
a compensating ramp of at least half the inductor's down slope, and a full down slope gives
deadbeat response to a perturbation.


power_electronics

Check whether your controller has internal compensation that is inadequate for your inductor
value. A larger inductance gives a shallower current slope, which makes a fixed internal ramp
relatively larger and helps; a smaller inductance makes it relatively smaller and hurts. If you
cannot adjust the compensation, increasing the inductor value is an alternative route to the same
result.


power_electronics

One thing to rule out first, since the symptom overlaps: verify that your output capacitor's
equivalent series resistance is within what the control loop was compensated for. Some
controllers rely on the ESR zero for phase margin, and replacing an electrolytic with a ceramic
capacitor removes it and destabilizes an otherwise fine design. If you changed the output
capacitor recently, that is the more likely cause and the fix is different — additional
compensation rather than slope compensation.


power_electronics

## Thermal, Battery Systems, and Protection

Thermal design determines whether a converter meets its rating, and the calculation is a chain
of thermal resistances from the junction to the ambient. Junction to case is a device property.
Case to heatsink depends on the interface material and mounting pressure. Heatsink to ambient
depends on the heatsink and the airflow. The temperature rise is the total dissipation times the
total resistance, and the junction temperature must remain below its rating with margin.


power_electronics

The thermal feedback in MOSFETs deserves specific attention. On-resistance rises with
temperature, so higher temperature means higher conduction loss, which means higher temperature.
For a well-designed system this converges to a stable operating point; for a marginal one it can
run away. The design must therefore use the on-resistance at the actual junction temperature
rather than the room temperature figure on the datasheet's front page, which is frequently
optimistic by a factor of two.


power_electronics

Battery systems add their own requirements. Lithium chemistries require charging within a
voltage and current envelope, with constant current until a target voltage and then constant
voltage until the current falls, and exceeding the voltage or charging outside a temperature
range degrades the cell and can cause thermal runaway. Cells in series must be balanced, since
capacity mismatch means one cell reaches its limit before the others and would be overcharged or
over-discharged without balancing.


power_electronics

Thermal, batteries, and protection:
  thermal resistance chain  junction to case to heatsink to ambient
  thermal runaway      on-resistance rises with temperature, raising dissipation
  derating             use the hot on-resistance and the actual ambient
  thermal vias         conduct heat through the board to more copper area
  lithium charging     constant current then constant voltage; temperature limits
  cell balancing       passive by bleeding the highest cells, active by
                       redistributing charge
  state of charge      estimated from voltage, coulomb counting, or a model; each
                       alone is inadequate and fusion is standard
  battery management   protection, balancing, state estimation, thermal management
  overcurrent          fuse, current limit, or foldback; foldback reduces current
                       under a fault and can latch up on a capacitive load
  overvoltage          crowbar or clamp; protects downstream circuitry
  undervoltage lockout  prevents operation below a safe input voltage, where the
                       gate drive would be insufficient and the switch would
                       operate in its linear region
  inrush limiting      NTC thermistor or an active limiter; prevents the initial
                       capacitor charging current from tripping protection or
                       welding contacts
  reverse polarity     a series MOSFET is far more efficient than a series diode
  isolation            required for safety at mains voltage; creepage and
                       clearance distances are set by standards


power_electronics

Undervoltage lockout is worth understanding because its absence produces a specific and
destructive failure. A MOSFET requires an adequate gate voltage to turn fully on; below that it
operates partially on with substantial resistance, dissipating heavily. During start-up or a
supply sag, a converter operating with insufficient gate drive can destroy its switches in
milliseconds. Lockout holds the converter off until the supply is adequate and adds hysteresis so
it does not chatter at the threshold.


power_electronics

## EMI and Layout

Switching converters generate electromagnetic interference by construction, because they
produce fast current and voltage transitions. The noise divides into conducted, travelling along
the input and output wiring, and radiated, emitted by loops and by long conductors acting as
antennas. Both are regulated and both must be addressed by design rather than by filtering
afterward, since a filter large enough to fix a badly laid out converter is expensive and
sometimes insufficient.


power_electronics

The critical loop is the single most important layout concept in the subject. In a buck
converter, the loop comprising the input capacitor, the high-side switch, and the low-side switch
carries a current that switches from zero to full load in nanoseconds. The loop's inductance
times that current slope produces a voltage spike, and the loop's area determines how much it
radiates. Minimizing this loop's physical area — placing the input capacitor immediately adjacent
to the switches with the shortest possible return path — is the highest-value layout action
available and frequently determines whether the design passes emissions testing.


power_electronics

The switch node is the corresponding voltage concern. It swings the full input voltage in
nanoseconds, so it is a strong capacitive noise source, and its area should be minimized —
large enough to conduct the current and carry heat, and no larger. Routing sensitive signals near
it, or placing a ground plane directly beneath a large switch node without considering the
coupling, injects noise into the control loop.


power_electronics

EMI and layout:
  critical loop        input capacitor and both switches; minimize its area above
                       all else
  switch node          minimize its area; it is a capacitive noise source
  input capacitor      place it immediately adjacent to the switches; bulk
                       capacitance further away is fine
  ground plane         continuous beneath the power stage; return current follows
                       the outgoing path
  feedback routing     away from the switch node and the inductor; route it as a
                       quiet trace referenced to the output ground
  current sense        Kelvin connections; sense across the element rather than
                       through the high-current path
  gate loop            the driver, gate, and source return; minimize it, or the
                       inductance slows switching and causes ringing
  snubber              an RC or RCD network damping ringing; costs efficiency and
                       is sometimes the pragmatic solution
  spread spectrum      dither the switching frequency; spreads the emission peaks
                       and reduces measured amplitude without reducing total
                       energy
  input filter         a pi or LC filter; check its interaction with the
                       converter's negative input impedance, since a filter with
                       inadequate damping can destabilize an otherwise stable
                       converter
  slew rate control    a gate resistor slows the edges; trades switching loss for
                       reduced emissions, and is a legitimate and commonly used
                       trade
  shielding            a last resort; fixing the source is cheaper and more
                       reliable


power_electronics

The input filter interaction deserves the closing note because it produces a failure that is
baffling without knowing the mechanism. A regulated converter behaves as a negative incremental
input impedance — drawing more current when the input voltage falls, since it maintains constant
output power. An input filter with insufficient damping and an output impedance comparable to
that negative resistance forms an unstable system, and the converter oscillates at the filter's
resonance despite both the converter and the filter being individually correct. The remedy is
damping the filter, typically with a series resistor and capacitor across the filter capacitor,
and the design rule is that the filter's output impedance must remain well below the converter's
input impedance magnitude at all frequencies.


rf_and_wireless

## Propagation and the Link Budget

Radio propagation determines what is achievable, and the dominant term at any distance is
free-space path loss. It grows with the square of both distance and frequency, which means
doubling the distance costs six decibels and doubling the frequency costs another six. The
frequency dependence is a consequence of the receiving antenna's effective aperture shrinking
with wavelength for a fixed gain, and it is why higher frequency bands trade range for
bandwidth.


rf_and_wireless

Real environments depart from free space in ways that dominate the design. Reflection from
surfaces creates multiple paths that arrive with different delays and combine constructively or
destructively, producing deep fades that vary with position on a scale of half a wavelength.
Diffraction bends signals around obstacles, with the effect stronger at lower frequency where the
wavelength is comparable to the obstruction. Scattering from rough surfaces and small objects
spreads energy. Absorption by materials attenuates, with water and therefore vegetation, rain,
and human bodies being significant absorbers at microwave frequencies.


rf_and_wireless

Multipath fading is the most consequential of these for system design. Two paths differing by
half a wavelength arrive in antiphase and cancel, which at 2.4 GHz means a null every six
centimetres — so a stationary receiver can sit in a deep fade while a position a hand's width
away has strong signal. This is why antenna diversity works: two antennas separated by a
fraction of a wavelength are unlikely to be in a fade simultaneously, and selecting or combining
them substantially improves reliability for a small cost.


rf_and_wireless

Propagation and link budget:
  free-space path loss  20 log10(d) + 20 log10(f) + 32.45 dB for km and MHz
  distance doubling     -6 dB
  frequency doubling    -6 dB for fixed antenna gain
  multipath             constructive and destructive combination; fades every
                        half wavelength
  Rayleigh fading       no dominant path; deep frequent fades
  Rician fading         a dominant line-of-sight path plus scatter; less severe
  fade margin           extra link budget to survive fading; 10-30 dB depending on
                        environment and required reliability
  diversity             spatial, polarization, frequency, or time; the practical
                        counter to fading
  Fresnel zone          the ellipsoid around the direct path; keep 60% of the
                        first zone clear or diffraction loss becomes significant
  penetration loss      walls, foliage, and bodies; strongly frequency dependent
  link budget           transmit power plus gains minus losses versus receiver
                        sensitivity
  link margin           the surplus; consumed by fading, ageing, and pointing
  noise floor           -174 dBm/Hz at room temperature; plus the bandwidth in dB
                        and the receiver noise figure


rf_and_wireless

The thermal noise floor is the reference point for every receiver calculation and is worth
having memorized. At room temperature it is -174 dBm per hertz of bandwidth, so a receiver with
one megahertz of bandwidth has a noise floor of -174 plus 60, or -114 dBm, before its own noise
figure is added. Sensitivity is that floor plus the noise figure plus the required
signal-to-noise ratio for the modulation in use, which is why narrower bandwidth and more robust
modulation both improve range — each reduces the required received power.


rf_and_wireless

Q: A link operating at 2.4 GHz is moved to 5 GHz with identical antennas and transmit power.
The received power changes by approximately:
A. No change   B. -6 dB   C. -12 dB   D. +6 dB
Reasoning: Free-space path loss grows with the square of frequency for antennas of fixed gain,
so slightly more than doubling the frequency costs about 6.4 dB. In practice the loss is worse
still, because higher frequencies penetrate walls and vegetation more poorly. This is why 5 GHz
Wi-Fi has shorter range than 2.4 GHz at equal power, and why it offers more bandwidth and less
congestion in compensation. Answer: B.


rf_and_wireless

## Modulation and Coding

Modulation impresses information onto a carrier by varying its amplitude, frequency, or phase,
and the choice trades spectral efficiency against required signal-to-noise ratio. Higher-order
schemes carry more bits per symbol and pack the constellation points closer together, so noise
is more likely to move a received point into a neighbouring decision region. Every additional
bit per symbol costs roughly six decibels of required signal-to-noise ratio.


rf_and_wireless

This tradeoff is why modern systems use adaptive modulation. When the link is strong, a
high-order scheme maximizes throughput; when it degrades, the system falls back to a robust
low-order scheme that maintains a connection at lower rate. The observable consequence is that
wireless throughput falls in steps rather than smoothly as a device moves away from an access
point, since each step is a modulation change.


rf_and_wireless

Spread spectrum deliberately uses more bandwidth than the information requires, which sounds
wasteful and buys several properties. Direct sequence multiplies the data by a fast pseudorandom
code, spreading the energy across a wide band and allowing the receiver to recover it by
correlating with the same code, which provides processing gain against narrowband interference
and allows multiple users to share the band with different codes. Frequency hopping changes
carrier frequency rapidly according to a pattern, which averages over frequency-selective fading
and resists both interference and interception.


rf_and_wireless

Modulation and coding:
  ASK, FSK, PSK        amplitude, frequency, phase modulation
  BPSK                 1 bit per symbol; the most robust common scheme
  QPSK                 2 bits per symbol
  16-QAM, 64-QAM, 256-QAM  4, 6, 8 bits per symbol; each step needs ~6 dB more
                       signal-to-noise ratio
  adaptive modulation  select by link quality; throughput falls in steps
  constellation        the symbol points; a diagram of received points diagnoses
                       phase noise, amplitude imbalance, and interference by the
                       shape of the scatter
  OFDM                 many narrow orthogonal subcarriers; converts a
                       frequency-selective channel into many flat ones and
                       simplifies equalization enormously
  cyclic prefix        a guard interval absorbing multipath delay spread; the
                       reason OFDM tolerates multipath
  PAPR                 OFDM's high peak-to-average ratio stresses the power
                       amplifier and forces backoff
  direct sequence      spreading by a fast code; processing gain and code-division
                       sharing
  frequency hopping    averages over fading and interference
  forward error correction  convolutional, Reed-Solomon, LDPC, turbo, polar;
                       trades rate for the required signal-to-noise ratio
  coding gain          the reduction in required SNR; several decibels for modest
                       overhead, and nearly always worth it


rf_and_wireless

OFDM deserves emphasis because it is the technique underlying essentially every modern
high-rate wireless standard. A wideband signal in a multipath channel experiences frequency-
selective fading, where some frequencies are attenuated and others are not, and equalizing that
in a single-carrier system is computationally demanding. OFDM divides the band into many narrow
subcarriers, each of which is narrow enough that the channel is approximately flat across it, so
equalization becomes one complex multiplication per subcarrier. The cyclic prefix — a copy of
the symbol's end prepended to its start — absorbs the delay spread so that multipath copies do
not interfere between symbols, at the cost of a few percent of the throughput.


rf_and_wireless

## Transmission Lines, Matching, and Amplifiers

Above the frequency where a conductor's length becomes comparable to a fraction of the
wavelength, it behaves as a transmission line rather than a wire. The characteristic impedance
depends on the geometry and dielectric, and it determines what happens at any discontinuity: a
mismatch reflects part of the incident wave back toward the source.


rf_and_wireless

Impedance matching maximizes power transfer and minimizes reflection, and it is the central
practical task in RF design. The conventions are fifty ohms for most radio work and seventy-five
for video and broadcast reception, and the fifty ohm figure is a compromise — minimum attenuation
in coaxial cable occurs near seventy-seven ohms and maximum power handling near thirty, so fifty
is roughly the geometric middle.


rf_and_wireless

The Smith chart is the classical tool for matching and remains useful as a way of thinking even
where software does the calculation. It maps the complex reflection coefficient onto a plane
where constant resistance and constant reactance are circles, so the effect of adding a series or
shunt component is a movement along a known arc. Matching becomes a geometric problem of
navigating from the load impedance to the centre, which is where the reflection is zero.


rf_and_wireless

Transmission lines and amplifiers:
  characteristic impedance  set by geometry and dielectric; 50 ohm convention
  reflection coefficient  from the mismatch between load and line
  VSWR                 standing wave ratio; 1:1 perfect, 2:1 reflects ~11% of
                       power
  return loss          dB below incident reflected; higher is better
  Smith chart          reflection coefficient plane; matching as a geometric path
  L-network            two reactive components; matches any two resistances at one
                       frequency
  stub matching        a length of open or shorted line as a reactance
  quarter-wave transformer  matches two resistances with a line of intermediate
                       impedance
  balun                balanced to unbalanced transition; required when feeding a
                       dipole from coax, and its absence causes current on the
                       feedline outer conductor, which then radiates
  amplifier classes    A linear and inefficient, C efficient and nonlinear, E and
                       F switching for high efficiency
  1 dB compression     where gain falls by 1 dB; the practical linear limit
  third-order intercept  a figure of merit for intermodulation; higher is more
                       linear
  intermodulation      two signals producing sum and difference products; the
                       third-order products fall in band and cannot be filtered out
  noise figure         degradation of signal-to-noise; the first stage dominates
                       the whole chain


rf_and_wireless

Third-order intermodulation deserves specific attention because it is the distortion mechanism
that filtering cannot remove. Two signals at nearby frequencies passing through a nonlinearity
produce products at frequencies that are close to the originals — specifically at twice one
frequency minus the other — so they land within the passband and are indistinguishable from
legitimate signals. This is why receiver linearity matters as much as sensitivity in a crowded
spectrum, and why a strong out-of-band signal can desensitize a receiver even though it is
nominally filtered.


rf_and_wireless

[user] My 915 MHz link works at 200 m in open field but drops out at 30 m inside a warehouse,
and moving the receiver a few centimetres sometimes fixes it.
[assistant] tool_call rf.link_diagnose({"frequency_mhz": 915, "open_field_m": 200,
"indoor_m": 30, "symptom": "position_sensitive_dropout", "antenna": "single_pcb_trace",
"environment": "metal_racking", "fade_margin_db": 6})
[tool] {"wavelength_cm": 32.8, "null_spacing_cm": 16.4, "environment": "rich_multipath",
"fading_model": "rayleigh", "margin_required_db": 20, "margin_present_db": 6,
"recommendations": ["antenna_diversity", "increase_fade_margin", "frequency_agility"]}
[assistant] The position sensitivity is the diagnosis: you are in multipath fading, and your
fade margin is far too small for the environment.


rf_and_wireless

At 915 MHz the wavelength is 32.8 cm, so multipath nulls occur roughly every 16 cm. In a
warehouse with metal racking there is no dominant line-of-sight path and many strong
reflections, which gives Rayleigh fading — the worst case, with deep fades occurring frequently.
Moving a few centimetres moves you out of a null, which is exactly what you observe.


rf_and_wireless

Your 6 dB fade margin is adequate for open field and inadequate here. Rayleigh fading requires
roughly 20 dB of margin for 99% reliability, and 30 dB for 99.9%. That is the gap.


rf_and_wireless

Three approaches, and the first is the most cost-effective by a wide margin.


rf_and_wireless

Antenna diversity. Two antennas separated by a quarter wavelength or more — 8 cm at your
frequency — are unlikely to be in a fade simultaneously, since the fading is spatially
uncorrelated at that separation. Selecting whichever has the stronger signal typically recovers
10 dB of effective margin for the cost of a second antenna, a switch, and some firmware. Many
transceivers support this directly.


rf_and_wireless

Frequency agility. Multipath fading is frequency selective, so a null at one frequency is
usually not a null at another. If you have channel-hopping available, hopping across the band
means a persistent null on one channel does not persist across all of them. This is what
frequency-hopping spread spectrum provides and it is why the technique is standard in
industrial environments.


rf_and_wireless

Then increase the raw margin: a higher-gain antenna if the geometry permits, a lower data rate
with more robust modulation, or more transmit power within your regulatory limit. Each buys a
few decibels.


rf_and_wireless

One thing to check first: your PCB trace antenna. Trace antennas are sensitive to the ground
plane, the enclosure, and nearby metal, and their real gain in situ is frequently several
decibels below the datasheet figure. Measuring the actual radiated performance in the enclosure,
or substituting an external antenna as a test, will tell you whether part of the shortfall is
there rather than in the channel.


rf_and_wireless

## Antennas, Spectrum, and Practical RF

An antenna converts between guided and radiated waves, and reciprocity guarantees identical
transmit and receive characteristics. Its size is set by the wavelength: efficient radiation
requires dimensions comparable to a substantial fraction of a wavelength, which is why low
frequencies need large antennas and why electrically small antennas are inefficient and
narrowband — a fundamental limit rather than an engineering shortfall.


rf_and_wireless

Gain is not amplification but redistribution: an antenna with gain concentrates the same
radiated power into a narrower beam, necessarily at the expense of other directions. Directivity
and beamwidth are inversely related, so higher gain means tighter pointing requirements. An
omnidirectional whip has near-unity gain in the horizontal plane with a null along its axis; a
dish concentrates enormously and must be aimed.


rf_and_wireless

Spectrum is a regulated resource, and the regulatory framework shapes what is designable.
Licensed bands provide exclusive use and protection from interference at the cost of licensing.
Unlicensed bands — the industrial, scientific, and medical allocations — are free to use subject
to power and duty cycle limits, with no protection from interference, which means a design must
tolerate whatever else is present. Regional differences in allocations, power limits, and duty
cycle rules mean a product must be designed for the regions it will ship to.


rf_and_wireless

Antennas, spectrum, and practice:
  half-wave dipole     the reference element; ~73 ohm radiation resistance, 2.15
                       dBi gain, doughnut pattern with nulls along the axis
  quarter-wave monopole  half a dipole over a ground plane; ~36 ohms, and its
                       performance depends critically on the ground plane
  patch antenna        planar, directional, easy to fabricate on a board
  PCB trace antenna    cheap and sensitive to layout, enclosure, and nearby metal
  chip antenna         small, requires a specified ground plane and keep-out
  gain and beamwidth   inversely related; gain is redistribution, not
                       amplification
  polarization         match transmit and receive, or lose several decibels;
                       cross-polarized is typically 20 dB down
  ground plane         part of the antenna for a monopole; its size and shape
                       change the pattern and the impedance
  ISM bands            unlicensed, power and duty cycle limited, no interference
                       protection
  duty cycle limits    strict in some regions; a design must respect them
  regulatory testing   emissions, spurious, and band edge compliance; plan and
                       budget for it early
  shielding            a can over the RF section; effective when the seams are
                       short relative to the wavelength
  keep-out             no ground plane or traces under a chip or trace antenna;
                       violating this detunes it substantially


rf_and_wireless

Antenna keep-out violations are the most common practical RF error in embedded products and
are invisible until measured. A chip or trace antenna is designed assuming a specified ground
plane geometry and an area kept clear of copper, components, and enclosure metal. Routing a trace
beneath it, extending the ground plane into the keep-out, or placing a metal shield nearby shifts
the resonant frequency and destroys the match, typically costing ten decibels or more of
effective radiated power. The manufacturer's layout guidance exists for this reason and following
it is not optional.


rf_and_wireless

The final practical observation is that RF design rewards measurement over calculation more
than most disciplines. Simulations and hand calculations establish the design, and the actual
performance depends on the enclosure, the ground plane, the nearby components, the cable
routing, and the environment in ways that are not captured. A vector network analyzer measuring
the antenna's match in its final assembly, and a spectrum analyzer measuring the actual radiated
output, are what distinguish a design that works from one that should. Budgeting time for that
measurement, and access to the instruments, is a project planning decision rather than a
technical one, and its absence is why so many embedded wireless products underperform their
specifications.


robotics_and_control

## Feedback Control Fundamentals

A control system drives a plant toward a desired state. Open-loop control applies a
predetermined input with no measurement of the result — adequate when the plant is well
characterized and disturbances are negligible, as in a stepper motor commanded to a
position it can always reach. Closed-loop control measures the output, computes the error
against a reference, and adjusts the input accordingly, which buys robustness to
disturbances, to modelling error, and to parameter drift, at the cost of the possibility of
instability.


robotics_and_control

That tradeoff is the central fact of the subject. Feedback creates a loop, and a loop with
enough gain and enough phase lag oscillates. Everything in classical control theory is
machinery for determining how much gain can be applied before that happens and how to shape
the loop so that more can be applied safely.


robotics_and_control

System response is characterized by a handful of quantities that translate directly into
requirements. Rise time measures speed. Overshoot measures how far past the target the
response goes. Settling time measures how long until it stays within a tolerance band.
Steady-state error measures the residual offset after transients decay. These trade against
each other: a faster response generally means more overshoot, and eliminating steady-state
error generally slows the response.


robotics_and_control

Response characteristics of a second-order system:
  natural frequency      omega_n; sets the timescale
  damping ratio          zeta; sets the character
  zeta = 0               undamped, sustained oscillation
  0 < zeta < 1           underdamped, overshoot with decaying oscillation
  zeta = 1               critically damped, fastest without overshoot
  zeta > 1               overdamped, slow, no overshoot
  overshoot              exp(-pi zeta / sqrt(1 - zeta^2)); ~4.3% at zeta = 0.707
  settling time (2%)     ~4 / (zeta omega_n)
  rise time              ~1.8 / omega_n for zeta ≈ 0.7
  common design target   zeta ≈ 0.7, a good compromise of speed and overshoot


robotics_and_control

Stability in the classical framework is assessed from the loop's frequency response. Gain
margin is how much the loop gain can increase before instability; phase margin is how much
additional phase lag can be tolerated. Typical design targets are a gain margin above 6 dB
and a phase margin above 45 degrees, and these are not arbitrary — they provide room for the
modelling error, the sensor and computation delay, and the parameter variation that a real
system will exhibit and a model will not capture.


robotics_and_control

Q: A control loop is tuned to be very fast on the bench and oscillates when the mechanism
is loaded. The most likely explanation is:
A. The sensor failed
B. Loading changed the plant dynamics, reducing the phase margin the tuning assumed
C. The setpoint is too high
D. The sample rate is too high
Reasoning: Adding load changes inertia and often adds compliance, lowering the plant's
resonant frequency and adding phase lag. A tuning with marginal phase margin on the
unloaded system has none on the loaded one. This is why controllers should be tuned under
representative load and designed with margin rather than to the edge of stability.
Answer: B.


robotics_and_control

## PID Control

The proportional-integral-derivative controller remains the workhorse of industrial
control, comprising the overwhelming majority of deployed loops, because it requires no
model and its three terms have intuitive effects.


robotics_and_control

The proportional term produces an output proportional to the current error. Increasing it
speeds the response and reduces steady-state error, and past a point produces overshoot and
then oscillation. It cannot eliminate steady-state error in general, because a nonzero
output requires a nonzero error to generate it — a motor holding a load against gravity needs
continuous torque, which the proportional term can only supply by maintaining a position
error.


robotics_and_control

The integral term accumulates error over time, so any persistent error eventually produces
whatever output is needed to eliminate it. This removes steady-state error, which is its
entire purpose, at the cost of adding phase lag that reduces stability margin, and of
introducing windup.


robotics_and_control

The derivative term responds to the rate of change of error, providing anticipatory damping
that permits higher proportional gain. Its weakness is noise: differentiation amplifies
high-frequency content, so a noisy measurement produces a violently noisy derivative output.
It must be filtered, and it should be computed on the measurement rather than on the error,
so that a step change in setpoint does not produce a derivative spike — the derivative kick.


robotics_and_control

PID practice:
  parallel form         u = Kp e + Ki integral(e) + Kd de/dt
  derivative on meas.   differentiate -y rather than e; avoids setpoint kick
  derivative filtering  a first-order filter with N between 8 and 20 times the
                        derivative time constant; unfiltered D is unusable
  integral windup       when the actuator saturates, the integral keeps growing
                        and the loop overshoots badly on recovery
  anti-windup           clamp the integrator, or back-calculate from the saturated
                        output; mandatory on any loop that can saturate
  bumpless transfer     initialize the integrator on mode change so the output does
                        not jump
  feedforward           add a model-based term for known demands; the loop then
                        corrects only the residual, which is far easier
  sample rate           10-20x the closed-loop bandwidth; faster is not free
                        because it amplifies quantization and noise in D


robotics_and_control

Integral windup is the failure mode most likely to appear in a working system and surprise
its author. When the actuator saturates — a valve fully open, a motor at current limit — the
error persists because the plant cannot respond, so the integrator continues accumulating to
a very large value. When the plant finally reaches the setpoint, the integrator must unwind
before the output comes down, producing a large overshoot and a long recovery. The symptom
is a loop that behaves well for small setpoint changes and badly for large ones, and the
fix is anti-windup logic that stops or reverses accumulation while saturated.


robotics_and_control

Tuning methods range from systematic to empirical. Ziegler-Nichols provides a classical
starting point from the ultimate gain and period, and it is known to produce aggressive,
oscillatory tuning that usually needs detuning. Relay auto-tuning drives the loop into a
controlled oscillation to identify the same parameters automatically. Model-based tuning
such as lambda or internal model control derives gains from an identified plant model and a
desired closed-loop time constant, giving a single intuitive tuning knob. Manual tuning —
raise proportional gain until oscillation, back off, add integral for steady-state error,
add derivative only if needed and if the signal is clean enough — remains common and works.


robotics_and_control

## State Space and Modern Control

State-space representation describes a system by a first-order vector differential equation
in the state, with matrices mapping state and input to state derivative and output. Its
advantages over transfer functions are that it handles multiple inputs and outputs
naturally, exposes internal states rather than only the input-output relationship, extends
directly to time-varying and nonlinear systems, and is the natural form for numerical
computation.


robotics_and_control

Two structural properties determine what is achievable. Controllability asks whether the
input can drive the state anywhere in finite time, tested by the rank of the controllability
matrix. Observability asks whether the state can be reconstructed from the output history,
tested by the rank of the observability matrix. A system that is not controllable has modes
the input cannot influence; one that is not observable has modes the sensor cannot see. Both
are checked before designing anything, because no amount of control design fixes a structural
deficiency — the answer is a different actuator or a different sensor.


robotics_and_control

State feedback places the closed-loop poles wherever desired, provided the system is
controllable, by choosing a gain matrix. Pole placement gives complete freedom and no
guidance about where to place them; the linear quadratic regulator instead minimizes a
quadratic cost balancing state error against control effort, producing an optimal gain from
two weighting matrices that have direct engineering meaning. LQR is the standard approach
because tuning two cost weights is far more intuitive than choosing pole locations, and the
result comes with guaranteed stability margins.


robotics_and_control

State-space and estimation:
  state equation       x' = A x + B u;   y = C x + D u
  controllability      rank[B, AB, A^2 B, ...] = n
  observability        rank[C; CA; CA^2; ...] = n
  pole placement       u = -K x; place closed-loop eigenvalues of (A - BK)
  LQR                  minimize integral of (x'Qx + u'Ru); Q penalizes state error,
                       R penalizes effort
  observer             estimate the state from inputs and outputs; place observer
                       poles faster than controller poles
  separation principle controller and observer can be designed independently for
                       linear systems
  Kalman filter        the optimal observer under Gaussian noise; the observer gain
                       is computed from process and measurement noise covariances
  LQG                  LQR plus Kalman filter; optimal but with no guaranteed
                       robustness margins, unlike LQR alone
  integral action      augment the state with the integral of the error to remove
                       steady-state offset


robotics_and_control

The Kalman filter is worth understanding as a recursive Bayesian update rather than as a
formula. It maintains a state estimate and a covariance representing uncertainty. The
prediction step propagates both through the system model, increasing uncertainty by the
process noise. The update step incorporates a measurement, combining prediction and
measurement weighted by their relative uncertainties — so a precise measurement pulls the
estimate strongly and a noisy one barely moves it. The two tuning parameters are the process
noise covariance, expressing how much you trust the model, and the measurement noise
covariance, expressing how much you trust the sensor, and their ratio determines the
filter's responsiveness. Setting process noise too low produces a filter that ignores
reality; too high produces one that simply follows the noisy measurement.


robotics_and_control

## Kinematics and Actuation

Forward kinematics computes end-effector pose from joint angles and is straightforward: a
chain of transformations, one per joint, composed in order. Inverse kinematics computes the
joint angles achieving a desired pose and is the hard direction — it may have no solution
if the target is outside the workspace, multiple solutions when the arm can reach the same
point in different configurations, or infinitely many for a redundant manipulator with more
joints than task dimensions. Analytical solutions exist for common geometries; general cases
use iterative numerical methods based on the Jacobian.


robotics_and_control

The Jacobian relates joint velocities to end-effector velocity and is the central object of
manipulator analysis. It maps joint rates to Cartesian rates, its transpose maps
end-effector forces to joint torques, and its singular values describe the manipulator's
ability to move and exert force in each direction. Singularities occur where the Jacobian
loses rank — the arm fully extended, or two axes aligned — and at those configurations the
manipulator loses a degree of freedom and the inverse Jacobian blows up, commanding
enormous joint velocities for small Cartesian motions. Practical controllers detect
proximity to singularities and use a damped least-squares inverse that trades exactness for
bounded velocity.


robotics_and_control

Actuator selection drives the mechanical design more than any other choice.


robotics_and_control

Actuator characteristics:
  brushed DC          simple drive, brushes wear, torque proportional to current
  brushless DC        higher efficiency and life, needs commutation and rotor
                      position sensing or sensorless estimation
  stepper             open-loop position, no feedback needed, loses steps under
                      overload with no indication, poor torque at speed
  servo (BLDC+enc)    closed-loop position with an encoder; the standard for
                      precision motion
  hydraulic           very high force density, stiff, messy, expensive
  pneumatic           compliant, fast, hard to position precisely due to
                      compressibility
  series elastic      deliberate compliance with force sensing; safe for human
                      interaction, lower bandwidth
  direct drive        no gearbox, no backlash, backdrivable, needs a large motor
  gear reduction      multiplies torque by the ratio, divides speed, multiplies
                      reflected inertia by the ratio squared, adds backlash and
                      friction


robotics_and_control

The reflected inertia relationship is the one most often missed in mechanical design. A
gearbox multiplies the load inertia seen by the motor by the square of the reduction ratio,
so a 100:1 reduction makes the load appear 10,000 times heavier in inertial terms. This is
usually beneficial, since it means the motor's own inertia dominates and the load is easy to
control, and it is precisely why high-reduction systems are not backdrivable and cannot
sense external forces through motor current. A robot intended to interact safely with people
needs either low reduction, series elastic actuation, or explicit force sensing, because a
high-reduction arm cannot feel what it hits.


robotics_and_control

[user] My quadruped's leg controller is stable in simulation and oscillates on hardware at
about 30 Hz.
[assistant] tool_call control.sim_to_real({"controller": "pd_joint", "kp": 180, "kd": 4,
"sim_dt_ms": 1, "hw_control_rate_hz": 500, "sensor_latency_ms": 3.5,
"actuator_bandwidth_hz": 45, "observed_oscillation_hz": 30})
[tool] {"total_loop_delay_ms": 6.5, "phase_lag_at_30hz_deg": 70,
"actuator_phase_lag_at_30hz_deg": 34, "estimated_phase_margin_deg": -4,
"sim_modeled_delay_ms": 0, "verdict": "unmodeled_delay_and_actuator_dynamics"}
[assistant] Your simulation has no delay and no actuator dynamics, and together those
consume all your phase margin at 30 Hz.


robotics_and_control

The accounting: 3.5 ms of sensor latency plus a 500 Hz control loop contributes about 6.5 ms
of total loop delay, which at 30 Hz is 70 degrees of phase lag. Your actuator's 45 Hz
bandwidth adds another 34 degrees. That is over 100 degrees of phase the simulation never
saw, and it puts your estimated phase margin slightly negative — which is exactly an
oscillation at 30 Hz.


robotics_and_control

Fixes in order of what I would try, starting with the one that costs nothing.


robotics_and_control

Reduce the gains, particularly Kd. A derivative gain of 4 against a proportional gain of 180
is providing damping at frequencies where the delay has already inverted its effect, so it is
destabilizing rather than damping above about 20 Hz. Cut Kd first and add a low-pass filter
on the velocity estimate with a corner around 30-50 Hz. Then reduce Kp until the oscillation
disappears with margin, and only then raise it back carefully.


robotics_and_control

Reduce the delay. Raising the control rate from 500 Hz to 1 kHz halves that component.
More importantly, find where the 3.5 ms of sensor latency comes from — encoder filtering,
bus transport, buffering in a driver — because that is usually reducible and it is pure loss.
If the encoder is on a serial bus polled once per cycle, moving to a synchronous read at the
top of the loop can eliminate a whole cycle of delay.


robotics_and_control

Then fix the simulation, because otherwise this recurs on the next controller. Add the
measured delay as an explicit transport lag and model the actuator as at least a first-order
lag at its measured bandwidth. A simulation without these systematically permits gains that
hardware cannot support, which is the single most common cause of sim-to-real failure in
legged robots.


robotics_and_control

If you need the high gains for stiffness, the durable solution is a model-based feedforward
term — computed torque or inverse dynamics — so the feedback loop only handles the residual
error and can run at much lower gain.


robotics_and_control

## Planning, Estimation, and Implementation

Motion planning finds a collision-free path from start to goal in configuration space,
where each dimension is a degree of freedom and obstacles map to forbidden regions. The
problem is high-dimensional for anything beyond a simple mechanism, which rules out exact
methods and motivates sampling. Rapidly-exploring random trees grow a tree by sampling
random configurations and extending toward them, finding feasible paths quickly in high
dimensions; probabilistic roadmaps build a reusable graph, which pays off when many queries
share the same environment. Both are probabilistically complete — they find a solution if
one exists, given enough time — and neither gives optimality without variants such as
RRT-star that rewire toward lower cost.


robotics_and_control

Trajectory optimization takes a different approach, formulating the problem as constrained
optimization over a parameterized trajectory with cost terms for effort, smoothness, and
obstacle proximity. It produces smooth, dynamically feasible motions directly rather than a
geometric path requiring post-processing, at the cost of local minima and sensitivity to
initialization. Model predictive control applies this idea in a receding horizon: optimize
over a short future window, execute the first step, and re-optimize — which handles
constraints and disturbances naturally and requires solving an optimization problem at every
control cycle, which is why its adoption tracked the availability of fast embedded solvers.


robotics_and_control

State estimation fuses multiple sensors, each with complementary weaknesses. An inertial
measurement unit gives high-rate acceleration and angular rate that drift when integrated.
Encoders give precise joint positions and cannot observe slip. Vision and lidar give
absolute position at low rate with occasional gross failures. Fusing them yields an estimate
better than any individually, and the standard tools are the extended Kalman filter for
mildly nonlinear systems, the unscented variant for stronger nonlinearity, and particle
filters for multimodal distributions where a single Gaussian is inadequate.


robotics_and_control

Real-time implementation constraints:
  determinism over speed  a controller that meets its deadline every cycle beats
                          one that is faster on average and occasionally late
  fixed control period    jitter in the sampling interval is equivalent to noise in
                          the derivative and to phase uncertainty in the loop
  measure the jitter      instrument the loop period; do not assume it
  no dynamic allocation   in the control path; unbounded latency
  bound every loop        no unbounded iteration inside a real-time task
  watchdog                a hung controller with an active actuator is dangerous
  safe state on fault     define what the actuator does when control is lost, and
                          make it the default rather than a commanded action
  saturate and rate-limit outputs, always; the plant has limits and the controller
                          should respect them explicitly
  units and frames        the largest source of real robot bugs; document the frame
                          and unit of every quantity at every interface


robotics_and_control

Frame and unit errors deserve the last word because they cause more robot failures than
control theory does. A quantity expressed in the wrong frame, an angle in degrees where
radians were expected, a sign convention differing between the encoder and the model, a
transform composed in the wrong order — each produces a system that moves confidently in
the wrong direction, and none of them is caught by any amount of control tuning. The
defenses are naming conventions that encode the frame in the variable name, unit types
enforced by the type system where the language permits, and a startup self-test that
commands a small known motion and verifies the measured response has the expected sign and
magnitude in every joint before anything else runs.


sensors_and_interfacing

## Sensor Fundamentals and the Measurement Chain

A sensor converts a physical quantity into an electrical signal, and every specification
that matters describes how faithfully it does so. Sensitivity is the output change per unit
input. Range is the span over which the relationship holds. Resolution is the smallest
detectable change. Accuracy is closeness to the true value and is a systematic property;
precision is repeatability and is a statistical one. A sensor can be precise and inaccurate,
returning consistently wrong values, which is the case a single calibration point fixes and
that repeated measurement never will.


sensors_and_interfacing

The measurement chain from physical quantity to usable number has several stages, and error
introduced at any stage is generally irrecoverable downstream. The sensing element responds
to the measurand. Signal conditioning amplifies, filters, and level-shifts. The converter
digitizes. Digital processing linearizes, compensates, and filters further. The chain's
overall performance is bounded by its weakest stage, and the recurring error is investing in
a high-resolution converter behind a noisy, poorly conditioned front end — the extra bits
digitize noise with great precision.


sensors_and_interfacing

Noise and bandwidth are inseparable. Thermal noise power is proportional to bandwidth, so
restricting the bandwidth to what the signal actually occupies directly improves
signal-to-noise ratio. A sensor measuring a quantity that changes over seconds gains nothing
from a kilohertz bandwidth and pays for it in noise. Filtering must occur in analog before
digitization where aliasing is concerned, since once high-frequency content has folded into
the band no digital filter can separate it.


sensors_and_interfacing

Sensor specification vocabulary:
  sensitivity        output per unit input
  range / span       the valid input interval
  resolution         smallest distinguishable change
  accuracy           closeness to truth; systematic
  precision          repeatability; statistical
  linearity          deviation from a straight-line response, as % of full scale
  hysteresis         output depends on approach direction
  drift              slow change with time or temperature
  offset / zero      output at zero input
  response time      typically the time to reach 63% (one time constant)
  cross-sensitivity  response to quantities other than the intended one
  self-heating       excitation power warming the element and biasing the reading


sensors_and_interfacing

Cross-sensitivity is the specification most often ignored and most often responsible for
puzzling field behaviour. A pressure sensor responds to temperature. A gas sensor responds to
humidity. A strain gauge responds to temperature far more strongly than to the strain being
measured. Each requires either compensation using a second measurement or a differential
configuration that cancels the interfering quantity structurally — which is why so many
precision sensors are built as bridges.


sensors_and_interfacing

Q: A 16-bit ADC is used with a sensor whose analog front end has 8 mV of noise on a 3.3 V
range. The effective resolution is closest to:
A. 16 bits   B. 12 bits   C. 9 bits   D. 8 bits
Reasoning: One LSB of a 16-bit converter over 3.3 V is 50 microvolts, far below the 8 mV of
noise. The noise spans about 160 LSBs, so roughly 7-8 bits of the converter output are noise.
Effective resolution is about 16 minus log2(160), or approximately 8.7 bits. The remaining
converter bits digitize noise. Fixing the front end is the only path to better resolution.
Answer: C.


sensors_and_interfacing

## Temperature and Strain

Temperature is the most commonly measured physical quantity and has several sensor families
with genuinely different tradeoffs.


sensors_and_interfacing

Thermocouples exploit the Seebeck effect, generating a small voltage at the junction of two
dissimilar metals that depends on the temperature difference between that junction and the
reference. They cover enormous ranges, are rugged and cheap, and produce only tens of
microvolts per degree, which demands careful low-noise amplification. Their defining
practical requirement is cold junction compensation: the output depends on the difference
between the measuring and reference junctions, so the reference temperature must be measured
by some other means and added back. Omitting this is the classic thermocouple error and
produces readings offset by whatever the ambient temperature happens to be.


sensors_and_interfacing

Resistance temperature detectors use the predictable resistance change of pure metal,
usually platinum. They are the most accurate and stable option, nearly linear, and slow and
expensive. Their measurement requires excitation current, which causes self-heating, and lead
resistance becomes significant relative to the element's resistance — which is why three-wire
and four-wire configurations exist, cancelling lead resistance by measurement rather than by
assumption.


sensors_and_interfacing

Thermistors are semiconductor devices with a large, strongly nonlinear resistance change.
The large sensitivity makes them easy to read with simple circuitry, and the nonlinearity
requires the Steinhart-Hart equation or a lookup table for accuracy. They are cheap, fast
because they can be made small, and limited in range.


sensors_and_interfacing

Temperature sensor comparison:
  thermocouple     -200 to +1800 C, ~1-2 C accuracy, needs cold junction
                   compensation, microvolt-level signal, very rugged
  RTD (Pt100)      -200 to +600 C, 0.1 C or better, nearly linear, needs 3- or
                   4-wire connection, self-heating matters
  thermistor       -50 to +150 C, 0.1-1 C, very sensitive, strongly nonlinear,
                   cheap and fast
  silicon IC       -55 to +150 C, digital output, calibrated, trivially easy;
                   the right default when the range suffices
  infrared         non-contact, needs emissivity knowledge; reads the surface
                   emissivity as much as its temperature
  thermal time constant  the sensor measures its own temperature, not the
                   medium's; mass and coupling dominate response speed


sensors_and_interfacing

The last line deserves emphasis because it causes more temperature measurement error than
sensor accuracy does. A sensor reports its own temperature, and its agreement with the
quantity of interest depends on thermal coupling. A probe in flowing air with poor contact
reads somewhere between the air and whatever it is radiating to and conducting through. A
sensor on a circuit board reads the board, not the enclosure. Self-heating from excitation
adds a systematic offset proportional to dissipated power and inversely proportional to
thermal conductance to the environment. Attention to mounting and to thermal path usually
matters more than choosing a better sensor.


sensors_and_interfacing

Strain gauges measure deformation through the resistance change of a foil pattern bonded to
a surface. The gauge factor relates fractional resistance change to strain and is about two
for metal foil, meaning that a strain of one part in a million produces a resistance change
of two parts per million — an extraordinarily small signal that must be extracted from a
resistance that itself varies strongly with temperature.


sensors_and_interfacing

The Wheatstone bridge is the solution and is worth understanding as a general technique
rather than a specific circuit. Four resistances arranged in two dividers produce an output
proportional to their imbalance, and if all four experience the same temperature change, the
change cancels in the difference. A quarter bridge with one active gauge compensates nothing
and needs a separate reference; a half bridge with two gauges in opposite strain states
cancels temperature and doubles sensitivity; a full bridge with four does better still. This
differential structure — measure a difference so that common-mode disturbances subtract out —
recurs throughout instrumentation and is the reason load cells, pressure sensors, and
precision resistive measurements are almost always bridges.


sensors_and_interfacing

## Inertial, Magnetic, and Position Sensing

Accelerometers measure proper acceleration, which includes gravity. A device at rest reads
one g upward, not zero, and this is not an error — it measures the force required to keep the
proof mass from falling, which at rest is exactly gravity. The consequence is that separating
gravity from linear acceleration requires knowing the orientation, and knowing the orientation
requires a gravity reference, which is the circularity that makes inertial navigation hard.