Real time implementation of fuzzy logic controller simulink model with Arduino Mega 2560
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169085/image.jpeg)
I have a simulink model that contains fuzzy logic controller and some other blocks. I want to implement this controller on Arduino. The controller output will be obtained by comparing the readings with the target value every 10 minutes. First, the question that comes to mind is how do I set the sampling period to 10 minutes? After that, how can I bury this model to the Arduino? I have implemented simple projects on arduino with Simulink (led_blink, motor control, etc.), but I have no idea how I can run such a controller on Arduino. I am very pleased if someone can help in this regard at least in the sense of an idea.
2 Kommentare
M
am 2 Nov. 2017
How did you connect Simulink and Arduino for the blink example ?
In Simulink, you can add a package 'Arduino support for Simulink' where you can directly connect the input/output to the Arduino.
Antworten (1)
Madhu Govindarajan
am 3 Nov. 2017
To set the sampling time, you can go to Solverand change the Fixed step time to 600 as these are seconds (as shown below).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179179/image.jpeg)
To tell your Simulink model that you are going to download it to an Arduino, choose this from the Hardware Implementation pane as shown below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179181/image.jpeg)
Siehe auch
Kategorien
Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!