机械臂的轨迹跟踪安全控制(转)

This example shows you how to use Simulink® with Robotics System Toolbox™ manipulator algorithm blocks to achieve safe trajectory tracking control for a simulated robot running in Simscape™ Multibody™.

Both Robotics System Toolbox and Simscape Multibody are required to run this example.

Introduction

In this example, you will run a model that implements a computed-torque controller with joint position and velocity feedback using manipulator algorithm blocks. The controller receives joint position and velocity information from a simulated robot (implemented using Simscape Multibody) and sends torque commands to drive the robot along a given joint trajectory. A planar object is placed in front of the robot so that the end effector of the robot arm will collide with it when the trajectory tracking control is executed. Without any additional setup, the increasing torque due to colliding with the object can cause damage on the robot or the object. To achieve safe trajectory tracking, a trajectory scaling block is built to adjust the time stamp when assigning the desired motion to the controller. You may adjust some parameters and interact with the robot while the model is running and observe the effect on the simulated robot.

 

Set Up the Robot Model in Workspace

This example uses a model of the Rethink Sawyer, a 7 degree-of-freedom robot manipulator. Call importrobot to generate a robotics.RigidBodyTree model from a description stored in a Unified Robot Description Format (URDF) file. Set the DataFormat and Gravity properties to be consistent with Simscape.sawyer = importrobot('sawyer.urdf'); sawyer.removeBody('head'); sawyer.DataFormat = 'column'; sawyer.Gravity = [0, 0, -9.80665];

Trajectory Generation and Related Setup

First, assign the start time and duration for the trajectory.

tStart = 0.5;
tDuration = 3;Next, assign the initial and target configuration. q0 is the initial configuration and q1 is the target configuration.
q0 = [0; -1.18; 0; 2.18; 0; -1.0008; 3.3161];
q1 = zeros(7,1);
The following figures show the robot visualization of the initial configuration and the target configuration related to the location of the planar object. The planar object is placed so that the robot will collide to it during trajectory tracking.

Use exampleHelperPolynomialTrajectory to generate the desired motion trajectory for each joint. exampleHelperPolynomialTrajectory generates the polynomial coefficients of a trajectory that satisfies the desired joint position, zero velocity and zero acceleration based on the initial and target configurations and the trajectory duration.

p = exampleHelperPolynomialTrajectory(q0,q1,tDuration);

Simulink Model Overview

Next, open the Simulink model. The variables generated above are already stored in Simulink model workspace:

open_system('robotSafeTrajectoryTracking.slx');

The robotSafeTrajectoryTracking model implements a computed torque controller with trajectory scaling for safe trajectory tracking. There are three main subsystems in this model:

  • Computed Torque Controller

  • Trajectory Scaling and Desired Motion

  • Simscape Multibody Model with Simple Contact Mechanics

On each time step, if the trajectory scaling switch is on, the modified time stamp is used for evaluating the desired joint position, velocity and acceleration. Then, the computed torque controller uses the manipulator blocks associated with the RigidBodyTree model to track the desired motion. The derived control input is fed into the Sawyer model in Simscape Multibody (where the planar object for interacting with the robot is included).

Build Computed Torque Controller Using Robotics Manipulator Blocks

For a manipulator with  non-fixed joints, the system dynamics can be expressed as:

where  are the position, velocity and acceleration of the generalized coordinate,  is the control input (torque),  is the joint space mass matrix,  is the velocity product torque,  is the gravity torque. To track along a desired joint trajectory with desired position , velocity  and acceleration , the computed torque controller calculates the torque needed to obtain a given configuration and velocity, provided the robot dynamics variables , and . In Simulink, these variables can be easily derived using robotics manipulator blocks from Robotics System Toolbox to design the following computed torque controller:

where  is the position error and  is the velocity error. With this controller input, the system dynamics becomes a second-order ODE:

By choosing  and  properly, the tracking error  will converge to zero when time approaches infinity.

The Computed Torque Controller subsystem is built using three robotics manipulator blocks: Joint Space Mass MatrixVelocity Product Torque, and Gravity Torque. Note that the associated robotics.RigidBodyTree model, sawyer, is assigned in all those blocks, and the configuration and velocity need to be inserted as column vectors.

