• No se han encontrado resultados

Capítulo 4 Simulaciones y grafícas de respuesta

5.1 Beneficio por objetivos

Logrando desarrollar las simulaciones y presentar las gráficas resultantes, en este capítulo se presentan nuevamente los objetivos particulares del capítulo uno, detallando en el beneficio adquirido al cumplir con los objetivos propuestos al inicio del presente trabajo de investigación. El objetivo de establecer el diseño de un controlador neurodifuso para un motor BLDC se alcanzó con el modelo ANFIS entrenado con la información obtenida de la planta o motor

BLDC tipo III (figura 3.10). Con esto se tiene un modelo ANFIS o sistema neurodifuso capaz de implementarse en una estructura de control de manera efectiva como se realizó y se aprecia en la figura 4.11. Tomando los objetivos particulares del primer capítulo tenemos los siguientes resultados:

El segundo capítulo de este trabajo de tesis cumple con el objetivo del Aprendizaje de técnicas de control y herramientas de inteligencia artificial para el diseño de controladores.

El diagrama a bloques presentado en la figura 4.11 es resultado de la Modelación del controlador para motor BLDC. Incluyendo las mejores técnicas de las herramientas redes neuronales y lógica difusa de inteligencia artificial.

El capítulo cuatro es un compendio, en el que se plantean las Simulaciones a lazo abierto, con el controlador neurodifuso y con un controlador PI para un motor BLDC.

Con las figuras 4.12 a la 4.15 y C.12 a la C.16, resultado de las simulaciones con los casos de experimentación propuestos y desarrollados en este trabajo de tesis, se comprueba el aprendizaje del controlador a través de experimentación con simulaciones.

5.2 Tablas de Resultados

En el desarrollo del presente se pueden dar como resultado dos tablas, en las cuales se puede ver las características adquiridas por ANFIS al ser la unión de lógica difusa y redes neuronales, y comparación del ANFIS en relación con el controlador PI. La tabla 5.1 contiene las bondades que se tienen con ANFIS tomándolas de las técnicas de IA establecidas.

Se aprecia en la tabla 5.1, que las dos técnicas de IA se pueden utilizar con las no-lineales de un sistema o planta, dato que se puede congnotar en el capítulo tres. Lógica difusa y redes neuronales son dos metodologías que tienen una propia forma de base de conocimiento,

red neuronal de retropropagación y la capacidad de manejo de variables lingüísticas que proporcionan robustez al sistema fue dote de lógica difusa en forma del modelo Takagi- Sugeno.

La Tabla 5.2 es una relación establecida entre el PI y el ANFIS tomada de los casos de simulación realizados en el capítulo cuatro. Se puede ver un tiempo de respuesta promedio de 0.015 seg (figuras 4.12 a la 4.15), para ambos controladores. Los cambios de par mecánico presentados para ambos controladores, hacen notar que el controlador neurodifuso ANFIS presentó una mejor respuesta ante la carga mecánica (figuras 4.12 a las 4.15). El punto de cambio de la resistencia del estator de 0.5Ω a 0.05Ω esta dictado por el comportamiento del motor BLDC, conservando sus características para una simulación de un motor real [7]. Aquí ambos controles mostraron una misma respuesta ante el cambio de la resistencia, pero se hace notar que el ANFIS tuvo una mayor capacidad de seguimiento con respecto al PI (figuras 4.12 a la 4.15). Con esto se ratifica la postura de diferentes autores [4, 9, 17, 21]a la hipótesis planteada en la presente tesis. Llegando a una conclusión.

5.3 Conclusión

El estudio de controladores es un área muy productiva, donde el uso de controladores con redes neuronales se hace notar como una manera efectiva de solución donde se requiera control de plantas con una alta no-linealidad y el control convencional resulta ser ineficiente. Citando los resultados en dos partes, tenemos:

