Wednesday 28 January 2015

Interfacing matlab with arduino


On continuing with making a wired robot without programming ,I came up with some advance version but still not programming,the matlab will do your rest of job.I also tell you how to stimulate the hex code with isis(proteus) sounding new let me elaborate it.


Just download following  from given links before starting:-


Now that you have downloaded lots of file,if any of the above mentioned file exist,then download only the needed file.

Step 1:- To install support for Arduino hardware:

  1.  In a MATLAB Command Window, enter supportPackageInstaller. This starts the Support Package Installer.
  2. Follow the instructions and default settings provided by Support Package Installer to complete the installation.
  3. On the MATLAB toolstrip, click Add-Ons > Get Hardware Support Packages
  4.  In the MATLAB Command Window, enter supportPackageInstaller.
  5. Double-click a support package installation file (*.mlpkginstall).

So far you have installed Matlab along with Arduino Support Package

Step 2:-Run Model On Arduino

You can prepare, configure, and run a model on your Arduino® hardware.
Before starting this procedure:
1. Connect your Arduino hardware to the host computer using a USB cable.
2. Create or open a Simulink® model.
     2.1. Open Simulink on the tool box.it take little time to open.
     2.2. Click file >new>model
     2.3. Drag and drop the blocks or right click on the block > add to untitled
            2.3.1. Analog input block from Simulink>support package for  Arduino>common.
            2.3.2. Right click>pin number 0 and sample time 0.016.
            2.3.5. Similarly standard servo write block and pin no 4. Repeat same with pin no 5.


3. Use File > Save As to create a working copy of your model. Keep the original model as a backup copy.
4. In your model, select Tools > Run on Target Hardware > Prepare to Run. This action changes the model Configuration Parameters.
5. When the Run on Target Hardware pane opens, set the Target hardware parameter to the specific board you are using.
6. Click the Deploy to Hardware button.
This action automatically downloads and runs your model on the board.
7. You can run the  model with hex code by following way.

   7.1. Click the Deploy to Hardware button.
   7.2. Find the hex code in current directory shown above the matlab main page.


   7.3. Design the working model on proteus with Arduino and motor and so on.

   7.4. Double click on the Arduino board on isis >program file>hex file path>ok
   7.5. Click run and enjoy the show.

-Sonu Singh

                                 


                             









Total Pageviews

    Submit Articles