Getting Started with Control Systems and MATLAB
English translation
Control Engineering I · Week 1
This week's goal · Distinguish the target, input, output, and measurement, and run code in Live Editor.
Run: After signing in to MathWorks, open .mlx in your workspace. Click inside the code → Live Editor → Run Section to run one section at a time. Run runs everything. After changing a value, rerun the relevant section. Edit the text in ⟦enter here⟧ response fields; do not execute them. You can use Ctrl+Enter on Windows/Linux and ⌘+Enter on Mac.
Read models and responses across different tools
Even if MATLAB functions or screens change, we still need to build models from physical laws and interpret input responses. In lectures, understand what equations and models mean; in exercises, use computational tools to check their results.
If usage changes, first clarify which model and input you are using and what you want to find. Check the function's input conditions and output meanings in the official documentation, then try a simple model whose result you can predict by hand. The goal is to move beyond memorizing functions and judge whether a new tool's results are valid.
1. Compare the reference and actual output
Consider room-temperature regulation as an example of a control system. To maintain 25 degrees, measure the current temperature and compare it with the target. The controller changes the heater input according to this difference. Identifying the target, controller, plant, and sensor is the first step in reading a control system.
Compare the reference and actual output
Open-loop control makes no correction using measured outputs. Closed-loop control feeds measurements back for comparison. If the sensor measures incorrectly, the actual result can miss the target even when the controller works hard.
2. From a physical system to a model
Rather than capturing every characteristic of a physical device, choose the inputs and outputs of interest and model the necessary relationships. Differential equations, transfer functions, and state space are ways to represent the same system whose values change over time, according to the purpose.
From a physical system to a model
Models have assumptions and limits of applicability. Consider how omitted effects such as friction, saturation, and sensor error could change actual results.
3. Open your copy in MATLAB Online
The start button clones the repository and opens the .mlx file. Sign in with a MathWorks account if needed. Read the explanations, click inside the code, and use Run Section.
Open your copy in MATLAB Online
The first run checks the version, basic arrays, and plots. Other weeks may additionally require Control System Toolbox, Symbolic Math Toolbox, or Simulink; check each document's environment instructions.
Check your understanding
- What values should go into the code, and what does each row and column of the resulting array represent? If calculating physical quantities, have you also checked the units?
- Can you identify which parts to rerun when you change one condition?
- Do the results match your expectations? If they differ, can you explain why using the output values or plots?
Practice materials
- Control_Engineering_1_Week01_CourseSetup.mlxPreview mlx script · Download mlx script