Matlab Cascaded Controller Code

0

Description

%% Initialize variables.
filename = 'D:\Thesis\Matlab\matlab_system_identification4.txt';
delimiter = '\t';
formatSpec = '%f%f%[^\n\r]';
%% Open the text file.
fileID = fopen(filename,'r');
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'ReturnOnError', false);
fclose(fileID);
x = dataArray{:, 1};
x=x/1000;
y = dataArray{:, 2};
%% Clear temporary variables
k=0.005;
J=0.0015;
c=.0022 + 9*k^2;
%% Cascaded controller
sys2=tf(9*k/c,[J/c 1])
%position controller
p_controller = pid(1.592,.01)
%velocity controller
v_controller = pid(0.3,0.01)
I=tf(1,[1,0]); %Integrator
W = feedback(sys2*v_controller,1)
figure
pzplot(W)
figure
rlocus(W *p_controller*I)
W = feedback(W *p_controller*I*1.96,1)
figure
step(W)
figure
pzplot(W)

https://matlab1.com/shop/matlab-code/matlab-proportional-controller-code/
https://matlab1.com/shop/matlab-code/matlab-and-microcontroller-code-for-controlling-air-conditioner/

Reviews

There are no reviews yet.

Be the first to review “Matlab Cascaded Controller Code”

Your email address will not be published. Required fields are marked *

SKU: addx018 Category: