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
Watch also our Maker-project:
link was added.
There was an error in signs at the D-path.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.