基于LQR和PID的倒立摆小车控制.rar

  • 帆帆能毕业
    了解作者
  • C/C++
    开发工具
  • 46KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 7
    下载次数
  • 2020-05-12 10:34
    上传日期
基于LQR和PID的倒立摆小车控制,希望有需要的人能用到
基于LQR和PID的倒立摆小车控制.rar
  • 基于LQR和PID的倒立摆小车控制
  • y8_2.m
    1020B
  • danbai.m
    1009B
  • y8_3.m
    1KB
  • pedulumpid.mdl
    34.4KB
  • wjchgzq.mdl
    22.2KB
  • pendulum.fig
    13KB
  • pendulum.m
    19.5KB
  • y8_1.m
    596B
  • jwgcl.m
    521B
  • jwgcql.mdl
    25.2KB
  • jwgcp.m
    702B
  • tracker.m
    424B
  • jwgcqp.mdl
    25.2KB
内容介绍
function varargout = pendulum(varargin) % PENDULUM M-file for pendulum.fig % PENDULUM, by itself, creates a new PENDULUM or raises the existing % singleton*. % % H = PENDULUM returns the handle to a new PENDULUM or the handle to % the existing singleton*. % % PENDULUM('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in PENDULUM.M with the given input arguments. % % PENDULUM('Property','Value',...) creates a new PENDULUM or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before pendulum_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to pendulum_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 % Copyright 2002-2003 The MathWorks, Inc. % Edit the above text to modify the response to help pendulum % Last Modified by SHE on 15-Dec-2008 22:08:58 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @pendulum_OpeningFcn, ... 'gui_OutputFcn', @pendulum_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 pendulum is made visible. function pendulum_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 pendulum (see VARARGIN) % Choose default command line output for pendulum handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes pendulum wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = pendulum_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; function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (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 edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double %以字符串的形式来存储数据文本框1的内容。如果字符串不是数字,则现实空白内容 input =str2double(get(hObject,'String')); %检查输入是否为空. 如果为空,则默认显示为0 if (isempty(input)) set(hObject,'String','0') end guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (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 edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double %以字符串的形式来存储数据文本框2的内容。如果字符串不是数字,则现实空白内容 input =str2double(get(hObject,'String')); %检查输入是否为空. 如果为空,则默认显示为0 if (isempty(input)) set(hObject,'String','0') end guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (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 edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double %以字符串的形式来存储数据文本框3的内容。如果字符串不是数字,则现实空白内容 input =str2double(get(hObject,'String')); %检查输入是否为空. 如果为空,则默认显示为0 if (isempty(input)) set(hObject,'String','0') end guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (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 edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double %以字符串的形式来存储数据文本框4的内容。如果字符串不是数字,则现实空白内容 input =str2double(get(hObject,'String')); %检查输入是否为空. 如果为空,则默认显示为0 if (isempty(input)) set(hObject,'String','0') end guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function edit5_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(
评论
    相关推荐
    • 倒立摆-LQR.rar
      关于一级倒立摆LQR+PID控制。包含源程序,simulink仿真模型等
    • lqr.rar
      基于LQ的二级倒立摆设计,可实现LQ校正,能画出原系统的阶跃响应,及加入LQ校正后的系统阶跃响应曲线。
    • LQR-DMC-Matlab.rar
      线性和非线性规划研究方面 迭代法 线性规划的定义,介绍,例子
    • PSO优化lqr控制.rar
      粒子群优化lqr倒立摆的线性二次型控制器
    • way3.rar
      利用LQR方法(线性二次调节器)对一级小车倒立摆的数学模型进行控制。
    • 一级直线倒立摆的LQR控制
      对一级倒立摆进行LQR控制的MATLAB仿真实验,可以得到摆杆的角度与小车的位置图,另有完整的word讲解,公式都是用公式编辑器编辑的
    • 二级倒立摆LQR控制Matlab
      二级倒立摆LQR控制,Multibody建立二级倒立摆模型,根据力学方程在Matlab实现线性化,建立状态空间方程,根据LQR计算反馈矩阵,在Simulink中连接模块实现控制和可视化。
    • 基于matlabGUI的小车倒立摆pid控制
      一个用matlab的GUI编写的小车倒立摆环境,自带pid控制,适合用作控制对象,练习对比各种控制算法,可以比较直观的观察控制效果,也可以修改源代码。
    • sim.rar
      对一阶倒立摆摆实现位置控制;观测小车位置、速度、摆杆倾角、角速度数据;结合simulink实现系统模型搭建。
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载