Hi Im quite new in Arduino and electronics so bear with me.
I have a project to control a step motor using Matlab and Simulink. For now I just want to get the thing up and running. I have hooked up the schematic tested it with a simple code for a step motor and it works (this has been done without Matlab). My problem is how can i get the motor to run using Simulink and Matlab?
When i try to Run the Simulink model i get this
My step motor driver board is ULN2003APG and my motor is .
I have downloaded the Arduino Hardware Support Package for Matlab and have already uploaded the server program to Arduino to enable communication between Matlab and Arduino.
I have no idea what might be causing the error that i get. Any help would be greatly appreciated!
If there are any existing guides or any examples covering such topics u can redirect me to them.
(If there is a need to write a new driver for the board please send me some tutorial where I can read about that.)
Thanks in advance.
EDIT!
Here are step by step the things that I do to try and get my Simulink model to run:
1: Complete the steps in this tutorial.
2: Download MATLAB Support Package for Arduino.
3: Connect the arduino uno to PC, open the Arduino IDE and upload adioes.pde from step 2.
4: Open Matlab change working path (if not it gives an error)
5: Open existing example from downloaded MATLAB Support Package for Arduino ...\ArduinoIO\examples\stepper_sim.mdl
6: Change COMPORT and click Tools/Run on Target Hardware/Prepare to run and after that Tools/Run on Target Hardware/Run
After that I get my error.
Here is a nother image of the simulink model:
I've finaly managed to get the stepper motor running using Simulink. Unfortunately I had to change the driver board to do that. It seems there isn't a driver from Matlab for this board or it's just not compatible (not sure).
I've bought an adafruit motor shield v2 and things worked perfectly. It no longer give's that error about a missing .tlc file.
Cheers !