Posted by Kostas Alexis on December 1, 2009 at 6:56am
Hi friends!I have just found and tested a Blockset that interfaces MATLAB/SIMULINK and Arduino. You may find this at:http://www.mathworks.com/matlabcentral/fileexchange/24675-arduino-targetI highly suggest this program since it offers rapid prototyping capabilities to the famous and cheap arduino. The guys have build a block that interfaces with the Real Time Workshop of MATLAB and have also implemented C functions for all arduino operations (analog in, out, serial read/write etc.). Despite the fact that the code is obviously bigger one can gain advantage from the quick and abstract way of programming that simulink offers. It is a good work!Happy coding!
I think Arduino Target is very good start. Author Doug Eastman must be congratulated.
Those who have formal/deeper understanding in flight control theory may use this tool in Matlab/Simulink to create better controller algorithms.
According to the following figure
the current version of Arduino Target only support analog and digital input/analog, serial read/write and serial config blocks. However, the ZIP file of the Arduino Target further contains a servo output block.
It seems to be that Arduino Target does not support interrupts. May be someone with real experience on Arduino Target can correct me.
I am looking forward to see people sharing their Matlab/Simulink based control applications.
probably just simple 'include' would allow portions or all of the existing ardupilot code to be used, with autocoded parts hooked in. not sure till try it though, just suspect that's a way.
can get matlab for linux. but it's big $$$ regardless of os. can get a student version for cheap or free. the arduino tool is only tested / used so far in windows per the listing in mathworks exchange, but pretty sure no huge reason it shouldn't work in linux, the arduino ide does work in linux fine. go for it. if I get around to trying that, i would be using matlab on windows, so may as well flash straight from there.
matlab real time workshop (RTW) is for autocoding, creating c or other code from graphical simulink and stateflow control models. make and test a control scheme or part of the code, or some fancy calculations, and mathworks creates the code for the target controller. good way to fill up an arduino, but the advantage is how easy it should be, once rtw is set up and working, very quick & easy to make things without typing out lots of code manually. If you're familiar with matlab simulink stateflow, it could be very handy. Otherwise, might do just as well writing code normal way, getting matlab and figuring it out would be a good investment, but could be a lot of time by itself.
There's not anything to wire up differently, use the ftdi cable. Think must be able to use parts of program in c / arduino language, and other parts autocoded. Everytime you flash new program to arduino, you erase it, except leave the bootloader basic program still there.
it looks like it piggybacks on the existing arduino ide. here's more description on it. GettingStarted.html
Anyway, I think I may try this sometime. Thanks for finding this!
Comments
Those who have formal/deeper understanding in flight control theory may use this tool in Matlab/Simulink to create better controller algorithms.
According to the following figure

the current version of Arduino Target only support analog and digital input/analog, serial read/write and serial config blocks. However, the ZIP file of the Arduino Target further contains a servo output block.It seems to be that Arduino Target does not support interrupts. May be someone with real experience on Arduino Target can correct me.
I am looking forward to see people sharing their Matlab/Simulink based control applications.
matlab real time workshop (RTW) is for autocoding, creating c or other code from graphical simulink and stateflow control models. make and test a control scheme or part of the code, or some fancy calculations, and mathworks creates the code for the target controller. good way to fill up an arduino, but the advantage is how easy it should be, once rtw is set up and working, very quick & easy to make things without typing out lots of code manually. If you're familiar with matlab simulink stateflow, it could be very handy. Otherwise, might do just as well writing code normal way, getting matlab and figuring it out would be a good investment, but could be a lot of time by itself.
There's not anything to wire up differently, use the ftdi cable. Think must be able to use parts of program in c / arduino language, and other parts autocoded. Everytime you flash new program to arduino, you erase it, except leave the bootloader basic program still there.
it looks like it piggybacks on the existing arduino ide. here's more description on it.
GettingStarted.html
Anyway, I think I may try this sometime. Thanks for finding this!