在现代工业、环境监控和城市安防应用中,多机器人系统(MRS)的应用日益广泛。相较于单一机器人系统,多机器人系统在执行复杂任务时不仅效率更高,而且对单一故障的鲁棒性更强。本文介绍了Tello无人机编队控制方法,设计了五架无人机的编队任务,并在物理中进行了实现。

通讯接口

可使用官方的Tello SDK通过电脑或手机无线2.4 GHz 802.11n WiFi连接控制无人机。无人机控制指令主要是通过UDP端口发送文本消息来实现。总的来说,与Tello无人机通信有三个基本的数据流:

  1. 命令上行流,可以发送文本命令直接控制飞行。SDK支持多种命令,从简单的平移和旋转到执行更复杂的飞行轨迹,比如沿曲线飞行。该协议还提供了确认机制,无人机的飞行控制器会返回一系列错误代码。

  2. 状态数据和遥测下行流,向用户提供基本的Tello遥测数据,比如横滚-俯仰-偏航定位、平移速度、加速度、电池电量以及通过气压和飞行时间传感器得到的当前高度信息。

  3. 视频下行流,利用机载720p 30 fps摄像头,可以像访问标准IP摄像头视频流一样独立访问。


速度控制器设计

根据给定速度与无人机的实际飞行速度,进行数据采集与系统辨识,下图为采集数据的曲线图,四个曲线图分别代表无人机在X、Y、Z轴的速度和Yaw角度的变化,将无人机的设定速度(红色实线)和实际飞行速度(黑色虚线)进行了比较。



采用Matlab系统辨识工具箱根据采集的输入输出数据进行运动学模型辨识,得到以下的辨识结果,并利用PID控制器参数整定工具箱进行控制器参数整定,得到如下控制器参数



经过PID控制器作用后的系统响应曲线如下图:


编队实现

定位阶段:对于编队中的每个机器人i,其中i = 1, 2, 3, 4, 5,参考位置{p}_{{ref}}[i]计算公式如下:

\mathbf{p}_{\text {ref }}[i]=\left[\begin{array}{c} r \sin \left(\frac{2 \pi(i-1)}{5}\right) \\ r \cos \left(\frac{2 \pi(i-1)}{5}\right) \\ h \end{array}\right]

其中:

  • r 代表编队的参考半径
  • h 代表机器人的参考高度

公转阶段:对于编队中的每个机器人i,其中i = 1, 2, 3, 4, 5,参考位置\mathbf{p}_{\text{ref}}[i]计算公式如下:

\mathbf{p}_{\text{ref}}[i] = \begin{bmatrix} r \sin\left(\frac{2\pi (i-1)}{5} + \frac{2\pi t}{T}\right) \\ r \cos\left(\frac{2\pi (i-1)}{5} + \frac{2\pi t}{T}\right) \\ h \end{bmatrix}

其中:

  • t 是当前时间,用于表达随时间变化的位置。
  • T是一个时间周期常数,这里设为10.0秒,用于控制公转的周期性。

通过上述表达式,可以精确地描述每个机器人在不同状态下的位置变化,并且可以控制无人机随时间变化,这对于编队控制和同步运动非常重要。


无人机定位

采用OptiTrack动作捕捉系统进行位姿检测。该系统由一组高速摄像机、荧光标记点和数据处理软件组成,可以提供精确的3D位置和姿态跟踪数据,常用于追踪物体或人体的运动轨迹。OptiTrack的基本原理是使用多个标记点构建运动体的刚体,通过红外相机捕捉标记点发出的光线及反射位置,数据处理软件根据相机采集的信息计算刚体的位置和姿态。该系统在追踪运动体时可以提供高达0.1毫米的位置精度和每秒120帧的数据采集速度,能够满足控制系统对高精度、高速度运动的需求。


实验效果

中心点旋转:


编队运动:


部分核心代码

编队初始化

% tello init
tello.command_port = 8889;
tello.udp_command  = udpport("LocalPort", tello.command_port);
global tello1_ip tello2_ip tello3_ip tello4_ip tello5_ip;
tello1_ip = '192.168.1.1';
tello2_ip = '192.168.1.2';
tello3_ip = '192.168.1.3';
tello4_ip = '192.168.1.4';
tello5_ip = '192.168.1.5';
write(tello.udp_command, uint8('command'), tello1_ip, tello.command_port);
write(tello.udp_command, uint8('command'), tello2_ip, tello.command_port);
write(tello.udp_command, uint8('command'), tello3_ip, tello.command_port);
write(tello.udp_command, uint8('command'), tello4_ip, tello.command_port);
write(tello.udp_command, uint8('command'), tello5_ip, tello.command_port);

队形切换

 if(run_state == 1)
        % 起飞
        write(tello.udp_command, uint8('takeoff'), tello1_ip, tello.command_port);
        write(tello.udp_command, uint8('takeoff'), tello2_ip, tello.command_port);
        write(tello.udp_command, uint8('takeoff'), tello3_ip, tello.command_port);
        write(tello.udp_command, uint8('takeoff'), tello4_ip, tello.command_port);
        write(tello.udp_command, uint8('takeoff'), tello5_ip, tello.command_port);
    elseif(run_state == 0)
        % 降落
        write(tello.udp_command, uint8('land'), tello1_ip, tello.command_port);
        write(tello.udp_command, uint8('land'), tello2_ip, tello.command_port);
        write(tello.udp_command, uint8('land'), tello3_ip, tello.command_port);
        write(tello.udp_command, uint8('land'), tello4_ip, tello.command_port);
        write(tello.udp_command, uint8('land'), tello5_ip, tello.command_port);
    else
        % 编队
        send_tello_rccontrol(tello, tello1_ip, v_ctrl1);
        send_tello_rccontrol(tello, tello2_ip, v_ctrl2);
        send_tello_rccontrol(tello, tello3_ip, v_ctrl3);
        send_tello_rccontrol(tello, tello4_ip, v_ctrl4);
        send_tello_rccontrol(tello, tello5_ip, v_ctrl5);
    end

 if(formation_state == 1)
        safe_distance = 0.45;
        for i_f = 1:5
            p_ref(:, i_f) = [radius_ref*sin(2*pi*(i_f-1)/5); radius_ref*cos(2*pi*(i_f-1)/5); height_ref];
        end
        if(cmd.A == true && t >= 2.0)
            t_formation     = t_now;
            formation_state = 2;
        end
    elseif(formation_state == 2)
        T = 10.0;
        for i_f = 1:5
            p_ref(:, i_f) = [radius_ref*sin(2*pi*(i_f-1)/5+2*pi*t/T); radius_ref*cos(2*pi*(i_f-1)/5+2*pi*t/T); height_ref];
        end
        if(t >= 1.8*T)
            formation_state = 3;
        end

总结

本文详细探讨了Tello无人机在多机器人系统中的应用,并介绍了无人机的通信控制,使用Matlab工具进行速度控制器的设计和参数整定,实现机器人编队飞行的方法,以及采用OptiTrack系统进行高精度动作捕捉的无人机定位技术。并进行了物理效果展示。

参考

  1. Ghazi G, Voyer J. Use of a DJI Tello Drone as an Educational Platform in the Field of Control Engineering[J]. Proceedings of the Canadian Engineering Education Association (CEEA), 2023.
  2. W. Giernacki, J. Rao, S. Sladic, A. Bondyra, M. Retinger and T. Espinoza-Fraire, “DJI Tello Quadrotor as a Platform for Research and Education in Mobile Robotics and Control Engineering,” _2022 International Conference on Unmanned Aircraft Systems (ICUAS)_, Dubrovnik, Croatia, 2022, pp. 735-744,