Raspberry Pi I/O with SIMULINK Model in real-time
37 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Prasanth Sunkara
2020-10-14
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Raspberry Pi Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!