El controlador PI se estructuró basándose en la literatura [10] para obtener el modelo de control óptimo de este tipo de motor BLDC de quinto orden no-lineal, (figura 4.10) las capacidades de control del PI son de un excelente tiempo de respuesta en el arranque del motor considerando carga nominal y puede resistir cambios de par mecánico a través del tiempo (se puede apreciar en las figuras C.7 a la figura C.11

del Apéndice C). Es sensible a tener par mecánico desde el arranque y a cambios de referencia del motor, (respuestas gráficas de las figuras C.9 y C.11). Presenta una respuesta favorable a cambios de la resistencia del estator en las tres fases as, bs y cs, (tabla 5.2). Se analizó para esta conclusión, el cambio en el comportamiento de las respuestas graficadas de mismas características (figuras C.8 a la C.11), sólo con cambio de resistencia del estator. El PI en su control presenta intervalos críticamente estables (Un controlador PI no presenta efecto timbre) en el voltaje y corriente del motor BLDC los cuales son perjudiciales a la vida útil de este.

El controlador ANFIS para el motor BLDC tipo III del presente escrito se modeló con tres entradas y una salida (figura 4.11) teniendo como resultado en términos generales, una mayor capacidad de control respecto al control PI. Entendiendo así que la implantación de redes neuronales y lógica difusa (ANFIS) se vuelve más confiable en casos de una alta no-linealidad del sistema. El tiempo de respuesta del control ANFIS es en promedio igual que al PI, considerándose excelente (En promedio 0.015 seg ). ANFIS mostró un mayor seguimiento de la referencia y robustez ante el cambio de par mecánico en el arranque y a través del tiempo (figura 4.12 a la 4.15). El tiempo de aprendizaje tomado por el controlador ANFIS es proporcional al tamaño de los pares entrada salida de entrenamiento o información del sistema y el numero de épocas a realizar, estas ultimas se pueden considerar como repeticiones realizadas con la información para un mejor entrenamiento de la RNA. El controlador neurodifuso resulta tener mejor desempeño ante las variaciones de par mecánico que experimente la planta (figura 4.14 y 4.15). Otro factor importante que se puede enunciar en este punto es que ANFIS no presenta variaciones perjudiciales a la vida útil del motor como se presentan en el control PI. Las capacidades conjuntas como la base de conocimiento con variables lingüísticas de la lógica difusa y las habilidades de aprendizaje de la red neuronal dieron una utilidad mayor de la esperada, al aplicar control en la planta elegida indiferentemente de la resistencia del estator que esta contenga de 0.5 ó 0.05 Ω (figuras 4.12 a la 4.15). Esto permite una estandarización de un diseño de control para toda una línea de motores de característica similares o mas propiamente en sus valores de resistencia del estator. Además elimina un entrenamiento individual de cada controlador ANFIS a utilizar en la línea de motores a controlar.

Como trabajo futuro de los resultados obtenidos, se puede considerar el llevar a plano físico el controlador propuesto aquí. Se puede aplicar ANFIS en el control del brazo robótico F3 para el desarrollo de alguna tarea específica, esperando buenos resultados. Por último se puede extender el área de investigación a motores BLDC Tipo II y Tipo I. Como una última nota en el desarrollo de esta investigación se percibió como las redes neurodifusas aplicadas

Apendice A

Entrenamiento ANFIS

Para información mas detallada sobre este codigo consulte la literartura [13]

function fis = genfis1(data, mf_n, in_mf_type, output_type) % GENFIS1 Generates a Sugeno-type FIS structure used in ANFIS % Synopsis

% fismat = genfis1(data)

% fismat = genfis1(data,numMFs,inmftype, outmftype) % Description

% genfis1 generates a Sugeno-type FIS structure

% (initialization of the membership function parameters) anfis trn %

% genfis1(data, numMFs, inmftype, outmftype) generates a FIS

% structure from a

% training data set, data, using a grid partition on the data (no % clustering). The output membership functions FIS

% The arguments for genfis1 are as follows:

% data is the training data matrix, which must be entered with all % the last column representing input data, and the last column % representing the single output.

% numMFs is a vector whose coordinates specify the number of

% membership functions associated with each input. If you want the % same number of membership functions to be associated with each % input, then it suffices to

% make numMFs a single number.

% inmftype is a string array in which each row specifies the

% membership function type associated with each input. Again, this % can be one dimensional single string if the type of membership % functions associated with each input is the same.

% outmftype is a string that specifies the membership function % type associated with the output. There can only be one output, % since this is a

