﻿ 小型AUV动力定位建模与控制仿真
 舰船科学技术  2019, Vol. 41 Issue (3): 93-96 PDF

Dynamic positioning modeling and control simulation of small-sized AUV
CAI Wei, WANG Jun-xiong
State Key Laboratory of Ocean Engineering, Shanghai Jiaotong University, Shanghai 200240, China
Abstract: AUV products are designed for smaller size and civil purpose with the further study of underwater vehicles. Based on small-sized AUVs, there are some problems about hydrodynamic performance analysis, path planning and underwater communication, which are the keys of AUV design. The paper set up an irregular wave simulation model in Matlab to predict the movement of AUV, which is based on ITTC two-parameter wave spectrum and drifting force computational formula. The paper also set up Simulink model of dynamic positioning control system, using particle swarm optimization to select PID controller parameters to do research on dynamic positioning of AUV. The study successfully simulated the water environment of small-sized AUV, set up dynamic positioning Simulink frame and realized the primary positioning control of AUV. The study created conditions for further hydrodynamic performance experiment and design of hardware and software for positioning system, which lay the foundation for the design of small-sized AUV products.
Key words: dynamic positioning control system     water environment simulation     particle swarm optimization     simulation model     small-sized AUV products
0 引　言

AUV动力定位系统框图如图1所示。

 图 1 AUV动力定位系统框图 Fig. 1 The diagram of AUV dynamic positioning system
1 AUV数学模型建立

 图 2 AUV固定坐标系和运动坐标系 Fig. 2 Fixed coordinate and moving coordinate of AUV

1.1 随机波浪模型

