ENع
→P control and offset
الدرس 37 · PID control and compensators

Proportional control and its offset

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

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

The simplest industrial controller sets its output in proportion to the error: u = Kp · e. Follow a motor-driven conveyor belt asked to run at 1.0 m/s and watch it settle short every time. See why the offset must stay, how its size follows from 1/(1 + Kp·G(0)), what raising Kp costs in overshoot, and why a load or a fixed bias only moves the problem around.

ستتعلّم

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

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

A belt at 1.0 m/s

A motor drives a conveyor belt, and we want it at r = 1.0 m/s, the setpoint. The belt is the plant; its speed y is the output. It starts at rest.

setpoint   r = 1.0 m/s
output     y = belt speed, 0 now
plant      motor + belt

The whole loop is unity feedback:
r → Σ → controller → motor → belt → sensor → Σ
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. A belt at 1.0 m/s

    A motor drives a conveyor belt, and we want it at r = 1.0 m/s, the setpoint. The belt is the plant; its speed y is the output. It starts at rest.

    setpoint   r = 1.0 m/s
    output     y = belt speed, 0 now
    plant      motor + belt
    
    The whole loop is unity feedback:
    r → Σ → controller → motor → belt → sensor → Σ
  2. What the belt needs

    The motor turns a voltage u into push. Hold u steady and the belt settles at 2 m/s per volt, so 1.0 m/s needs 0.50 V, held for ever. Its model is G(s) = 10/((s+1)(s+5)), with G(0) = 2.

    G(s) = 10 / ((s + 1)(s + 5))
         = 10 / (s² + 6s + 5)
    G(0) = 10 / 5 = 2 m/s per V
    
    to run at 1.0 m/s:  u = 1.0 / 2 = 0.50 V
    (always, not just at the start)
    
    poles −1 (belt and motor inertia)
          −5 (motor winding)
  3. The proportional rule

    Proportional control sets the voltage in proportion to the error: u = Kp · e, where e = r − y. With Kp = 4 V per m/s and the belt at rest, e = 1.0, so the motor gets 4 V.

    e = r - y = 1.0 - 0.0 = 1.0 m/s
    u = Kp * e = 4 * 1.0 = 4 V
    
    Kp is the controller gain.
    Big error → big push.
    Small error → small push.
    Zero error → zero push.
  4. It settles short

    As the belt speeds up the error shrinks and so does the push. The belt peaks at 1.07 m/s, then settles at 0.89 m/s, not 1.0. The 0.11 m/s left over is the offset, or steady-state error.

    Kp, u0 = 4, 0
    y, v, dt = 0.0, 0.0, 0.001     # speed, its rate, step (s)
    for n in range(2500):         # 2.5 s
        d = 0.0
        u = Kp * (1.0 - y) + u0  # P control
        a = -6 * v - 5 * y + 10 * (u - d)
        y, v = y + v * dt, v + a * dt
    print(round(y, 3))            # 0.889
  5. Why the offset stays

    To keep moving, the belt needs voltage all the time. A P controller only gives voltage when there is error: 0.44 V = 4 × 0.11. With zero error it would give 0 V and the belt would slow down. So some error must stay.

    at rest the loop balances:
      belt     y = 2 · u
      control  u = 4 · (1 − y)
    
    y = 0.89 m/s  needs  u = 0.44 V
    u = 0.44 V   needs  e = 0.11 m/s
    
    No error, no voltage: the offset is
    what pays for the push.
  6. The size of the offset

    Solve the balance: e_ss = 1 / (1 + Kp·G(0)) = 1/(1 + 8) = 0.111 m/s. It is the step error from the lesson "Steady-state error and the final value theorem", with Kp·G(0) = 8 as the position constant.

    y = G(0)·Kp·(r − y)
    y = r · Kp·G(0) / (1 + Kp·G(0))
    e_ss = r / (1 + Kp·G(0))
    
    Kp = 4:  e_ss = 1 / (1 + 4·2) = 1/9
                 = 0.111 m/s
    
    Only an infinite Kp makes it zero.
  7. Turn Kp down to 1

    With Kp = 1 the push is gentle. The belt barely overshoots (2%) but stops at 0.67 m/s: an offset of 0.33 m/s, three times as large. A weak controller needs a big error to make its voltage.

    Kp = 1:  e_ss = 1 / (1 + 1·2) = 0.33 m/s
             y_ss = 0.67 m/s
             peak  0.68 m/s
    
    closed loop  s² + 6s + 15
    ζ = 0.77   overshoot 2%
  8. Turn Kp up to 20

    With Kp = 20 the first push is 20 V. The offset shrinks to 0.024 m/s, but the belt shoots up to 1.47 m/s and rings before it settles. That overshoot is 51%.

    Kp = 20: e_ss = 1 / (1 + 20·2) = 0.024 m/s
             peak 1.47 m/s
    
    closed loop  s² + 6s + (5 + 10Kp)
                 = s² + 6s + 205
    ζ = 3 / √205 = 0.21
    %OS = exp(−ζπ / √(1 − ζ²)) = 51%
  9. Offset against overshoot

    Raising Kp trades offset for overshoot. The poles keep real part −3 but swing further from the real axis, so the damping falls. P control alone cannot give zero offset and a calm response together.

    Kp     offset    overshoot   ζ
     1     0.33        2%       0.77
     4     0.11       21%       0.45
    20     0.024      51%       0.21
    
    poles  s = −3 ± j√(10Kp − 4)
    
    With more lag in the plant, high Kp
    goes further: the loop turns unstable.
  10. A box makes it worse

    Back to Kp = 4. At 2.5 s a box lands and drags on the belt. Speed sags, the error grows, and only then does the voltage rise, to 0.67 V. The belt settles at 0.83 m/s: offset 0.17 m/s.

    Kp, u0 = 4, 0
    y, v, dt = 0.0, 0.0, 0.001     # speed, its rate, step (s)
    for n in range(5000):         # 5 s
        d = 0.25 if n * dt >= 2.5 else 0.0
        u = Kp * (1.0 - y) + u0  # P control
        a = -6 * v - 5 * y + 10 * (u - d)
        y, v = y + v * dt, v + a * dt
    print(round(y, 3))            # 0.833
    
    box = 0.25 V of extra drive needed
    e_ss = (1 + 2·0.25) / (1 + 8) = 0.17
  11. A bias helps once

    Add a fixed 0.5 V: u = Kp·e + 0.5. Now the empty belt reaches 1.00 m/s exactly. When the box lands the offset returns (0.06 m/s). Integral action resets this bias automatically: next lesson.

    Kp, u0 = 4, 0.5
    y, v, dt = 0.0, 0.0, 0.001     # speed, its rate, step (s)
    for n in range(5000):         # 5 s
        d = 0.25 if n * dt >= 2.5 else 0.0
        u = Kp * (1.0 - y) + u0  # P control
        a = -6 * v - 5 * y + 10 * (u - d)
        y, v = y + v * dt, v + a * dt
    print(round(y, 3))            # 0.944
    
    empty belt  e_ss = 0
    with box    e_ss = 0.06 m/s
    The bias is right for one load only.

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