Home / Robotics & Controls / Kinematics / Hobby Servo Pulse-Width to Angle Mapping

Formula & Calculator

Hobby Servo Pulse-Width to Angle Mapping

A hobby servo is controlled by a PWM signal, usually a pulse every 20 ms. A 1000 microsecond pulse commands 0 degrees; 1500 µs commands 90 degrees; 2000 µs commands 180 degrees. This formula converts any pulse width in that range to the corresponding angle. For example, a 1250 µs pulse gives 45 degrees. It is the standard mapping for RC servos used in robots, RC planes, and animatronics.

Robotics Actuators Calculator
VORZEP · ROBOTICS & ACTUATOR CONTROL TOOLS

Hobby Servo Mapping Calculator — Pulse Width → Angle

Solve the classic hobby-servo mapping relation θ = (pulse − pulsemin) / (pulsemax − pulsemin) × 180 for any of its four quantities — commanded angle, pulse width, or either endpoint — with step-by-step math, a live pulse-train diagram, and companion PWM timing metrics.

θ = ( pulse − 1000 ) / ( 2000 − 1000 ) × 180
Solve for
Servo presets
Commanded Angle (θ) Angle the servo horn is commanded to move to. With the standard 1000–2000 µs mapping, 1000 µs commands 0° and 2000 µs commands 180°. The range can be changed by editing the min and max pulse endpoints. Typical servo mechanical travel is slightly wider than the electrical range, so endpoints should be set conservatively.
deg
Angle must be ≥ 0°.
Pulse Width (pulse) The high-time of the servo control pulse, in microseconds. A typical hobby servo expects a pulse every 20 ms (50 Hz), with the high-time encoding the commanded angle. Pulse values below the minimum or above the maximum will command the servo beyond its mechanical limits and may damage it.
µs
Pulse width must be greater than zero.
Minimum Pulse (pmin) Pulse width that commands the servo to its 0° position. The classic hobby-servo convention is 1000 µs, but many digital servos use 900 µs or 500 µs for a wider mechanical range. Always check the servo datasheet — commanding below the true minimum can drive the horn into the mechanical stop.
µs
Minimum pulse must be greater than zero.
Maximum Pulse (pmax) Pulse width that commands the servo to its maximum position (180° in the default mapping). The classic hobby-servo convention is 2000 µs. For extended-range servos this is often 2500 µs. The maximum must always be greater than the minimum, otherwise the mapping is inverted and the servo will run backwards.
µs
Maximum pulse must be greater than the minimum.
Frame Rate (f) — optional Frame refresh rate — how often a new pulse is sent. The classic analog-servo frame rate is 50 Hz (20 ms period), because that is the natural rate of the old RC radio links. Modern digital servos accept 100–333 Hz or higher for faster response. Used here only for companion duty-cycle and period metrics; it does not affect the angle mapping.
Hz
COMMANDED ANGLE (θ)
90.00 °
1.5708 rad · u = 0.5000 · 10.0 °/100µs
CENTRE — 45–135°
θ = ( pulse − p_min ) / ( p_max − p_min ) × 180
Step-by-step solution
θ vs. pulse width (three endpoints)
Current endpoints Narrow span Wide span
Pulse width vs. angle (inverse mapping)
Current endpoints Narrow span Wide span
Sensitivity
Companion PWM & servo metrics
Servo pulse train & angle mapping — live schematic
SERVO CONTROL PULSE · θ = (pulse − p_min) / (p_max − p_min) × 180 PULSE TRAIN pulse T = 1/f SERVO HORN POSITION θ = 90.0° LIVE VALUES pulse = 1500.0 µs p_min = 1000 · p_max = 2000 θ = 90.00° u = (pulse − p_min) / (p_max − p_min) = 0.5000
Servo control pulse train Pulse width (high-time) Frame period T = 1/f Servo horn position θ
What the servo mapping relation really measures
θangle
=
(pulse − pmin)offset
/
(pmax − pmin)span
×
180°full scale

The mapping is a linear interpolation

