Bench and safety

Before any code moves a motor, the bench decides how much damage a mistake can do. Set the current limit before the output is on, know which instrument answers which question, and know what the arm does when the power goes away, because one day it will.

3 formulas · 5/5 checks pass · 18 sources · fact-checked and reviewed

Key ideas

  1. The current limit is the setting that protects you

    A bench supply in constant-voltage mode holds its voltage and lets the load draw what it likes, up to the current limit. A load that would draw more pushes it into constant current: the supply holds the current and lets the voltage fall. The crossover sits at Rcross=Vset/IlimitR_{\text{cross}} = V_{\text{set}}/I_{\text{limit}} (F1.02); any load below it gets the limit and no more.[1][2]

  2. A stalled motor is just a resistor

    A motor at rest generates no back emf, so the only thing limiting its current is the winding's resistance: I=V/RI = V/R, and every watt of P=VIP = VI (F1.01) becomes heat in the winding. Starting, stalling against a hard stop and a jammed gearbox all look the same to the supply.[3][4][5]

  3. Logic analyser for timing, oscilloscope for shape

    A logic analyser records ones and zeros on many lines at once and decodes protocols such as I²C, SPI and serial; it answers when and what was sent. An oscilloscope records the voltage itself and answers what does the signal look like: ringing, noise, a sagging rail. Sample a digital line at least four times its bandwidth (F1.03).[6][7][8]

  4. A motor can push energy back into the supply

    A spinning motor is also a generator. When its load drives it, or a driver slows it by applying less voltage than the motor's own emf (as a servo drive does when it decelerates), current flows back through the driver toward the supply; in a coasting H-bridge it returns through the transistors' body diodes once the emf exceeds the supply voltage. Most supplies can absorb very little of it, so the rail rises. TI's DRV8842 data sheet asks for bulk capacitors rated above the operating voltage to leave margin for exactly this.[3][9][10][11][12]

  5. Cutting the power is a stop, but not a controlled one

    IEC 60204-1, on the electrical equipment of machines, names three stop categories: 0, immediate removal of power; 1, a controlled stop and then power off; 2, a controlled stop with power kept on. A desktop arm is not built to it, but the words are useful. A switch that simply removes power gives a category 0 stop; categories 1 and 2 need the drives to bring the arm to rest under power first. After a category 0 stop, an arm that can be back-driven and has no brake falls.[13]

  6. A driver has two ways to be off

    Coast turns the bridge off: the driver stops driving, and any current left in the winding decays through the transistors' body diodes, so the joint is left largely free. Brake shorts the winding, which then resists motion in proportion to speed (F8.11). Braking slows a falling link; it cannot hold one still, because at zero speed the braking torque is zero.[9][14]

Formulas

The same entries as the formula sheet. Open an entry's details for its symbols and the checks behind it.

  1. Electrical power

    P=V IP = V\,I
    F1.01[5]
    Symbols
    SymbolMeaningUnit
    PPpowerW
    VVvoltageV
    IIcurrentA
  2. Where a bench supply switches from constant voltage to constant current

    Ideal CV/CC supply with a resistive load. Loads below R_cross put the supply in constant current, and the output voltage falls to I_limit·R.

    Rcross=VsetIlimitR_{\text{cross}} = \dfrac{V_{\text{set}}}{I_{\text{limit}}}
    F1.02✓ 5/5 checked[1][4]
    Symbols and checks
    SymbolMeaningUnit
    RcrossR_{\text{cross}}load resistance at the crossoverΩ
    VsetV_{\text{set}}voltage settingV
    IlimitI_{\text{limit}}current limitA
    • ✓ 20 ohm at 1 V / 0.08 A: predicted CV, Siglent observed CVobserved as stated
    • ✓ 20 ohm: predicted current vs Siglent's measured 0.049 Aexpected 0.05 · got 0.049 · relative error 0.02within 5 %: resistor tolerance and lead resistance
    • ✓ 10 ohm: predicted CC (R below 12.5 ohm), Siglent observed CCobserved as statedSiglent: the current 'stops at just below the current setpoint of 80 mA'
    • ✓ spin-up with winding inductance: the clamp releases at (V - I_lim R)/K (rad/s)expected 70 · got 70.0001 · relative error 1.1×10⁻⁶agrees by construction once the current is steady; the run shows the inductance does not move it. Rotor inertia 1e-05 kg m^2 sets only how long it takes
    • ✓ spin-up: the limit is reached within the first millisecondobserved as statedthe winding current rises with time constant L/R = 0.1 ms
  3. Logic analyser sample rate

    Rule of thumb for digital timing work, not a theorem. Nyquist (2×) is the floor for recovering a band-limited signal, not for resolving edges; more margin resolves timing better.

    fs≥4 fmax⁡f_s \ge 4\,f_{\max}
    F1.03[8]
    Symbols
    SymbolMeaningUnit
    fsf_{s}sample rateHz
    fmaxf_{\text{max}}bandwidth of the fastest signal (for a clocked bus, its clock frequency)Hz

