Raspberry Pi I/O with SIMULINK Model in real-time

조회 수: 36 (최근 30일)
Abhigya Raval
Abhigya Raval 2020년 10월 13일
답변: Prasanth Sunkara 2020년 10월 14일
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!

답변 (1개)

Prasanth Sunkara
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
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

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by