PID Control with Simulink and Arduino
A constant loop time is essential for digital feedback control. Normally a micro-controller is programmed using interrupt routines. We applied the Simulink Support Package for Arduino Hardware and achieved a feedback control system with constant control loop frequency up to 1 kHz. We could implement and test different control algorithm on real Maglev systems without writing any C-code.
The sample time of the loop is given from both sources: the Step Function Block and the Analog Input Block, you must choose for both blocks the same sample time. By using Arduino Due hardware the least sample time was 0.001 seconds to achieve stable control loops without failure.
Watch a video with the working conrol loop on
www.leviball.com .
Watch also our Maker-project:
https://www.hackster.io/matlab-makers/magnetically-levitated-ball-with-matlab-and-arduino-e3a2e1
Cite As
Tobias (2024). PID Control with Simulink and Arduino (https://www.mathworks.com/matlabcentral/fileexchange/61131-pid-control-with-simulink-and-arduino), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Control Systems > Control System Toolbox > Control System Design and Tuning > PID Controller Tuning >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.