Lead-Lag
ContinuousImplements a first-order continuous dynamic lead-lag compensator. Parameterized by a lead time constant and a lag time constant . When , the block operates as a Phase Lead Compensator, introducing positive phase lead (up to ) to increase phase margin, extend closed-loop bandwidth, and damp resonant overshoot. When , it operates as a Phase Lag Compensator, boosting low-frequency loop gain to eliminate steady-state tracking errors while attenuating high-frequency noise.
Mathematical Model
In the Laplace domain (), the continuous transfer function is defined as:
where represents leadTime and represents lagTime ().
Evaluating the frequency response along the imaginary axis () yields:
The peak phase shift occurs at the geometric center frequency :
- Lead Network (): Contributes positive phase advance (), improving stability margin and transient settling.
- Lag Network (): Contributes phase retard () while providing high DC gain to eliminate steady-state error.
- Unity Neutral (): Zero and pole cancel identically, yielding transparent unity passthrough ().
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
In | number | Required |
| ← Out | out |
Out | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
leadTime |
Lead Time Constant (τ₁) | number | 1 |
|
lagTime |
Lag Time Constant (τ₂) | number | 0.1 |
Usage Examples
Example 1: Phase Lead Compensation for Servomotor Resonant Damping
In an underdamped optical tracking gimbal with an inadequate phase margin of only , step inputs provoke severe oscillatory ringing. Designing a LeadLag block with leadTime = 0.1 s and lagTime = 0.02 s () aligns peak phase advance () at . Cascading this block into the forward loop raises phase margin to , suppressing transient overshoot without adding derivative noise.
Example 2: Phase Lag Compensation for Steady-State Error Reduction
In robotic conveyor speed regulation, load friction introduces undesirable steady-state velocity droop. Configuring a LeadLag block with leadTime = 0.4 s and lagTime = 4.0 s provides a tenfold () DC gain amplification below to eliminate tracking offset, while returning to unity gain () at high frequencies to preserve existing high-frequency gain margins.
Remarks & Best Practices
- Center Frequency Placement: To extract maximum phase compensation, always size and such that the geometric center frequency coincides exactly with the open-loop gain crossover frequency ().
- Pure Low-Pass Filtering: Setting
leadTime = 0.0converts the block into an ideal first-order low-pass filter with cutoff frequency and high-frequency roll-off. - Continuous ODE State Integration: Formulated as a continuous-state dynamic system in the WASM simulation engine, ensuring smooth integration across RK4, RK45, and TR-BDF2 solvers.
- Cascaded Topologies: Multiple LeadLag blocks can be cascaded in series to synthesize complex multi-stage lead-lag compensators (e.g. lead-lead-lag networks for flexible structures).
Frequently Asked Questions (FAQ)
Q: When should I design a Lead Compensator vs a Lag Compensator?
Use Phase Lead (, zero before pole) to improve phase margin and speed up transient settling time. Maximum phase lead is placed at geometric mean near the gain crossover frequency. Use Phase Lag (, pole before zero) to boost DC gain by factor without destabilizing the loop, driving steady-state tracking error to near zero while placing its phase attenuation far below gain crossover.
Related Components
- TransferFunction: General continuous-time transfer function in polynomial fraction form .
- PIDController: Packaged three-term controller with configurable proportional, integral, and derivative gains.
- Integrator: Continuous dynamic state accumulator.
- Derivative: First-order filtered differentiator ().