In MATLAB:open_system('robotSafeTrajectoryTracking/Computed Torque Controller');

Inside the Computed Torque Controller, there are two tunable parameters (indicated by colored blocks):

  • Gain Kp: The proportional gain when correcting the robot configuration

  • Gain Kd: The derivative gain when correcting the robot configuration

A standard way to determine the Kp and Kd is to calculate them as:

where  and  are the natural frequency and damping ratio of the second-order ODE. In this example, the default value of Kp and Kd are derived by setting the natural frequency and damping ratio as and  to make the second-order ODE a critical damped system.

Trajectory Scaling

There are two main blocks in this subsystem:

  • Trajectory Scaling

  • Desired Motion

Trajectory Scaling is the main block deployed for safe trajectory tracking in this example. At each time step , the original time stamp is calculated as . However, when the robot collides with an unexpected object, the increasing torque and deviance from the planned trajectory can be destructive for both the robot and the object. The main idea of trajectory scaling is to calculate the time stamp as  by introducing , which is a function of the desired motion and measured torque . The function  controls the speed of the robot motion and is determined based on the interference felt by the robot. If the measured torques are greater than expected,  is decreased to make the robot slow down or even move backward until the desired torques are achieved. These values of  have the following effects on the robot's motion:

  • , the robot moves forward ( is the normal speed).

  • , the robot stops.

  • , the robot moves backward.

In the Trajectory Scaling block, it is required to estimate the external torque  to calculate , where  is the measured torque from the Simscape model, and  is the expected torque of the desired motion on the previous time stamp. In the External Torque Observer section of the model, the Inverse Dynamics block calculates the expected torque which is subtracted from the measure torque. Expected torque is: .

In the Desired Motion block, the polynomial coefficients are given to generate the desired trajectory with the given timeStamp input, which can be adjusted based on the trajectory scaling algorithm. The , and  are outputs based on the trajectory polynomial and are fed to the Computed Torque Controller subsystem.

 

Simscape Multibody Robot Model and Simple Contact Mechanics

The Simscape Multibody Robot Model is imported from the same .urdf file using smimport, where a set of torque actuators and sensors for joint torque, joint position and velocity are added. A contact mechanism block as shown below is added to simulate the reaction force between the end effector and the obstacle as a sphere and a plane, where a simple linear spring-damper model is used.

Note: The contact mechanism has only been implemented between the end effector and the planar object. Therefore, other parts of the robot arm may still pass through the obstacle.

Run the Model

Run the model and observe the behavior of Sawyer in the robot simulator and interact with it.

  • First, open the viewer by clicking on the scope icon shown below on the left of the Simscape model block. It displays signals including the joint torques, reaction contact force between the end effector and the planar object, and the time stamp for calculating desired motion for trajectory tracking.

 

Toggle the trajectory scaling switch to "Off".

Click the Play button in Simulink to start the simulation. You should see the arm collide with the object yielding high torque inputs and a large reaction force. Note in this case the original time stamp is used. Stop the simulation afterwards.

Now, toggle trajectory scaling switch to "On" and rerun the model. Notice the differences in the computed torques and the reduced reaction force after the collision.

While the simulation is running, adjust the slider to move the object towards or away from the robot. The robot should react to its position while still trying to execute the trajectory safely.

Click the Stop button in Simulink to stop the simulation.

Summary

This example showed how to use robotics manipulator blocks in Simulink to design a computed torque controller, and integrate it with trajectory scaling and dynamic simulation in Simscape Multibody to achieve safe trajectory tracking. The resultant torque, reaction force and time stamp also demonstrated the capability of trajectory scaling for performing safe trajectory tracking.

来源:https://au.mathworks.com/help/robotics/examples/perform-safe-trajectory-tracking.html

