Effacer les filtres
Effacer les filtres

Is it possible to receive data from arduino via serial communication, then compute with the data and send information back to the arduino?

4 vues (au cours des 30 derniers jours)
I have to run a controller through arduino that controls a motor for a specifc purpose. I have designed the Model predictive controller in Simulink with my model, and everything works as intended. Is it possible, instead od reading values from the simulated model, to receive real values from an arduino board into matlab and use those in the control implementation on simulink, then send the control signal back? Say for example in my simulated model, I measure some variable, x. I measure this x in the simulation, feed it back to the MPC, compute a control signal, then send that to the simulated plant. Is it possible to instead, receive x into my simulink model from my arduino board (would be measured from the physical model), use this x in my MPC controller, and send the computed control signal back to my arduino where further processing and actuating of the various physical systems can be done?

Réponses (1)

Biral Pradhan
Biral Pradhan le 1 Sep 2022
I understand you want to achieve serial transmission and reception with an Arduino via your Simulink model. Kindly follow the below documentation link for better understanding of "Serial Transmission" and "Serial Reception" blocks.
I would also recommend going through the below example documentation to help with the overall process.

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by