Parts of a loop: sensor, controller, actuator and plant
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
Every feedback loop is built from the same four parts. Follow a car's cruise control round its loop: the wheel sensor measures the speed, a two-line Python controller compares it with the set speed and decides the throttle, the engine (the actuator) pushes, and the car (the plant) speeds up. Watch the signal change kind at every part, then see what happens when the sensor is wrong.
Hold 90 km/h on its own
Cruise control holds a car at the speed the driver sets. The driver dials in 25 m/s (90 km/h); the car is doing 20 m/s (72 km/h). Four parts share the work, and each has one job.
setpoint (goal) 25 m/s = 90 km/h car right now 20 m/s = 72 km/h m/s = metres per second. Multiply by 3.6 to get km/h. The four parts: plant, actuator, sensor and controller.
اقرأ الدرس خطوة بخطوة
Hold 90 km/h on its own
Cruise control holds a car at the speed the driver sets. The driver dials in 25 m/s (90 km/h); the car is doing 20 m/s (72 km/h). Four parts share the work, and each has one job.
setpoint (goal) 25 m/s = 90 km/h car right now 20 m/s = 72 km/h m/s = metres per second. Multiply by 3.6 to get km/h. The four parts: plant, actuator, sensor and controller.The plant: the car
The plant is the thing being controlled: the car. Its output is the quantity we care about, its speed. Its input is the push from the engine. With no push, air and tyres slow it down.
plant the car, 1200 kg input push from the engine (newtons, N) output speed (m/s) Drag here: 30 N for every m/s. At 20 m/s that is 600 N slowing it. Hold a push long enough and the speed settles at push ÷ 30.The actuator: the engine
Nobody can set a speed directly. The engine is the actuator: it turns a throttle command, from 0 to 100 %, into a push on the car, from 0 to 3000 N. It is strong, but it has a limit.
actuator engine + throttle in throttle command, 0 to 100 % out push on the car, 0 to 3000 N push = 3000 N × throttle A newton (N) is a unit of force: about the weight of a small apple.The sensor: the wheel
A sensor measures the output. Here a toothed ring turns with the wheel, and a sensor counts the teeth going past. More teeth per second means faster. The car's computer turns the count into a speed reading.
sensor wheel-speed sensor in the real speed of the car out a reading: 20.0 m/s reading = teeth per second ÷ teeth per turn × distance per wheel turnThe controller compares
The reading travels back to the controller. That trip is feedback, as in Open loop versus closed loop. The controller subtracts the reading from the setpoint: 25 − 20 = +5 m/s. That difference is the error. Positive means too slow.
error = goal - reading = 25.0 - 20.0 = +5.0 m/s (too slow) error > 0 too slow, push harder error < 0 too fast, ease off error = 0 on targetThe controller decides
Our rule: open the throttle 100 % for every 1 m/s of error, kept between 0 and 100 %. An error of 5 m/s asks for 500 %, so the command is full throttle. The controller only decides; the engine does the pushing.
throttle = min(max(error, 0), 1) = min(max(5.0, 0), 1) = 1.0 → 100 % 1 m/s or more too slow → full throttle. The closer the speed, the gentler. This is proportional control.Six signals, one loop
Follow the loop and the signal changes kind at every part: setpoint (m/s), error (m/s), throttle command (%), push (N), speed (m/s), reading (m/s). Each part turns one kind of signal into the next.
setpoint 25 m/s driver → controller error +5.0 m/s inside the controller command 100 % controller → engine push 3000 N engine → car speed 20.0 m/s the car's output reading 20.0 m/s sensor → controller speed → reading → controller is feedback.Round and round
Now the loop runs, 20 times a second. The engine stays at its limit, full throttle, for 2.1 s. Then the error shrinks and the throttle eases to 25 %. The car settles at 24.8 m/s.
# the loop, 20 times a second, for 12 s import math m, c, F_MAX = 1200, 30, 3000 goal, v, dt = 25.0, 20.0, 0.05 for n in range(240): reading = v # sensor error = goal - reading # controller throttle = min(max(error, 0), 1) push = F_MAX * throttle # actuator target = push / c # plant v = target + (v - target) * math.exp(-dt * c / m) print(round(v, 1)) # 24.8The loop trusts its sensor
Now fit bigger tyres without telling the computer, so the sensor reads 10 % low. The loop holds the reading near the goal (24.7 m/s), so the car really does 27.5 m/s, about 99 km/h. Feedback cannot fix a wrong sensor.
# same loop, but the sensor reads 10 % low import math m, c, F_MAX = 1200, 30, 3000 goal, v, dt = 25.0, 20.0, 0.05 for n in range(240): reading = 0.9 * v # bad sensor throttle = min(max(goal - reading, 0), 1) target = F_MAX * throttle / c v = target + (v - target) * math.exp(-dt * c / m) print(round(v, 1)) # 27.5Four parts, four jobs
The sensor measures. The controller compares and decides. The actuator pushes. The plant responds. A weak actuator makes the loop slow, a wrong sensor makes it wrong. This rule still leaves 0.25 m/s of error.
part job here sensor measure the output wheel sensor controller compare and decide two lines of Python actuator push on the plant engine, max 3000 N plant respond the car left over error 0.25 m/s (a later lesson shows how to remove it)
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01In cruise control, which part is the actuator?
The actuator is the part that pushes on the plant. The engine turns the throttle command into a push on the car. The car is the plant, and the Python rule is the controller.
02What does the controller do?
The controller works out the error (setpoint minus reading) and turns it into a command for the actuator. It never pushes on the car itself: that is the engine's job.
03Which signal travels from the controller to the engine?
The controller sends a command (here 0 to 100 % throttle). The engine turns that into a push in newtons, and the car turns the push into speed.
04The error is 5 m/s, but the car takes about 2.1 s to get close to the goal. What limits it?
The rule asks for far more than 100 % throttle, so the engine runs at its limit of 3000 N. The car can only speed up so fast (about 2.0 m/s² here). Every actuator has a limit like this.
05After fitting bigger tyres, the speed sensor reads 10 % low. What does the cruise control do?
Feedback drives the reading to the goal. The reading says 24.7 m/s while the car really does 27.5 m/s (about 99 km/h). A loop can be no more accurate than its sensor.
المسرد
- Plant
- The thing being controlled, here the car. Its output (here its speed) is the quantity we care about.
- Actuator
- The part that pushes on the plant, here the engine and throttle. It turns a command into a physical effect, up to a limit.
- Sensor
- The part that measures the output, here a wheel-speed sensor. Its reading is what the controller sees.
- Controller
- The rule that compares the reading with the setpoint and decides the command. Ours is two lines of Python.
- Setpoint (reference)
- The value we ask the output to reach and hold, here 25 m/s (90 km/h).
- Error
- Setpoint minus reading. Positive means too slow, negative too fast.
- Command (control signal)
- What the controller sends to the actuator, here a throttle setting from 0 to 100 %.
- Feedback
- Measuring the output and sending the reading back to the controller, which closes the loop.
الملاحظات والمصادر
- The car is a simple model with illustrative numbers: 1200 kg, drag of 30 N per m/s (real drag grows faster than this, roughly with speed squared), and an engine that can push up to 3000 N. Every curve and number in the figure is computed from that model.
- The Python on each step is plain Python 3 with the math module. It updates the controller every 0.05 s and moves the car forward with the exact solution of its equation between updates, just as the figure does.
- Feedback drives the reading, not the true speed, to the goal. A sensor that reads 10 % low therefore makes the car run about 10 % fast (27.5 m/s instead of 24.8 m/s). Control textbooks make the same point: the loop can be no more accurate than its sensor.
- The small error left by the proportional rule (0.25 m/s) is called steady-state error. A later lesson in this course shows why it appears and how integral action removes it.
- The car model follows the cruise-control example in Åström and Murray's Feedback Systems and in the python-control documentation, simplified to linear drag on a flat road.
- N. S. Nise, Control Systems Engineering, 8th ed., Wiley (ch. 1)
- K. Ogata, Modern Control Engineering, 5th ed., Pearson (ch. 1)
- G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems, 8th ed., Pearson (ch. 1 and 4)
- python-control documentation: Cruise control example (after Åström and Murray, Feedback Systems)
- MIT OpenCourseWare 16.06 Principles of Automatic Control (S. Hall)
- MIT OpenCourseWare 6.302 Feedback Systems (Roberge, Dawson, Lundberg)
- Python Control Systems Library (python-control) documentation
اختبار يتاح بعد الخطوة الأخيرة.