﻿ 基于Elman神经网络的Stewart平台位姿正解
 计算机系统应用  2001, Vol. 29 Issue (9): 95-101 PDF

Forward Kinematics Solution of Stewart Platform Based on Elman Neural Network
HE Ya-Lin, ZHAO Xin-Long
Faculty of Mechanical Engineering and Automation, Zhejiang Sci-Tech University, Hangzhou 310018, China
Foundation item: National Natural Science Foundation of China (61273184)
Abstract: The Stewart platform is widely used in motion simulator, optics, precision positioning, and other fields. However, due to the complex multivariate nonlinearity, it is difficult to accurately obtain the forward kinematics solution. Aiming at the problem of forward kinematics solution of Stewart platform, conventional methods such as iterative method and numerical method have problems such as difficulty in selecting initial values and slow calculation speed, a forward kinematics solution method based on Elman neural network is proposed. First, the kinematics model of the leg length and platform kinematics of the Stewart platform is established, and then the Elman neural network is used to solve the forward kinematics solution and experimentally verify it. This method has sound dynamic characteristics, high accuracy, and can quickly and accurately solve the forward kinematics solution of Stewart platform. Experiments prove the effectiveness of the method.
Key words: Stewart platform     pose forward solution     Elman neural network

Stewart微动平台由动平台、定平台和连杆通过铰链链接而成, 可以实现6自由度运动. 作为一种并联机器结构, 具有结构刚度大、位置精度高、载重比高等优点, 被广泛应用于电子元件生产中的夹持系统、精密机床中的刀具控制和钻铣等领域. Stewart平台具有运动空间小、鲁棒性强、惯性小、运动精度高以及成本较低等优点, 同时具有较大的刚度和良好的定位能力, 是串联机构所不能代替的. 从Stewart平台的控制方面看, Stewart平台包含两个最基本的问题: 位姿正解和位姿反解. 位姿反解即Stewart的运动学反解是已知求解平台的位姿, 即已知3个线性坐标X、Y、Z和3个旋转坐标参量 $\alpha$ $\beta$ $\gamma$ [1], 求解平台的6个支腿长度. 位姿正解即Stewart的运动学正解则是已知平台的6个支腿长度求解平台位姿. 对Stewart平台来说, 运动学反解的求解较容易求得, 而运动学正解的求解比较困难[2]. 位姿正解的求解对于Stewart平台空间分析、机构设计以及机构在故障中恢复均有重要作用[3], 因此, 合理有效快速的位姿正解求解方法是十分必要的. 然而, 由于Stewart平台具有高耦合性、非线性等特点, 其位姿正解的求解问题一直是一个难题. 无法进行准确的位姿正解将使系统无法准确得知目前的平台运动状态, 会导致产生较大误差或引起系统震荡等问题.

1 Stewart平台运动学模型

