How-to
Starting PID values for a brushed servo drive: P200, D400, I4 first
Short answer
For a brushed DC servo drive, start the position loop at P = 200, D = 400 and I = 4, sweep the loop-time parameter L from 3 to 7 for the deadest response to a hand disturbance, and only then set range, trip and feedforward. These are first-pass values for a manual tune on a step-and-direction retrofit, with the encoder trip starting near four times the line count.

On this page
For a brushed DC servo drive on a step-and-direction retrofit, start the position loop at P = 200, D = 400 and I = 4, then sweep the loop-time parameter L through its range of 3 to 7 and keep the value that gives the deadest response when you disturb the motor by hand. Range, encoder trip and feedforward go in last, once the motor holds and tracks cleanly. These numbers are a first-pass tune, not a final one: they land close enough that each parameter afterwards needs only a small move. The sequence assumes the hardware side is done — servo drive pulse and direction wiring on a retrofit covers that part — and that the motor spins freely and the encoder counts the right direction.
What P, I, D and L do #
The drive closes its position loop on encoder counts, and the four tuning-stage parameters act on the following error in different ways:
- P, the proportional gain, sets stiffness: restoring torque proportional to the error. Too low feels soft and lags; too high buzzes at standstill.
- D, the derivative gain, damps: torque proportional to how fast the error is changing. It is what kills ringing after a stop, and too much of it amplifies encoder noise.
- I, the integral gain, removes the last standing error under a steady load, such as gravity on a vertical axis. It works slowly, and too much of it produces a slow back-and-forth hunt.
- L, the loop time, matches the loop to the motor's mechanical mass — the inertia the drive has to move — which is why it goes in before the other three are final.
Make the motor hold before the first gain #
With no bank jumpers fitted and the parameters at their defaults, enable the drive: the motor should hold its position and push back firmly when you try to turn the shaft. If it does not hold, stop — no gain values will fix a swapped motor lead, an encoder counting the wrong way or a dead power stage, so sort the installation first. Bench testing the brushed servo motor with a 12 V battery rules the motor itself in or out before you blame the tuning. If the motor holds but growls before you have touched a parameter, start with servo motor noise: mechanics or tuning first instead of tuning around the noise.
The first-pass tuning sequence #
- Enable the drive with no bank jumpers fitted and the gains at their defaults, and confirm the motor holds.
- Enter the starting values: P = 200, D = 400, I = 4.
- Sweep L through its range, 3 to 7. At each value, disturb the motor by hand and watch how it recovers; keep the value with the deadest response.
- Change nothing else during the sweep — one parameter at a time, or you cannot tell which move did what.
- Re-check the hold, then command slow moves from the controller: the axis should start and stop without ringing, hold under load without offset and stay quiet at standstill.
- Trim by symptom: ringing at the end of a move means lower P or raise D; a slow hunt means lower I; a small constant offset under load means raise I slightly.
- Only when the motor is stable, set range, trip and feedforward — the trip gets its worked example below.
- Write the final set into the machine's documentation file; a tune nobody recorded is a tune someone will have to do again.
Reading the hand-disturbance test #
With the loop closed, twist the motor shaft a few degrees and let go. Three responses tell you where you stand:
- Dead: it snaps back and stops at once — the goal.
- Alive: it rings for several cycles before settling — this L is not matching the mass; try the next value.
- Mushy: it drifts back slowly or not fully — keep sweeping.
The deadest value in the sweep is your L. Do the test with the axis unloaded or behind the machine's guarding: an enabled servo can slam to a limit without warning, the machine's risk assessment (ISO 12100) is what defines that guarding, and this test is commissioning, not a safety validation.
Worked example: the trip setting for a 1000-line encoder #
The case is a brushed DC servo axis on a 140 V supply, retrofitted to step-and-direction control — the arrangement these starting values come from — with incremental encoders on the motors.
Inputs, with where each comes from:
- Encoder line count: 1000 lines per revolution, from the retrofit's motors.
- Counting convention: quadrature decoding at 4 counts per line — two channels, both edges — the standard behavior of incremental encoder electronics.
- Starting rule for this drive family: trip at about four times the line count, a rule of thumb.
The rule in words: the trip is the following-error count at which the drive faults. Starting it near one motor revolution of quadrature counts leaves room for normal following error while still catching a real stall.
The arithmetic: 1000 lines/rev × 4 counts/line = 4000 counts per revolution, so the trip setting is T4000.
Result: T4000.
Decision: enter T4000 before the first powered move. If a cleanly tuned axis still trips during a normal rapid, the threshold is too tight — raise it — but re-check the tune first, because a genuine stall or a lost encoder channel trips at exactly the same place. The one thing the drive manual must confirm is that the trip counts quadrature edges, the 4-counts-per-line convention this arithmetic assumes.
Range, trip and feedforward after the motor is stable #
With the motor stable, the remaining tuning-stage parameters go in:
- Range limits the travel the drive will accept from its reference point. Set it just inside the machine's real travel, so a runaway command faults before the axis reaches the mechanical stops.
- Trip is the following-error limit from the worked example — protection, not tuning.
- Feedforward pushes torque in proportion to commanded velocity, so the axis follows a move without waiting for error to build. Raise it until the following error during a constant-velocity move is smallest, and back off if the axis kicks at the start of moves.
Feedforward cleans up tracking; it cannot rescue a loop that P, I, D and L have not already stabilized.
When the first pass will not settle #
If the loop buzzes the moment it closes at the starting P, halving P and retesting is a common field rule; a buzz that survives at very low gain is mechanics or wiring, not the gains, and belongs back in the noise diagnosis. Trips during moves go to the worked example above: separate a tight threshold from a real stall by how the axis behaves at low speed. On a brushed drive of this class, hand tuning is the whole procedure — there is no auto-tune to fall back on. On drives that do offer one, auto, adaptive or manual servo tuning: what decides is a question of its own.
Questions asked
Do these values also start a stepper or a brushless servo axis?
No. They are register settings for a brushed DC servo drive whose position loop works on encoder counts, and they carry no universal units. A stepper drive has no position loop to tune this way, and a brushless servo drive usually states its gains in different terms, so its own manual's defaults replace these numbers. Keep the sequence — hold, starting values, loop-time sweep, second pass — but take the values from the drive's documentation.
Why sweep L before finishing P, I and D?
Because the gains you find at the wrong L do not survive the change. L scales the loop to the motor's mechanical mass, and moving it afterwards shifts how stiff and how damped the same P, D and I numbers behave, so tuning the three first means tuning them twice. One clean sweep, judged by the hand test, fixes the match before you spend time on the other gains.
What should I do after the drive trips on encoder error?
Do not simply clear the fault. Find out why the following error grew past the trip count — a stall, a slipping coupling, a contaminated encoder disc or a command the axis could not follow — before enabling again, or the same fault returns with the mechanism still wrong. The trip is protection, and a stable tune runs all day without approaching it.
I am changing from a 1000-line to a 2000-line encoder — do the values carry over?
The trip rule does: four times the line count gives 8000 for the 2000-line encoder. The gains do not carry cleanly, because every degree of error is now twice the counts, so the same P, D and I feel stiffer — re-sweep L and expect to lower P before raising anything. Recheck counting direction and count rate at the new resolution before the first powered move.