AUV在水下面临的作业环境属于不规则波浪环境，研究上经常把仅存在于主风方向且有无穷长波线、单向波峰彼此保持平行的二次不规则波称为不规则长峰波[2]

 $\begin{split} \zeta (t) = & \sum\limits_{i = 1}^n {{\zeta _{ai}}\cos ({\omega _i}t + {\varepsilon _i})} = \\ & \sum\limits_{i = 1}^n {\sqrt {2{S_{\zeta \zeta }}({\omega _i})\Delta {\omega _i}} \cos ({\omega _i}t + {\varepsilon _i})} \text{。} \end{split}$ (1)

 ${S_{\zeta \zeta }}(\omega ) = \frac{{173h_{1/3}^2}}{{T_1^4{\omega ^5}}}\exp \left( - \frac{{691}}{{T_1^4{\omega ^4}}}\right)\text{。}$ (2)

 \left\{ \begin{aligned} & F_x^D = \frac{1}{2}\rho L\zeta _a^2\cos \chi C_x^D\text{，}\\ & F_y^D = \frac{1}{2}\rho L\zeta _a^2\sin \chi C_y^D\text{，}\\ & M_n^D = \frac{1}{2}\rho {L^2}\zeta _a^2\sin \chi C_n^D\text{。} \end{aligned} \right. (3)

 \left\{ \begin{aligned} & C_x^D(\lambda ) = 0.05 - 0.2\left(\frac{\lambda }{L}\right) + 0.75{(\frac{\lambda }{L})^2} - 0.51{\left(\frac{\lambda }{L}\right)^3}\text{，}\\ & C_y^D(\lambda ) = 0.46 + 6.83\left(\frac{\lambda }{L}\right) - 15.65{\left(\frac{\lambda }{L}\right)^2} + 8.44{\left(\frac{\lambda }{L}\right)^3}\text{，}\\ & C_n^D(\lambda ) = - 0.11 + 0.68\left(\frac{\lambda }{L}\right) - 0.79{\left(\frac{\lambda }{L}\right)^2} + 0.21{\left(\frac{\lambda }{L}\right)^3}\text{，} \end{aligned} \right. (4)
 $\left\{ \begin{array}{l} \lambda = 2{\text{π}}/k\text{，}\\ k = {\omega ^2}/g\text{。} \end{array} \right.$ (5)

 \left\{ \begin{aligned} & F_x^D = \rho L\cos \chi \sum\limits_{i = 1}^n {C_x^D(2{\text{π}} g/\omega _i^2){S_{\zeta \zeta }}({\omega _i})\Delta \omega }\text{，} \\ & F_y^D = \rho L\sin \chi \sum\limits_{i = 1}^n {C_y^D(2{\text{π}} g/\omega _i^2){S_{\zeta \zeta }}({\omega _i})\Delta \omega } \text{，}\\ & M_n^D = \rho {L^2}\sin \chi \sum\limits_{i = 1}^n {C_n^D(2{\text{π}} g/\omega _i^2){S_{\zeta \zeta }}({\omega _i})\Delta \omega }\text{。} \end{aligned} \right. (6)
1.2 操纵运动数学模型

 ${ M}\dot { v} + { Dv} = { \tau _t}\text{。}$ (7)

1.3 基于粒子群算法（PSO）的PID参数优化

20世纪70年代，Fossen提出非线性PID控制方法，实现了船舶自航控制。至今，PID控制以其算法成熟、结构简单、控制效果好等优点仍然成为工程项目控制系统的主要选择。

PID控制器以目标设定值与实际测量值的偏差作为输入量，将偏差值的比例（P）、积分（I）和微分（D）分量通过线性组合构成控制量，传递给执行机构，继而作用于控制对象。PID系统原理如图3所示。

 图 3 PID系统原理图 Fig. 3 Schematic diagram of PID control system

AUV动力定位系统的PID控制算法如下：

 \left\{ \begin{aligned} & u(t) = {K_p}[\varepsilon (t) + \frac{1}{{{T_i}}}\int_0^t {\varepsilon (t){\rm d}t + {T_d}\frac{{{\rm d}\varepsilon (t)}}{{{\rm d}t}}]} \text{，}\\ & \varepsilon (t) = {x_0} - x(t)\text{，}\\ & \dot \varepsilon (t) = - \dot x(t)\text{。} \end{aligned} \right. (8)

PID参数的整定与优化是PID控制器设计实现的核心，随着智能控制理论的发展，出现了粒子群算法、遗传算法、神经网络算法等PID参数优化方法。

d维空间上的第i个粒子的位置信息记为 ${X_i} =$ $({x_{i1}},{x_{i2}} \cdot \cdot \cdot {x_{id}})$ ，粒子的搜索速度记为 ${V_i} = ({v_{i1}},{v_{i2}} \cdot \cdot \cdot$ ${v_{id}})$ 。粒子跟踪2个最优值在空间区域内进行搜索。第1个是个体极值 ${P_{ibest}}$ ，记为 ${P_{ibest}} = ({p_{i1}},{p_{i2}} \cdot \cdot \cdot {p_{id}})$ ，表示第i个粒子在搜索过程中本身找到适应值的最优值所在位置；第2个是全局极值 ${g_{best}}$ ，记为 ${g_{best}} = ({g_1},{g_2}, \cdot \cdot \cdot {g_d})$ ，表示整个空间区域内，所有粒子搜索过程中找到适应值的最优值所在位置。

 \left\{ \begin{aligned} & V_i^{n + 1} = wV_i^n + {c_1} \cdot rand() \cdot (P_{ibest}^n - X_i^n) + \\ & {\rm{ }}{c_2} \cdot rand() \cdot (g_{best}^n - X_i^n)\text{，}\\ & X_i^{n + 1} = X_i^n + rV_i^{n + 1}\text{。} \end{aligned} \right. (9)

 $J = \int_0^{ + \infty } {t\left| {e(t)} \right|{\rm d}t} \text{。}$ (10)

2 仿真结果与分析

AUV初始位置向量为 ${[0,0,45^\circ ]^{\rm T}}$ ，在图4所示的随机波浪作用下做慢漂运动，逐渐远离原点，运动轨迹如图5所示，同时首向角绕浪向30°方向做往复摆动。

 图 4 随机波浪波高时变曲线 Fig. 4 Wave height time-varying curve of random waves

 图 5 模拟波浪作用下的X–Y运动轨迹图 Fig. 5 X–Y moving trace with the effect of simulated wave

 图 6 PID控制下的横向位移–时间变化曲线 Fig. 6 Horizontal displacement curve with PID controller

 图 7 PID控制下的纵向位移–时间变化曲线 Fig. 7 Vertical displacement curve with PID controller

 图 8 PID控制下的首向角–时间变化曲线 Fig. 8 Heading angle curve with PID controller

 图 9 PID控制下的X–Y 运动轨迹图 Fig. 9 X–Y moving trace with PID controller

2组PID控制下，AUV均由定位原点抵达目标位置。常规PID控制下，系统经历约100 s的调整达到稳定，同时超调量达到约20%，控制效果较差；经PSO优化后的PID控制器，系统约40 s后快速达到目标位置状态附近进行微调，整体超调量约5%，控制性能较常规PID控制得到大幅优化。

3 结　语

AUV在军用项目的成功推动了将其向小型民用产品方向推广的设想，用以实现例如湖底景色拍摄、水产养殖巡视、内陆河水文信息采集等诸多功能。小型AUV产品设计的核心问题有水动力性能分析、路径规划、水下通信等。本文基于不规则随机长峰波浪理论，模拟小型AUV作业的水环境，获取AUV的慢漂运动规律，并基于PID控制器搭建动力定位控制仿真系统，利用粒子群算法（PSO）优化PID参数，实现AUV的定位控制，获取了较好的控制性能。为AUV水动力性能试验及动力定位系统的软硬件设计创造了条件，为小型AUV产品的设计实现奠定基础。

 [1] 徐海祥, 冯辉. 船舶动力定位系统原理[M]. 北京:国防工业出版社, 2016:15–17. [2] 钱小斌, 尹勇, 张秀凤, 等. 海上不规则波浪扰动对船舶运动的影响[J]. 交通运输工程学报, 2016, 16(3): 116-124. DOI:10.3969/j.issn.1671-1637.2016.03.014 [3] 魏泽, 赵战华, 刘家瑞. 二阶波浪力数值计算与试验方法研究[J]. 船舶力学, 2017(z1): 251-257. DOI:10.3969/j.issn.1007-7294.2017.z1.032 [4] 梁海军, 闫超. 环境干扰力作用下船舶操纵运动仿真数学模型研究[J]. 舰船科学技术, 2015, 37(7): 153-156. DOI:10.3404/j.issn.1672-7649.2015.07.035