Problem in serial communication between Simulink and Arduino

3 次查看(过去 30 天)
Hi everybody! I really need your help!
I'm trying to redo the same project that has been done here:
I've done exactly the same steps and replied the configuration and settings in my model but I got the following bad result:
I receive the serial signal only when the servo is not linked to arduino board. When I link it the serial communication stops suddenly; if i try to connect the servo before running the communication on the host side it gives me an error saying that the selected port is not available and occupied by other application (so in this way the communication doesn't start at all).
When i connect the servo it doesn't follow the sine wave signal but it starts to do very little movements in a cyclic way; it seems that it countinously connect and disconnect itself by the board (i can also hear the windows audio signal that there is when you connect and disconnect a usb device). I've tried to disconnect Arduino from the PC and connecting it to a battery but nothing changed.
Have you any idea about this problem? I really need your help; i can't understand where is the mistake.
Thank you for all you could do for me.
VZ

回答(2 个)

Kaustubha Govind
Kaustubha Govind 2012-2-24
Your best bet might be to contact the author of the block library - in this case, Matt Bilsky I guess? Also, this paragraph makes me think that the Servo Motor is reserving the serial port for communication, so you cannot open another connection to it:
"I receive the serial signal only when the servo is not linked to arduino board. When I link it the serial communication stops suddenly; if i try to connect the servo before running the communication on the host side it gives me an error saying that the selected port is not available and occupied by other application (so in this way the communication doesn't start at all)."

Massimiliano Curzi
try connecting the Board to an external power supply: I had your same issue with the servos making the board disconnect and reconnect continuosly and i solved by connecting my arduino to an external power supply

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by