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.
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
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–2000 | 500–2500 | 1100–1900 | 800–2200 | 900–2100 |
|---|
Typical Pulse Endpoints by Servo Class
Representative values. Always verify against the specific servo datasheet — endpoint conventions vary between manufacturers.
| Servo class | p_min (µs) | p_max (µs) | Span (µs) | Slope (°/µs) | Notes |
|---|---|---|---|---|---|
| Standard analog hobby (SG90, MG996R) | 1000 | 2000 | 1000 | 0.180 | Classic RC convention; 180° nominal travel |
| Extended range digital (HV) | 900 | 2100 | 1200 | 0.150 | Wider mechanical range; higher torque |
| Wide-band analog (sail winch) | 500 | 2500 | 2000 | 0.090 | Two or three turns of the drum; linear winch |
| Narrow-band tail servo | 1100 | 1900 | 800 | 0.225 | Narrow span, faster transit per µs |
| Standard digital servo (DS3218) | 1000 | 2000 | 1000 | 0.180 | Higher refresh rate tolerated (up to 333 Hz) |
| Continuous-rotation servo | 1000 | 2000 | 1000 | — | Pulse commands speed, not position (1500 = stop) |
| High-torque industrial (Dynamixel) | 0 | 4095 | 4095 | 0.044 | Serial bus; pulse is a 12-bit position value |
Variable Reference
| Symbol | Meaning | Typical range | Units |
|---|---|---|---|
| θ | Commanded angle | 0 – 180 | deg |
| pulse | Command pulse width | 500 – 2500 | µs |
| pmin | Pulse width for 0° | 500 – 1100 | µs |
| pmax | Pulse width for 180° | 1900 – 2500 | µs |
| u | Normalised fraction (pulse−pmin)/(pmax−pmin) | 0 – 1 | — |
| f | Frame rate | 50 – 500 | Hz |
| T | Frame period = 1/f | 2 – 20 | ms |
| D | Duty cycle = pulse / T | 2.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:
Rearranged to solve for the other three quantities:
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:
And the linear slope of the mapping is:
which is constant across the whole range — the hallmark of a linear interpolation.
Servo Mapping Variables
| Symbol | Meaning | Notes |
|---|---|---|
| θ | Commanded angle | 0° at pmin, 180° at pmax; linear in between |
| pulse | Command pulse width | High-time of the control pulse, in microseconds |
| pmin | Minimum pulse (0°) | Typically 1000 µs for a classic hobby servo |
| pmax | Maximum pulse (180°) | Typically 2000 µs; must always exceed pmin |
| u | Normalised fraction | The position along the pulse span, between 0 and 1 |
| f | Frame rate | How often pulses are sent; 50 Hz is the classic analog value |
| T | Frame period | T = 1/f; 20 ms at 50 Hz |
| D | Duty cycle | D = 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
u = (1500 − 1000) / (2000 − 1000) = 500 / 1000 = 0.5
θ = 0.5 × 180 = 90°
pulse = 1000 + (45/180) × 1000 = 1000 + 250 = 1250 µs
u = 135/180 = 0.75
pmin = (1750 − 0.75 × 2000) / (1 − 0.75) = (1750 − 1500) / 0.25 = 1000 µs
u = 45/180 = 0.25
pmax = (1250 − 1000 × 0.75) / 0.25 = 500 / 0.25 = 2000 µs
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°
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.
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| Parameter | Value |
|---|---|
| pulse_width (μs) | 1500 |
| Parameter | Value |
|---|---|
| pulse_width | 1250 |
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.)
Related calculators · Kinematics
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.