Tuning
The defaults suit a NEMA 17 with a light load. When the axis should be stiffer, quieter or faster, these are the knobs, in the order worth trying them.
The loop
Section titled “The loop”Every 50 µs the S1 computes a velocity for the step generator:
v = v_ref + Kp·e + Ki·∫e dt + Kd·(v_ref − v_meas)v_ref is the motion profile’s own speed, so a well-matched motor tracks a move with almost no correction.e is where the profile says the shaft should be, minus where the encoder says it is.A tuning session
Section titled “A tuning session”Tercio Control’s Tuning tab has what you need: a live chart of position, velocity or following error, the Position loop gains with Apply, and a Step response test.
- Pick a step size typical for your machine and select Run step. The motor moves by the step, measures for 1.5 s and moves back.
- Read the results: rise time (10 % to 90 %), overshoot, settling time (to within 2 % of the step), peak and final error.
- Change one gain, Apply, run the step again. Repeat.
- Save to motor when you are happy.
Current and chopper
Section titled “Current and chopper”| Setting | Default | Guidance |
|---|---|---|
| Run current | 1500 mA | About 70 % of the motor’s rating to start. More current gives more torque and more heat. Capped at 1770 mA. |
| Hold current | 50 % | Current at standstill. Lower runs cooler; higher resists more when pushed. |
| Quiet mode (StealthChop) | On | Near-silent at low speed. |
| Quiet mode up to | 1 motor rev/s | Above this speed the driver switches to SpreadCycle, which keeps torque at speed. 0 keeps StealthChop at all speeds. |
If the motor loses torque or stalls at speed, check the switch speed first, then raise the supply voltage (up to 28 V) before raising the current.
Microsteps
Section titled “Microsteps”The step generator makes up to 500,000 steps per second, so the microstep setting caps the top speed:
| Microsteps | Steps per turn (200-step motor) | Top speed |
|---|---|---|
| 1/8 | 1,600 | 312 turns/s |
| 1/16 | 3,200 | 156 turns/s |
| 1/32 | 6,400 | 78 turns/s |
| 1/64 | 12,800 | 39 turns/s |
| 1/128 | 25,600 | 19.5 turns/s |
| 1/256 | 51,200 | 9.8 turns/s |
The TMC2209 interpolates to 1/256 internally whatever you choose, so 1/16 is already smooth. Choose finer microstepping for slow, very smooth motion; coarser leaves more headroom for speed. A stepper’s torque drops long before these speeds, so for most machines anything from 1/8 to 1/32 is fine.
Position loop gains
Section titled “Position loop gains”| Gain | Default | Unit | Effect |
|---|---|---|---|
| Kp, proportional | 20 | 1/s | Correction speed per unit of error: with 20, an error of 0.01 turn is corrected at 0.2 turns/s. Higher is stiffer and settles faster; too high buzzes or oscillates. |
| Ki, integral | 0 | 1/s² | Removes a steady error under constant load, such as gravity on a vertical axis. |
| Kd, damping | 0 | — | Acts on the difference between planned and measured speed. Can calm overshoot on fast moves; the measured speed is noisy, so too much adds buzz. |
Kp is the one to start with. Raise it in steps of about 25 % until the step response starts to overshoot or the motor sounds rough at standstill, then back off a step. Values from 10 to 60 cover most setups.
Ki only if an error remains at rest under load. The shaft behaves like a pure integrator of the commanded speed, so with PI control the response is critically damped at Ki = Kp² / 4 (100 with Kp = 20). Start at a quarter of that and raise it until the error goes away within your settling time. More causes slow, rolling overshoot. The integral term is limited to half of Max velocity.
Kd usually stays at 0. If a stiff, fast axis overshoots, try small values and compare step responses.
Deadband
Section titled “Deadband”The Deadband (default 0.0005 turn, 0.18°, about two counts of the on-board encoder) is how close is close enough at rest. Once the error falls inside it, the S1 stops correcting; it corrects again only when the error grows past twice the deadband.
- Motor hums or ticks at rest: raise the deadband a little.
- Resting error too large for the job: lower it, and consider an encoder with more resolution.
Stall detection
Section titled “Stall detection”A stall is a following error larger than Stall threshold (default 0.05 turn, 18°) that lasts Stall confirm time (default 50 ms). The S1 then stops and holds, and raises the Stall fault; the next move clears it.
- False stalls during hard accelerations: raise the threshold a little, or lower the acceleration.
- Late detection of a blocked axis: lower the threshold.
- Stall confirm time 0 turns stall detection off. Not recommended.
Speed limits
Section titled “Speed limits”Max velocity and Max acceleration bound every move, and the correction can reach twice and four times those values. Rather than guess, run auto-tune with the real load: it keeps the fastest level that passes three times.
Symptoms
Section titled “Symptoms”| Symptom | Try |
|---|---|
| Hums, ticks or hunts at standstill | Raise the deadband; lower Kp; lower the hold current. |
| Overshoots and rings after a move | Lower Kp; lower Ki; try a small Kd. |
| Settles slowly | Raise Kp. |
| Stays slightly off target under load | Add Ki (see above). |
| Stalls when accelerating | Raise the run current; lower Max acceleration; check the stall threshold. |
| Loud at low speed | Turn on quiet mode (StealthChop). |
| Weak at high speed | Raise the supply voltage; check Quiet mode up to; use coarser microsteps. |