How to properly set up my Transfer function
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시

syms s
J1 = 0.0024;
C1 = 0.007;
K12 = 2.8;
a = 0;
z = 1;
b = 1;
p = 1;
Kc = .1;
Kh = ((16000)*(1/(2*pi))*(32));
Ka = (10/32768)*2*0.1*3;
Gn = (Kh*Ka)/J1
Gd = s^2 + (C1/J1)*s + K12/J1
Cn = Kc*(a*s+z)
Cd = (b*s+p);
% Cs = Cn/Cd;
num = [Cn * Gn]
dem1 = Cd*Gd
dem2 = Cn * Gn
dem = (dem1 + dem2)
% Tf = num/(dem1 + dem2)
sys = tf(num,dem)
step(10000*sys)
채택된 답변
Reshma Nerella
2020년 11월 10일
Hi,
The numerator and denominator coefficients of transfer function should be a row vector or a cell array of row vectors. In the above of code
num = [Cn * Gn]
>> 6835652755764317/10995116277760
class(num)
>> 'sym'
You need to convert 'num' to a vector.
dem = (dem1 + dem2)
>> (s + 1)*(s^2 + (35*s)/12 + 3500/3) + 6835652755764317/10995116277760
class(dem)
>> 'sym'
Convert 'dem' to a vector of polynomial coefficients.
For example,
sys(s)=1/(2s2+3s+4);
Specify the numerator and denominator coefficients ordered in descending powers of s, and create the transfer function model.
numerator = 1;
denominator = [2,3,4];
sys = tf(numerator,denominator)
sys =
1
---------------
2 s^2 + 3 s + 4
%Continuous-time transfer function.
댓글 수: 7
Is that what class(num) and class(dem) do? So I also need to add the "sys" after each of them?
So I was able to refine my code with your help and ended up with something that looks and provides the correct transfer functions. However I know what when p = -.5 or -.1 my sys should explode and become unstable. However, right now when I plot it, it doesnt really grow exponentially. I cant figure out why.
syms s
J1 = 0.0024;
C1 = 0.007;
K12 = 2.8;
a = 0;
z = 1;
b = 1;
p = -.1;
Kc = .1;
Kh = ((16000)*(1/(2*pi))*(32));
Ka = (10/32768)*2*0.1*3;
%plant Transfer Function
numg = [(Kh*Ka)/J1];
demg = [1 (C1/J1) (K12/J1)];
%Controller Transfer Function.
numc = [Kc*a z*Kc];
demc = [b p];
%verying that they are correct.
sysg = tf(numg,demg)
sysc = tf(numc,demc)
%Combining them
Tfnum = conv(numc,numg);
% Tfd= conv(demc,demg) + Tfnum
Tfdem = [1 (2.916+p) (2.916*p+1166.67) (1166.67*p+627.7)];
TF = tf(Tfnum,Tfdem);
step(10000*TF)
Why do you think that p = -0.1 and p = -0.5 should make the system unstable, when using all of your other parameters?
I don't think the equation for Tfdem is quite correct. Instead of trying to do it by hand, you can get the closed loop transfer function directly:
TF = feedback(sysc*sysg,1)
really? I didn't know I was able to do this. Let me give it a shot.
Thank you for the advise. I do have one more question. How do I go about finding the zeros, poles, and gains. Ive tried doing
rlocus(TF)
and just clicking on the information. Ive also tried
[z,p,k] = zpkdata(TF)
but I cannot access the data.
zpkdata returns z and p in cell arrays; they need to be accessed as such:
>> TF=feedback(sysc*sysg,1)
TF =
621.7
------------------------------
s^3 + 2.817 s^2 + 1166 s + 505
>> [z,p,k]=zpkdata(TF);
>> z{:}
ans =
0×1 empty double column vector
>> p{:}
ans =
-1.1916 +34.1163i
-1.1916 -34.1163i
-0.4334 + 0.0000i
>> k
k =
621.6990
Thank you very much. You were very hepful
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Control System Toolbox에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
