⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trans_func_ip_uc.m

📁 把控制倒立摆的matlab文件不上去
💻 M
字号:
%--------------------------------------------------------------------------------------------
% trans_func_ip_uc.m
% Design and Development of Closed Loop Control for INVERTED PENDULUM
% By IIEE Visionaries
% Copyright 2003
% Open Loop & Closed Loop (Uncompensated) Transfer Function of the Inverted Pendulum System
%--------------------------------------------------------------------------------------------
%
%                 E(s)         U(s)             
%       Vpot --->O--->[ G2(s) ]--->[ G1(s) ]---+---> Theta (s)
%              - ^                             |                
%                |                             |            Theta = SYS * E
%                +----------[ H(s) ]<----------+
%                  V viper

% ip_data is a MAT File (MATLAB specific binary file), 
% with variables I, Kf, Km, Lp, M, b, g, l, m, r, tau  
%-----------------------------------------------------------------------------
% data_ip.m
% Design and Development of Closed Loop Control for INVERTED PENDULUM
% By IIEE Visionaries
% Copyright 2003
% Data of the Inverted Pendulum System
%-----------------------------------------------------------------------------

% Mass of the Cart = 900 gm	
M = 0.9;        % in Kg
% Mass of the Pendulum = 100 gm
m = 0.1;        % in Kg
% Length of Pendulum = 47 cm
Lp = 0.47;      % in m 
% Length of pendulum to Center of Gravity = 23.5 cm
l = 0.235;      % in m
% Moment of Inertia  of Pendulum = 5.3 gm-m^2
I = 0.0053;     % in Kg.m^2
% Radius of Pulley = 2.3 cm
r = 0.023;      % in m
% Time Constant of Motor = 0.5 second
tau = 0.5;      % in seconds
% Gain of Feedback = 9/pi V/rad/sec
Kf = 2.8648;    % in V/rad/sec
% Gain of Motor = 17 rad/sec/V
Km =17;         % in rad/sec/V
% Friction of the Cart = 0.000 N/m/sec
b = 0;          % in N/m/sec
% Acceleration due to Gravity = 9.8 m/sec^2
g = 9.8;        % in m/sec^2

Kp = 1 / ((M + m) * g);
K  = Kf * Kp * Km * r * (M + m);
Ap = sqrt ((M + m) * m * g * l / ((M + m)*(I + (m * (l ^ 2)))- ((m * l)^2)));

% G1(s) = Theta(s) / U(s)
% ? represents a small angle from the vertical upward direction, 
% u represents the input (impulse) force on the cart by pulley chain mechanism.
num_Th_U = [0 0 Kp];
den_Th_U = [Ap^(-2) 0 -1];
Th_U = tf (num_Th_U, den_Th_U);

% G2(s) = U(s) / E(s)
% u represents the input force on the cart by the pulley chain mechanism, 
% e represents the input to the motor driving pulley-chain mechanism.
num_U_E = [((Km * (M + m))*r) 0];
den_U_E = [tau 1];
U_E = tf (num_U_E, den_U_E);

disp ' '
% G(s) = Theta(s) / E(s)
% Forward Transfer Function (Open Loop Without Feedback)
num_G = conv (num_U_E, num_Th_U);
den_G = conv (den_U_E, den_Th_U);
disp 'Forward Path Transfer Function of Inverted Pendulum System is:'
G = series (U_E, Th_U)

% H(s) (Feedback)
num_H = Kf;
den_H = 1;
H = tf (num_H, den_H);

% Closed Loop Transfer Function of Uncompensated System
% Gc(s) = G(s) / (1 + G(s) * H(s))
disp 'Closed Loop Transfer Function of Inverted Pendulum System is:'
Gc = feedback (G, H)

% GH(s)
% Open Loop Transfer Function
GH = series (G, H);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -