Electrical Energy Calculator
Calculate electricity use from power and duration, or constant DC voltage and current. Compare energy use over different operating times in watt-hours, kilowatt-hours and joules.
Open toolInteractive calculation is unavailable until JavaScript loads. The formulas, worked examples and references below remain available.
Calculate encoder position resolution from lines, decoding and gearing, add backlash and encoder error, and check the result against a position-accuracy target.
Enter the encoder's lines per revolution (PPR) from its datasheet and choose the decoding your counter uses; x4 counts every edge of both channels.
Enter the gear reduction between the encoder and the output. With the encoder on the output, enter gear 1 and backlash 0: it measures after the backlash.
Choose a rotary or linear output. For a linear output, enter how far it moves per output revolution: the screw lead or the pulley circumference.
Enter the backlash at the output, the encoder's accuracy in arcminutes and the accuracy you need. Leave backlash and accuracy at 0 to see resolution alone.
Read the resolution, the worst-case error and whether it meets your target. Drag the lines slider under the chart to try other encoders. Copy result copies the summary; Reset restores the example.
An incremental encoder's disk has a number of lines per revolution. Each line gives one pulse on channel A and one on channel B, a quarter cycle apart. Counting only the rising edges of A gives one count per line (x1); both edges of A give two (x2); every edge of both channels gives four (x4).
Resolution is the smallest step the count can show: one revolution divided by the counts per revolution. A gearbox between the encoder and the output multiplies the counts per output revolution by its reduction, so a 500-line encoder at x4 behind a 10:1 gearbox gives 20,000 counts and 0.018° per count.
Resolution is not accuracy. The count can only place the position within a count, which this tool takes as half a count either side. The encoder's own errors, from disk eccentricity and line placement, are usually given in arcminutes. The gearbox divides them, but it adds backlash, a dead band the encoder on the motor cannot see.
The worst-case error adds half a count, the encoder error at the output and half the backlash. More lines shrink only the first term, so the curve on the chart falls and then flattens at the backlash and encoder floor. If the target is below that floor, no encoder can meet it: reduce the backlash or put the encoder on the output.
Assumptions and limitations: the three errors are added as a worst case; for independent errors the usual estimate is the root-sum-square, which is smaller. Enter the encoder accuracy as ±: halve a value the datasheet quotes as a total band. Backlash is a fixed dead band; gear transmission error, shaft twist, coupling compliance, lead-screw error, thermal growth and edge jitter are not modelled. The half-count bound is this tool's convention for an ideal counter; some datasheets quote one count.
What is the difference between PPR and CPR? PPR (lines) counts one channel's cycles per revolution. CPR counts the edges your decoder sees, so x4 decoding makes CPR four times PPR. Some vendors write CPR for cycles, so check the datasheet's definition.
Why does a higher-resolution encoder not fix my error? Because the error is then set by backlash and the encoder's accuracy, not by the count. On the chart, the operating point sits on the flat part of the curve.
Should the encoder go on the motor or on the output? On the motor, the gearbox multiplies the counts but the encoder cannot see backlash. On the output, it sees the true position, but needs many more lines for the same resolution. With the encoder on the output, enter gear 1 and backlash 0: it measures after the backlash.
Related tools: the Encoder PPR/CPR and quadrature-count calculator (045) converts counts into angle and count rate; the Stepper steps-per-mm / steps-per-degree calculator (044) and the Gear-ratio calculator (041) give the travel and reduction to enter here; the Stepper torque/speed and microstepping helper (146) covers open-loop stepper positioning.
Counts: CPR = N × k; counts per output revolution C = CPR × G.
Resolution: q = U ÷ C, where U is 360° for a rotary output or the travel per output revolution in mm.
Worst-case error: E = q ÷ 2 + (a ÷ 60) ÷ G × (U ÷ 360) + b ÷ 2.
Fewest lines: N_min = ⌈U ÷ (2 × k × G × (t − F))⌉ with F = (a ÷ 60) ÷ G × (U ÷ 360) + b ÷ 2; no solution when t ≤ F.
Symbols: N is the encoder lines per revolution, k the decoding factor (1, 2 or 4), G the gear reduction, a the encoder accuracy in arcminutes, b the total backlash and t the accuracy target.
500 lines, x4, 10:1 gearbox, rotary, 0.1° backlash, ±20 arcmin encoder, target ±0.1°: 0.018° per count; worst case ±0.09233°; meets with a 1.083× margin; fewest lines 270. 20,000 counts per output turn give 0.018°, so half a count is 0.009°. The encoder error is 20 ÷ 60 ÷ 10 = 0.03333° and half the backlash 0.05°, the largest term.
The same with 0.2° backlash: No encoder meets ±0.1°: backlash and encoder error alone are ±0.1333°. Half the backlash is 0.1° on its own, so even infinitely many lines cannot reach the target. Reduce the backlash or move the encoder to the output.
Linear stage: 8 mm lead screw driven directly, 500 lines, x4, no backlash or encoder error, target ±0.1 mm: 4 µm per count; worst case ±2 µm; fewest lines 10. 8 mm ÷ 2000 counts = 0.004 mm. The resolution is 50 times finer than the target.
The same stage with x1 decoding: 16 µm per count; fewest lines 40. Counting only rising edges of A gives a quarter of the counts, so the resolution is four times coarser.
US Digital: Resolution, Accuracy, and Precision of Encoders
Dynapar: Encoder Resolution, Encoder Accuracy & Repeatability
Available now
Calculate electricity use from power and duration, or constant DC voltage and current. Compare energy use over different operating times in watt-hours, kilowatt-hours and joules.
Open tool →Available now
Add up to 20 resistors in series using Ω, kΩ or MΩ for circuit analysis and electricity calculations, with a diagram and running total.
Open tool →Available now
Convert absolute temperatures between Celsius, Fahrenheit and kelvin.
Open tool →Waveshare 240×240 1.28inch Round LCD Display Module, 65K RGB
When sellers / websites do not fulfill / deliver the promised goods and replace them with other comparable alternatives without intimation, it leads to ther erosion of trust on such sellers / websites. My order for Yihua 08C soldering tip cleaner (Order Id #TR66916) was substituted with a Myto Tips Cleaner MTS 08B which may be comparable but not identical. Such practices need to be curbed and better communication as well as approval regarding the same should be obtained before proceeding with a replacement. Hope to have a better experience next time. Other than that, the quality of the other items in the order was good. The speed of refund against another unavailable item was good. The choice of the delivery partner and the speed of delivery was good.
Nice audio board working as expected.
Given the fact that this was my first purchase and I made it thinking I was buying genuine Yihua products, this has been a setback. I received a lesser known OEM brand called MYTO and while both the products seem to be similar from appearance, my real contention is the quality and quantity of the brass wool. On top of that not informing the customer about the unavailability of the Yihua product and instead sending a product from a different brand is also antagonising. Henceforth, I might just have to think twice before ordering from ThinkRobotics.