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

📄 trans_func_ip_comp.m

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

% func_ip_uc is a MAT File (MATLAB specific binary file), 
% with variables G, GH, Gc, H, Th_U, U_E, num_G, den_G
load func_ip_uc

% C(s) = ( Kd * s^2 + Kp * s + Ki ) / s
% PID Controller to reshape the root locus.
Kp = 20;
Ki = 100;
Kd = 1;
Kc = 1;
num_PID = Kc * [Kd Kp Ki];
den_PID = [1 0];
disp ('The transfer function of the PID Controller is:')
PID = tf (num_PID, den_PID)

% G_comp(s) = PID(s) * G(s)
% Overall Forward Transfer Function.
num_Gcomp = conv (num_PID, num_G);
den_Gcomp = conv (den_PID, den_G);
G_comp = series (PID, G);

% Open Loop Transfer Function of the Compensated System
% G_comp_H(s) = G_comp(s) * H(s)
G_comp_H = series (G_comp, H);

% Closed-Loop Transfer Function of the Compensated System
% Gc_comp
disp 'Closed Loop Transfer Function of the Compensated Inverted Pendulum System is:'
Gc_comp = feedback (G_comp, H)

% DC Gain
disp ('The DC Gain of the Closed Loop Compensated Inverted Pendulum System is:')
disp (dcgain (Gc_comp))

⌨️ 快捷键说明

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