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

48 visualizaciones (últimos 30 días)
Abhigya Raval
Abhigya Raval el 13 de Oct. de 2020
Respondida: Prasanth Sunkara el 14 de Oct. de 2020
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!

Respuestas (1)

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

Categorías

Más información sobre Raspberry Pi Hardware en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by