机器人动力学:https://au.mathworks.com/help/robotics/ug/robot-dynamics.html

 LBR案例:https://au.mathworks.com/help/robotics/examples/control-lbr-manipulator-motion-through-joint-torque.html

  • 4
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
多关节机械臂轨迹规划和轨迹跟踪控制研究 本文提出了基于差分进化 (Differential Evolution) 优化 BP 神经网络求解 机械臂运动学逆解的方法,并与 BP 神经网络进行了比较,仿真结果表明 DE- BP 神经网络求得的逆解精度高同时也分析了传统求解运动学逆解方法的不足 之处。在关节空间和笛卡尔空间内分别进行机械臂的轨迹规划,在关节空间内 通过运动学的逆解求得关节角度值序列,并采用五次多项式插值法进行运算, 求得了关节空间内关节角的位置、速度和加速度的变化曲线。在笛卡尔空间内 采用直线插补法完成了从初始位置到终止位置的轨迹规划,完成了目标指定任 务。 最后本文采用了双幂次趋近律与改进的终端滑模面相结合的滑模变结构控 制策略,对平面两自由度机械臂进行轨迹跟踪控制研究。针对传统幂次趋近律 收敛速度慢,抖振现象明显等缺点,采用了双幂次趋近律的滑模控制方法,保 证了系统能够在有限时间内快速的到达滑动模面。与此同时传统的终端滑模面 在对机械臂关节角的位置误差和速度误差跟踪时精度较低,也不能很好的控制 当系统进入滑动模面瞬间的状态情况,易于产生较强的抖振现象,因此本文又 采用了改进的终端滑模面。将双幂次趋近律和改进的终端滑模面结合后,针对 机械臂动力学方程推导出机械臂系统的控制律
### 回答1: 轨迹跟踪机械臂是一种能够按照事先规划的轨迹进行移动和执行任务的机械臂。它通过激光传感器、视觉系统或者编码器等装置,实时感知自身的位置和姿态,然后通过控制系统对关节进行精确控制,使机械臂能够跟随所设定的轨迹进行移动和操作。 轨迹跟踪机械臂在工业生产中具有广泛应用。它可以被用于自动化装配线上的零件加工、产品组装或者包装等工作。通过事先编程,轨迹跟踪机械臂可以高效地完成重复性、精细化的工作任务,提高生产效率并降低人力成本。 轨迹跟踪机械臂的关键技术主要包括轨迹规划和轨迹跟踪控制。轨迹规划是指根据所需的路径和目标点,计算出机械臂关节的运动轨迹。常用的方法有插补算法、逆向运动学计算等。而轨迹跟踪控制则是通过传感器实时获得机械臂当前的位置和姿态信息,再由控制算法根据规划的轨迹来实时调整机械臂关节的运动,使其准确地跟随所设定的轨迹。 总之,轨迹跟踪机械臂是一种在工业自动化领域非常重要的设备,它通过精确的运动控制和轨迹规划,能够高效地完成各种需要按照特定路径移动和操作的任务,为生产过程提供了稳定可靠的支持。 ### 回答2: 轨迹跟踪机械臂是一种能够模拟人类手臂运动的机械装置。它通过精确控制多个关节的运动,实现对特定轨迹的准确跟踪。 这种机械臂通常由多个关节组成,每个关节都有自己的运动范围和角度限制。通过调整每个关节的角度和位置,可以使机械臂按照要求的轨迹进行运动。为了实现准确的轨迹跟踪,通常需要使用传感器来测量机械臂当前的位置和角度,并根据测量结果进行适当的校正和调整。 轨迹跟踪机械臂广泛应用于工业生产线、医疗手术、物流仓储等领域。在工业生产中,它可以代替人工进行重复性的、繁琐的操作,提高生产效率和质量。在医疗手术中,它可以实现精确的器官定位和手术操作,减少手术风险和创伤。在物流仓储中,它可以自动处理、装载和搬运物品,提高物流效率。 随着人工智能和机器学习等技术的发展,轨迹跟踪机械臂的控制和应用也在不断改进和创新。通过引入自主导航和智能感知技术,机械臂能够更加灵活地适应环境变化,并自动调整运动轨迹和动作。此外,轨迹跟踪机械臂还可以与其他智能设备和系统进行联网通信,实现协同工作和远程控制。 总之,轨迹跟踪机械臂在工业和服务领域发挥着重要作用。它的出现和发展,不仅提高了生产效率和质量,还为人类带来了更多便利和安全。随着技术的进一步创新和应用,我们可以期待轨迹跟踪机械臂在未来的更广泛应用和发展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值