Raspberry Pi I/O with SIMULINK Model in real-time
34 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a prototype program written in C that runs on the Raspberry Pi 4B. It reads sensors values from some GPIO pins and writes valve actuation commands to other GPIO pins.
I have created a SIMULINK model of the plant that the software is supposed to control. I'm setting up the connection between the RPi and my computer using the support package provided by MATLAB and SIMULINK.
The question I have is:
How would I make the SIMULINK model interact with the Raspberry Pi in real-time? i.e. Send sensor values to the Pi and accept actuation signal from the Pi.
Any help is appreciated. Thank you!
0 comentarios
Respuestas (1)
Prasanth Sunkara
el 14 de Oct. de 2020
Hello Abhigya,
You can deploy the entire plant software model + Raspberry Pi GPIO blocks to raspberry pi using one of the below two workflows
1) Standalone deployment workflow --> https://www.mathworks.com/help/supportpkg/raspberrypi/ug/create-and-run-an-application-on-raspberry_pi-hardware.html
2) Monitor & Tune workflow --> https://www.mathworks.com/help/supportpkg/raspberrypi/ug/remotely-monitoring-and-controlling-an-application-on-hardware.html
Alternatively, if you just want to check how your algorithm(or plant software model in your case) works with real hw data, you may want to use "Simulink Connected I/O workflow". In this approach, the model does not get deployed onto the hardware, rather Raspberry Pi Simulink blocks communicate with the hw for all I/O needs and brings that data to your host PC which is running your simulink model. This way you can see how your plant behaves with real sensor and actuator data.
For more info on Connected I/O workflow, please see the below page.
You might also find the below image processing example with connected i/o helpful.
Thanks,
Prasanth
0 comentarios
Ver también
Categorías
Más información sobre Raspberry Pi Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!