Signal & Tuning Issue with Simulink Model Deploying on Raspberry Pi 3B

2 visualizaciones (últimos 30 días)
Saumya Sharma
Saumya Sharma el 26 de Mzo. de 2023
Respondida: Pratheek el 26 de Mayo de 2023
Hello!
I am working on a project that involves deploying a Simulink model on a Raspberry Pi 3B to see how computational loads impact the model run. I am using the Model Predictive Control Toolbox to run a MPC Simulink model on the Pi.
I am referencing the in-built MATLAB example of MPC Single-Input-Single-Output Plant as the Simulink model in question. My assumption was that if I used the Signal & Tuning process suggested in these two webpages (Run in External Mode & Communicating with Raspberry Pi Hardware) I should be able to see the input (u) and output (y) variables populate with values in the MATLAB workspace even though the Simulink model was executing on the Raspberry Pi.
I do get a successful build of the Simulink model as seen in this screenshot below of the Diagnostic Viewer:
However, when I stop the run of the model on my Raspberry Pi the u and v variables populate as empty vectors. It is important to note that this Simulink model does run successfully on my computer as a simulation on my host machine (like in the documentation linked above).
I am not entirely sure as to if I am missing some step in my execution or need to enable something else. Thank you for your help!

Respuestas (1)

Pratheek
Pratheek el 26 de Mayo de 2023
Hi Saumya,
I understand that your model is getting build properly but u and y are not getting populated, there could be few possible reasons for that:
1. Communication settings are not configured properly: Make sure that MATLAB's host computer and the Raspberry Pi's connection settings are set up correctly. Verify once more that the Raspberry Pi's IP address and port are entered correctly in the External Mode settings.
2. Connection between MATLAB host and Raspberry Pi is lost: The connection between the host and Raspberry Pi may be lost or unstable. Check that the network connection is active and stable, and that the host machine can communicate with the Raspberry Pi.
3. Incorrect parameter settings: Check that the parameters of the Simulink model and the MPC Toolbox are set correctly. Make sure that the sample times, data types and other settings are correctly specified. If any of the settings are incorrect, it may cause difficulty communicating with the Raspberry Pi.
For further assistance Can you also provide the code files so that I can help you in a better way.
Hope this helps!

Categorías

Más información sobre Run on Target Hardware en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by