Stewart平台结构如图1所示, 驱动器利用万向节和平台、底座链接, 通过伸缩运动驱动动平台运动, 从而在三维空间中实现6自由度的运动[14].

 图 1 Stewart平台结构图

 $\left\{ \begin{array}{l} {R_{\rm Z}}\left( \gamma \right) = \left[ {\begin{array}{*{20}{c}} {\cos\gamma }&{ - \sin\gamma }&0\\ {\sin\gamma }&{\cos\gamma }&0\\ 0&0&1 \end{array}} \right]\\ {R_{\rm Y}}\left( \beta \right) = \left[ {\begin{array}{*{20}{c}} {\cos\beta }&0&{\sin\beta }\\ 0&1&0\\ { - \sin\beta }&0&{\cos\beta } \end{array}} \right]\\ {R_{\rm X}}\left( \alpha \right) = \left[ {\begin{array}{*{20}{c}} 1&0&0\\ 0&{\cos\alpha }&{ - \sin\alpha }\\ 0&{\sin\alpha }&{\cos\alpha } \end{array}} \right] \end{array}\right.$

 \begin{aligned} R & = {R_{\rm Z}}\left( \gamma \right) \cdot {R_{\rm Y}}\left( \beta \right) \cdot {R_{\rm X}}\left( \alpha \right) \\ & = \left[ {\begin{array}{*{20}{c}} {C\beta C\gamma }&{S\alpha S\beta C\gamma - C\alpha S\gamma }&{C\alpha S\beta C\gamma + S\alpha S\gamma }\\ {C\beta S\gamma }&{S\alpha S\beta S\gamma + C\alpha C\gamma }&{C\alpha S\beta S\gamma - S\alpha C\gamma }\\ { - S\beta }&{S\alpha C\beta }&{C\alpha C\beta } \end{array}} \right] \end{aligned} (1)

 $T = \left[ {\begin{array}{*{20}{c}} {C\beta C\gamma }&{S\alpha S\beta C\gamma - C\alpha S\gamma }&{C\alpha S\beta C\gamma + S\alpha S\gamma }&{{x_p}}\\ {C\beta S\gamma }&{S\alpha S\beta S\gamma + C\alpha C\gamma }&{C\alpha S\beta S\gamma - S\alpha C\gamma }&{{y_p}}\\ { - S\beta }&{S\alpha C\beta }&{C\alpha C\beta }&{{{\textit{z}}_p}}\\ 0 & 0 & 0 & 1 \end{array}} \right]$ (2)

 ${\left[ {{P_{ix}}^{\rm{'}}{P_{iy}}^{\rm{'}}{P_{i{\textit{z}}}}^{\rm{'}}{\rm{}}1} \right]^{\rm T}} = T{\left[ {{P_{ix}}{P_{iy}}{P_{i{\textit{z}}}}{\rm{}}1} \right]^{\rm T}}$ (3)

 ${l_i}\!\! =\!\! \sqrt {{{\left( {{P_{ix}}^{'} \!\!-\!\! {O_{ix}}} \right)}^2}\!\! +\!\! {{\left( {{P_{iy}}^{'}\!\! -\!\! {O_{iy}}} \right)}^2} \!+\! {{\left( {{P_{i{\textit{z}}}}^{'} - {O_{i{\textit{z}}}}} \right)}^2}} ,\left( {i = 1,2, \cdots ,6} \right)$ (4)

 $\left\{ {\begin{array}{*{20}{c}} {{f_1}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_1}} \right) = 0}\\ {{f_2}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_2}} \right) = 0}\\ {{f_3}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_3}} \right) = 0}\\ {{f_4}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_4}} \right) = 0}\\ {{f_5}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_5}} \right) = 0}\\ {{f_6}\left( {x,y,{\textit{z}},\alpha ,\beta ,\gamma ,{l_6}} \right) = 0} \end{array}} \right.$ (5)

2 基于Elman神经网络的Stewart平台位姿正解

Elman神经网络的网络结构一般分为4层: 输入层、输出层(中间层)、承接层和输出层. 输入层、隐含层、输出层的连接类似于前馈式网络, 输入层的单元仅起信号传输作用, 输出层单元起线性加权作用. 隐含层单元的传递函数可采用线性或者非线性函数, 承接层又称为上下文层或者状态层, 它用来记忆隐含层单元前一时刻的输出值并返回给网络的输入, 可以认为是一个一步延时算子. Elman神经网络的网络结构图如图2所示.

 图 2 Elman神经网络结构图

 $x\left(k\right)=f\left({\omega }^{2}{x}_{c}\left(k\right)+{\omega }^{1}u(k-1)\right)$ (6)
 ${x}_{c}\left(k\right)=\alpha {x}_{c}\left(k-1\right)+x(k-1)$ (7)
 $\hat y\left( k \right) = g\left( {{\omega ^3}x\left( k \right)} \right)$ (8)