% Sugeno-type system. The output membership function type must be % either linear or constant.

% the same as the number of rules generated by genfis1. The % default number of membership functions, numMFs, is 2; the % default input or output membership function type is ‘gbellmf’. % These are used whenever genfis1 is invoked without the last % three arguments.

% Example

% data = [rand(10,1) 10*rand(10,1)-5 rand(10,1)]; % numMFs = [3 7]; % mfType = str2mat(‘pimf’,’trimf’); % fismat = genfis1(data,numMFs,mfType); % [x,mf] = plotmf(fismat,’input’,1); % subplot(2,1,1), plot(x,mf); % xlabel(‘input 1 (pimf)’); % [x,mf] = plotmf(fismat,’input’,2); % subplot(2,1,2), plot(x,mf); % xlabel(‘input 2 (trimf)’); %

% See also GENFIS2 ANFIS

% Roger Jang, 8-7-94, Kelly Liu 7-30-96

% Copyright (c) 1994-98 by The MathWorks, Inc. % $Revision: 1.20 $ $Date: 1998/05/06 16:02:31 $ % Change this to have different default values default_mf_n = 2; default_mf_type = ‘gbellmf’; default_output_type = ‘linear’; if nargin <= 3, output_type = default_output_type; end if nargin <= 2, in_mf_type = default_mf_type; end if nargin <= 1, mf_n = default_mf_n; end

% get dimension info data_n = size(data, 1); in_n = size(data, 2) - 1; % error checking if length(mf_n)==1, mf_n=mf_n*ones(1, in_n); end

if length(mf_n) ~= in_n | (size(in_mf_type, 1) ~=1 & size(in_mf_type, 1) ~= in_n),

end rule_n = prod(mf_n); fis.name = ‘anfis’; fis.type = ‘sugeno’; fis.andMethod = ‘prod’; fis.orMethod = ‘max’; fis.defuzzMethod = ‘wtaver’; fis.impMethod = ‘prod’; fis.aggMethod = ‘max’;

range = [min(data)’ max(data)’];

in_mf_param = genparam(data, mf_n, in_mf_type); k=1;

for i = 1:in_n,

fis.input(i).name = [‘input’ num2str(i)]; fis.input(i).range=range(i,:);

for j=1:mf_n(i)

MFType = deblank(in_mf_type(i, :));

fis.input(i).mf(j).name = [‘in’ num2str(i) ‘mf’ num2str(j)]; fis.input(i).mf(j).type = MFType;

if strcmp(MFType,’gaussmf’) | strcmp(MFType,’sigmf’) ... | strcmp(MFType,’smf’),

fis.input(i).mf(j).params= in_mf_param(k,1:2);

elseif strcmp(MFType,’trimf’) | strcmp(MFType,’gbellmf’), fis.input(i).mf(j).params= in_mf_param(k,1:3); else fis.input(i).mf(j).params= in_mf_param(k,1:4); end k=k+1; end end fis.output(1).name=’output’; fis.output(1).range=range(end,:); for i = 1:rule_n, fis.output(1).mf(i).name=[‘out1mf’, num2str(i)]; fis.output(1).mf(i).type=output_type; if (strcmp(output_type, ‘linear’)==1) fis.output(1).mf(i).params=zeros(1, in_n+1);

else

fis.output(1).mf(i).params=[0]; end

end

rule_list = zeros(rule_n, length(mf_n)); for i = 0:rule_n-1, tmp = i; for j = length(mf_n):-1:1, rule_list(i+1, j) = rem(tmp, mf_n(j))+1; tmp = fix(tmp/mf_n(j)); end end

rule_list = [rule_list (1:rule_n)’ ones(rule_n, 1) ones(rule_n, 1)]; fis.rule=[];

Apendice B

Algoritmo ANFIS

En la literartura [13] puede ampliar en el conocimiento de siguiente código.

function [t_fismat, t_error, stepsize, c_fismat, c_error] ... = anfis(trn_data, in_fismat, t_opt, d_opt, chk_data, method) %ANFIS Training routine for Sugeno-type FIS (MEX only).