The relation is just a straight line from (pmin, 0°) to (pmax, 180°). The normalised fraction u = (pulse − pmin) / (pmax − pmin) tells you where along that line the current pulse sits, and multiplying by 180 converts the fraction into an angle. Because the mapping is linear, the slope in degrees per microsecond is constant: it equals 180 / (pmax − pmin). With the classic 1000–2000 µs endpoints, the slope is 0.18 °/µs — that is, 1 µs of pulse-width error corresponds to 0.18° of angle error, and the servo's 1 µs PWM resolution gives about 0.18° of positioning resolution.

Endpoints define the mechanical range

The two endpoints pmin and pmax are what set the servo's useful travel. A servo configured for 1000–2000 µs sweeps 180° in 1000 µs of pulse change. If you widen the endpoints to 500–2500 µs, the same 180° maps onto 2000 µs of pulse change, so the angle-per-microsecond slope halves and the effective resolution doubles — but the servo may hit its mechanical stops before reaching the electrical endpoints, which is dangerous. If you narrow the endpoints, the slope steepens and the servo moves faster per microsecond, but the mechanical travel is clipped. The right endpoints are the ones that place the electrical range just inside the mechanical range.

Servos are position commands, not duty-cycle devices

Unlike a PWM motor drive where the average voltage matters, a hobby servo reads only the width of the pulse. The frame rate and the duty cycle are irrelevant to the commanded angle — a 1500 µs pulse commands 90° whether it arrives every 20 ms (50 Hz), every 5 ms (200 Hz), or every 3 ms (333 Hz). The frame rate only affects how often the servo updates its target and how quickly it can respond to a changing command. What matters for the angle is the absolute pulse width, which is why the mapping relation depends only on pulse and the two endpoints.

Out-of-range pulses are dangerous

If you command a pulse shorter than pmin or longer than pmax, the equation returns a negative angle or an angle greater than 180°. The servo cannot physically go past its mechanical limits, so it will drive against its internal hard stop. This stalls the motor, draws stall current, overheats the driver, and can strip the output gears. Good firmware clamps the commanded pulse to the calibrated endpoints before sending it, and often applies a small safety margin — for example, limiting the commanded range to 1050–1950 µs for a servo whose true mechanical limits are 1000–2000 µs.

How to Use This Calculator

The servo mapping relation links four quantities: θ, pulse, pmin, and pmax. Pick which one you want the tool to solve, then fill in the other three.

1. Choose what to solve for

Pick θ, pulse, pmin, or pmax from the toggle. The calculator rearranges the interpolation formula for whichever variable you choose, including the singular cases at the endpoints.

2. Start from a servo preset

Presets cover the classic 1000–2000 µs hobby servo, an extended-range servo at 500–2500 µs, a narrow-band digital servo at 1100–1900 µs, a wide-band analog servo at 800–2200 µs, and a high-voltage digital servo at 900–2100 µs.

3. Match pulse width to the datasheet

Always check the servo datasheet for the true endpoints. Many cheap analog servos use 1000–2000 µs, but digital servos frequently use 900–2100 µs or 500–2500 µs. Using the wrong endpoints causes the servo to hit its mechanical stops at one end of the range and to under-travel at the other.

4. Read the result and verdict

The result card shows the solved value with its radian equivalent, the normalised fraction u, and the linear slope in °/100µs. A colour-coded verdict classifies the position from minimum through low, centre, high, to maximum travel.

5. Check the pulse train and dial

The diagram shows a live pulse train scaled to the current pulse width and frame rate, with the pulse-width bracket and period bracket marked, plus a servo dial showing the horn position.

6. Switch to Advanced for depth

Advanced mode adds the inverse mapping chart, a sensitivity check on a ±1 µs input change, and companion metrics including the normalised fraction, the pulse span, duty cycle, the angle-per-microsecond slope, and the resolution in degrees per microsecond.

What This Tool Offers

Built around the classic servo interpolation θ = (pulse − pmin) / (pmax − pmin) × 180, the fundamental link between pulse width, endpoints, and commanded angle.

Four-way solving

