Real time implementation of fuzzy logic controller simulink model with Arduino Mega 2560

조회 수: 5 (최근 30일)
Hi everyone,
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
M
M 2017년 11월 2일
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.
Selim
Selim 2017년 11월 2일
편집: Selim 2017년 11월 2일
I already added 'Arduino support for Simulink' and connected Simulink and Arduino Mega 2560 for the blink example. I also used 'Deploy to hardware' option. But here I want this model to be encoded (or otherwise) to work in arduino and produce output. I hope I explained what I wanted to ask.

댓글을 달려면 로그인하십시오.

답변 (1개)

Madhu Govindarajan
Madhu Govindarajan 2017년 11월 3일
To set the sampling time, you can go to Solverand change the Fixed step time to 600 as these are seconds (as shown below).
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.
  댓글 수: 1
Selim
Selim 2017년 11월 5일
Hi Madhu Govindarajan, thank you first of all. There is no hardware implementation option of Arduino in Conf. Parameters. However, there are Arduino options in Run on Harware section.
Moreover, when i tried to implement my model i'm getting an error as: block type MATLABFcn not yet supported by Simulink Coder.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by