当前位置: 首页 > article >正文

平面机械臂运动学分析

平面机械臂运动学分析

  • 一 整体概述
  • 二 正向
  • 三 逆向

一 整体概述

研究步骤:

1 正向:根据所读取的关节处角度,立刻计算出末端坐标,可随时计算得出当前末端坐标值,方便用于计算。

2 逆向:根据末端坐标,计算出关节角度的值,已知终点坐标,计算出各关节角度写入,以到达指定位置。

3 规划路径曲线点,设置曲线路径,使各关节移动丝滑,稳定、快速的到达指定位置。

4 误差补偿,通过PID等算法,补偿摩擦力重力等环境因素带来的影响,优化精度。


二 正向

1 简介:根据已知角度杆长,计算得出机械臂末端位置的位置变化,角度可由传感器采集。

2 效果:输入各个关节的角度值,可以计算出机械臂末端执行器的位置和姿态。

3 几何分析 :

在这里插入图片描述

4 计算方法
在这里插入图片描述

5 matlab 模拟测试

在这里插入图片描述
matlab测试代码:

function forward_direction
%----------------------1 初始参数设置---------------------------
    l1=50; l2=50; l3=50; %已知信息:臂长
    degree1 = deg2rad(0);%各关节角度
    degree2 = deg2rad(0);
    degree3 = deg2rad(0);
    
    %求出4个点坐标
    bx = l1*sin(degree1); % B点坐标,A为(0,0)
	by = l1*cos(degree1);
	cx = bx+l2*sin(degree1+degree2);% C点坐标
	cy = by+l2*cos(degree1+degree2);
	dx = cx+l3*sin(degree1+degree2+degree3);% D点坐标
	dy = cy+l3*cos(degree1+degree2+degree3);
%-----------------------2初始图像设置---------------------------
    x = linspace(0, 150, 1500);  % X轴范围包含所有分段
    y = zeros(size(x));         % 初始化Y数组
    figure('Position', [0 0 600 600]);
    axe = axes('Position', [0.1 0.3 0.8 0.6]);
    sport_plot = plot(x,y,'.', 'LineWidth', 2);
    update();%计算初始参数点,设置分段函数
    set(sport_plot, 'YData', y);
    axis('equal',[0 200 -150 150]); % 设置坐标轴范围 [x1,x2],[y1,y2]
    title('正向运动学分析'); % 标题
    xlabel('X坐标'); % x轴标签
    ylabel('Y坐标'); % y轴标签
    grid on; % 显示网格
%-------------------------3 更新参数点,设置分段函数----------------
    function [] =update()
        bx = l1*sin(degree1); % B点坐标,A为(0,0)
        by = l1*cos(degree1);
        cx = bx+l2*sin(degree1+degree2);% C点坐标
        cy = by+l2*cos(degree1+degree2);
        dx = cx+l3*sin(degree1+degree2+degree3);% D点坐标
        dy = cy+l3*cos(degree1+degree2+degree3);
        y = zeros(size(x));
        %x = linspace(0, dx, 1500);
        idx1 = (x >= 0 ) & (x <= bx);
        idx2 = (x >= bx) & (x <=cx); 
        idx3 = (x >= cx) & (x <=dx);
        idx4 = x >dx;
        y(idx1) = tan(pi/2-degree1)*x(idx1);         % 注意使用 .^
        y(idx2) = tan(pi/2-degree1-degree2)*(x(idx2)-bx)+by;    % 线性计算
        y(idx3) = tan(pi/2-degree1-degree2-degree3)*(x(idx3)-cx)+cy;
        y(idx4) = 999;
        title(axe, ['末端坐标(x,y)=(', num2str(dx), ',', num2str(dy), ')']);
    end
%--------------------------4 滑块-----------------------------------------
    % 添加degree1滑块
    uicontrol('Style', 'slider', ...
        'Position', [190 110 200 20], ...
        'Min', 0, 'Max', 180, 'Value', degree1, ...
        'Callback', @updatedegree1);
    uicontrol('Style', 'text', ...
        'Position', [140 110 42 15], ...
        'String', 'degree1');
    % 回调函数1
    function updatedegree1(hObj, ~)
        tem = hObj.Value; 
        degree1=deg2rad(hObj.Value);%更新角度
        update();
        set(sport_plot, 'YData', y);
        uicontrol('Style','text','String',num2str(tem),'Position',[400 110 40 15]);
    end

 % 添加degree2滑块
    uicontrol('Style', 'slider', ...
        'Position', [190 60 200 20], ...
        'Min', 0, 'Max', 180, 'Value', degree2, ...
        'Callback', @updatedegree2);
    uicontrol('Style', 'text', ...
        'Position', [140 60 42 15], ...
        'String', 'degree2');
    % 回调函数1
    function updatedegree2(hObj, ~)
        tem = hObj.Value; 
        degree2=deg2rad(hObj.Value);%更新角度
        update();
        set(sport_plot, 'YData', y);
        uicontrol('Style','text','String',num2str(tem),'Position',[400 60 40 15]);
    end

