Robust Control for the Quanser Magnetic Levitation System
Updated Fri, 04 Mar 2022 21:41:26 +0000
- MathWorks Control System Toolbox to define transfer functions in MATLAB and so on.
- MathWorks Simulink Control Design Toolbox. Used to linearize the nonlinear model and design the control gains with the Control System Tuner app.
- MathWorks Robust Control Toolbox. Required to define uncertain parameters that is used when performing the robust control tuning.
- [optional] Quanser QUARC Real-Time Control Software is required to run the controllers on the actual Magnetic Levitation hardware. If you don’t have the QUARC software, you can sign up for free trial.
- Go through the Maglev_Robust_Tuning.mlx Live Script posted. It guides you through the robust control process and simulates it directly in the Live Script.
- Simulate the ball position control in the s_maglev_pid.slx Simulink model posted using either the nominal or robust control gains. You can select between the two controllers using the Manual Switch.
- Make sure the Quanser Magnetic Levitation system has been setup (and tested using the Quick Start Guide).
- The sensors should be calibrated and the VoltPAQ amplifier powered and set to a Gain of 3.
- Run the Maglev_Robust_Tuning Live Script up to the “Robust Control Implementation” section.
- Open the q_maglev_pid_robust.slx Simulink model.
- If you are not using the Quanser Q2-USB data-acquisition device, then change the Board type in the HIL Initialize block found in the MAGLEV w/ PI Control | MAGLEVsubsystem.
- Click on the Monitor & Tune button in the Simulnk model Hardware tab to generate and run the QUARC real-time code. The ball should start levitation.
- Once the ball is stabilized at a fixed point, you can add a square wave command by setting the Amplitude (m) Gain block to 1e-3 (for 1 mm) or something larger.
- Click on the Stop button to stop running the controller.
- The new measured results can be plotted in Live Script.
- Follow a similar procedure to implement nominal control gain with q_maglev_pid_nominal.slx.
Quanser (2022). Robust Control for the Quanser Magnetic Levitation System (https://www.mathworks.com/matlabcentral/fileexchange/107534-robust-control-for-the-quanser-magnetic-levitation-system), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!