Control Design Principles


Control Design Principles

Maria
Welcome to another MATLAB and Simulink Racing Lounge episode! Today, we'll explore control design principles using a throttle example. I'm joined by Daniel, an application engineer who specializes in control design and physical modeling. Let's start with our classic workflow: first, we set up a plant model of the throttle.

Michael
Right, Maria. We start with a basic model of the throttle valve, including three torques: a spring pulling it back, the motor torque, and damping from friction. The equations are resolved for angular acceleration, then integrated twice to get the angle. In Simulink, we build this model with a voltage input and angle output, then create a subsystem for clarity.

Maria
Once we have the plant, we need a controller. The natural choice is a PID controller, since it's simple, widely used, and works for most linear systems. We close the loop by subtracting the feedback from the reference, and use a signal builder block to provide a step input from 0 to 90 degrees, simulating opening the throttle fully.

Michael
Exactly. In Simulink, we add a PID block, connect it in the loop, and set up a reference signal. We also add scopes to view the response. When we simulate initially, we see overshoot and oscillations. That's where tuning comes in. The PID block has a built-in 'Tune' button that linearizes the system and suggests better gains.

Maria
The tuning interface shows both time and frequency responses. We can adjust sliders for response speed and robustness while watching gain and phase margins. For our throttle, we want faster response with less overshoot. Once we accept the tuned parameters, the controller automatically updates, and re-simulating shows a much smoother, faster response.

Michael
That's the standard tuning workflow. But real-world systems have uncertainties—like the damping coefficient varying with dirt accumulation. To handle this, we can model the uncertainty directly. In Simulink, we set a block linearization specification for the damping parameter with a 20% tolerance. Then we perform linear analysis to get an uncertain state-space model.

Maria
Using the Robust Control Toolbox, we can find the worst-case scenario for gain or overshoot. The 'wcgain' function gives us the maximum gain and the corresponding parameter values. In our example, the worst case occurs at the upper bound of damping, giving higher overshoot. We can then plot the worst-case step response alongside the nominal to compare.

Michael
This worst-case analysis gives confidence that the controller handles all expected variations. Even if you don't know every parameter exactly, you can numerically find the worst combination. Next, we might have real-world constraints—like a maximum voltage supply. In our throttle, the initial controller demanded 18 volts, but we only have 15 volts available.

Maria
To enforce this constraint, we use the Response Optimization tool. We set the voltage signal as a bound, requiring it to stay below 15 volts. The optimizer then adjusts the PID gains to meet this requirement while maintaining acceptable performance. After optimization, the voltage stays within limits, and the throttle response remains smooth and stable, albeit slightly slower.

Michael
So the key takeaways? Control design isn't magic—these tools make it accessible. The workflow is straightforward: model, tune, robustify, optimize. Worst-case analysis, even if you think you know all cases, can reveal hidden edge cases. And optimization bridges theory and reality by incorporating real-world limits like voltage constraints.

Maria
Exactly, Michael. This episode covered the fundamentals, but there's more to explore—like parameter estimation, robust control, or model predictive control. We encourage you to try these techniques yourself using MATLAB and Simulink. If you have questions or feedback, reach out to us at the Formula Student email. And remember, we offer free software for student teams.

Michael
Thanks for joining us! Check out mathworks.com/racinglounge for more videos. Let us know what topics you'd like next. Until then, happy tuning!

Ask anything
We've read this whole study set, so questions about it get the best answers.