changing Kp value in a loop for PID tuning

Hello Everyone can someone help me with this error :
The following error occurred converting from pid to double:
Conversion to double from pid is not possible.
Kp = 1;
for i=1:3
C(:,:,i)= pid(Kp);
Kp = Kp + 10;
end
Thank you all

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 15 Mai 2020

0 votes

pidsys=pid(1) creats a PID controller. pidsys is an object with the class of 'pid'. You can run class(pidsys) or get(pidsys) to find out.
You seem to assign a PID controller to a numerical array C with double data type. That is the error message.

Community Treasure Hunt

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

Start Hunting!

Translated by