Worked example: the first power-up of a motor, limit first

The illustrative motor behind module 08's braking check, with a winding resistance of 10 Ω and a torque constant of 0.1 N·m/A, on an ideal bench supply set to 12 V. The numbers below come from tools/robotics/verify.py, which also time-steps the spin-up.

  1. Name the worst case

    Stalled, the motor is its winding resistance, so it would draw the full V/RV/R and turn all of it into heat (F1.01).[15]

    Istall=VR=12 V10 Ω=1.2 AP=VI=14.4 W\begin{aligned} I_{\text{stall}} &= \frac{V}{R} = \frac{12\ \text{V}}{10\ \Omega} = 1.2\ \text{A} \\ P &= VI = 14.4\ \text{W} \end{aligned}
  2. Set the limit, with the output off

    A limit of 0.5 A puts the crossover at 24 Ω (F1.02). The stalled motor's 10 Ω is below it, so the supply would hold 0.5 A at 5 V: 2.5 W of heat instead of 14.4 W.[15]

    Rcross=12 V0.5 A=24 ΩVout=IlimitR=5 V\begin{aligned} R_{\text{cross}} &= \frac{12\ \text{V}}{0.5\ \text{A}} = 24\ \Omega \\ V_{\text{out}} &= I_{\text{limit}} R = 5\ \text{V} \end{aligned}
  3. Switch on, and watch the mode change

    As the motor speeds up, its back emf KωK\omega adds to the IRIR the supply must provide at constant current. When the two reach the voltage setting, the supply can no longer hold the current, returns to constant voltage, and the current falls as the motor keeps accelerating. For this motor that happens at about 668 rpm. A time-stepped run that includes the winding's inductance releases the limit at the same speed, since the inductance plays no part once the current is steady.[3][15]

    IlimitR+Kω=Vsetω=Vset−IlimitRK=70 rad/s\begin{aligned} I_{\text{limit}} R + K\omega &= V_{\text{set}} \\ \omega &= \frac{V_{\text{set}} - I_{\text{limit}} R}{K} = 70\ \text{rad/s} \end{aligned}
    What the supply does as the motor spins up (no load, no friction)
    MotorSupply modeOutput voltageCurrent
    At rest, or stalledconstant current5 V0.5 A
    Speeding upconstant current5 V + KωK\omega0.5 A
    Above 70 rad/sconstant voltage12 Vfalls as KωK\omega rises
  4. Read the display

    Constant current during the first moments of a start is expected. Constant current while the shaft is not turning means a stall, a short or a wiring mistake: switch the output off and find out which. The limit has already capped the heating power while you do.

Set the limit for the worst case you can name, before the output is on. A fault then shows up as a lit constant-current indicator, with the heating power capped at a value you chose in advance.

