quadcopters和其他风格的无人机 quadcopters and other styles of drones
甚至在树木等级中也非常受欢迎 are extremely popular even in tree grade
车辆有精密控制 vehicles have sophisticated control
编程到其中的系统允许 systems programmed into them that allow
它们是稳定的并且能够自主飞行 them to be stable and fly autonomously
几乎没有人为干预 with very little human intervention
因此螺旋桨精确旋转 therefore propellers are spun in precise
六种方式控制四轴飞行器 ways to control the quadcopter in six
在这方面有不同的自由度 different degrees of freedom in this
系列我们通过要去散步 series we're gonna walk through the
设计的控制系统的过程 process of designing a control system
那将无人机悬停在一个 that will get a drone to hover at a
现在即使你没有固定高度 fixed altitude now even if you don't
计划写自己的无人机 plan on writing your own drone
控制器值得了解 controller it's worth understanding the
过程因为我们的工作流程 process because the workflow that we're
要遵循的是类似的 going to follow is similar to the
几乎任何你都需要的工作流程 workflow you'll need for almost any
与控制项目虽这么说 control project with that being said
这个系列使用的是无人机而不是 this series is using a drone rather than
其他一些平台因为如何 some other platform because of how
可访问的硬件是和 accessible the hardware is and the
可用的现有基础设施 existing infrastructure available for
编程和建模无人机也 programming and modeling drones also
这样飞行真的很有趣 they're just really fun to fly so with
考虑到这一点，让我们头以上的 that in mind let's head over to the
黑板， 并设置我们的问题 blackboard and set up our problem
我是Brian，欢迎来到MATLAB Tech I'm Brian and welcome to a MATLAB Tech
在我们关注的这个系列中谈论 Talk in this series we're focusing on
四轴飞行器的控制策略 the control strategies for a quadcopter
命名是因为 他们的四个旋转，从而 named so because of their four rotating
螺旋桨同样可以添加更多 propellers similarly you could add more
转子，然后他们采取类似的名字 rotors and then they take on names like
hexacopter和octocopter 但全部 hexacopter and octocopter but all of
这些无人机式飞行器是 these drone style flying machines are
整个旋转系列的一部分 part of an entire family of rotating
翼飞机叫做转子工艺 wing aircraft called rotor craft this
包括熟悉的直升机和 includes the familiar helicopter and the
不太熟悉的旋翼机以及任何 less familiar autogyro as well as any
其他使用的飞行机器 other flying machine that uses a
旋转翼而不是固定翼 rotating wing rather than a fixed wing
即使这些是产生升力 to generate lift even though these are
他们都有的所有旋翼飞行器 all rotary wing vehicles they all have
不同的动态， 因此 different dynamics and therefore
不同的控制策略 different control strategies for this
系列我们将要设计 series we're going to be designing a
四轴飞行器的控制系统 control system for a quadcopter the
鹦鹉迷你无人机现在才能成立 parrot mini-drone now in order to set up
我们需要花费一个控制问题 our control problem we need to spend a
很少时间了解我们的硬件 little time understanding our hardware
在这种情况下，硬件已经存在 in this case the hardware already exists
所以我没有能力轻松 so I don't have the ability to easily
改变任何传感器或执行器 change the sensors or actuators in any
如果你是控制者，现在有意义的方式 meaningful way now if you're the control
四轴飞行器开发工程师 engineer for a quadcopter development
程序不是你的情况 program that wouldn't be the case you
可能会被指望和指导 would probably be expected to guide and
影响设计过程使 influence the design process so that the
硬件设计合理 hardware is appropriately designed to
满足您的控制要求 meet your control requirements
因为我们的硬件已经建成了我们 since our hardware's already built we
我必须处理给予我们的东西 have to deal with what's given to us so
让我们来看看迷你无人机和 let's take a look at the mini drone and
看看我们必须与之合作 see what we have to work with we'll
如果我们翻转它，请从传感器开始 start with the sensors if we flip it
过去，看看底部有 over and look at the bottom there are
两个传感器，你可以看到一个 two sensors that you can see though one
与网格是超声波传感器 with the grid is an ultrasound sensor
那用来测量垂直 that's used to measure vertical
它发出的高频距离 distances it sends out a high-frequency
声音脉冲并测量它有多长 sound pulse and measures how long it
将脉冲从地板上弹开 takes that pulse to bounce off the floor
并返回到从所述传感器 and return back to the sensor from the
测量地板之间的时间距离 measured time distance between the floor
无人机至少可以计算出来 and the drone can be calculated at least
高达约13英尺和高度之后 up to about 13 feet and altitude after
反射的声音太软了 that the reflected sound is too soft for
传感器拿起另一个传感器 the sensor to pick up the other sensor
是一台摄像机，拍摄时的照片是60 is a camera it's taking images at 60
每秒帧数和使用图像 frames per second and using an image
处理技术称为 processing technique called
光流确定物体如何 optical flow to determine how objects
在一帧和一帧之间移动 are moving between one frame and the
接下来从这个明显的动作迷你 next from this apparent motion the mini
无人机可以估计水平运动和 drone can estimate horizontal motion and
速度 speed
现在迷你无人机里面有一个 now inside the mini drone there is a
压力传感器是间接的 pressure sensor which is indirectly
测量无人机爬升时的高度 measuring altitude as the drone climbs
在高度，气压下降 in altitude the air pressure drops
稍微，我们可以使用这个轻微 slightly and we can use this slight
改变压力估计如何 change in pressure to estimate how the
迷你无人机的高度正在发生变化 altitude of the mini drone is changing
它是在最后一个传感器上升还是下降 is it going up or down the last sensor
是惯性测量单元或IMU is an inertial measurement unit or IMU
简而言之， 这是由三个人组成的 for short this is made up of a three
测量线性的轴加速度计 axis accelerometer which measures linear
加速度和3轴陀螺仪 acceleration and a 3-axis gyroscope that
来自IMU措施角速率和 measures angular rate from the IMU and
我们对加速度的了解 our knowledge of acceleration due to
重力我们可以估计迷你无人机 gravity we can estimate the mini-drones
相对于引力的态度和方式 attitude relative to gravity and how
快速它旋转，这是它的 fast it's rotating and that's it for the
传感器我们有这四个传感器 sensors we have these four sensors to
我们可以使用超声波和 work with we can use ultrasound and
压力确定高度和 pressure to determine altitude and the
IMU和相机确定 IMU and the camera to determine
旋转和平移运动 rotational and translational motion
好的，传感器覆盖让我们谈谈 okay with the sensors covered let's talk
关于我们的执行器我们有四个电机 about our actuators we have four motors
每个都有自己的螺旋桨前面 each with their own propeller the front
两个螺旋桨是白色的和后面的 two propellers are white and the back
两个是黑色但颜色只是 two are black but the colors are just
那里向操作员表明 there to indicate to the operator which
无人机面对的方式 way the drone is facing when they're
飞行它更重要的是 flying it a more important thing to
认识到这些电机是他们的 recognize with these motors is their
配置和旋转方向这些 configuration and spin direction these
四个马达布置在X中 four motors are laid out in an X
配置而不是加号 configuration as opposed to a plus
组态 configuration
这两者之间的唯一区别是 the only difference between these two is
哪些电机你发送命令到什么时候 which motors you send commands to when
俯仰和滚动微型 无人机在 pitching and rolling the mini-drone in
一般虽然基本概念 general though the underlying concepts
现在两者都是一样的 are the same for both now the most
四轮直升机电机的巧妙组成部分 ingenious part of a quad copters motor
配置是旋转方向 configuration is the spin direction
对立的电机旋转相同 opposing motors spin in the same
方向彼此但相反 direction as each other but opposite
这是 另一对的方向 direction as the other pair this is
必须确保推力滚动 necessary to make sure that thrust roll
可以命令俯仰和偏航 pitch and yaw can be commanded
这意味着彼此独立 independently of each other that means
我们可以命令一个动作没有 that we can command one motion without
影响其他人我们会明白为什么 affecting the others we'll see why the
配置至少使这成为现实 configuration makes this true at least
在短短位第一顺序 to a first order in just a bit in
现实复杂的流体动力学 reality complex fluid dynamics around
无人机意味着所有动作都是 the drone means that all motion is
以某种方式耦合在一起，但对我们来说 coupled together in some way but for our
目的我们可以忽略那个细节和 purpose we can ignore that detail and
最终让我们的反馈控制 eventually let our feedback control
系统现在可以纠正错误 system correct for that error now we can
谈谈控制的概述 talk about the overview of the control
问题我们的工厂是无人机 problem we have our plant the drone
本身，我们有四个执行器 itself and we have our four actuators
将力和扭矩注入 that inject forces and torques into the
系统所以问题是我们如何 system so the question is how do we
将正确的输入注入我们的系统 inject the right inputs into our system
这样输出就是我们想要的结果 so that the output is the result we want
我们可以找到一种方法 that is can we figure out a way to
非常操纵这四个电机 manipulate these four motors in a very
精确的方式使无人机可以旋转 precise way so that the drone can rotate
并在三维空间中进行操纵 and maneuver around in three-dimensional
空间来帮助我们拥有我们的一套 space to help us we have our set of
我们可以直接使用的传感器 sensors that we can use to directly or
间接估计我们的状态 indirectly estimate the state of our
迷你无人机系统状态是这样的 mini drone system states are things like
角位置和速率高度和 angular position and rates altitude and
水平速度和状态 horizontal velocity and the states that
估计取决于控制 were estimating depend on the control
建筑和我们正在努力的目标 architecture and what we're trying to
完成我们要去血肉出 accomplish we're gonna flesh that out in
这个系列的更多细节 more detail throughout this series
终于了解了国家的情况 finally with knowledge of the state of
系统 the system
和我们想要的东西我们理解 and an understanding of what we want our
迷你无人机做我们可以开发一个 mini-drone to do we can develop a
控制器基本上是一种算法 controller basically an algorithm that
以我们的集合中的软件运行 runs in software that takes in our set
点和估计状态并计算 point and estimated state and calculates
那些精确的电机命令，用于 those precise motor commands that will
注入必要的力和扭矩 inject the necessary forces and torques
这就是整个问题但是和你一样 that's the whole problem but as you
可能想象得出那个 might imagine coming up with that
算法并不简单 algorithm isn't straightforward for a
四轴飞行器我们应该做的第一件事 quadcopter the first thing we should
通知是，这是一个未启动 notice is that this is an under actuated
系统我们只有四个执行器但是 system we only have four actuators but
我们有六个自由度 we have six degrees of freedom
三个转化方向和 three translational directions up and
左右前进和 down left and right forward and
向后和三个旋转 backwards and three rotational
方向滚动俯仰和偏航，从那以后 directions roll pitch and yaw and since
我们没有每个人的执行器 we don't have an actuator for every
然后我们已经知道了一些动作 motion then we already know that some
方向在任何方面都是无法控制的 directions are uncontrollable at any
以时间为例我们的迷你无人机 given time as an example our mini drone
不能够向左移动至少 is not capable of moving left at least
并非没有先旋转 not without first rotating in that
方向和前进一样 direction and the same goes for forward
我们要走了 and backward motion as well we're going
要解决此驱动下 to get around this under actuation
通过开发控制系统的问题 problem by developing a control system
将轮转和推力结合起来 that couples rotations and thrust to
现在实现总体目标 accomplish the overall goals so now
让我们来看看我们如何产生 let's walk through how we generate
推力滚动俯仰和偏航只有四个 thrust roll pitch and yaw with just four
电机以及旋转方向允许的原因 motors and why the spin Direction allows
我们从其他脱钩一个运动 us to decouple one motion from the other
电动机通过旋转产生推力 a motor produces thrust by spinning a
螺旋桨推动空气下降造成的 propeller which pushes air down causing
如果是电机，反作用力就会增加 a reaction force that is up if the motor
被置于力的位置 is placed in a position that the force
通过重心施加 is applied through the center of gravity
然后该对象将移动 of an object then that object will move
在纯粹的平移没有旋转可言 in pure translation no rotation at all
如果推力是 and if the force of the thrust is
完全等于和相反的力量 exactly equal to and opposite the force
然后物体将悬停在 of gravity then the object will hover in
放置在力从一个距离 place a force at a distance from the
重心同时产生 center of gravity produces both a
平移运动以及扭矩 translational motion as well as a torque
或围绕中心的旋转时刻 or a rotating moment about the center of
重力和我们的电机是否连接 gravity and if our motor is attached to
因为它旋转扭矩杆 the bar as it rotates the torque will
因为距离之间保持不变 stay constant since the distance between
力和重心 the force and the center of gravity
保持不变，但力量现在没有 stays the same but the force is now no
总是在相反的方向 longer always in the opposite direction
重力，因此我们的酒吧将 of gravity and therefore our bar will
开始离开 begin to move off
现在如果一边，从天上掉下来的 the side and fall out of the sky now if
相反的是反作用力 there's a counter force on the opposite
重心的一侧和每个 side of the center of gravity and each
力是重力的一半 force is half of the force of gravity
然后对象将再次停留 then the object will again stay
因为扭矩和扭矩是静止的 stationary because the torques and
部队将相互抵消 forces will cancel each other out
但是我们的执行器并不是纯粹的 but our actuators don't generate purely
因为它会产生推力 force when it generates thrust since it
通过旋转和完成推力 accomplishes thrust by rotating and
扭转螺旋桨 torquing a propeller
我们的执行器也有质量 which has mass our actuators are also
产生的反应转矩是在 generating a reaction torque that is in
相反的方向，如果两者兼而有之 the opposite direction and if both of
我们的电机在旋转 our motors are spinning in the same
方向然后扭矩加倍和 direction then the torque is doubled and
我们的酒吧现在开始转动到 our bar would start to rotate now to
反击我们可以花费的扭矩 counter this torque we could spend the
两个相反方向的电机和 two motors in opposite directions and
这对两个人来说会很好 that would work just fine for two
尺寸，但只有两个酒吧 dimensions but a bar with only two
电机无法产生 motors would not be able to generate
扭矩在第三维度 torques in the third dimension that is
我们将不能够推出这一栏，以便 we wouldn't be able to roll this bar so
我们添加了另外两个电机的第二个电压棒 we add a second bar with two more motors
用这个来创造我们的四轴飞行器 to create our quadcopter with this
我们可以悬停的配置 configuration we can hover by
加速每个电机直到它们各自 accelerating each motor until they each
产生一个四分之一的力量 produce a force one fourth that of
重力，只要我们有两个 gravity and as long as we have two
反转电机的扭矩来自 counter-rotating motors the torques from
旋转螺旋桨将平衡 spinning the propellers will balance out
并且无人机不会旋转它不会 and the drone will not spin it doesn't
无论你在哪里放 matter where you put the
反转电机只要 counter-rotating motors as long as
有两个人在一个方向 there's two of them in one direction and
两个在另一个方向但是 two in the other direction but
四轴飞行器的开发商选择了 quadcopter developers settled on a
配备相反的电机 configuration with opposing motors
在同一个方向旋转所以那里 spinning in the same direction so there
必须是一个原因 ，并有 must be a reason for this and there is
这是因为偏航或平坦 it's because of how yaw or the flat
旋转运动与滚动相互作用 spinning motion interacts with roll and
沥青理解为什么这是真的 pitch to understand why this is true
让我们来看看我们如何指挥偏航 let's look at how we would command yaw
我们有反转电机 we have counter rotating motors
特别是没有Yod specifically so that there is no Yod
所有电机在系统上的扭矩 torque on the system with all motors
以相同的速度旋转，因此使得 spinning at the same speed so it makes
某种意义上说，如果我们想花 无人机 sense that if we want to spend the drone
关于垂直轴或我们想要的 about the vertical axis or we want to
让车辆偏航然后我们需要 have the vehicle yaw then we need to
制造一个偏航 create a yaw
减速两个电机的扭矩 torque by slowing two motors down that
正朝着同一个方向奔跑 are running in the same direction and
通过放慢速度来加快其他两个速度 speed the other two up by slowing two
电机下降，加速两个 motors down and speeding two up
适当地， 我们可以保持相同的总数 appropriately we can keep the same total
整个机动的 力量 force throughout the maneuver so that
我们仍在徘徊和抵制 we're still hovering and counteracting
重力但是电机的总和 gravity but the summation of the motor
扭矩非零，车辆将 torques is nonzero and the vehicle will
纺 spin
所以这样我们可以不用偏航 so in this way we can yaw without
影响推力现在让我们看看是否 affecting thrust now let's see if yah
如果旋转，效果滚动和俯仰 effects roll and pitch if the rotating
那么电机对就在同一侧 motor pairs are on the same side then
减速减速并增加 slowing one pared-down and increasing
另一对会导致不平衡 the other pair will cause an imbalance
关于重心的力量 of forces about the center of gravity
并且车辆将倾斜或 and the vehicle will either pitch or
根据电机的哪一侧滚动 roll depending on which side the motor
然而，如果我们分开了 pairs are on however if we separate the
两个马达并将它们放在对面 two motors and place them on opposite
无人机的两侧然后部队将 sides of the drone then the forces will
相互平衡，这就是原因 balance each other out and this is why
电机配置和旋转方向 motor configuration and spin directions
如此重要我们现在可以发送命令 are so critical we can now send commands
这样的四个电机 to the four motors in such a way that
车辆将偏航但不会滚动俯仰 the vehicle will yaw but not roll pitch
或者我们可以改变它的推力 or change its thrust similarly we can
看看滚动和俯仰滚动我们 look at roll and pitch to roll we
减少其中一个左/右对和 decrease one of the left/right pairs and
增加另一个导致滚动 increase the other causing a rolling
扭矩和俯仰我们减少一个 torque and to pitch we decrease one of
前/后对和增加 the front/back pairs and increase the
其他引起俯仰扭矩二者的 other causing a pitching torque both of
这些动作对Y没有影响 these motions would have no effect on Y
因为我们正在反转 since we're moving counter rotating
同一方向的电动机和它们的 motors in the same direction and their
偏航扭矩将继续取消每个 yaw torque would continue to cancel each
其他现在要改变我们需要的推力 other out now to change thrust we need
增加或减少所有四个电机 to increase or decrease all four motors
同时以这种方式滚动间距 simultaneously in this way roll pitch
偏航和推力是四个方向 yaw and thrust are the four directions
我们有直接控制和 that we have direct control over and the
对电动机的命令将是混合的 commands to the motors would be a mix of
推力滚动俯仰量和偏航量 the amount of thrust roll pitch and yaw
我们现在知道我们可以命令 required as we now know we can command
将所有四个电机设置为 thrust by setting all four motors to the
相同的速度然后我们可以创造偏航 same speed then we can create yaw by
增加两台电机的费用相同 increasing two motors spending the same
方向和减少其他两个 direction and decrease the other two
通过增加或创建音高 pitch is created by increasing or
减少前电机对然后 decreasing the front motor pair and then
在对面指挥后卫对 commanding the back pair in the opposite
方向和滚动是相同的，但有 direction and roll is the same but with
左右对这是我们的简单 the left right pair this is our simple
可转换的电机混合算法 motor mixing algorithm that can convert
在直观的滚动俯仰偏航和 between the intuitive roll pitch yaw and
推力和不太直观的电机 thrust and the less intuitive motor
现在的速度正如我刚才所说移动 speeds now as I said earlier moving
我们向前和向后转发 forwards backwards left and right our
未激活的动作和我们获得的方式 unactivated motions and the way we get
在那附近是先旋转成一个 around that is by first rotating into an
推力矢量的姿态 attitude where the thrust vector is
部分地在重力方向上 partially in the gravity direction
部分地在行进的方向 partially in the direction of travel to
如果 ， 现在以这种方式加速无人机 accelerate the drone in that way now if
我们想要保持高度 we wanted to maintain altitude while we
做这个操作然后我们会增加 do this maneuver then we would increase
推力使垂直 the thrust so that the vertical
组件仍在取消 component is still cancelling out the
向下拉引力可以，所以我们 downward pull of gravity all right so we
知道操纵四个电机 know that manipulating the four motors
以特定的方式将允许我们 in specific ways will allow us to
控制三维空间中的无人机和我们 control the drone in 3d space and we
有一套我们可以使用的传感器 have a set of sensors that we can use to
估计系统的状态和我们 estimate the state of the system and we
有一个可以运行的板载处理器 have an onboard processor that can run
我们的控制逻辑控制系统 our control logic the control system
发展最终将在 development will ultimately be done in
Simulink我们要建造的地方 Simulink where we're going to build and
模拟模型四轴调 simulate the quadcopter model tune the
控制器在闭环中测试它 controller test it in a closed loop
模拟然后最后 simulation and then finally
自动生成航班代码 automatically generate flight code that
我们要加载到板载 we're going to load into the onboard
鹦鹉迷你无人机上的微控制器 microcontroller on the parrot mini-drone
但下一步要弄明白 but the very next step is to figure out
我们如何设置控制系统 how we want to set up the control system
建筑，我们要谈谈 architecture and we're going to talk
关于下一个视频中的内容，如果你 about that in the next video so if you
不想错过下一次技术讲座 don't want to miss the next Tech Talk
视频不要忘记订阅这个 video don't forget to subscribe to this
频道也如果你想看看我的 channel also if you want to check out my
我负责的频道控制系统讲座 channel control system lectures I cover
那里还有更多的控制理论主题 more control theory topics there as well
谢谢你的收看，我会见到你 thanks for watching and I'll see you
下一次 next time