问题描述
喜林在Arduino的电子相当新,因此忍耐一下。
Hi Im quite new in Arduino and electronics so bear with me.
我有一个项目,以控制使用Matlab和Simulink步进电机。现在我只是想获得的东西和运行。我已经迷上了原理图用一个简单的code为步进电机测试,它的工作原理(这已经没有Matlab的完成)。我的问题是我如何能得到电机利用Simulink和Matlab运行?
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?
当我试图运行Simulink模型我得到这个
When i try to Run the Simulink model i get this
我的步进电机驱动板ULN2003APG 和我的电机
。
My step motor driver board is ULN2003APG and my motor is .
我已经下载了MATLAB中的Arduino硬件支持包和已经上传服务器程序Arduino的,让Matlab和Arduino的之间的通信。
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.
我不知道什么可能导致我得到的错误。任何帮助将大大AP preciated!
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.)
先谢谢了。
修改!
下面是一步一步的,我做的尝试并获得我的Simulink模型运行的东西:
Here are step by step the things that I do to try and get my Simulink model to run:
1:完成这个教程。
2:下载 MATLAB支持包的Arduino 。
3:Arduino的UNO连接到电脑,打开Arduino的IDE,并从第2步上传adioes.pde
3: Connect the arduino uno to PC, open the Arduino IDE and upload adioes.pde from step 2.
4:打开Matlab的改变工作路径(如果不是它给出了一个错误)
4: Open Matlab change working path (if not it gives an error)
5:下载打开现有的例子 MATLAB支持包的Arduino ... \\ ArduinoIO \\例子\\ stepper_sim.mdl
5: Open existing example from downloaded MATLAB Support Package for Arduino ...\ArduinoIO\examples\stepper_sim.mdl
6:更改COMPORT,然后单击工具/目标硬件/ prepare运行和工具后运行/目标硬件/ RUN RUN
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.
下面是Simulink模型的诺特尔形象:
Here is a nother image of the simulink model:
推荐答案
我finaly设法利用Simulink运行步进电机。不幸的是我不得不改变驱动板做到这一点。这似乎没有从MATLAB的驱动程序这块主板还是它只是不兼容(不知道)。
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).
我已经买了一个Adafruit的电机屏蔽v2和东西完美。它不再给的这个错误关于丢失.tlc文件。
I've bought an adafruit motor shield v2 and things worked perfectly. It no longer give's that error about a missing .tlc file.
干杯!
这篇关于使用Simulink Arduino的步进电机控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!