Effacer les filtres
Effacer les filtres

PID Controller running on Arduino in a closed loop Simulink model not working?

14 vues (au cours des 30 derniers jours)
Michael Dsaachs
Michael Dsaachs le 4 Mai 2023
Réponse apportée : Vishwa le 18 Mai 2023
I have the following closed loop system.
The data is supposed to be passed to an Arduino running the PID Controller for the system, which is modeled separately.
I was under the impression that Build Deploy & Start would run this on the board continuously. When I run the system model I do not get the expected value at the post PID scope just 0 the whole time. I have tried placing the Arduino block diagram in the same closed loop model but that just times out the simulation. I've tried entering different value in the PID to see if anything changes, it doesn't the post PID signal remains 0.

Réponses (1)

Vishwa
Vishwa le 18 Mai 2023
Hi Micheal,
To monitor real-time data from the target hardware in Simulink, you need to configure “External Mode”, which can be found in “Hardware Settings > Hardware Implementation > Target hardware resources > External Mode”.
Next step is to run the model using “Monitor and Tune” rather than “Build and Deploy”. “Monitor and tune” will by default build and deploy the generated code and start fetching real-time data from the target.
For more information in Signal monitoring and tuning please refer the following documentation: Tune and Monitor Model Running on Hardware - MATLAB & Simulink - MathWorks India
For documentation on “External mode” please refer: External mode - MATLAB & Simulink - MathWorks India
Hope that helps!
Regards,
Vishwa

Catégories

En savoir plus sur Run on Target Hardware dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by