Solve for angle, pulse width, minimum pulse, or maximum pulse. The calculator rearranges the interpolation for whichever variable you choose and flags singular endpoints.

Live pulse-train diagram

A pulse-train schematic scaled to the actual pulse width and frame rate, with pulse and period brackets, plus a servo dial showing the horn position.

Position verdict

Each result is classified from minimum through low, centre, high, to maximum travel, and out-of-range pulses are flagged as potentially damaging.

Resolution & slope readout

Every result reports the linear slope 180/(pmax−pmin) in °/µs and °/100µs, and the resolution in degrees per LSB of a typical PWM timer.

Frame-rate metrics

Enter a frame rate to compute the period T = 1/f, the duty cycle of the pulse, and the timing margin between pulses.

Reference tables

Typical endpoints by servo class, a pulse-to-angle lookup grid for four different endpoint sets, and a full variable reference table.

Reference Tables & Conversions

A pulse and endpoint converter, a pulse-to-angle lookup grid, and typical endpoints by servo class.

Pulse & angle converter

µs
µs
µs
deg
Hz
= pulse 1500 µs · p_min 1000 µs · p_max 2000 µs → θ 90° · f 50 Hz → T 20 ms

Pulse-to-Angle Lookup — θ = (pulse − pmin) / (pmax − pmin) × 180

Computed for four common endpoint sets. Values in degrees. Cells outside the valid pulse range for a given endpoint set are left blank.

Pulse (µs)1000–2000500–25001100–1900800–2200900–2100

Typical Pulse Endpoints by Servo Class

Representative values. Always verify against the specific servo datasheet — endpoint conventions vary between manufacturers.

Servo classp_min (µs)p_max (µs)Span (µs)Slope (°/µs)Notes
Standard analog hobby (SG90, MG996R)1000200010000.180Classic RC convention; 180° nominal travel
Extended range digital (HV)900210012000.150Wider mechanical range; higher torque
Wide-band analog (sail winch)500250020000.090Two or three turns of the drum; linear winch
Narrow-band tail servo110019008000.225Narrow span, faster transit per µs
Standard digital servo (DS3218)1000200010000.180Higher refresh rate tolerated (up to 333 Hz)
Continuous-rotation servo100020001000—Pulse commands speed, not position (1500 = stop)
High-torque industrial (Dynamixel)0409540950.044Serial bus; pulse is a 12-bit position value

Variable Reference

SymbolMeaningTypical rangeUnits
θCommanded angle0 – 180deg
pulseCommand pulse width500 – 2500µs
pminPulse width for 0°500 – 1100µs
pmaxPulse width for 180°1900 – 2500µs
uNormalised fraction (pulse−pmin)/(pmax−pmin)0 – 1—
fFrame rate50 – 500Hz
TFrame period = 1/f2 – 20ms
DDuty cycle = pulse / T2.5 – 12.5%

What Does θ = (pulse − pmin) / (pmax − pmin) × 180 Measure?

The hobby-servo mapping relation converts a command pulse width into a commanded angle. It answers a simple question: if I send a 1500 µs pulse to a servo configured for 1000–2000 µs endpoints, where does the horn go? The answer is the normalised position along the pulse range, multiplied by 180°. At 1000 µs the servo goes to 0°; at 2000 µs it goes to 180°; at 1500 µs it goes to the midpoint, 90°. In between, the mapping is a straight line.

This is not a physical law — it is a de facto industry convention inherited from the early RC hobby radio systems of the 1960s. The original analog servos decoded a 1–2 ms pulse width into a potentiometer feedback loop, and the 1000–2000 µs range became standard because it fit comfortably inside the 20 ms frame of a 50 Hz RC link. Modern digital servos have largely freed themselves from that constraint, but they retain the 1000–2000 µs convention for backward compatibility, and most accept 900–2100 µs or 500–2500 µs for extended mechanical range.

Servo Mapping Formula

The defining relationship is:

θ = ( pulse − pmin ) / ( pmax − pmin ) × 180

Rearranged to solve for the other three quantities:

