Saving data on a multicore processed Simulink code on a Raspberry Pi 4

1 回表示 (過去 30 日間)
Pedro Henrique
Pedro Henrique 2023 年 11 月 22 日
回答済み: Samhitha 2025 年 3 月 24 日
I am working on a code that controls a robotic leg with a Raspberry Pi 4, and I am using Simulink to code it. I wanted to run the code with the four cores available and I achieved it with the help of the "Implement Multicore Programming with CPU Core Affinity for Raspberry Pi" tutorial.
In the process, thoguh, you have to "clear the MAT-file logging option", that disables the feature of saving data.
Question: Is there a way for me to bypass this and save the data I need?

回答 (1 件)

Samhitha
Samhitha 2025 年 3 月 24 日
In order to save the data, you can log the data while maintaining multicore processing on a Raspberry Pi 4 with Simulink, consider these two approaches:
  1. Logging via UDP: Implement a UDP Send block in the Simulink model to transmit data to a host computer for logging. The host can run a UDP server to receive and store the data, offloading logging from the Raspberry Pi.
  2. File-Based Logging with Reduced Frequency: Use ‘MATLAB Function’ block in Simulink to write data to a file on the Raspberry Pi. Reduce the logging frequency by using a counter to log data every few steps, minimizing performance impact.
Hope this helps!

カテゴリ

Help Center および File ExchangeRun on Target Hardware についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by