Best practice

Questions

The motor is rated for 12 V. Why limit the current at all?
The rating is for running. Starting or stalled, the motor generates no back emf, so it draws V/RV/R, which for the motor on this page is 1.2 A and 14.4 W of heat. The limit decides how much of that a mistake can have.[3][15]
Do I need an oscilloscope, or is a logic analyser enough?
For timing and protocols, a logic analyser is the better tool and often all you need. Saleae, which makes logic analysers, says plainly that they do not replace an oscilloscope for signal integrity, high-bandwidth analog work, or voltages outside their input range.[6][7]
What sample rate should I use?
At least four times the bandwidth of the fastest digital signal (F1.03); for a clocked bus such as SPI, that means four times the clock. Saleae's rule for analog is at least ten times. More margin gives finer timing.[8]
Why did the supply voltage jump when the motor stopped suddenly?
If a driver was decelerating the motor under power (not by shorting its winding), or the load was driving it, the motor became a generator and pushed current back onto the rail, which most supplies can absorb very little of. This is why the DRV8842 data sheet asks for bulk capacitors rated above the operating voltage. With the motor wired straight to the supply, as in the example above, a sudden stall does the opposite: the current rises, and if it reaches the limit the supply drops into constant current and its voltage falls.[10][12][15]
Will braking the motor hold the arm up if the power fails?
No. A shorted winding produces torque in proportion to speed, so it slows a fall but cannot stop it (F8.11). And a driver needs power to brake: below its undervoltage threshold the DRV8833 disables all its circuitry, so it cannot short the winding at all. Holding a load without power takes something mechanical, such as a brake.[9][14]
What should a bench supply for this have?
Constant-voltage and constant-current modes with a limit you can set, and enough voltage and current for the motors you will test one at a time. A linear programmable supply such as Siglent's SPD1305X, with up to 30 V and 5 A, is one example of the type.[16][17]

Watch

Read

Sources

