How-to
Sizing a Spindle Encoder Input for Servo Feed Control
Short answer
A 2000 PPR quadrature encoder on a 250 RPM spindle produces 33,333 counts/s, which fits a 50 kHz counter but overruns a 10 kHz variant; the most resolution that counter family allows is 3000 PPR. Scale feed per revolution to motor RPM through screw lead and gear ratio, then keep command pulses per revolution low enough that rapid speed stays under the 100 kHz pulse-output ceiling.
On this page
- How fast does my encoder count at spindle speed?
- What frequency limit does my high-speed counter actually have?
- How many pulses per revolution can I use?
- How do I turn feed per revolution into servo speed?
- How many command pulses per revolution can the output afford?
- How do rapids work when the spindle is stopped?
- How do I prove the scaling on the machine?
- What do I order and set on this machine?
- Questions asked
Sizing a spindle encoder input for servo feed control is two frequency budgets with hard numbers. On the input side, a 2000 PPR quadrature encoder at 250 spindle RPM delivers 33,333 counts/s to the high-speed counter: comfortable under a 50 kHz ceiling, more than three times over a 10 kHz one. On the output side, the servo's command-pulse frequency at rapid speed has to fit under the pulse-output ceiling. The example machine used throughout has a 125 to 275 RPM spindle, a 5 mm ball screw, a 50 kHz counter and a 100 kHz pulse output; every number below is a calculated example for those inputs, not a measured result.
How fast does my encoder count at spindle speed? #
Multiply spindle speed by resolution by four and divide by 60: at 250 RPM a 2000 PPR quadrature encoder delivers 33,333 counts/s to the counter, four times its nameplate rate, because four-edge decoding counts both edges of both channels.
The formula is counts/s = (N × P × 4) / 60, with N in RPM and P in pulses per revolution. The nameplate rate appears per phase as N × P / 60, which is 8,333 Hz here; the counter sees four times that. Keep the two straight, because counter specifications quote both kinds of number.
| Spindle speed | 2000 PPR, four-edge decoding | 1000 PPR, four-edge decoding |
|---|---|---|
| 150 RPM | 20,000 counts/s | 10,000 counts/s |
| 250 RPM | 33,333 counts/s | 16,667 counts/s |
| 275 RPM | 36,667 counts/s | 18,333 counts/s |
Speed is measured by counting edges over a time window. Four-edge decoding of a 2000 PPR encoder gives 8,000 counts per spindle revolution, so a 100 ms window at 150 RPM averages 2,000 counts and the RPM reading quantizes in steps of 60 / (8,000 × 0.1) = 0.075 RPM — far finer than a potentiometer-set spindle needs.
What frequency limit does my high-speed counter actually have? #
Take the number from the specification of your exact controller variant, because the ceiling moves a hundredfold across one family: 10 kHz on the compact variant of this machine's controller, 50 kHz on its sibling, around 100 kHz typical for high-speed inputs, and 250 kHz on a control-class counter module.
The family name alone is not an answer; the suffix on the nameplate is. On the 10 kHz variant, a 2000 PPR encoder is limited to 10,000 × 60 / (2,000 × 4) = 75 RPM, below this machine's synchronized range, and 250 RPM caps resolution at 600 PPR sitting exactly on the limit. A control-class module documents its 250 kHz in encoder x1 and x4 modes at 50% duty cycle with a 2 µs minimum pulse width, so an encoder whose output distorts at speed can fail below the headline figure. One compact controller trades rate for channels: four single-phase counters at 25 kHz, or two quadrature counters.
Two more settings decide the real limit. The input filter time sets the maximum counting frequency, with configurable values commonly spanning 0.002 ms to 4 ms; a counter left on a slow filter loses counts far below its rating. And confirm whether the quoted figure is per-phase input frequency or decoded count rate — a 200 PPR limit quoted for this machine came from mixing the two. For one compact controller family, the counter setup from configuration to download is shown in configuring a CP1H high-speed counter for an encoder input.
How many pulses per revolution can I use? #
At 250 RPM against a 50 kHz counter with four-edge decoding, the ceiling is 3,000 PPR, from 50,000 × 60 / (250 × 4), so the 2000 PPR encoder on this machine fits with a third of the budget still free.
The sizing rule is P_max = f_limit × 60 / (N × 4), sized to the highest spindle speed at which the counter must still track. If the operator can reach 275 RPM while feeding, the ceiling drops to 50,000 × 60 / (275 × 4) = 2,727 PPR, and the 2000 PPR unit still clears it at 36,667 counts/s. The decision for this machine: keep the 2000 PPR encoder on the 50 kHz variant, because it covers the full dial range with margin.
Resolution here is set by the counter's frequency budget alone, a different constraint from choosing encoder resolution to match a stepper step response, where the loop's ability to follow each step decides. Nothing in the feed function rewards more resolution than the counter can swallow.
How do I turn feed per revolution into servo speed? #
Motor speed is spindle RPM × feed × 25.4 ÷ (screw lead × gear ratio): at 150 RPM and 0.002 in/rev on a direct-coupled 5 mm screw, the axis feeds 7.62 mm/min and the motor turns 1.524 RPM.
- Measure travel, do not inherit it. The original 0.002 in/rev on this machine came from gearing at the ball-screw nut; fixing the nut and driving the screw changes the kinematics. Put a dial indicator on the axis and measure travel over ten spindle revolutions.
- Confirm the screw lead L is travel per screw revolution — 5 mm here, not thread pitch — and measure G, motor revolutions per screw revolution. A direct coupling is G = 1.
- Convert each feed F to axis speed: linear feed = N × F × 25.4 mm/min, with F in inches per spindle revolution.
- Convert axis speed to motor speed: motor RPM = N × F × 25.4 × G / L.
- Give each feed its own scaling constant. The 0.002, 0.004 and 0.006 in/rev settings are three recipes, not one roughing value.
| Feed | Axis speed at 150 RPM | Motor speed, L = 5 mm, G = 1 |
|---|---|---|
| 0.002 in/rev | 7.62 mm/min | 1.524 RPM |
| 0.004 in/rev | 15.24 mm/min | 3.048 RPM |
| 0.006 in/rev | 22.86 mm/min | 4.572 RPM |
Cross-check any number handed to you. Quoted motor speeds of 6.53 and 13.06 RPM for the first two feeds imply G = 6.53 / 1.524 ≈ 4.28, not direct coupling, and the quoted 22.97:1 and 11.48:1 are spindle-to-motor speed ratios, not command pulses per revolution. Measure the transmission before either goes into the scaling table. The same master-axis-to-feed scaling pattern is walked through for a conveyor in matching a stepper feed rate to conveyor speed with an encoder.
How many command pulses per revolution can the output afford? #
Command frequency equals motor RPM × command pulses per revolution ÷ 60, so 10,000 pulses/rev against the 100 kHz output ceiling caps the motor at 600 RPM — short of a 1500 RPM rapid, and the fix is 3,000 pulses/rev at 75 kHz.
Pulse outputs need transistor outputs; relay contacts cannot make the train. Then read the controller's output-circuit diagram — sourcing and sinking variants exist in one family — and the drive's pulse-input circuit, and verify switching with a meter at the drive terminals; a lit output indicator proves neither. Read the drive's electronic-gear setting for the effective command resolution instead of trusting a remembered value.
The ceiling math gives E ≤ 100,000 × 60 / 1,500 = 4,000 command pulses per revolution; choose 3,000 for margin, which puts the fast rapid at 1,500 × 3,000 / 60 = 75,000 Hz. Position resolution becomes 5 mm / 3,000 = 0.0017 mm per command pulse, far finer than the 0.0508 mm (0.002 in) the finest feed moves per spindle revolution.
At the finest cut the motor turns 1.524 RPM — a command train of 1.524 × 3,000 / 60 = 76 pulses/s. Confirm the drive accepts a train that slow in position mode, or command cutting feed through the drive's speed input and keep the pulse train for rapids. The signal side of feeding a drive input from a controller output is covered in driving step and direction inputs from a controller velocity output.
How do rapids work when the spindle is stopped? #
They need no synchronization at all: with the spindle at zero the controller outputs preset frequencies — 120 RPM slow and 1500 RPM fast on this machine, which is 6,000 Hz and 75,000 Hz at 3,000 command pulses per revolution.
Make the mode change explicit in the program: stop the synchronized output before starting a preset, and never allow both. Hardware limit switches at each end of travel and an origin sensor are still the real boundary; scaling constants must not be the only thing keeping the carriage in its envelope.
How do I prove the scaling on the machine? #
Compare the controller's RPM display against an independent tachometer at three speeds, then measure axis travel with a dial indicator over ten spindle revolutions at each feed before the first synchronized cut.
- Tachometer check at 125, 150 and 250 RPM: the displayed value should sit within one quantization step, 0.075 RPM for the 100 ms window above.
- Travel check: ten spindle revolutions at 0.002 in/rev must move the axis 0.020 in (0.508 mm), and proportionally at the other feeds.
- Run the first synchronized moves at the bottom of the spindle range with the workpiece clear and hands out of the envelope; feed faults found at full speed find the operator's hands first.
- If travel is off by a clean factor of two or four, the decoding mode or the ratio G is wrong. Correct the constant, not the encoder.
What do I order and set on this machine? #
Keep the 2000 PPR quadrature encoder and verify the counter is the 50 kHz variant, set the drive's electronic gear to 3,000 command pulses per revolution, and program a separate scaling constant for each of the three feeds.
If the nameplate says the 10 kHz variant, the encoder changes instead: 500 PPR runs 9,167 counts/s at 275 RPM with margin, and the 100 ms window still quantizes to 0.3 RPM. Either way the fast rapid is 75 kHz, the slow rapid 6 kHz, and the finest cut turns the motor near 1.5 RPM — the low-speed region a servo is there to hold.
Questions asked
Is one pulse per spindle revolution enough instead of an encoder?
A single cam pulse runs 2.08 Hz at 125 RPM and 4.58 Hz at 275 RPM, so the feed correction updates only once every 0.22 to 0.48 s — too coarse while cutting, though fine for an RPM display. A 100 Hz inductive sensor at 50% duty handles one pulse per turn up to 6,000 RPM, so the sensor is never the limit; the update rate is.
Why does my counter read four times the encoder's rated pulses per revolution?
Four-edge decoding counts both edges of both channels, so a 2000 PPR encoder yields 8,000 counts per revolution; x1 and x2 modes also exist, and whichever is active must be the divisor in your scaling. Selecting quadrature counting also says nothing about the electrical interface — line driver or open collector is a separate setting.
Can I read the servo drive's own encoder feedback instead of adding a spindle encoder?
No — that tells you what the feed axis did, not what the spindle is doing, and the spindle is the master you must follow. It is a useful second counter channel for position monitoring or diagnostics, but synchronized feed still needs a sensor on the spindle itself.
Why replace the feed VFD with a servo at all?
Because the cutting feeds need roughly 1.5 to 4.6 motor RPM on a direct-coupled 5 mm screw, and a VFD driven at 6 to 12 Hz gave this machine poor low-speed control. A servo holds rated torque and stable speed near zero RPM, which is exactly the operating region a feed-per-revolution axis lives in.
My programmed feed came out exactly half of what the axis moved. What broke?
A clean 2x or 4x error is almost never the encoder — it is a mismatch between the counter's decoding mode and the divisor in your scaling, or between the assumed and actual mechanical ratio. Measure travel per spindle revolution with a dial indicator, then correct the constant; do not swap the encoder.
What if no counter variant I have is fast enough?
Either move the encoder to a dedicated counter module, drop resolution until the count rate fits, or convert externally: a frequency-to-analog converter feeding a spare analog input returns a speed signal the controller can scale without any high-speed channel. The last option trades update rate and noise immunity for wiring simplicity.