How to find this parameters..?

[k,ku,pu]=znpidtuning(G,2)
T=1;
G=tf(3.24,[15.23*T 1]);
k=znpidtuning(G,2);
C=k.kc*(1+tf(1,[k.ti 0])); % the PI-controller
H=minreal(feedback(ss(G*C),1)); % the closed loop transfer function
[Gm,Pm,Wcg]=margin(G);
ku=Gm;
pu=2*pi/Wcg;
k.kc=ku/1.7;
k.ti=pu/2;
k.td=pu/8;
Hi i have made this as a finction znpidtuning But it shows undefined.. So how to solve it..? please help..

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 9일

0 개 추천

Check if your function is in the current folder
dir znpidtuning.m

댓글 수: 7

Ok.. It shows in folder..
When i am running code then The error is
Error in ==> znpidtuning at
k=znpidtuning(G,2);
I am using function as function
[k,ku,pu]=znpidtuning(G,2)
and my G is
G=tf(3.24,[15.23*T 1])
Ok, znpidtuning is a FEX function. Then why are you writing
function [k,ku,pu]=znpidtuning(G,2)
You should write
[k,ku,pu]=znpidtuning(G,2)
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 9일
But it seems that this function is not working well
??? Attempt to execute SCRIPT znpidtuning as a function:
C:\Users\admin\Documents\MATLAB\code\znpidtuning.m
I change my script as your saying, but when i type
[k,ku,pu]=znpidtuning(G,2)
in command window it shows error as above..
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 9일
If you have a Control System Toolbox, use the pidtool
pankajkumar
pankajkumar 2013년 3월 9일
No, i am using older version of matlab but i want to do tuning using my own code.. Thats why i require correction..
Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 9일
But znpidtuning is not your own code

댓글을 달려면 로그인하십시오.

카테고리

질문:

2013년 3월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by