pulse = pmin + ( θ / 180 ) × ( pmax − pmin )
pmin = ( pulse − u · pmax ) / ( 1 − u ),   u = θ/180   [singular at θ = 180°]
pmax = ( pulse − pmin · ( 1 − u ) ) / u   [singular at θ = 0°]

A useful intermediate quantity is the normalised fraction:

u = ( pulse − pmin ) / ( pmax − pmin )   ∈ [0, 1]

And the linear slope of the mapping is:

dθ/dpulse = 180 / ( pmax − pmin )   [° / µs]

which is constant across the whole range — the hallmark of a linear interpolation.

Servo Mapping Variables

SymbolMeaningNotes
θCommanded angle0° at pmin, 180° at pmax; linear in between
pulseCommand pulse widthHigh-time of the control pulse, in microseconds
pminMinimum pulse (0°)Typically 1000 µs for a classic hobby servo
pmaxMaximum pulse (180°)Typically 2000 µs; must always exceed pmin
uNormalised fractionThe position along the pulse span, between 0 and 1
fFrame rateHow often pulses are sent; 50 Hz is the classic analog value
TFrame periodT = 1/f; 20 ms at 50 Hz
DDuty cycleD = pulse/T; only relevant for power consumption, not for angle

How Each Variable Affects the Commanded Angle

The angle is linear in the pulse width over the whole range: every additional microsecond of pulse advances the servo by the same number of degrees. The slope of that relationship is set entirely by the endpoints — a wider span (pmax − pmin) gives a smaller slope, so the servo moves more slowly per microsecond but with finer resolution; a narrower span gives a steeper slope and coarser resolution. This is why servos with extended mechanical range are often specified with a wider endpoint span: the same 1 µs of PWM jitter produces less angle error, which is exactly what you want when the servo is driving a large load or tracking a precise trajectory.

The endpoints themselves are an electromechanical contract, not a formula. They tell the servo's internal controller what pulse width corresponds to each mechanical extreme. If you set them too wide, the servo will try to drive past its mechanical stops and stall. If you set them too narrow, you lose usable travel. The correct procedure is to start from the datasheet's recommended endpoints, command a slow sweep across the full range, and then trim the endpoints slightly inward until the servo no longer buzzes or draws excess current at either extreme. A typical safety margin is 3–5% of the full span at each end.

Frame rate and duty cycle do not enter the angle calculation at all — they only affect the servo's response time and power consumption. A pulse of 1500 µs commands 90° whether it arrives at 50 Hz or 333 Hz. What changes with frequency is how often the servo updates its target and how quickly it reacts to a moving command. That is why high-performance digital servos are usually specified up to 333 Hz, while cheap analog servos may be damaged if driven above 60–70 Hz.

Servo Mapping Calculation Examples

Given: pulse = 1500 µs, pmin = 1000 µs, pmax = 2000 µs — solve for θ
u = (1500 − 1000) / (2000 − 1000) = 500 / 1000 = 0.5
θ = 0.5 × 180 = 90°
Given: θ = 45°, pmin = 1000 µs, pmax = 2000 µs — solve for pulse
pulse = 1000 + (45/180) × 1000 = 1000 + 250 = 1250 µs
Given: pulse = 1750 µs, θ = 135°, pmax = 2000 µs — solve for pmin
u = 135/180 = 0.75
pmin = (1750 − 0.75 × 2000) / (1 − 0.75) = (1750 − 1500) / 0.25 = 1000 µs
Given: pulse = 1250 µs, θ = 45°, pmin = 1000 µs — solve for pmax
u = 45/180 = 0.25
pmax = (1250 − 1000 × 0.75) / 0.25 = 500 / 0.25 = 2000 µs
Given: pmin = 900 µs, pmax = 2100 µs, f = 200 Hz — solve for slope and timing
span = 2100 − 900 = 1200 µs
slope = 180 / 1200 = 0.150 °/µs = 15.0 °/100µs
T = 1 / 200 = 5 ms
at pulse = 1500 µs: u = (1500 − 900) / 1200 = 0.5 → θ = 90°
Given: a 12-bit PWM timer at fPWM = 1 MHz — solve for the angle resolution
1 LSB = 1 / 1 MHz = 1 µs
With pmin = 1000, pmax = 2000: slope = 0.18 °/µs
resolution = 0.18° per LSB — about 1000 steps across 180°

