image thumbnail

Simulation of Control Systems for a Mobile Robot Platform

by

 

Control design for Field Survey Mobile Robot using lead-lag compensation, PID and Fuzzy Logic

Simulation_Plots.m
% m-code number two

%==========================================================================
% Design and Simulation of Control Systems for a Field Survey Mobile Robot Platform using lead-lag compensation, PID and Fuzzy Logic
% To customize this code you need to:
% 1- Change the values of DC motor constants 
% 2- Change the zeros of lead-lag compensation
% 3- Change the gains of PID controller
% 4- Change the rules of Fuzzy logic controller
%==========================================================================

%++++++++++++++++++++++++++++++++++
%   July.29.2012, Ramin Shamshiri +
%   ramin.sh@ufl.edu              +
%   Dept of Ag & Bio Eng          +
%   University of Florida         +
%   Gainesville, Florida          +
%++++++++++++++++++++++++++++++++++

%% Simulation plots
%% Plot of simulation Errors
figure
subplot(3,1,1)
title('Plot of error')
plot(e_PID.time,e_PID.signals.values,'DisplayName','error PID') % PID error
hold on
plot(e_filter.time,e_filter.signals.values,'DisplayName','error lead-lag') % Filter error
hold on
plot(e_fuzzy.time,e_fuzzy.signals.values,'DisplayName','error fuzzy logic')  % Fuzzy logic error

subplot(3,1,1)
plot(de_fuzzy.time,de_fuzzy.signals.values,'DisplayName','Change of error fuzzy logic')  % Fuzzy logic error


%% Plot of simulation responses
subplot(3,1,2)
title('Plot of responses')
plot(r_source.time,r_source.signals.values,'DisplayName','Reference') % source signal
hold on
plot(r_PID.time,r_PID.signals.values,'DisplayName','Response PID') % PID response
hold on
plot(r_filter.time,r_filter.signals.values,'DisplayName','Response lead-lag') % Filter response
hold on
plot(r_fuzzy.time,r_fuzzy.signals.values,'DisplayName','Response fuzzy logic')  % Fuzzy logic response

%% Plot of simulation control
subplot(3,1,3)
title('Plot of control')
plot(c_PID.time,c_PID.signals.values,'DisplayName','PID Control') % PID Control
hold on
plot(c_filter.time,c_filter.signals.values,'DisplayName','lead-lag control') % Filter Control
hold on
plot(c_fuzzy.time,c_fuzzy.signals.values,'DisplayName','fuzzy logic control')  % Fuzzy logic Control

Contact us