ENع
→Routh special cases
الدرس 24 · Steady-state error and stability

Routh special cases and finding the gain limit

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

15 دقيقة11 خطوة5 أسئلةIntermediate
عن هذا الدرس

This lesson builds on The Routh-Hurwitz test, where you learned to build a Routh table and count sign changes. The table sometimes breaks: a zero lands in the first column, or a whole row comes out as zeros. Learn the fix for each, then use the table with the gain K left as a letter to find how far you can turn K up before the loop K/(s(s+1)(s+2)) goes unstable. At the limit, K = 6, the row of zeros tells you exactly where the poles sit and how fast the output rings.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 24 · تفاعلي
01 / 11

A zero where you divide

Take s⁴ + s³ + 2s² + 2s + 3 and build its Routh table. The s² row comes out as 0 and 3. Every entry of the next row divides by that first-column 0, so the table is stuck.

s⁴ |  1    2    3
s³ |  1    2
s² |  (1·2 − 1·2)/1 = 0    (1·3 − 1·0)/1 = 3
s¹ |  ? = (0·2 − 1·3)/0   divide by zero!

Only the FIRST entry of the s² row is zero;
the rest of the row (3) is not.
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. A zero where you divide

    Take s⁴ + s³ + 2s² + 2s + 3 and build its Routh table. The s² row comes out as 0 and 3. Every entry of the next row divides by that first-column 0, so the table is stuck.

    s⁴ |  1    2    3
    s³ |  1    2
    s² |  (1·2 − 1·2)/1 = 0    (1·3 − 1·0)/1 = 3
    s¹ |  ? = (0·2 − 1·3)/0   divide by zero!
    
    Only the FIRST entry of the s² row is zero;
    the rest of the row (3) is not.
  2. Swap the zero for ε

    When only the first entry of a row is zero, replace it with ε, a tiny positive number, and carry on. The s¹ entry becomes (ε·2 − 1·3)/ε = 2 − 3/ε. The s⁰ entry is 3.

    s² |  ε    3          ε > 0, very small
    s¹ |  (ε·2 − 1·3)/ε = 2 − 3/ε
    s⁰ |  ((2 − 3/ε)·3 − ε·0)/(2 − 3/ε) = 3
    
    ε stands in for the zero so the arithmetic
    can go on. At the end we let ε shrink to 0.
  3. Shrink ε, count the signs

    As ε shrinks, 2 − 3/ε becomes hugely negative: −298 when ε = 0.01. The first column reads +, +, +, −, +. Two sign changes mean two right-half-plane poles. The s-plane agrees: 0.41 ± 1.29j.

    def first_column(c, eps=0.01):
        w = (len(c) + 1) // 2 + 1
        a = (c[0::2] + [0] * w)[:w]
        b = (c[1::2] + [0] * w)[:w]
        col = [a[0], b[0]]
        for _ in range(len(c) - 2):
            n = [(b[0] * a[j + 1] - a[0] * b[j + 1]) / b[0]
                 for j in range(w - 1)] + [0]
            if n[0] == 0:
                n[0] = eps    # zero only in the first column
            a, b = b, n
            col.append(round(n[0], 2))
        return col
    
    col = first_column([1, 1, 2, 2, 3])
    print(col)       # [1, 1, 0.01, -298.0, 3.0]
    print(sum(x * y < 0 for x, y in zip(col, col[1:])))   # 2
  4. A loop with a gain knob

    Now a design question. The plant 1/(s(s+1)(s+2)) sits in a unity-feedback loop behind a gain K. The closed-loop poles are the roots of s³ + 3s² + 2s + K. How big can K get before the loop goes unstable?

    G(s) = K / (s(s + 1)(s + 2))
    unity feedback:  T(s) = G / (1 + G)
    
    1 + G = 0   →   s(s + 1)(s + 2) + K = 0
                →   s³ + 3s² + 2s + K = 0
    
    The first two Routh rows copy the coefficients:
    s³ |  1   2
    s² |  3   K
  5. Keep K as a letter

    Build the table with K left as a letter. The first two rows copy the coefficients: 1, 2 and 3, K. Then s¹ gets (3·2 − 1·K)/3 = (6 − K)/3, and s⁰ gets K.

    s³ |  1          2
    s² |  3          K
    s¹ |  (3·2 − 1·K)/3 = (6 − K)/3
    s⁰ |  K
    
    No numbers needed yet: the table tells us
    how the signs depend on K.
  6. Every sign positive: 0 < K < 6

    Stable means no sign changes, so every first-column entry must be positive. (6 − K)/3 > 0 needs K < 6, and the s⁰ entry needs K > 0. The loop is stable for 0 < K < 6. The gain limit is 6.

    # first column of s³ + 3s² + 2s + K
    def first_column(K):
        return [1, 3, (3 * 2 - 1 * K) / 3, K]
    
    for K in (3, 8):
        col = first_column(K)
        flips = sum(x * y < 0 for x, y in zip(col, col[1:]))
        print(K, flips)    # 3 0, then 8 2
    
    # (6 - K)/3 > 0  ->  K < 6;   K > 0  ->  0 < K < 6
  7. K = 3: it settles

    Turn the knob to K = 3. The first column is 1, 3, 1, 3: no sign changes. All three poles sit in the left half, at −2.67 and −0.16 ± 1.05j. The step response swings, then settles at 1.

    K = 3
    s³ |  1   2
    s² |  3   3
    s¹ |  (6 − 3)/3 = 1
    s⁰ |  3
    
    signs   + + + +   → 0 changes
    poles   −2.67,  −0.16 ± 1.05j
    T(0) = K/K = 1: the output settles at 1
  8. K = 8: two poles cross

    Turn up to K = 8. The s¹ entry is (6 − 8)/3 = −0.67, so the column reads +, +, −, +: two sign changes, two right-half-plane poles at 0.08 ± 1.59j. The output swings wider and wider.

    K = 8
    s³ |  1   2
    s² |  3   8
    s¹ |  (6 − 8)/3 = −0.67
    s⁰ |  8
    
    signs   + + − +   → 2 changes
    poles   0.08 ± 1.59j  (right half)
    The response grows without limit.
  9. K = 6: a row of zeros

    At exactly K = 6 the s¹ entry is (6 − 6)/3 = 0, and the rest of that row is 0 too. A whole row of zeros is the second special case. It means roots in mirror pairs, here on the jω axis.

    K = 6
    s³ |  1   2
    s² |  3   6
    s¹ |  0   0      ← the whole row is zero
    
    ε will not help here: every entry is zero.
    A zero row means an even polynomial divides
    the characteristic polynomial: its roots are
    mirror images through the origin.
  10. The row above holds the answer

    Read the row above as a polynomial: 3s² + 6, the auxiliary polynomial. Its roots, ±j√2 ≈ ±1.41j, are poles of the loop. Its derivative, 6s, fills the zero row. The column 1, 3, 6, 6 has no sign change.

    auxiliary polynomial (row s²):  P(s) = 3s² + 6
    P = 0   →   s = ±j√2 = ±1.41j
    dP/ds = 6s   →   s¹ row becomes  6   0
    s⁰ |  6
    
    signs   + + + +   → 0 changes: none in the right half
    check:  s³ + 3s² + 2s + 6 = (s² + 2)(s + 3)
    poles   ±1.41j,  −3
  11. At the limit it rings for ever

    With two poles exactly on the jω axis the loop is marginally stable: the step response oscillates for ever at √2 ≈ 1.41 rad/s, a period of 4.44 s. So K must stay below 6. Real designs keep a margin, like K = 3.

    import math
    # auxiliary polynomial 3s^2 + 6 = 0  ->  s = ±jw
    w = math.sqrt(6 / 3)
    print(round(w, 2), round(2 * math.pi / w, 2))   # 1.41 4.44
    
    # the gain limit: K_max = 6 (s¹ row = 0)
    # K = 3 leaves a gain margin of 6/3 = 2

اختبار يتاح بعد الخطوة الأخيرة.