I'm doing this transfer function routine but I can't get G, what's wrong?
% servo motor data
% Ra, armor resistance [Ohms]
Ra = 0.34;
% La, armature inductance [H]
La = 0.007;
% Ia, current in the armature [A]
Ia = 8;
% J, motor and load moment of inertia, referring to the motor axis [kg m2]
J = 63.9 * 10 ^ -4;
% C, viscous damping coefficient of the motor and load, referring to the motor shaft [Nms / rad]
C = 18400;
% T, torque developed by the motor [Nm]
T = 1.59;
% kb, generator constant
% [V.s / rad]
kb = 314;
% k, motor constant [Nm / A]
k = 0.19785;
% transfer function calculation:
% motor gain value, km:
Km = k / Ra * C + k * kb
% value of the motor time constant, Tm:
Tm = (Ra * J / (Ra * C + k * kb))
% Transfer function, G (x)
G = Km / (s * (Tm * s +1))
I get this message:
Undefined function or variable 's'.
Error in Untitled2 (line 25)
G = Km / (s * (Tm * s +1))

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 20 日

0 投票

's' is not defined by default in MATLAB. You need Control system toolbox to create a transfer function. Change the last part of your code to
% Transfer function, G (x)
s = tf('s');
G = Km / (s * (Tm * s +1))

4 件のコメント

Joaquim Lima
Joaquim Lima 2020 年 11 月 20 日
Error: File: Untitled2.m Line: 25 Column: 7
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To
construct matrices, use brackets instead of parentheses.
Joaquim Lima
Joaquim Lima 2020 年 11 月 20 日
Perfect, it worked, Thanks !!!!
Joaquim Lima
Joaquim Lima 2020 年 11 月 20 日
Please qaul the function to generate the graph?
Ameer Hamza
Ameer Hamza 2020 年 11 月 20 日
What type of graph? See bode() function for bode plot of transfer function.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEngines & Motors についてさらに検索

製品

リリース

R2018a

質問済み:

2020 年 11 月 20 日

コメント済み:

2020 年 11 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by