% Synopsis % [fismat,error1,stepsize] = anfis(trnData) % [fismat,error1,stepsize] = anfis(trnData,fismat) % [fismat1,error1,stepsize] = ... % anfis(trnData,fismat,trnOpt,dispOpt) % [fismat1,error1,stepsize,fismat2,error2] = ... % anfis(trnData,fismat, trnOpt,dispOpt,chkData) % [fismat1,error1,stepsize,fismat2,error2] = ... % anfis(trnData,fismat, trnOpt,dispOpt,chkData,optMethod) % % Description

% This is the major training routine for Sugeno-type fuzzy % inference systems.

% anfis uses a hybrid learning algorithm to identify parameters of % Sugeno-type fuzzy inference systems. It applies a combination of % the least-squares method and the backpropagation gradient

% descent method for training FIS membership function parameters % to emulate a given training data set. anfis can also be invoked % using an optional argument for model

% validation. The type of model validation that takes place with % this option is a checking for model overfitting, and the

% argument is a data set called the checking data set.

% The arguments in the above description for anfis are as follows: % trnData: the name of a training data set. This is a matrix with % all but the last column containing input data, while the last % column contains a single vector of output data.

% fismat: the name of an FIS, (fuzzy inference system) used to % provide anfis with an initial set of membership functions for % training. Without this option, anfis will use genfis1 to

% implement a default initial FIS for training. This default FIS % will have two membership functions of the Gaussian type, when % invoked with only one argument. If fismat is provided as a % single number (or a vector), it is taken as the number of % membership functions (or the vector whose entries are the % respective numbers of membership functions associated with each % respective input, when these numbers differ for each input). In % this case, both arguments of anfis are passed to genfis1 to % generate a valid FIS matrix before starting the training % process.

% trnOpt: vector of training options. When any training option is % entered as NaN the default options will be in force. These % options are as follows:

% trnOpt(1): training epoch number (default: 10) % trnOpt(2): training error goal (default: 0) % trnOpt(3): initial step size (default: 0.01) % trnOpt(4): step size decrease rate (default: 0.9) % trnOpt(5): step size increase rate (default: 1.1)

% dispOpt: vector of display options that specify what message to % display in the MATLAB command window during training. The

% default value for any display option is 1, which means the % corresponding information is displayed. A 0 means the % corresponding information is not displayed on the

% screen. When any display option is entered as NaN, the default % options will be in force. These options are as follows:

% dispOpt(1): ANFIS information, such as numbers of input and output

% membership functions, and so on (default: 1) % dispOpt(2): error (default: 1)

% dispOpt(3): step size at each parameter update (default: 1) % dispOpt(4): final results (default: 1)

% chkData: the name of an optional checking data set for % overfitting model

% validation. This data set is a matrix in the same format as the % training data set.

% optMethod: optional optimization method used in membership

% function parameter training: either 1 for the hybrid method or 0 % for the backpropagation method. The default method is the hybrid % method, which is a combination of least squares estimation with % backpropagation. The default method is invoked whenever the % entry for this argument is anything but 0.

% The training process stops whenever the designated epoch number % is reached or the training error goal is achieved.

% Note on anfis arguments:

% When anfis is invoked with two or more arguments, any optional % arguments will take on their default values if they are entered % as NaNs or empty matrices. Default values can be changed

% directly by modifying the file anfis.m. NaNs or empty matrices % must be used as place-holders for variables

% to a minimum training error criterion.

% error1 or error2 is an array of root mean squared errors, % representing the training data error signal and the checking % data error signal, respectively.

% stepsize is an array of step sizes. The step size is decreased % (by multiplying it with the component of the training option % corresponding to the step size decrease rate) if the error % measure undergoes two consecutive

% combinations of an increase followed by a decrease. The step % size is increased (by multiplying it with the increase rate) if % the error measure undergoes four consecutive decreases.

% fismat2 is the FIS structure whose parametes are set according % to a minimum checking error criterion.

% Example % x = (0:0.1:10)’; % y = sin(2*x)./exp(x/5); % trnData = [x y]; % numMFs = 5; % mfType = ‘gbellmf’; % epoch_n = 20; % in_fismat = genfis1(trnData,numMFs,mfType); % out_fismat = anfis(trnData,in_fismat,20); % plot(x,y,x,evalfis(x,out_fismat));