Frequently Asked Questions

Because of the original RC radio design. In the 1960s, hobby radio links transmitted a 20 ms frame containing several 1–2 ms channel pulses, with the pulse width encoding the stick position. The first analog servos were designed to decode exactly that signal: a 1 ms pulse drove the horn to one extreme, a 2 ms pulse to the other, and the servo's internal potentiometer feedback loop held the horn at the corresponding position. That 1000–2000 µs convention survived into the digital era because it kept backward compatibility with millions of existing transmitters and receivers. Modern digital servos can usually accept wider ranges, but they default to the classic convention so they drop straight into an existing RC system.

No. The servo reads only the width of each pulse, not how often pulses arrive. A 1500 µs pulse commands 90° whether it is sent every 20 ms (50 Hz) or every 3 ms (333 Hz). What frame rate does affect is how quickly the servo updates its target and how aggressively it drives toward it. Higher frame rates let a digital servo respond faster to a changing command, which is essential for tail-rotor control on a helicopter or steering on a fast car. But they also increase power dissipation in the servo's motor and driver, and cheap analog servos may overheat or buzz if driven above their rated frame rate — typically 60 Hz for the cheapest, 200–333 Hz for high-end digital units.

The equation returns an angle below 0° or above 180°, but the servo cannot physically go there — its mechanical hard stops prevent it. So instead of moving further, the servo drives its motor against the stop at full torque, drawing stall current and dissipating all of that power as heat inside the motor and the H-bridge. Within a few seconds this can melt the motor windings, strip the output gears, or destroy the driver transistor. Good firmware always clamps the commanded pulse to a safe range — typically 50–100 µs inside the true endpoints — before sending it. The clamping should be done in the pulse domain, not the angle domain, so that any small nonlinearity in the servo's internal mapping does not push the horn past the stop.

Because inside a hobby servo the pulse width is compared against the potentiometer position by an analog comparator, and the difference is amplified to drive the motor. As long as the potentiometer, the comparator, and the motor driver are all reasonably linear over the travel range, the relationship between pulse width and commanded angle is a straight line. Real servos have small nonlinearities at the extremes — the potentiometer's resistance can deviate from linear near its mechanical limits, and the motor's back-EMF changes as it approaches the target — but for most hobby applications the linear model is accurate to within a degree or two across the full range.

A continuous-rotation servo is a modified hobby servo whose feedback potentiometer has been removed and replaced with a fixed resistor, so it can spin indefinitely. In that configuration the pulse width no longer commands an angle — it commands a speed. Typically 1500 µs means stop, 1000 µs means full speed in one direction, and 2000 µs means full speed in the other. The formula in this calculator does not apply: you cannot compute a "commanded angle" because there is no angle. What you can compute is the commanded speed as a normalised fraction u = (pulse − 1500) / 500, ranging from −1 (full reverse) through 0 (stop) to +1 (full forward). The same endpoints appear, but the physical meaning is completely different.

Start from the datasheet's recommended endpoints (usually 1000 and 2000 µs, or 500 and 2500 for extended-range servos). Then run a slow automatic sweep — say, 1 µs per 10 ms from one end to the other — and watch the current draw on a bench supply. Well before the sweep reaches the datasheet endpoints, the current will start to rise as the servo drives against the mechanical stop. Note the pulse at which the current first rises, and back off by 3–5% of the span to give yourself a safety margin. Use the resulting values as pmin and pmax in this calculator and in your firmware. If you do this for each individual servo, you will get slightly different endpoints for each unit — that is normal, and calibrating per unit is the difference between a hobby project and a reliable robotic system.

