data transfer to matlab workspace by running the simulink control logic in Arduino due hardware

3 visualizaciones (últimos 30 días)
Hello,
I am using Arduino due with control block diagram in simulink to control the speed of DC motor. I want to run the control loop completely in hardware (i.e., After uploading the simulink file, entire calculation should be done in Arduino board, NOT in simulink), and I want to save the data in matlab workspace.
Please suggest me how can I do the same.
Thanks in advance!

Respuesta aceptada

Manikanta Aditya
Manikanta Aditya el 17 de Mzo. de 2023
Hi Aakash,
As per my understanding, you are using an Arduino Due and you want to run your complete control loop in hardware and save the data to MATLAB workspace.
You can create the Control System on Simulink with Control System Toolbox blocks and then use Simulink Support Package for Arduino Hardware to generate code. Once code is generated you can run the code on Arduino, and then the control loop will run completely on the hardware.
To save data to MATLAB Workspace, you can use the MATLAB Support Package for Arduino Hardware. In MATLAB, you can create a new MATLAB script and use ‘arduino’ function to create Arduino object and use ‘readVoltage’ function to read the data from Arduino board. You can then store the data to MATLAB Workspace using ‘assignin’ function.
For further reference, please go through these links:
From this link, you can check the Arduino integration with MATLAB and Simulink:
From these links, you can learn more about ‘assignin’ and ‘readVoltage’ functions:
I hope this resolves the issue you are facing.

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by