您现在的位置:首页 >> 智能控制 >> 内容

一级倒立摆平衡控制系统MATLAB仿真,可显示倒立摆平衡动画,对比极点配置,线性二次型,PID,PI

时间:2024/10/10 4:33:21 点击:

  核心提示:0sj_022m,包括程序操作录像...

1.完整项目描述和程序获取

>面包多安全交易平台:https://mbd.pub/o/bread/ZpyYlpxp

>如果链接失效,可以直接打开本站店铺搜索相关店铺:

点击店铺

>如果链接失效,程序调试报错或者项目合作可以加微信或者QQ联系。

2.部分仿真图预览


3.算法概述

一个可以活动的小车上立着一根不稳定随时会倒下的杆。小车的轮子由电机控制,可以控制小车电机的转动力矩M。同时,也可以获取小车轮子转动的圈数N(可以精确到小数)和杆相对于垂直位置的倾角α.

4.部分源码

.......................................................................................

%%%%%%%%%%%%%%%%%%%%%%选择倒立摆的控制方式%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --- Executes on button press in pushbutton4.

function pushbutton4_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton4 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

pause;

 

% --- Executes on button press in pushbutton5.

function pushbutton5_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton5 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

close(gcbf);

clc,clear,close all

 

 

% --- Executes on button press in pushbutton6.

function pushbutton6_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton6 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

 

load mat\R1.mat

y1=y;

t1=t;

 

load mat\R2.mat

y2=y;

t2=t;

 

load mat\R3.mat

y3=y;

t3=t;

 

load mat\R4.mat

y4=y;

t4=t;

 

load mat\R5.mat

y5=y;

t5=t;

 

 

figure;

subplot(211);

plot(t1,y1(:,1),'r','linewidth',2);

hold on

plot(t2,y2(:,1),'b','linewidth',2);

hold on

plot(t3,y3(:,1),'m','linewidth',2);

hold on

plot(t4,y4(:,1),'k','linewidth',2);

hold on

plot(t5,y5(:,1),'g','linewidth',2);

hold on

legend('极点配置法','线性二次型','PID','PI','PD');

title('偏转角变化对比');

xlim([0,10]);

 

subplot(212);

plot(t1,y1(:,3),'r','linewidth',2);

hold on

plot(t2,y2(:,3),'b','linewidth',2);

hold on

plot(t3,y3(:,3),'m','linewidth',2);

hold on

plot(t4,y4(:,3),'k','linewidth',2);

hold on

plot(t5,y5(:,3),'g','linewidth',2);

hold on

legend('极点配置法','线性二次型','PID','PI','PD');

title('小车位移变化对比');

xlim([0,10]);

0sj_021m

---

作者:我爱C编程 来源:我爱C编程
本站最新成功开发工程项目案例
相关评论
发表我的评论
  • 大名:
  • 内容:
本类固顶
  • 没有
  • FPGA/MATLAB商业/科研类项目合作(www.store718.com) © 2025 版权所有 All Rights Reserved.
  • Email:1480526168@qq.com 站长QQ: 1480526168