An analog servo uses an analog error amplifier and a linear motor driver. A digital servo replaces them with a microcontroller and a PWM-driven H-bridge running at a much higher internal frequency — typically 300–500 kHz. The visible effect is that the digital servo is more precise, holds its position more firmly against load, and can be updated at a higher frame rate. The pulse-to-angle mapping, however, is unchanged: the microcontroller still counts the incoming pulse width and compares it against the potentiometer reading, and the linear interpolation between pmin and pmax still describes the relationship. Digital servos often ship with wider endpoint options because the microcontroller can store per-unit calibration data.

Only by analogy. A Dynamixel or similar smart bus servo does not use pulse-width signalling at all — it receives a digital position command over a serial bus, usually as a 12-bit integer from 0 to 4095. The mapping is then a different formula: θ = (value / 4095) × 360° (or 300°, depending on the model). You can enter those "virtual endpoints" (0 and 4095) into this calculator if you like — the mathematical structure is identical, and the linear interpolation is the same — but the physical quantities are not pulse widths. For clarity, this calculator uses microseconds throughout, matching the hobby-servo convention.

Calculating...

Variables

Symbol Quantity Unit
theta Commanded servo angle degrees
pulse_width PWM control pulse width microseconds

What it means

Standard hobby servos use a 50 Hz PWM signal, with pulse widths from 1000 µs to 2000 µs corresponding to 0° to 180°. This linear mapping is used to generate the appropriate pulse width for a desired angle. Understanding this is essential for controlling servos with microcontrollers.

Worked example

Servo Pulse‑Width to Angle – Two Detailed Examples

Real‑World
Scenario: A hobby servo expects a pulse width between 1000 μs (0°) and 2000 μs (180°). A pulse width of 1500 μs corresponds to angle θ = (1500 - 1000) / (2000 - 1000) × 180 = 500/1000 × 180 = 90°. The robot builder uses this to position the servo to the neutral position. This mapping is essential for controlling servo‑based joints in hobby robotics.
ParameterValue
pulse_width (μs)1500
1θ = (1500 - 1000) / 1000 × 180 = 0.5 × 180 = 90°
Result 90° ✓ Neutral position
Scenario: A pulse width of 1250 μs maps to θ = (1250 - 1000) / 1000 × 180 = 0.25 × 180 = 45°. The engineer uses this to control a camera pan‑tilt mechanism, setting the camera to look 45° to the right. The linear mapping makes it easy to compute the required pulse width for any desired angle.
ParameterValue
pulse_width1250
1θ = (1250 - 1000) / 1000 × 180 = 45°
Result 45° ✓ Angle control
Insight: Hobby servos use pulse‑width modulation (PWM) to control position. The mapping is linear: pulse width = 1000 + (angle/180) × 1000. This makes them easy to interface with microcontrollers for precise angular control.

Common mistakes

  • Servo pulse‑width to angle mapping: θ = (pulse_width − 1000) / (2000 − 1000) × 180 – for common 1000‑2000 µs range.
  • Assumes: Linear mapping, 180° range (some servos have smaller ranges).
  • Units: pulse_width in microseconds – typical range 1000‑2000 µs.
  • Center position: 1500 µs corresponds to 90°.
  • Limits: Some servos have different ranges – check the datasheet.

Applications

Hobby servo pulse‑width to angle mapping, θ = (pulse_width − 1000)/(2000 − 1000)×180, converts a pulse width (in microseconds) to the corresponding angular position for standard RC servos. This is used to command servos in robotics, animatronics, and model aircraft. Engineers and hobbyists use it to map desired angles to PWM signals, allowing precise positioning of joints and control surfaces. By understanding this mapping, they can interface microcontrollers with servos and implement closed‑loop control. This formula is a fundamental tool for servo‑based actuation.

  • Position control of servo motors in robotics and animatronics
  • Control surface deflection in RC aircraft and drones
  • Gripper and end‑effector actuation in pick‑and‑place systems
  • Calibration and programming of servos for precise positioning
  • Integration with microcontrollers (Arduino, Raspberry Pi, etc.)

Suggest an improvement

Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.

Page details

1,419

Views
  • Published July 13, 2026
  • Last updated September 25, 2026