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

平面机械臂运动学分析

平面机械臂运动学分析

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

一 整体概述

研究步骤:

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

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


三 逆向

(待补充)

相关文章:

  • 如何高效地找工作?
  • tomcat单机多实例部署
  • 2025年渗透测试面试题总结-腾某讯-技术安全实习生(题目+回答)
  • 使用XShell连接RHEL9并配置yum阿里源
  • 使用express创建服务器保存数据到mysql
  • linux安装nginx
  • 【前端基础】Day 10 CSS3-2D3D
  • Visual Studio Code for SAP (SAP PRESS) (Leon Hassan)
  • Vue中常见动画执行详解
  • 数据库高级面试题
  • 第六课:数据库集成:MongoDB与Mongoose技术应用
  • javaweb:Maven、SpringBoot快速入门、HTTP协议
  • OpenCV视频解码性能优化十连击(实测帧率提升300%)
  • Java数据结构:解构排序算法的艺术与科学(一)
  • 光通信产业链分析
  • 第五课:Express框架与RESTful API设计:技术实践与探索
  • 动物摄像头监测识别AI技术结合了摄像头监测与人工智能识别(新产品)
  • 机动车授权签字人考试题库及答案
  • 青少年编程与数学 02-010 C++程序设计基础 30课题、操作符重载
  • 深度学习模型组件之优化器--动量优化方法(带动量的 SGD 与 Nesterov 加速梯度)
  • 搭建网站商城/专业网页设计和网站制作公司
  • 惠州市人民政府门户网站/网络广告推广方法
  • 网站商城建设费用/班级优化大师的功能有哪些
  • 如何做微信网站建设/seo企业推广案例
  • 做兼职靠谱的网站有哪些/网络公司网站
  • 潮南最新消息今晚/金华关键词优化平台