Numbered in order of first use on this page. read: checked against the claim. listed: exists and covers the topic, wording not checked. derived: worked out here and checked numerically.

  1. [1]

    SPD Constant Current (operating tip) (opens in a new tab)

    Siglent Technologies North America

    The supply stays in CV while the load draws less than the limit and switches to CC when it would draw more (worked example with 20 Ω and 10 Ω loads).

    read
  2. [2]

    Understanding Constant Voltage (CV) and Constant Current (CC) Modes in Regulated Power Supplies (opens in a new tab)

    B&K Precision, technical note, 5 June 2025

    When the load would draw more than the current limit, the supply switches from CV to CC, holds the current at the limit and reduces the voltage as needed.

    read
  3. [3]

    University Physics Volume 2, §13.6 Electric Generators and Back Emf (opens in a new tab)

    Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0

    Back emf and Fig. 13.32

    A turning motor generates a back emf that is zero at rest and rises in proportion to the motor's angular velocity.

    read
  4. [4]

    University Physics Volume 2, §9.4 Ohm's Law (opens in a new tab)

    Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0

    Eq. 9.11 (V = IR)

    Ohm's law, used for the current a back-emf drives through a shorted winding.

    read
  5. [5]

    University Physics Volume 2, §9.5 Electrical Energy and Power (opens in a new tab)

    Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0

    Eq. 9.12 (P = IV)

    Electrical power.

    read
  6. [6]

    What is the difference between a Logic Analyzer and an Oscilloscope? (opens in a new tab)

    Joe Garrison · Saleae blog, 21 December 2017

    Logic analyzers are best for digital signals and protocols (I²C, SPI, serial), recording ones and zeros over time; oscilloscopes are best for analog signals, tracking voltage and how it changes.

    read
  7. [7]

    Can These Products Replace an Oscilloscope? (opens in a new tab)

    Saleae support

    Saleae devices are logic analyzers with analog logging, of lower bandwidth than oscilloscopes and with fixed input range; a scope is still needed for signal integrity, high-bandwidth analog, small voltages at high resolution and voltages outside their range.

    read
  8. [8]

    What Sampling Rate Should I Use? (opens in a new tab)

    Saleae support

    Sample digital signals at least 4× their bandwidth, analog at least 10×.

    read
  9. [9]

    DRV8833 Dual H-Bridge Motor Driver, data sheet (SLVSAR1E) (opens in a new tab)

    Texas Instruments, 2011, revised 2015

    §7.3.2 Bridge Control and Decay Modes, Table 1 (H-Bridge Logic); §7.3.5.3 Undervoltage Lockout

    A driver’s two “off” states: coast (outputs high-impedance; in fast decay the recirculation current flows through the body diodes) and brake (both outputs low, which shorts the winding). Below the undervoltage threshold (VM < 2.5 V) all circuitry in the device is disabled.

    read
  10. [10]

    Power Supplies Can Absorb Power, Too (opens in a new tab)

    Bob Zollo · Electronic Design, 1 February 2018

    In most power supplies, some provision is made to discharge the output capacitor: a bleed resistor or an active down-programmer, the latter typically limited to about 10 % of rated output current. A supply that can also sink current is called two-quadrant. A device under test can itself be an energy generator.

    read
  11. [11]

    How to Size a Power Supply for a Servo Drive (opens in a new tab)

    ADVANCED Motion Controls, 2026

    Every deceleration drives the load’s kinetic energy back through the drive onto the DC bus; with nowhere to go, the bus voltage rises until the drive faults on overvoltage. An unregulated supply is not built to sink reverse current; a shunt regulator can clamp the bus.

    read
  12. [12]

    DRV8842 data sheet, Power Supply Recommendations (SLVSAB8G) (opens in a new tab)

    Texas Instruments, 2010, revised 2016

    §9.1 Bulk Capacitance Sizing

    Bulk capacitors should be rated above the operating voltage to allow for cases when the motor transfers energy to the supply; without enough bulk capacitance the supply voltage moves with the motor’s current demands and dumps.

    read
  13. [13]

    Stop Categories (UR20/UR30 user manual) (opens in a new tab)

    Universal Robots

    Stop categories as defined in IEC 60204-1: 0, stop by immediate removal of power; 1, controlled stop, then power removed; 2, stop with power maintained to the drives.

    read
  14. [14]

    Braking from a shorted winding (back emf, Ohm’s law, torque proportional to current)

    F8.11, checked against an independent simulation of the coupled pendulum and RL circuit.

    derived
  15. [15]

    Stalled and spinning motor on a current-limited supply

    The illustrative motor behind module 08’s braking check (K = 0.1 N·m/A, R = 10 Ω, L = 1 mH): stall current and power from Ohm’s law, and a time-stepped spin-up from rest on a voltage source whose current is clamped at the limit, recording the speed at which the clamp releases.

    derived
  16. [16]

    SPD1305X Programmable Linear DC Power Supply (opens in a new tab)

    Siglent Technologies NA, product page

    Output 0–30 V, 0–5 A, 150 W; a programmable linear supply. (The page’s feature list also shows 16 V / 8 A figures that belong to another model.)

    read
  17. [17]

    SPD1000X Series Programmable Linear DC Power Supply, data sheet (DataSheet-2021.04) (opens in a new tab)

    Siglent Technologies, April 2021 (copy hosted by SMU Physics)

    SPD1305X: 30 V / 5 A, up to 150 W; constant-voltage and constant-current modes; output short-circuit and overload protection.

    read
  18. [18]

    Modern Robotics, Chapter 8.9: Actuation, Gearing, and Friction (opens in a new tab)

    Kevin M. Lynch · Northwestern University, Modern Robotics video series (YouTube)

    The book’s own video for §8.9: motors, gearing, apparent (reflected) inertia and friction models. Linked from the book site’s chapter 8 video list.

    listed