Algorithm 3 for Robot Manipulator Control

| 17 min read
Author: takahiro-ishii takahiro-ishiiの画像
Information

To reach a broader audience, this article has been translated from Japanese.
You can find the original version here.

Algorithm 3 for Robot Manipulator Control

#

Takahiro Ishii, Engineering Solutions Division, Mamezou Co., Ltd.

1. Introduction

#

At Mamezou Co., Ltd., we develop various robot technologies. While we often develop applied technologies using robots from other companies to meet client demands, we also develop industrial robots with 6-axis or 7-axis arms, commonly known as robot arms or manipulators, from scratch. Through this development, we generate various applied technologies and proposals. I would like to share the insights gained here with the readers. In this explanation, I will use a 6-axis industrial vertical articulated manipulator as an example to explain the various mechanisms for controlling it.

This time, I will explain the "singularity" problem, which inevitably arises when applying the previously explained trajectory generation processing algorithm to operate a manipulator or robot arm, including the theory. I will also introduce an example of a solution, known as "singularity avoidance."

2. Singularity of Robot Arm

#

What is a Singularity?

#

As mentioned earlier, a robot arm can assume various postures by moving its six joint axes, changing the position and orientation (direction, angle) of the tool tip (TCP=Tool Center Point). However, when approaching or moving away from a specific posture, some parts of the arm may suddenly move rapidly, placing excessive loads on the servo motors or reducers, or causing significant vibrations. This specific posture is called a "singularity" of the robot arm. For the 6-axis industrial vertical articulated manipulator discussed in this article, the following three singularities are empirically known:

  1. Shoulder Singularity
  2. Elbow Singularity
  3. Wrist Singularity

In the manipulator geometry shown below, (※Z-axis is the rotation axis at each joint)

These three singularities are defined as follows.

When the posture approaches these singularities, the arm's movement becomes problematic. For example, when moving slowly in the Z4 axis (Bn axis) direction (from back to front in this diagram) from the "3. Wrist Singularity" posture without changing the TCP's orientation, the arm between P3 and P4 may suddenly rotate around the Z3 axis (Rt axis). This rotation angle can reach nearly 90 degrees in an instant. Since the component beyond P3 is quite heavy, a sudden load is applied to the Rt axis servo motor, sometimes causing significant vibrations.

Mathematical Explanation of Singularity

#

Let's mathematically explain what these singularities are.

First, let's revisit the Jacobian matrix and its usage introduced in the description of "forward/inverse kinematics calculation of velocity" explained earlier.

  • Pt\vec{P_t}: TCP position
  • P0\vec{P_0}: Base coordinate system origin position
  • "×\times" is the cross product
  • The T in the superscript denotes matrix transposition.

J=([Z0×(PtP0)]T[Z1×(PtP1)]T[Z2×(PtP2)]T...[Z5×(PtP5)]TZ0TZ1TZ2T...Z5T)J=\left( \begin{array}{ccccc} [\vec{Z_0} \times (\vec{P_t}-\vec{P_0})]^T & [\vec{Z_1} \times (\vec{P_t}-\vec{P_1})]^T & [\vec{Z_2} \times (\vec{P_t}-\vec{P_2})]^T & ... &[\vec{Z_5} \times (\vec{P_t}-\vec{P_5})]^T\\ \vec{Z_0}^T & \vec{Z_1}^T & \vec{Z_2}^T & ... & \vec{Z_5}^T\\ \end{array} \right)

Using this Jacobian matrix, the translational and rotational velocities of the TCP can be calculated from the joint axis velocities as follows.

v=Jω\vec{v}=J \vec{\omega}

The inverse transformation can also be performed as follows.

ω=J1v\vec{\omega} =J^{-1} \vec{v}

Here,

  • ω\vec{\omega}: 6-dimensional column vector representing the angular velocity of each joint axis
  • v\vec{v}: 6-dimensional column vector representing the TCP velocity

More specifically,

  • ωi\omega_i: { i=1,2,,6{i=1,2,\cdots,6} } : Angular velocity at each joint axis
  • vt\vec{v_t}: 3-dimensional translational velocity vector of TCP (vtx,vty,vtz)(v_{tx},v_{ty},v_{tz})
  • wt\vec{w_t}: 3-dimensional rotational velocity vector of TCP (wtx,wty,wtz)(w_{tx},w_{ty},w_{tz})

