PID Control with Simulink and Arduino

Version 1.1.0.0 (23.1 KB) by Tobias
Feedback PID control with Simulink on Arduino Due hardware.
2.8K Downloads
Updated 10 Feb 2017

View License

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
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

link was added.
There was an error in signs at the D-path.

1.0.0.0