【故障分析】基于matlab GUI鼠笼式异步电机转子断条故障诊断【含Matlab源码 1089期】

2021/7/3 14:51:21

本文主要是介绍【故障分析】基于matlab GUI鼠笼式异步电机转子断条故障诊断【含Matlab源码 1089期】,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

一、简介

基于matlab鼠笼式异步电机转子断条故障诊断

二、源代码

function varargout = motor_diag(varargin)
% MOTOR_DIAG MATLAB code for motor_diag.fig
%      MOTOR_DIAG, by itself, creates a new MOTOR_DIAG or raises the existing
%      singleton*.
%
%      H = MOTOR_DIAG returns the handle to a new MOTOR_DIAG or the handle to
%      the existing singleton*.
%
%      MOTOR_DIAG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MOTOR_DIAG.M with the given input arguments.
%
%      MOTOR_DIAG('Property','Value',...) creates a new MOTOR_DIAG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before motor_diag_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to motor_diag_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help motor_diag

% Last Modified by GUIDE v2.5 17-Nov-2020 17:22:27

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @motor_diag_OpeningFcn, ...
                   'gui_OutputFcn',  @motor_diag_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

 
% --- Executes just before motor_diag is made visible.
function motor_diag_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to motor_diag (see VARARGIN)

% Choose default command line output for motor_diag
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);
% UIWAIT makes motor_diag wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = motor_diag_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in readmatfile.
function readmatfile_Callback(hObject, eventdata, handles)
% hObject    handle to readmatfile (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global size_x;global currentvalue;
[filename,filepath]=uigetfile({'.mat'},'读取数据','D:\zl工作文档\设备控制与故障诊断\电机诊断数据\1120实验数据\1120正常');

load(strcat(filepath,filename));   %load current signal data;
currentvalue=data(:,3);         %extract current signal data from the original data;
[size_x,size_y]=size(currentvalue);
set(handles.data_length,'String',num2str(size_x));


function input_f_Callback(hObject, eventdata, handles)
% hObject    handle to input_f (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of input_f as text
%        str2double(get(hObject,'String')) returns contents of input_f as a double
a=str2double(get(hObject,'String'));
if isempty(a)
    set(hObject,'String',0);
end
guidata(hObject,handles);

% --- Executes during object creation, after setting all properties.
function input_f_CreateFcn(hObject, eventdata, handles)
% hObject    handle to input_f (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function actual_f_Callback(hObject, eventdata, handles)
% hObject    handle to actual_f (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of actual_f as text
%        str2double(get(hObject,'String')) returns contents of actual_f as a double
a=str2double(get(hObject,'String'));
if isempty(a)
    set(hObject,'String',0);
end
guidata(hObject,handles);

% --- Executes during object creation, after setting all properties.
function actual_f_CreateFcn(hObject, eventdata, handles)
% hObject    handle to actual_f (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function s_Callback(hObject, eventdata, handles)
% hObject    handle to s (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of s as text
%        str2double(get(hObject,'String')) returns contents of s as a double


% --- Executes during object creation, after setting all properties.
function s_CreateFcn(hObject, eventdata, handles)
% hObject    handle to s (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function chara_f1_Callback(hObject, eventdata, handles)
% hObject    handle to chara_f1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of chara_f1 as text
%        str2double(get(hObject,'String')) returns contents of chara_f1 as a double


% --- Executes during object creation, after setting all properties.
function chara_f1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to chara_f1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function chara_f2_Callback(hObject, eventdata, handles)
% hObject    handle to chara_f2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of chara_f2 as text
%        str2double(get(hObject,'String')) returns contents of chara_f2 as a double


% --- Executes during object creation, after setting all properties.
function chara_f2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to chara_f2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function chara_f2_value_Callback(hObject, eventdata, handles)
% hObject    handle to chara_f2_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of chara_f2_value as text
%        str2double(get(hObject,'String')) returns contents of chara_f2_value as a double


三、运行结果

在这里插入图片描述

四、备注

版本:2014a



这篇关于【故障分析】基于matlab GUI鼠笼式异步电机转子断条故障诊断【含Matlab源码 1089期】的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程