Thus,

ω=(ω1,ω2,ω3,ω4,ω5,ω6)T\vec{\omega}= ( \omega_1, \omega_2 , \omega_3 , \omega_4 , \omega_5 , \omega_6 ) ^T

v=(vtTwtT)\vec{v}= \left( \begin{array}{c} {\vec{v_t}^T} \\ {\vec{w_t}^T} \\ \end{array} \right)

is represented.

The Jacobian matrix JJ is determined by the instantaneous posture of the robot arm, but its inverse matrix J1J^{-1} may not be obtainable. In this case, regardless of the instantaneous movement v\vec{v} of the TCP, the instantaneous rotation ω\vec{\omega} of the joint axis becomes indeterminate. When determining the elements of the inverse matrix, division by the determinant is necessary, so not being able to obtain J1J^{-1} means that the determinant is 0, i.e.,

det[J]=0\rm{det}[J] = 0

This is precisely the posture that takes a singularity. On the other hand, in postures near a singularity, the determinant det[J]\rm{det}[J] is close to but not zero. Therefore, J1J^{-1} can be obtained, but its elements can become enormous because they are divided by the minute det[J]\rm{det}[J]. Therefore, when calculating

ω=J1v\vec{\omega} =J^{-1} \vec{v}

even if the movement v\vec{v} of the TCP is small, the elements of the change in joint angle ω\vec{\omega} can become enormous. This is why some parts of the arm exhibit abnormal behavior near singularities.

Singularity Avoidance

#

Main Avoidance Methods

#

As mentioned above, there are problems with movement near singularities, so methods have been devised to somehow avoid these singularities. The main methods are as follows:

  1. Slightly change the original trajectory (TCP path or orientation) when approaching a singularity.
  2. Rapidly reduce the speed of all motors uniformly when approaching a singularity without changing the original trajectory.

In method 1, the operation proceeds according to the planned time, but accuracy is compromised due to deviation from the original trajectory. In method 2, the planned trajectory is accurately followed, but the operation is significantly delayed compared to the initially planned time.

Since industrial robot manipulators are often used in production sites such as factories, the issue of time-saving is important. Also, if careful programming is done to avoid singularities in important trajectories requiring accuracy, and only become singularities in simple tool movement scenes, method 1 is acceptable. Therefore, this article explains a method of singularity avoidance using "singularity low-sensitivity motion decomposition," an example of method 1 that was actually adopted (see Reference 1).

Singularity Avoidance by Singularity Low-Sensitivity Motion Decomposition

#

Overview of the Method

Reference 1 introduces a method of introducing a low-sensitivity motion decomposition matrix JJ^{*} to slightly change the original trajectory (TCP path or orientation) when approaching a singularity. The way of changing (sensitivity) can be finely adjusted with parameters. The specific calculation method when applying this method to a 6-axis manipulator is explained. The reference document generally mentions any multi-joint manipulator, and JJ is not necessarily a square matrix, so it is replaced with a generalized inverse matrix (pseudo matrix) for discussion. However, since JJ and J1J^{-1} are square matrices in this article, they are used without replacement.

The outline of this method is as follows:

From the condition to minimize the error between the exact TCP position and orientation, a low-sensitivity motion decomposition matrix JJ^{*} for performing low-sensitivity motion decomposition can be derived. By using this instead of J1J^{-1} during trajectory generation, it is possible to operate in such a way that sacrifices the "orientation" accuracy of the TCP while maintaining the "position" accuracy of the TCP near singularities. As a result, singularities can be successfully avoided. At this time, no joint axis undergoes unexpected rapid acceleration and operates smoothly. Incidentally, JJ^{*} completely matches J1J^{-1} when moving away from the vicinity of a singularity.

Low-Sensitivity Motion Decomposition Matrix JJ^*

The derivation is omitted, and the definition of the low-sensitivity motion decomposition matrix JJ^{*} is shown below.

J=Nθ1J^T(J^J^T+kI)1NrJ^{*}=N_{\theta}^{-1}\hat{J}^{T}(\hat{J}\hat{J}^{T} + kI)^{-1}N_{r}