Elman神经网络的输出可表示为:

 $\hat y\left( k \right) = {\omega ^3}x\left( k \right)$ (9)

 $E=\frac{1}{2}{\left(y\left(k\right)-\hat y\left(k\right)\right)}^{\rm T}\left(y\left(k\right)-\hat y\left(k\right)\right)$ (10)

 $W\left(k+1\right)=W\left(k\right)+\eta \left(-\frac{\partial E}{\partial W}\right)$ (11)

 $\frac{\partial E}{\partial {\omega }_{ij}^{3}}=-\left({y}^{i}\left(k\right)-{\widehat{y}}^{i}\left(k\right)\right)\frac{\partial {\widehat{y}}^{i}\left(k\right)}{\partial {\omega }_{ij}^{3}}=-{\varphi }_{i}^{o}{x}_{j}\left(k\right)$ (12)

 $\frac{\partial E}{\partial {\omega }_{jl}^{2}}=\sum _{i=1}^{m}(-{\varphi }_{i}^{o}{\omega }_{ij}^{3})\frac{\partial {x}_{j}\left(k\right)}{\partial {\omega }_{jl}^{2}},\;\;l={1,2},\cdots ,n$ (13)

$\partial {x}_{j}\left(k\right)/\partial {\omega }_{jl}^{2}$ 可由下式得到:

 $\begin{split} \dfrac{{\partial {x_j}\left( k \right)}}{{\partial \omega _{jl}^2}} &= \dfrac{\partial }{{\partial \omega _{jl}^2}}{f_j}\left( {\displaystyle \mathop \sum \limits_{l = 1}^n \omega _{jl}^2{x_{c,j}}\left( k \right)+ } {\displaystyle \mathop \sum \limits_{q = 1}^r \omega _{jq}^1{u_q}\left( {k - 1} \right)} \right)\\ &= f_j^{\rm{'}}\left( \cdot \right)\left( {{x_{c,j}}\left( k \right) + \displaystyle \mathop \sum \limits_{l = 1}^n \omega _{jl}^2\frac{{\partial {x_{c,j}}\left( k \right)}}{{\partial \omega _{jl}^2}}} \right) \end{split}$ (14)

 $\frac{\partial {x}_{j}\left(k\right)}{\partial {\omega }_{jl}^{2}}={f}_{j}^{'}\left( \cdot \right){x}_{l}\left(k-1\right)+\alpha \frac{\partial {x}_{j}(k-1)}{\partial {\omega }_{jl}^{2}}$ (15)

 $\frac{\partial E}{\partial {\omega }_{jq}^{1}}=\frac{\partial E}{\partial {\omega }_{j}\left(k\right)}\frac{\partial {x}_{j}\left(k\right)}{\partial {\omega }_{jq}^{1}}=-{\varphi }_{j}^{h}{u}_{q}(k-1)$ (16)

 ${\varphi }_{j}^{h}=\sum \limits_{i=1}^{m}\left({\varphi }_{i}^{o}{\omega }_{ij}^{3}\right){f}_{j}^{'}\left( \cdot \right),q={1,2},\cdots ,r$ (17)
3 Elman神经网络训练与验证

 图 3 Stewart平台

3.1 Stewart平台参数

 $\left\{ {\begin{array}{*{20}{c}} {x' = r'*\cos\alpha '}\\ {y' = r'*\sin\alpha '} \end{array}} \right.$ (18)

 图 4 Stewart平台参数化模型

3.2 Elman神经网络训练及验证

Elman神经网络模型结构选择为6-5-6, 输入为支腿长度 $u={\left[{l}_{1}\;{l}_{2}\;{l}_{3}\;{l}_{4}\;{l}_{5}\;{l}_{6}\right]}^{\rm T}$ , 输出为位姿 $y={\left[{x}_{p}\;{y}_{p}\;{{\textit{z}}}_{p}\alpha \beta \gamma \right]}^{\rm T}$ , 隐含层使用Sigmoid函数, 输出层使用Purelin线性传递函数, 样本通过位姿反解求得.

 $\left\{ {\begin{array}{*{20}{l}} {{f_{\rm X}}\left( t \right) = 20\sin t}\\ {{f_{\rm Y}}\left( t \right) = 20\sin t}\\ {{f_{\rm Z}}\left( t \right) = 10\sin t}\\ {{f_\alpha }\left( t \right) = 0.13\sin t}\\ {{f_\beta }\left( t \right) = 0.13\sin t}\\ {{f_\gamma }\left( t \right) = 0.21\sin t} \end{array}} \right.$ (19)

 图 5 样本支腿长度变化图

 图 6 X、Y、Z输出结果

 图 7 α、β、γ输出结果

 图 8 X、Y、Z误差

4 结论

 图 9 α、β、γ误差

 [1] 陈海龙, 汪伟, 王小兵, 等. Stewart平台六自由度位姿方程的改进数值解法研究. 机床与液压, 2014, 42(3): 47-50. DOI:10.3969/j.issn.1001-3881.2014.03.013 [2] Lopes AM. Dynamic modeling of a Stewart platform using the generalized momentum approach. Communications in Nonlinear Science and Numerical Simulation, 2009, 14(8): 3389-3401. DOI:10.1016/j.cnsns.2009.01.001 [3] 刘兴芳. 六自由度并联平台的运动学分析与结构参数优化[硕士学位论文]. 太原: 中北大学, 2018. [4] Nanua P, Waldron KJ, Murthy V. Direct kinematic solution of a Stewart platform. IEEE Transactions on Robotics and Automation, 1990, 6(4): 438-444. DOI:10.1109/70.59354 [5] Yang JF, Xu ZB, Wu QW, et al. Dynamic modeling and control of a 6-DOF micro-vibration simulator. Mechanism and Machine Theory, 2016, 104: 350-369. DOI:10.1016/j.mechmachtheory.2016.06.011 [6] Lee KM, Shah D. Kinematic analysis of a three degrees of freedom in-parallel actuated manipulator. Proceedings of 1987 IEEE International Conference on Robotics and Automation. Raleigh, NC, USA. 1987. 345–350. [7] Puglisi LJ, Saltaren RJ, Rey Portolés G, et al. Design and kinematic analysis of 3PSS-1S wrist for needle insertion guidance. Robotics and Autonomous Systems, 2013, 61(5): 417-427. DOI:10.1016/j.robot.2013.02.001 [8] Sayevand K, Jafari H. On systems of nonlinear equations: Some modified iteration formulas by the homotopy perturbation method with accelerated fourth- and fifth-order convergence. Applied Mathematical Modelling, 2016, 40(2): 1467-1476. DOI:10.1016/j.apm.2015.06.030 [9] Niu XM, Gao GQ, Liu XJ, et al. Dynamics and control of a novel 3-DOF parallel manipulator with actuation redundancy. International Journal of Automation and Computing, 2013, 10(6): 552-562. DOI:10.1007/s11633-013-0753-6 [10] Mohammed AM, Li S. Dynamic neural networks for kinematic redundancy resolution of parallel Stewart platforms. IEEE Transactions on Cybernetics, 2016, 46(7): 1538-1550. DOI:10.1109/TCYB.2015.2451213 [11] 刘伟锐, 赵恒华. 改进粒子群算法在并联机构位置正解中的应用. 机械设计与制造, 2014(2): 181-183. DOI:10.3969/j.issn.1001-3997.2014.02.056 [12] 张宗之, 秦俊奇, 陈海龙, 等. 基于BP神经网络的Stewart平台位姿正解算法研究. 机械传动, 2015, 39(6): 54-57. [13] Zhang Y, Wang XP, Tang HM. An improved Elman neural network with piecewise weighted gradient for time series prediction. Neurocomputing, 2019, 359: 199-208. DOI:10.1016/j.neucom.2019.06.001 [14] Lin PP, She JH, Wu M, et al. Decoupling control for parallel robot based on equivalent-input-disturbance approach. Proceedings of 2017 29th Chinese Control and Decision Conference. Chongqing, China. 2017. 4895–4900.