% legend(‘Training Data’,’ANFIS Output’); %

% References %

% Jang, J.-S. R., “Fuzzy Modeling Using Generalized Neural % Networks and Kalman Filter Algorithm,” Proc. of the Ninth % National Conf. on Artificial

% Intelligence (AAAI-91), pp. 762-767, July 1991.

% Jang, J.-S. R., “ANFIS: Adaptive-Network-based Fuzzy Inference % Systems,” IEEE Transactions on Systems, Man, and Cybernetics, % Vol. 23, No. 3, pp. 665-685, May 1993.

%

% See also GENFIS1, ANFISEDIT %

% Roger Jang, 9-12-94. Kelly Liu, 10-10-97 % Copyright (c) 1994-98 by The MathWorks, Inc. % $Revision: 1.24 $ $Date: 1998/08/10 18:58:17 $

if nargin > 6 & nargin < 1,

error(‘Too many or too few input arguments!’); end

% Change the following to set default train options. default_t_opt = [10; % training epoch number 0; % training error goal

0.01; % initial step size

0.9; % step size decrease rate 1.1]; % step size increase rate

% Change the following to set default display options. default_d_opt = [1; % display ANFIS information

1; % display error measure 1; % display step size 1]; % display final result

% Change the following to set default MF type and numbers default_mf_type = ‘gbellmf’; % default MF type

default_outmf_type=’linear’; default_mf_number = 2; if nargin <= 5, method = 1; end if nargin <= 4, chk_data = []; end if nargin <= 3, d_opt = default_d_opt; end if nargin <= 2, t_opt = default_t_opt; end if nargin <= 1, in_fismat = default_mf_number; end

% If fismat, d_opt or t_opt are nan’s or []’s, replace them with default settings

if isempty(in_fismat)

in_fismat = default_mf_number;

elseif ~isstruct(in_fismat) & length(in_fismat) == 1 & isnan(in_fismat),

in_fismat = default_mf_number; end

if isempty(t_opt),

t_opt = default_t_opt;

elseif length(t_opt) == 1 & isnan(t_opt), t_opt = default_t_opt;

if isempty(method) method = 1;

elseif length(method) == 1 & isnan(method), method = 1;

elseif method>1 |method<0 method =1;

end

% If d_opt or t_opt is not fully specified, pad it with default values. if length(t_opt) < 5, tmp = default_t_opt; tmp(1:length(t_opt)) = t_opt; t_opt = tmp; end if length(d_opt) < 5, tmp = default_d_opt; tmp(1:length(d_opt)) = d_opt; d_opt = tmp; end

% If entries of d_opt or t_opt are nan’s, replace them with default settings

nan_index = find(isnan(d_opt)==1);

d_opt(nan_index) = default_d_opt(nan_index); nan_index = find(isnan(t_opt)==1);

t_opt(nan_index) = default_t_opt(nan_index); % Generate FIS matrix if necessary

% in_fismat is a single number or a vector if class(in_fismat) ~= ‘struct’,

in_fismat = genfis1(trn_data, in_fismat, default_mf_type); end

% More input/output argument checking if nargin <= 4 & nargout > 3,

error(‘Too many output arguments!’); end

if length(t_opt) ~= 5,

error(‘Wrong length of t_opt!’); end

if length(d_opt) ~= 4,

error(‘Wrong length of d_opt!’); end

% Start the real thing! if nargout == 0,

anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method); elseif nargout == 1,

[t_fismat] = ...

anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method);

elseif nargout == 2,

[t_fismat, t_error] = ...

anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method);

elseif nargout == 3,

[t_fismat, t_error, stepsize] = ...

anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method);

elseif nargout == 4,

[t_fismat, t_error, stepsize, c_fismat] = ...

anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method);

elseif nargout == 5,

[t_fismat, t_error, stepsize, c_fismat, c_error] = ... anfismex(trn_data, in_fismat, t_opt, d_opt, chk_data, method);

else

error(‘Too many output arguments!’); end

Bibliografía

[1] A. Rubaai, Raj Kotaru "Neural net-based robust controller design for brushless dc motor drives" IEEE Trans on systems, Man and Cybernetics 29(3):460-474. 1999.

