Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Real time user inputs to SimMechanics
Posted:
May 7, 2012 8:50 AM


> I recently interfaced Matlab and Simulink with my Arduino board using Arduino Target.
Can you confirm which version and target you have set up? This Technical Support solution shows some of the different options: http://www.mathworks.com/support/solutions/en/data/1HCE464/index.html
> I am giving analog input to the board and that is being correctly visualized into Matlab. > Now, I have a simMechanics model where i wish to give the input (force) to this system as an input controlled by my analog input to the board ( basically wish to give a user controlled input rather than standard trigonometric/constant input blocks ).
It sounds like you want a hardware interface into your simulink model (like a joystick would be), and have that model run in a simulated state on the host computer (with MATLAB and Simulink running). I want to confirm that you do not want to put the SimMechanics model down on the arduino or otherwise (although a code gen path is possible given any limitations on the target hardware platform  arduino in this case may be too limiting).
> The dilemma here is system target file for Arduino interfacing needs to be arduino.tlc and for simMechanics i think, needs to be grt.tlc(generic real time). > Is there a workaround for this or any setting that I am missing, so that I could get this working ? > > Any suggestion would be very helpful !
If you are simply using the arduino for I/O into your Simulink model, then I suggest you simply use the MATLAB Arduino I/O package... which comes with Simulink blocks. This is just an interface, and doesn't put algorithms down on the board. But you can use it to pump I/O through your arduino. given your description that is my best guess as to what would be most useful for you. The advice may change, if I didn't understand your intentions well.
Here is the Arduino I/O package, MATLAB interface: Landing Page  http://www.mathworks.com/academia/arduinosoftware/arduinomatlab.html File Exchange Entry  http://www.mathworks.com/matlabcentral/fileexchange/32374



