ENع
→Block diagrams
الدرس 10 · Modelling systems

Block diagrams

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

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

A block diagram draws a system as boxes and arrows: each box holds a transfer function, each arrow carries a signal, circles add signals and dots copy them. Learn the four pieces, then turn the cart's equation of motion m·ẍ + b·ẋ + k·x = F into a diagram with a gain, two integrators and two feedback paths, step it in Python and check it against its transfer function 1/(2s² + 4s + 50).

ستتعلّم

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

شكل 10 · تفاعلي
01 / 12

A block multiplies

A block is a box holding a transfer function. What leaves it is what enters it times that function. The damper block b turns velocity into force: with b = 4 N·s/m, 0.5 m/s in gives 2 N out.

a block:   input → [ G(s) ] → output
           Y(s) = G(s) · U(s)

damper block   G(s) = b = 4 N·s/m
  in    V = 0.5 m/s
  out   bV = 4 × 0.5 = 2 N

Signals are written by their Laplace
transforms, like V(s), so every block
just multiplies.
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. A block multiplies

    A block is a box holding a transfer function. What leaves it is what enters it times that function. The damper block b turns velocity into force: with b = 4 N·s/m, 0.5 m/s in gives 2 N out.

    a block:   input → [ G(s) ] → output
               Y(s) = G(s) · U(s)
    
    damper block   G(s) = b = 4 N·s/m
      in    V = 0.5 m/s
      out   bV = 4 × 0.5 = 2 N
    
    Signals are written by their Laplace
    transforms, like V(s), so every block
    just multiplies.
  2. Arrows carry signals

    Each arrow carries one signal, one way: a quantity that changes with time, written by its Laplace transform. This arrow carries the push on the cart, F(s). An arrow only reports a value; it never changes it.

    signal   a quantity that changes with time
             force F(t), speed v(t), position x(t)
    written  by its Laplace transform: F(s)
    
    An arrow has one direction.
    It only carries information: it does
    not load or change what it reports.
  3. The summing junction

    The circle is a summing junction. It adds the signals arriving at it, each with the sign drawn beside its arrow. Ours has one plus and two minus inputs, so what leaves it is F − bV − kX.

    summing junction
      inputs   +F   −bV   −kX
      output   Fnet = F − bV − kX
    
    The signs are part of the drawing.
    A missing sign means +.
    The output is the net force on the cart.
  4. A pickoff point copies

    A dot on an arrow is a pickoff point, also called a takeoff point. The signal is copied into two branches, and each carries exactly the same signal. Reading a signal never uses it up.

    pickoff (takeoff) point
    
       X(s) ──●──→ X(s)   (on to the output)
              │
              └──→ X(s)   (down to the k block)
    
    Unlike water splitting in a pipe,
    both branches get the whole signal.
  5. Start from the equation

    Now build the cart from its equation, m·ẍ = F − b·ẋ − k·x. Solve for the highest derivative: ẍ = (F − b·ẋ − k·x)/m. The summing junction builds the bracket from the push F. We want position x out.

    cart   m = 2 kg, b = 4 N·s/m, k = 50 N/m
    
    m·ẍ + b·ẋ + k·x = F
    m·ẍ = F − b·ẋ − k·x
      ẍ = (F − b·ẋ − k·x) / m
    
    Recipe: solve for the highest
    derivative, then build it from the
    signals you have.
  6. Divide by the mass

    The net force flows into the 1/m block and acceleration comes out: A(s) = Fnet(s)/m. With m = 2 kg the block is just the number 0.5. A block that only scales its signal is called a gain.

    1/m gain   G(s) = 1/m = 1/2 = 0.5
    
    at t = 0:  v = 0, x = 0
      Fnet = 10 − 0 − 0 = 10 N
      a    = 10 / 2   = 5 m/s²
    
    Newton's law is now one block.
  7. Integrate to get velocity

    Velocity is the running total of acceleration: v is the integral of a. Integrating from rest divides a Laplace transform by s, so the integrator block is 1/s, and V(s) = A(s)/s.

    v(t) = ∫₀ᵗ a(τ) dτ
    Laplace:  ∫₀ᵗ f dτ  →  F(s) / s
    
    integrator   G(s) = 1/s
                 V(s) = A(s) / s
    
    Transfer functions start from rest
    (zero initial conditions).
  8. Integrate again for position

    Integrate once more and velocity becomes position: X(s) = V(s)/s. The forward path now has three blocks in a row, 1/m, 1/s and 1/s. X(s), the cart's position, is the output.

    x(t) = ∫₀ᵗ v(τ) dτ
           X(s) = V(s) / s
    
    forward path   Fnet → 1/m → 1/s → 1/s → X
                   A = Fnet/m, V = A/s, X = V/s
    
    Still missing: the damper and the
    spring. They depend on V and X.
  9. Feed back the damper

    The damper force depends on velocity. So pick V(s) off the forward path, pass it through the b block, and bring bV(s) back into the summing junction with a minus sign. That loop is the damper.

    pickoff V(s) → [ b = 4 ] → bV(s)
                             → junction, sign −
    
    The arrow runs backwards, from a later
    signal to an earlier point: a feedback
    path inside the cart itself.
  10. Feed back the spring

    The spring force depends on position. Pick X(s) off at the output, multiply by k = 50 N/m, and subtract it at the junction. Every term of m·ẍ = F − b·ẋ − k·x now has its own arrow.

    pickoff X(s) → [ k = 50 ] → kX(s)
                              → junction, sign −
    
    equation        diagram
      F             arrow in, sign +
      −b·ẋ          V → b, sign −
      −k·x          X → k, sign −
      ÷ m, ∫, ∫     1/m, 1/s, 1/s
  11. Push and let it run

    Apply a steady 10 N push and let the signals run round both loops. The position overshoots to 0.305 m at 0.64 s, then settles at F/k = 0.2 m. The curve comes from stepping the diagram itself, block by block.

    # the block diagram, stepped block by block
    m, b, k, F = 2.0, 4.0, 50.0, 10.0
    v = x = peak = 0.0
    dt = 0.0001
    for n in range(50000):     # 5 s
        fnet = F - b*v - k*x    # summing junction
        a = fnet / m            # 1/m gain
        v = v + a*dt            # integrator 1/s
        x = x + v*dt            # integrator 1/s
        peak = max(peak, x)
    print(round(peak, 3), round(x, 3))   # 0.305 0.199
  12. One block from outside

    From outside, the whole diagram acts like one block: X(s)/F(s) = 1/(ms² + bs + k) = 1/(2s² + 4s + 50). Its exact step response lies on top of the simulated one. Reducing diagrams by rule comes next.

    X(s) / F(s) = 1 / (m·s² + b·s + k)
                = 1 / (2s² + 4s + 50)
    
    diagram, simulated   peak 0.305 m
    exact formula        peak 0.305 m
    largest gap          0.05 mm
    
    # exact step response of 1/(2s² + 4s + 50)
    import math
    m, b, k, F = 2.0, 4.0, 50.0, 10.0
    wn = math.sqrt(k/m)                # 5 rad/s
    z = b / (2*math.sqrt(k*m))         # 0.2
    wd = wn * math.sqrt(1 - z*z)
    def x(t):
        e = math.exp(-z*wn*t)
        r = z / math.sqrt(1 - z*z)
        return F/k * (1 - e*(math.cos(wd*t) + r*math.sin(wd*t)))
    print(round(x(math.pi/wd), 3))     # 0.305

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