i have problem with tuning pid 2dof on simulink

2 views (last 30 days)
alaa
alaa on 27 Dec 2023
Answered: Shubham on 17 Jan 2024
every time i try to run the tuning code i get this error but idk why
TunedBlocks ={'PD1','PD2','PD3'};
ST0 = slTuner('Assem1',TunedBlocks);
Warning: The slTuner object is created but the model "Assem1" does not exist; thus you are not going to be able to use this object properly.
addpoint={ST0,TunedBlocks};
addpoint={ST0,'Robot/qm'};
Refsignals ={...
'Assem1/invers/t1','Assem1/invers/t2','Assem1/invers/t3'};
addpoint={ST0,Refsignals};
controls =TunedBlocks;
Measurments ='Assem1/Robot/qm';
options= looptuneOptions('RandomStart',80','UseParallel',true);
TR=TuningGoal.StepTracking(Refsignals,Measurments,0.05,0);
ST1=looptune(ST0,controls,Measurments,TR,options);
Error using slTuner/looptune
To use "looptune" command, there should be at least one block specified to be tuned. Use addBlock method to add one or more blocks.
writeBlockvalue(ST1);

Answers (1)

Shubham
Shubham on 17 Jan 2024
Hey Alaa,
It seems that you require help in tuning the Simulink model.
The warning message being produced indicates that the model "Assem1" does not exist. Since the “Assem1.slx” file is visible in the attached image, I would assume that the error is because the model is not loaded properly.
Please check that the model is present in the same directory as that of the MATLAB script you are using. Use the following command to open your model:
open_system('Assem1');
Please check that the syntax for adding the signal for analysis is incorrect. Try using the “addPointfunction:
addPoint(ST0, Refsignals);
Also note that the error while using the “looptune” is also linked to the previous warning. Since the model "Assem1" does not exist, the slTuner object cannot find any blocks to tune, which is required for the looptune command to work.
Please refer to the MathWorks documentation "slTuner Interface to Simulink Model" to configure the model:
Please refer to the following example for the "looptune" function.:
Hope this helps.

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!