[2] Benjamin C. Kuo "Automatic control systems",Ed: Prentice-Hall, Englewood Cliffs, 1975.

[3] Boosley, K.M. "Neurofuzzy Modelling Approaches in System Identification". University of Southampton. 1998.

[4] D. Driankov, H. Hellendoorn, M. Reinfrank "An introduction to Fuzzy Control second edition" Ed: Springer-Verlag. Berlin-New York, 1996.

[5] E. Bassily, G.A. Capolino, H. Henao "Design and simulation of brushless motor drive control with fuzzy regulator: a control optimization procedure" Industrial Electronics, Control, and Instrumentation, Proceedings of the IECON'93 international conference on 2(Nov):902-906, 1993.

[6] E. Sergey Lyshevski and Alberico Menozzi, "Control of Permanent Magnet Brushless DC Motors." AMC2001-Arligton VA, vol 3, num 6, 2150-2154, 2001. [7] E. Sergey Lyshevski, "Electromechanical Systems, Electric Machines and Applied

Mechatronics" 590-613, CRC, United States of America, 2000.

[8] H. Asada and Kamal Youcef-Toumi, "Direct Drive Robots Theory and Practice." Ed: Engineering, The MIT Press,London, England,1987

[9] J.P. Carrascal "Sistemas Neurodifusos" 1999 en http://einstein.univalle.edu.co/pro- yectos/rna/neurofuzzy1/neuro.htm

[10] J.M. Díaz de la Cruz Cano "Motores y generadores" 2000 en http:// mecfunnet.faii.etsii.upm.es/Xitami/webpages/euler/wwwmg.html

[11] "DC Brushless Motors" (n.a*5) 2001 en http://www.magnedyne.com/bldcbene.htm [12] Matworks Co. "MatLab Realse 11 ver 5.3" 2001 en http://www.mathworks.com [13] Matworks Co. "ANFIS genfis1 faq" 2001 en http://www.mathworks.com/

search97cgis97_cgi?ResultTemplate=mwres.hts&ResultStyle=normal&ClusterPageSize =5&ClusterCount=5&collection=Technical+Support+Knowledge+Base&collection= MATRIXx+Knowledge+Base&collection=Documentation&QueryMode=Internet&Query Text=genfis1

[14] Jean-Jacques E. Slotine, Weiping Li "Applied nonlinear control" Ed: Prentice Hall, Englewood Cliffs, N.J. 1991.

[15] J. Holtz and L. Sringob. "Identification y compensation of torque ripple in high precision permanent magnenet motor drives" IEEE Trans on industrial electronics 11(1). 83-88. 1996.

[16] Jose R. Hilera, Victor J. Martinez "Redes Neuronales Artificiales, Fundamentos, modelos y aplicaciones" Ed: Alfaomega. Santafe Bogota Colombia. 2000

[17] Jyh-Shing Roger Jang "Adaptive-Network-Based Fuzzy Inference Systems". IEEE Trans, on Systems, Man and Cybernetics, Vol 23, No 3, pp 665-685, May 1993. [18] Jyh-Shing Roger Jang, Chuen-Tsai Sun, Eiji Mizutani "Neuro-fuzzy and soft

computing : a computational approach to learning and machine intelligence" Ed: Prentice Hall, Upper Saddle River, NJ, 1997.

[19] Katsuhiko Ogata "Ingeniería de control moderna", Ed: Prentice-Hall .Englewood Cliffs, N. J. 1976.

[20] Katsuhiko Ogata "Discrete-time control systems 2nd ed",Ed: Prentice Hall. Saddle River, N.J. 1995.

[21] Li-Xi Wang "A course in fuzzy systems and control" Ed: Prentice Hall, United States of America. 1997.

[22] Li-Xin Wang "Adaptive fuzzy systems and control : design and stability analysis" Ed: PTR Prentice Hall. Englewood Cliffs, N.J. 1994.

Hall, New York. 1994.

[25] Paul C. Krause "Analysis of electric machinery" Ed: McGraw-Hill, New York 1987.

[26] S. Hatori and Muneaki Ishida and Takasama Hori, "Suppression control for Torque vibration of Brushless DC Motor Utilizing Repetitive Control With Fourier

Documento similar