https://github.com/auralius/soft-rt-simulink-arduino
Soft Real-time System with Simulink and Arduino
https://github.com/auralius/soft-rt-simulink-arduino
arduino data-acquisition matlab realtime simulink
Last synced: 7 months ago
JSON representation
Soft Real-time System with Simulink and Arduino
- Host: GitHub
- URL: https://github.com/auralius/soft-rt-simulink-arduino
- Owner: auralius
- Created: 2020-06-20T09:31:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-24T07:27:22.000Z (over 3 years ago)
- Last Synced: 2025-02-01T10:27:19.328Z (8 months ago)
- Topics: arduino, data-acquisition, matlab, realtime, simulink
- Language: MATLAB
- Homepage:
- Size: 709 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Soft Real-time System with Simulink and Arduino**
The aim here is to build a (low-cost) soft real-time system by using Arduino as an IO server (data acquisition device). The software that we use is MATLAB Simulink 2018b. The developed real-time system will be used for controlling low dynamic systems, such as thermal and fluidic systems, while performing data acquisition process. The real-time system is expected to run at a 10 Hz of sampling rate, with the capability to log data to its hard drive at each iteration, thus, the resulting data is equally timed.
**Steps to do:**
Here, we assume you have successfully installed the Simulink Support Packages for Arduino. After running the MATLAB, go to system monitor (in Linux system) or task manager (in Windows system), and set the MATLAB priority to be the highest. Sort the process lists based on the priority and make sure that MATLAB has the highest priority. You must set priority of other processes to normal if they consume rather high processor power.

*Figure 1: In Linux, process priority value is called __"nice value"__: the lower the nice value is, the higher the priority is. -20 is the highest prority in a Linux system. In a Windows system, the highest priority is labelled as __“realtime”__.*
Next, run the provided MATLAB Simulink file. A Simulink file named: __Template10HzUno.slx__ is provided. Use this file as a template to build your project (see Figure 2). You can adapt the configuration to suit your hardware selections. However, before continuing with your project, you should perform jitter test. Run the Simulink file for at least 60 seconds and then use the m-file named: __jitter_tes_result.m__ to plot the result. Your system should have jitter less than 1% (see Figure 3).

*Figure 2: Run this model for about 60 seconds. A file named loggedtime.mat is generated.*
*Figure 3: Jitter result from jitter_test_result.m showing jitter of less than one percent.*
-----------------------

*Figure 4: For Windows user, use the Task Manager to increase MATLAB prioriy.*
-----------------------
Contact:
manurung.@yandex.com