% 添加degree3滑块
    uicontrol('Style', 'slider', ...
        'Position', [190 13 200 20], ...
        'Min', 0, 'Max', 180, 'Value', degree3, ...
        'Callback', @updatedegree3);
    uicontrol('Style', 'text', ...
        'Position', [140 13 42 15], ...
        'String', 'degree3');
    % 回调函数1
    function updatedegree3(hObj, ~)
        tem = hObj.Value; 
        degree3=deg2rad(hObj.Value);%更新角度
        update();
        set(sport_plot, 'YData', y);
        uicontrol('Style','text','String',num2str(tem),'Position',[400 13 40 15]);
    end
%------------------------------5 文本框输入------------------------------
    uicontrol('Style', 'text', ...
        'Position', [450 430 100 20], ...
        'String', 'set 1:');
    uicontrol('Style', 'edit', ...
        'Position', [450 400 100 30], ...
        'String', '0', ...
        'Callback', @setdegree1);

    % 定义回调函数
    function setdegree1(src, ~)
        % 获取输入值
        input_str = get(src, 'String');
        input_num = str2double(input_str);
        % 验证输入
        if isnan(input_num)
            errordlg('请输入有效数字!', '输入错误');
            return;
        end
        % 更新全局变量
        degree1 = deg2rad(input_num);
        update();
        set(sport_plot, 'YData', y);
    end

	uicontrol('Style', 'text', ...
        'Position', [450 370 100 20], ...
        'String', 'set 2:');
	uicontrol('Style', 'edit', ...
        'Position', [450 340 100 30], ...
        'String', '0', ...
        'Callback', @setdegree2);

    % 定义回调函数
    function setdegree2(src, ~)
        % 获取输入值
        input_str = get(src, 'String');
        input_num = str2double(input_str);
        % 验证输入
        if isnan(input_num)
            errordlg('请输入有效数字!', '输入错误');
            return;
        end
        % 更新全局变量
        degree2 = deg2rad(input_num);
        update();
        set(sport_plot, 'YData', y);
    end

	uicontrol('Style', 'text', ...
        'Position', [450 310 100 20], ...
        'String', 'set 3:');
	uicontrol('Style', 'edit', ...
        'Position', [450 280 100 30], ...
        'String', '0', ...
        'Callback', @setdegree3);

    % 定义回调函数
    function setdegree3(src, ~)
        % 获取输入值
        input_str = get(src, 'String');
        input_num = str2double(input_str);
        % 验证输入
        if isnan(input_num)
            errordlg('请输入有效数字!', '输入错误');
            return;
        end
        % 更新全局变量
        degree3 = deg2rad(input_num);
        update();
        set(sport_plot, 'YData', y);
    end

end

几何法正向分析比较简单,且此处仅以二维为例


三 逆向

(待补充)


http://www.kler.cn/a/576605.html

相关文章:

  • echarts中使用geo3d绘制地图添加定位点时给symbol设置图片不显示
  • 深入理解网络通信:从OSI七层模型到TCP/IP协议栈
  • VScode代码格式化插件black失效问题
  • Oracle 数据库基础入门(七):触发器与事务的深度探究
  • 亲测解决笔记本触摸板使用不了Touchpad not working
  • 电脑网络出现问题!简单的几种方法解除电脑飞行模式
  • Spring Boot + MyBatis + MySQL:快速搭建CRUD应用
  • MTK Android12 修改鼠标右键为返回键
  • 记录排查服务器CPU负载过高
  • 洛谷————B2061 整数的个数
  • OpenManus:快速复刻Manus项目的技术路径与实施策略
  • ruoyi-ai开源项目启动
  • 《Operating System Concepts》阅读笔记:p200-p202
  • 【每日学点HarmonyOS Next知识】网页Scheme拉起应用、列表刷新、Web下载文件、根据子元素
  • 【Python运维】用Python自动化AWS资源管理:利用boto3实现高效管理S3桶和EC2实例
  • 尚硅谷爬虫note15
  • MyBatis与其使用方法讲解
  • BUU44 [BJDCTF2020]ZJCTF,不过如此1 [php://filter][正则表达式get输入数据][捕获组反向引用][php中单双引号]
  • 深度学习笔记——神经网络
  • 大模型开发(四):PET项目——新零售决策评价系统(上)