Control System Parameters
PID (Ziegler-Nichols)
PID Recommended Values
Kp = —
Ti = — s
Td = — s
| Parameter | Value | Unit |
| Natural frequency ωn | — | rad/s |
| Natural frequency fn | — | Hz |
| Damping ratio ζ | — | — |
| Bandwidth (-3dB) | — | rad/s |
| Resonant frequency ωr | — | rad/s |
| Phase margin PM | — | ° |
| Settling time ts | — | ms |
| Overshoot | — | % |
| Peak resonance Mr | — | dB |
Engineer Dialogue — "Why is 45° the phase margin target?"
🙋 "My professor says to aim for 45° phase margin. Why that number specifically?"
🎓 "Phase margin tells you how far you are from -180° at the gain crossover frequency — the point where feedback flips from negative to positive and causes oscillation. 45° corresponds roughly to a damping ratio of 0.42, which gives about 20% overshoot but fast response. It's a practical engineering sweet spot."
🙋 "So if I increase PM to 60°, what changes?"
🎓 "ζ increases to about 0.6 — less overshoot (around 9%), slower settling, more robust to model uncertainty. Below 30° PM the transient gets quite oscillatory, which industrial machines usually can't tolerate."
🙋 "In real servo drives, how do engineers actually achieve the target PM?"
🎓 "Mainly by tuning the D-term to advance phase at high frequencies, or by reducing gain to lower the crossover frequency. More advanced drives use notch filters to suppress mechanical resonances, which then allows a higher bandwidth without violating PM requirements."
Theory & Key Formulas
2nd-order transfer function:
$$G(s) = \frac{\omega_n^2}{s^2 + 2\zeta\omega_n s + \omega_n^2}$$
Settling time and overshoot:
$$t_s \approx \frac{4}{\zeta\omega_n}, \quad \text{OS}= \exp\!\left(\frac{-\pi\zeta}{\sqrt{1-\zeta^2}}\right) \times 100\%$$
Resonance peak and bandwidth:
$$M_r = \frac{1}{2\zeta\sqrt{1-\zeta^2}}\quad (\zeta < 0.707), \quad \omega_{BW}= \omega_n\sqrt{1-2\zeta^2+\sqrt{4\zeta^4-4\zeta^2+2}}$$
What is Servo System Tuning?
🙋
What exactly is a "servo mechanism"? I hear it in robots and CNC machines, but what's the core idea?
🎓
Basically, it's a self-correcting system. A motor (the "servo") tries to match its actual position or speed to a command signal. It constantly measures the error and adjusts. In this simulator, the `Feedback Gain K` controls how aggressively it reacts to that error. Try moving the K slider up and down to see how it changes the system's response plot.
🙋
Wait, really? So the "Damping Ratio ζ" I see here is about preventing overshoot, right? Like a car suspension?
🎓
Exactly! A great analogy. In practice, ζ is like the shock absorber. Too low (ζ < 0.5), and the system oscillates wildly before settling. Too high (ζ > 1), and it's sluggish. For a responsive yet stable system, like a robot arm, we aim for ζ = 0.6–0.8. Adjust the ζ slider in the tool and watch the overshoot percentage change instantly.
🙋
Okay, so the goal is a "45° phase margin" mentioned in the tool. What does that mean, and why is it the magic number for stability?
🎓
In simple terms, phase margin is a safety buffer against oscillations. Think of it as how much delay the system can tolerate before becoming unstable. A 45° margin is the engineering sweet spot—it gives you a fast response (good bandwidth) with minimal overshoot, correlating to that ζ ≈ 0.6–0.8 range. The simulator's Bode plot shows this directly; when you tune `ωn` and `ζ`, you're directly shaping that margin.
Physical Model & Key Equations
The core of many servo systems is modeled as a second-order transfer function. It describes how the system's output (like position) responds to an input command over time.
$$G(s) = \frac{\omega_n^2}{s^2 + 2\zeta\omega_n s + \omega_n^2}$$
ωn is the Natural Frequency (rad/s). It sets the base speed of the system's response. ζ (zeta) is the Damping Ratio (unitless). It determines the oscillation behavior: underdamped (ζ<1), critically damped (ζ=1), or overdamped (ζ>1).
From this model, we derive two critical performance metrics: Settling Time and Percent Overshoot. These tell engineers how fast and how accurately the system reaches its target.
$$t_s \approx \frac{4}{\zeta \omega_n}\quad \text{(for ±2\% band)}$$
$$\text{OS}\% = \exp\!\left(\frac{-\pi\zeta}{\sqrt{1-\zeta^2}}\right) \times 100\%$$
ts is the settling time. Notice it's inversely proportional to both ζ and ωn. OS% is the percent overshoot, which depends ONLY on ζ. This is why adjusting ζ in the simulator has a direct and dramatic effect on the overshoot value.
Real-World Applications
Industrial Robot Arms: Precise welding or assembly requires motors to move to a point quickly without vibrating. Engineers use this calculator to tune ζ for ~0.7, ensuring fast settling with less than 5% overshoot, preventing the arm from damaging itself or the workpiece.
CNC Machining Centers: When cutting metal, the tool head must follow a complex path accurately. The bandwidth (related to ωn) must be high enough to track rapid direction changes, while sufficient phase margin prevents chatter that ruins the surface finish.
Auto-Focus in Cameras: The lens motor is a micro-servo. It must move swiftly to the focus point and stop precisely. Tuning involves balancing speed (high ωn) against hunting (oscillation from low ζ), which you can experiment with directly in the simulator.
Aircraft Flight Control: Fly-by-wire systems use servos to move control surfaces. Stability is paramount. The 45° phase margin target ensures the aircraft responds predictably to pilot inputs without dangerous oscillations, a direct application of the stability criteria shown in this tool.
Common Misconceptions and Points of Caution
First, there is a common misconception that "if the bandwidth is wide, everything will move faster." While bandwidth is indeed an indicator of responsiveness, physical limits always exist. For instance, factors like the motor torque constant, mechanical part stiffness, or driver current limits often become bottlenecks, preventing you from achieving the high-speed response seen in simulations. It's a frequent occurrence that while you might set ωn to 1000 rad/s in a simulator, the actual machine vibrates excessively and is unusable.
Next, consider the practice of "blindly increasing only the P gain" during PID parameter tuning. This is a direct path to instability. Raising the P gain does speed up the response, but it rapidly reduces phase margin and increases overshoot. In practice, a common step-by-step approach is to first achieve reasonable tracking with the P gain, then use the D gain to suppress vibration, and finally use the I gain to eliminate steady-state error. Using this tool to see how changing the "damping ratio ζ" affects the response can help you intuitively understand the effect of the D gain.
Furthermore, overconfidence that "a nice-looking Bode plot means everything is okay" is also dangerous. The plots from this tool are based on an ideal second-order model. Real systems invariably include elements like computational sampling delay, transmission delay, and nonlinearities (backlash, friction). These introduce additional phase lag and reduce stability margins compared to the simulation. Therefore, a practical rule of thumb during the design phase is to include a generous margin in your phase margin (e.g., aim for 60° when your target is 45°).