where

J^=NrJNθ1k=kf(k0,w0,wf(J))wf(J)=det[J]\begin{align*} & \hat{J}= N_r J N_{\theta}^{-1}\\ & k=k_f(k_0, w_0, w_f(J)) \\ & w_f(J)=|\rm{det}[J]| \end{align*}

Furthermore,

  • NθN_θ : 6x6 diagonal matrix determining the sensitivity of joint axis motion
    • Default value: diag(1,1,1,1,1,1)\rm{diag}(1,1,1,1,1,1)
  • NrN_r : 6x6 diagonal matrix determining the sensitivity of TCP motion
    • Default value: diag(a,a,a,b,b,b)\rm{diag}(a,a,a,b,b,b)
    • Here, a=1/Vmax,b=1/Wmaxa=1/V_{max},\quad b=1/W_{max}
    • VmaxV_{max}: Maximum translational speed of TCP in design specifications
    • WmaxW_{max}: Maximum rotational speed of TCP in design specifications
  • kk: Nakamura's index indicating whether the robot arm's posture is close to a singularity
    • k0k_0 at a singularity, asymptotically approaching 0 when away from a singularity
    • Defined as follows

k=kf(k0,w0,w)={k0(1w/w0)2if(w/w0<1)0elsek=k_f(k_0,w_0,w) = \left \{ \begin{array}{} k_0(1-|w/w_0|)^2 & \rm{if}(|w/w_0|<1) \\ 0 & \rm{else} \end{array} \right.

  • The graph outline of the above function kf()k_f() (horizontal axis: ww, vertical axis: kk) is shown below.

Here, k0k_0 and w0w_0 are control adjustment values determined by the following guidelines.

  • k0k_0

    • Adjustable between 0.0 and 1.0. Default value: 0.01
    • Increasing it reduces the sensitivity of θθ to TCP movement near singularities. While it alleviates sudden acceleration of some axes, it tends to deviate from the target trajectory.
    • Decreasing it improves adherence to the target trajectory.
  • w0w_0

    • Boundary reference value separating singular and non-singular regions
    • Calculated as w0=wf(J0)w_0=w_f(J_0). It is good to use the Jacobian matrix calculated for the posture when θ5θ_5 is changed to about 10° to 30° from the Wrist singularity posture (θ5θ_5=0°).

Trajectory Generation Algorithm Using JJ^{*}

The specific method for trajectory generation that can avoid singularities using JJ^{*} is explained.

First, for a posture composed of a certain set of joint angles θτ\vec{\theta_\tau}, the calculated JJ^* is expressed as a function

J=J(θτ)J^{*}=J^*(\vec{\theta_\tau})

Also, let tt be the time, and

  • θ(t)\vec{\theta}_{(t)}: Time series of joint angles to be taken
  • v(t)\vec{v}_{(t)}: Time series of 6-dimensional column vector representing TCP velocity
  • Δt\Delta t: Small time interval

Then, theoretically, the recurrence formula including the following integral

θ(t+Δt)=τ=tt+ΔtJ(θ(τ))v(τ)dτ+θ(t)\vec{\theta}_{(t+\Delta t)}=\int_{\tau=t}^{t+\Delta t}{J^*(\vec{\theta}_{(\tau)})\vec{v}_{(\tau)}}d\tau + \vec{\theta}_{(t)}

can be calculated to output a set of joint angles that can generate a trajectory capable of avoiding singularities in real-time. However, in practice, it is difficult to accurately calculate v(t)\vec{v}_{(t)}. Even if the original velocity v(t)O\vec{v}^O_{(t)} calculated from the original trajectory (trajectory calculated by the previously described trajectory generation method) is considered as v(t)\vec{v}_{(t)} and the above integral is performed to obtain a new θ(t)\vec{\theta}_{(t)}, it will deviate more and more from the original course each time it passes near a singularity.

For example, as shown in the diagram below, when actually at the point P(τ)P(\tau) on the course, if the TCP moves with the original velocity vO\vec{v}^{O} that should be taken on the original course, it will continue to move off the course, so it will be further away from the planned target point P(t+Δt)P'(t+\Delta t) at the next time point. To avoid this, it is necessary to move while deviating by the recovery velocity vreg\vec{v}^{reg} to return exactly to the planned course. Note that vreg\vec{v}^{reg} is the difference between the target velocity vtgt\vec{v}^{tgt} for moving accurately to the target point from the current point and the original velocity vO\vec{v}^{O}.

Based on the above concept, the following calculations using feedback control are performed to ensure that the original course can always be returned to even if deviated.

First, define v(τ)\vec{v}_{(\tau)} as follows.

v(τ)=v(τ)O+G(θ(τ))v(τ)reg\vec{v}_{(\tau)}=\vec{v}^{O}_{(\tau)} + G(\vec{\theta}_{(\tau)}) \vec{v}^{reg}_{(\tau)}

Here, τ\tau is the time between [ tt to t+Δtt+\Delta t ], and if FK(θ)FK(\vec{\theta}) is the operation to find the TCP coordinates from the joint angles, that is, the forward kinematics operation, then

v(τ)tgt=FK(θ(t+Δt)O)FK(θ(τ))t+Δtτ\vec{v}^{tgt}_{(\tau)}=\frac{FK(\vec{\theta}^{O}_{(t+\Delta t)})-FK(\vec{\theta}_{(\tau)})}{t+\Delta t - \tau}

v(τ)O=FK(θ(t+Δt)O)FK(θ(t)O)Δt\vec{v}^{O}_{(\tau)}=\frac{FK(\vec{\theta}^{O}_{(t+\Delta t)})-FK(\vec{\theta}^{O}_{(t)})}{\Delta t}

v(τ)reg=v(τ)tgtv(τ)O\vec{v}^{reg}_{(\tau)}=\vec{v}^{tgt}_{(\tau)}-\vec{v}^{O}_{(\tau)}

G(θ)=g0(1kf(k0,w0,wf(J(θ)))k0)ρG(\vec{\theta})=g_0 \left( \frac{1-k_f(k_0,w_0,w_f(J(\vec{\theta})))}{k_0} \right) ^{\rho}

In this, v(τ)O\vec{v}^{O}_{(\tau)} is the velocity when the TCP is moving along the original course, v(τ)tgt\vec{v}^{tgt}_{(\tau)} is the target velocity for the TCP to move straight to the next original position/orientation, and v(τ)reg\vec{v}^{reg}_{(\tau)} is the recovery velocity for the TCP to approach the original course. Also,

  • G(θG(\vec{\theta}) is the Gain value for returning to the target TCP trajectory (0.0 to 1.0). Near singularities, G approaches 0.
  • ρ\rho is set to 2.0.
  • g0g_0 is the recovery coefficient. Default value: 0.0001
  • Δt\Delta t is the same as the sample time for trajectory generation.

Using the above, the previous integral can be calculated. However, in practice, the following approximation, which simplifies this integral, can be used. This allows the output of joint angle sets that can return to the original course in real-time.

θ(t+Δt)=J(θ(t))v(t)Δt+θ(t)\vec{\theta}_{(t+\Delta t)}={J^*(\vec{\theta}_{(t)})\vec{v}_{(t)}}\Delta t + \vec{\theta}_{(t)}

Note that when passing through a singularity, the course may slightly shift sideways even if a linear course is expected. In this case, the course deviation can be adjusted by adjusting the values of k0k_0, w0w_0, or VmaxV_{max}, WmaxW_{max}. Also, note that if the value of g0g_0 is large, the course may oscillate.

3. Conclusion

#

I explained what singularities of robot arms are and how to avoid singularities in 6-axis robot arms. In actual system implementation, parameter adjustments are made by operating these on actual machines. Also, in practice, functions such as singularity avoidance during JOG operation using a pendant and singularity detection alarm functions are also required separately. However, these can be implemented by applying the theory in this article.

References

#
  1. Hitoshi Nakamura, Hidero Hanabusa, ","Singularity Low-Sensitivity Motion Decomposition for Joint-Type Robot Arms," Transactions of the Society of Instrument and Control Engineers, Vol. 20, No. 5 (May 1984)
  2. Shigeki Toyama (Author), "Robotics (Mechatronics Textbook Series)," Corona Publishing (1994)

豆蔵では共に高め合う仲間を募集しています!

recruit

具体的な採用情報はこちらからご覧いただけます。