Is it possible to run the code in my computer and send the information to Arduino (Simulink)?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Victor Maciel
am 1 Dez. 2022
Beantwortet: Midhulesh Vellanki
am 21 Dez. 2022
I have created some type of Predictive Controller and I have a physical prototype which I want to test my code. This prototype use an arduino and collect the information from some sensors and controls an actuator. My code needs more memory than my board have. So, I want to run the controller code (generated by Simulink Coder) in my computer and send only the control signal to my arduino board. Is that possible? If yes, how can I do it?
I want to run the code of controller (in red) on my computer and only send and receive data from arduino (blue).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1215853/image.png)
0 Kommentare
Akzeptierte Antwort
Midhulesh Vellanki
am 21 Dez. 2022
Hi Victor,
there are several ways for doing this, depending on what you are trying to test
One the most striaght forward ways is to use Connected IO mode as outlined here: https://www.mathworks.com/help/supportpkg/arduino/ug/connected-io.html?searchHighlight=Connected%20IO&s_tid=srchtitle_Connected%20IO_1
With this approch you would have access to sesnors on your host computer, and test your alogrithm but your controller would be running on the host computer as well.
If you would like to check performance of your controller on hardware, I would recommend, using an ethernet or CAN sheild on your arduino to send sensor data and configure simulink model with a ethernet read. I can elobrate more if the first approch is not ideal for you.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!