How can I pass GUI data to simulink?

1 次查看(过去 30 天)
I'm designing a GUI to calculate PID parameters using Ziegler-Nichols, Cohen_Coon and so on. This GUI calculate the parameters and display it, I'd like to send the result values to a PID Controller block on simulink. I'v read about set_param function but I don't know how to use it actually.

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-9-5
编辑:Azzi Abdelmalek 2012-9-5
the best way is set_param, and it's simple
if your moel name is 'ModelName', and an PID Controller name is 'PID Controller' (name by default) then if your parameters are Kp, Ti ad TD
set_param('ModelName/PID Controller','P',num2str(Kp)) %Proportional action
set_param('ModelName/PID Controller','I',num2str(Ti)) %Integral action
set_param('ModelName/PID Controller','D',num2str(Td)) %Derivative action

类别

Help CenterFile Exchange 中查找有关 PID Controller Tuning 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by