四轴飞行器控制电路详解
四轴 原理
四轴原理
四轴原理即为四旋翼飞行器的工作原理。
四旋翼飞行器由四个相对对称的旋翼组成,每个旋翼都由一个电动机驱动,并通过控制电路进行精确的调节。
四轴飞行器的飞行原理是通过对四个旋翼的转速进行精确控制,实现悬停、上升、下降、前进、后退、向左、向右平移以及旋转等多种飞行动作。
具体原理如下:
1. 升力平衡原理:四个旋翼产生的升力将飞行器维持在空中,飞行器的重力与升力平衡,实现悬停状态。
2. 空气动力学平衡原理:四个旋翼的转速可以通过电机转速控制器进行精确调节,进而调节各个旋翼产生的升力大小,实现空气动力学平衡。
3. 控制算法原理:通过搭载的传感器(如加速度计、陀螺仪、磁力计等)实时监测飞行器的姿态信息,将监测到的数据传输给飞行控制器。
飞行控制器根据姿态信息计算出相应的控制指令,通过电调调节四个旋翼的转速,控制飞行器的姿态。
如需向前飞行,则增加后面两个旋翼的转速,减小前面两个旋翼的转速,使飞行器倾斜向前。
类似地,对其他方向的飞行也是通过对相应旋翼转速的调节实现的。
4. 电源与电路原理:四轴飞行器通过电池为电动机提供能量,电路控制系统将飞行器的控制信号转化为电流和电压输出供电给电动机。
通过对四个旋翼的转速进行精确控制,在合适的气动力学平衡和姿态控制下,四轴飞行器能够实现精确悬停、稳定飞行及各种飞行动作,具有广泛的应用前景。
基于STM32四轴飞行器电路设计的详细图解资料概述
基于STM32四轴飞行器电路设计的详细图解资料概
述
四轴飞行器是一种利用四个旋翼作为飞行引擎来进行空中飞行的飞行器。
进入20世纪以来,电子技术飞速发展四轴飞行器开始走向小型化,并融入了人工智能,使其发展趋于无人机,智能机器人。
四轴飞行器不但实现了直升机的垂直升降的飞行性能,同时也在一定程度上降低了飞行器机械结构的设计难度。
四轴飞行器的平衡控制系统由各类惯性传感器组成。
在制作过程中,对整体机身的中心、对称性以及电机性能要求较低,这也正是制作四轴飞行器的优势所在,而且相较于固定翼飞机,四轴也有着可垂直起降,机动性好,易维护等优点。
系统方案
本设计采用STM32F4作为核心处理器,该处理器内核架构ARM Cortex-M4,具有高性能、低成本、低功耗等特点。
设计总体框图。
六个自由度的四旋翼飞行控制原理
1.四旋翼飞行器只有四个输入力,同时却有六个状态输出,所以 它又是一种欠驱动系统。 2.四旋翼飞行器是通过改变旋翼转速实现升力变化。 3.电机1和电机3逆时针旋转的同时,电机2和电机4顺时针旋转, 保证四旋翼飞行器能够提供升力的同时,又能平衡其对机身 的反扭矩。
机载端控制电路版开发
• 红外接收装置——接收到发射装置的信息传递给单片机。
• 中央处理——单片机将接收到的红外信息处理,发送到PWM装置, 控制发动机的转速改变。
动力电路开发(PWM控制电流装置)
PWM电流控制电路: 每个PWM控制 器由一组电桥、及其外部一个感应电 阻(Rs)、一个内部比较器和一个单 稳多谐振荡器组成,来独立感应和控 制输出电流。
红外线接收器(接收信号)
反馈
单片机(中央处理)
PWM 步进电机(改变电流大小)
电机(转速改变) 飞行动作 轨道偏移外部扰动来自遥控电路开发(红外线装置)
• 四通道遥控器——上下、左右、前后、旋转 • 红外遥控装置——开关键,上升下降键,方向前后左右键。 (开关键:开启时,转速与飞行器重力刚好抵消,处于悬停 状态。关闭时,转速为零,处于停止状态。)
输出电流的逻辑控制:两个输入逻辑信号(l0 和 I1)用于数 字选择电机线圈电流在其最大水平的百分比,100%, 67%, 33%, or 0%。0%的输出电流值说明电桥关闭了所有驱动并且 也作为一个输出特性。
外界干扰因素
• 1.传感器噪声 • 2.外部扰动 • 3.摩擦 • 4.风速
R5F100LE控制的四旋翼自主飞行器,含原理图、程序
式 1-1
y
z ]T 为四旋翼飞行器在导航坐标系下的线位移, [ x y z ]T 为运动加速度,m
为飞行器质量, , , 分别为机体的偏航角、俯仰角和横滚角,l 为旋翼面中心到四旋翼飞行 器质心的距离,I X , IY , I Z 为轴向惯性主矩。该动力学模型对四旋翼飞行器的真实飞行状态进 行了合理的简化,忽略了空气阻力等对系统运行影响较小的参数,使得飞行控制算法更加简 洁。 2.2 PID 控制算法结构分析 在动力学模型的基础上,将小型四旋翼飞行器实时控制算法分为两个控制回路,即位置
其中, xd , yd , zd 为航姿参考系统测量到的加速度积分得到的位移量。
1.2 电机的选择与论证
四旋翼无人飞行器是通过控制四个不同无刷直流电机的转速,达到控制四旋翼无人飞行 器的飞行姿态和位置,与传统直升机通过控制舵机来改变螺旋桨的桨距角,达到控制直升机 的目的不同。在电机的选型上,主要有直流有刷电机和直流无刷电机两种。 方案一:直流有刷电机是当前普遍使用的一种直流电机,它的驱动电路简单、控制方法 成熟,但是直流有刷电机使用电刷进行换向,换向时电刷与线圈触电存在机械接触,电机长 时间高速转动使极易因磨损导致电气接触不良等问题,而且有刷电机效率低、力矩小、重量 大,不适合对功率重量比敏感的电动小型飞行器。 方案二:直流无刷电机能量密度高、力矩大、重量轻,采用非接触式的电子换向方法, 消除了电刷磨损,较好地解决了直流有刷电机的缺点,适用于对功率重量比敏感的用途,同 时增强了电机的可靠性。
-2-
所以选择直流无刷电机作为动力源。
1.3 电机驱动方案的选择与论证
方案一:采用电阻网络或数字电位器调整电动机的分压,从而达到调速的目的。但是电阻 网络只能实现有级调速,而数字电阻的元器件价格比较昂贵。更主要的问题在于一般电动机 的电阻很小,但电流很大;分压不仅会降低效率,而且实现很困难。 方案二:采用继电器对电动机的开或关进行控制,通过开关的切换对小车的速度进行调 整。这个方案的优点是电路较为简单,缺点是继电器的响应时间慢、机械结构易损坏、寿命 较 短、可靠性不高。 方案三:采用全桥驱动 PWM 电路。这种驱动的优点是使管子工作在占空比可调的开关状 态,提高使用效率实现电机转速的微调。并且保证了可以简单的方式实现方向控制。 基于上述理论分析,选择方案三。
四轴(多轴)飞行器概述
四轴(多轴)飞行器概述一、简介四轴(多轴)飞行器也叫四旋翼(多旋翼)飞行器它有四个(多个)螺旋桨,四轴(多轴)飞行器也是飞行器中结构最简单的飞行器了。
前后左右各一个,其中位于中心的主控板接收来自于遥控发射机的控制信号,在收到操作者的控制后通过数字的控制总线去控制四个电调,电调再把控制命令转化为电机的转速,以达到操作者的控制要求,前后马达是顺时针转动,需要安装反桨,左右马达是逆时针转动,需要安装正桨,机械结构上只需保持重量分布的均匀,四电机保持在一个水平线上,可以说结构非常简单,做四轴的目的也是为了用电子控制把机械结构变得尽可能的简单。
二、控制原理四轴飞行器的控制原理就是,当没有外力并且重量分布平均时,四个螺旋桨以一样的转速转动,在螺旋桨向上的拉力大于整机的重量时,四轴就会向上升,在拉力与重量相等时,四轴就可以在空中悬停。
在四轴的前方受到向下的外力时,前方马达加快转速,以抵消外力的影响从而保持水平,同样其它几个方向受到外力时四轴也是可以通过这种动作保持水平的,当需要控制四轴向前飞时,前方的马达减速,而后方的马达加速,这样,四轴就会向前倾斜,也相应的向前飞行,同样,需要向后、向左、向右飞行也是通过这样的控制就可以使四轴往我们想要控制的方向飞行了,当我们要控制四轴的机头方向向顺时针转动时,四轴同时加快左右马达的转速,并同时降低前后马达的转速,因为左右马达是逆时针转动的,而左右马达的转速是一样,所以左右是保持平衡的,而前后马达是顺时针转动的,但前后马达的转速也是一样的,所以前后左右都是可以保持平衡,飞行高度也是可以保持的,但是逆时针转动的力比顺时针就大,所以机身会向反方向转动,从而达到控制机头的方向。
这也是为什么要使用两个反桨,两个正桨的原因。
三、电调我们平时用的商品电调是通过接收机上的油门通道进行控制的,这个接收机出来的控制信号一般都是20mS 间隔的PPM脉宽控制信号,而四轴为了提高响应的速度,需要控制命令的间隔更短-比如说5mS,所以就需要特殊的电调而不能用普通的商品电调,但是为什么要使用I2C总线跟电调连接呢,这个跟电路设计以及软件编写等有关,I2C总线在硬件连接上可以多个设备直接并连在总线上,它有相应的传输机制保证主机与各个从机之前顺畅沟通,这样连接就比较的方便,所以四个电调的控制线是并接在一起连到主控板上就可以了,这个也跟我们选用的芯片相关,很多单片机都有集成I2C总线的,软件设计起来也得心应手。
全球最小四轴飞行器Crazyflie电路部分详解
全球最小四轴飞行器Crazyflie电路部分详解上网日期: 2016年02月16日Crazyflie是目前全世界最小的四轴飞行器,仅重19克,相对的两翼之间长度为9厘米。
有两个不同的版本,区别在于传感器的数量。
这个小四轴飞行器可以在空中飞行长达7分钟,通过一个标准的USB接头给锂聚合物电池充电需要约20分钟。
它的电路部分到底是如何实现的?且听我慢慢道来。
1. 电气原理从中心开始:72M主频的M3内核的处理器来处理各传感器数据,并对四个旋翼进行控制达到想要的效果。
往上:通过IIC接口与三轴陀螺仪、三轴加速度计(也就是MPU6050)、磁力计、气压计等传感器连接获取传感器数据,来感知载体(也就是四轴机体)的姿态(这里的姿态包括俯仰、横滚、航向)和高程。
往下:通过PWM调节四个电机驱动器来驱动四个电机转动,由于电机带有螺旋桨转动而产生所谓的“升力”。
往右:通过SPI协议接口与无线芯片通讯,回传载体数据和接收控制信号,还有外部扩展接口。
往左:电源管理部分。
2. 电池电池使用的是锂电池(锂离子聚合物电池),是目前流行的遥控模型电池。
但锂电池必须按照规定使用,过冲、过放都会产生安全隐患。
由于它具有最高的电能/质量比和最大的放电电流,所以也是比较适合的选择。
为了应付锂电池的这些缺点,我们使用电路保护模块(PCM)来防止电量不足、过放电或者短路。
PCM 位于电池上部的橙色胶带下面,从中引出两条电源线。
但是这种保护是远远不够的,还需要有专门的充放电管理电路来保护。
比如电气原理图的Power Mangment and Charging部分。
PCM 的参数如下:3. 电源管理电源管理主要是由TI BQ24075 电源管理芯片来完成。
它能开/关和给锂电池充电。
BQ24075有三种输入限制模式,100mA,500mA和用户自定义(Crazyflie设置740mA)。
当将Crazyflie 接上普通电源适配器时就可以使它能快速的充电。
四轴飞行器飞行原理与双闭环PID控制
四轴飞行器是微型飞行器的其中一种,相对于固定翼飞行器,它的方向控制灵活、抗干扰能力强、飞行稳定,能够携带一定的负载和有悬停功能,因此能够很好地进行空中拍摄、监视、侦查等功能,在军事和民用上具备广泛的运用前景。
四轴飞行器关键技术在于控制策略。
由于智能控制算法在运行复杂的浮点型运算以及矩阵运算时,微处理器计算能力受限,难以达到飞行控制实时性的要求;而PID控制简单,易于实现,且技术成熟,因此目前主流的控制策略主要是围绕传统的PID控制展开。
1 四轴飞行器的结构与基本飞行原理四轴飞行器结构主要由主控板和呈十字交叉结构的4个电子调速器、电机、旋浆组成,电机由电子调速器控制,主控板主要负责解算当前飞行姿态、控制电调等功能。
以十字飞行模式为例,l号旋翼为头,1、3号旋翼逆时针旋转,2、4号旋翼顺时针旋转,如图1所示。
图1 四轴飞行器结构图参照飞行状态表1变化电机转速,由于四个电机转速不同,使其与水平面倾斜一定角度,如图l所示。
四个电机产生的合力分解为向上的升力与前向分力。
当重力与升力相等时,前向分力驱动四轴飞行器向倾斜角度的方向水平飞行。
空间三轴角度欧拉角分为仰俯角、横滚角、航向角:倾斜角是仰俯角时,向前、向后飞行;倾斜角是横滚角时,向左、向右飞行;而倾斜航向角时,向左、右旋转运动,左(右)旋转是由于顺时针两电机产生的反扭矩之和与逆时针两电机产生的反扭矩之和不等,即不能相互抵消,机身便在反扭矩作用下绕z轴自旋转。
2 姿态解算四轴飞行器运用姿态解算计算出空间三轴欧拉角。
结构框架如图2所示,陀螺仪采样三轴角速度值,加速度传感器采样三轴加速度值,而磁力传感器采样得到三轴地磁场值,将陀螺仪、加速度传感器、磁力传感器采样后的数据进行标定、滤波、校正后得到三轴欧拉角度,其中陀螺仪和加速度传感器选用MPU6050芯片,磁力传感器选用HMC5883L芯片,采用IIC总线与主控板通信。
图2 姿态解算结构图由于传感器存在器件误差,因此在使用前需要标定。
四旋翼飞行器控制系统硬件电路设计
图1 四旋翼飞行器的结构形式
2015.12
41
行。
通过适当地改变电机的转速,来控制飞行器的飞行状态。
1.3 飞行器控制系统总体系统设计出系统,控制模块的主要输入信号有
各个传感器的测量数据,输出信号为
四路变脉宽电机控制信号,需要多个
载与调试。
此微控制器具有8个定时
器,对于信号采集和PWM输出均能
图4 遥控器硬件电路图3 MPU-6050姿态测量电路
图2 系统总体框图
nRF24L01无线模块器件。
其发射电路可以通过LC振荡电路构成。
为了便控制参数给飞行器,使其按照控制
算法运行;(2)在飞行器调试阶段,
完成飞行器PID参数的修改和调整。
(2)反电动势检测
在换向的过程中
图5 反电动势检测电路图6 实际飞行姿态角数值
图13 ZVS降压时序图
图14 无人机数据链解决方案。
四轴飞行器飞控原理要点
四轴飞行器飞控原理四轴飞行器飞控原理 (1)一、六种姿态控制原理示意 (3)二、四轴翼飞行器系统建模 (4)2.1假设条件: (4)2.2建立坐标系: (5)2.3转换矩阵推导: (6)2.4非线性模型 (7)2.5模型线性化 (11)三、基于PID的飞行控制 (15)四、硬件设计与实现 (17)4.1四轴飞行器硬件电路 (17)五、国内外四轴飞行器 (17)5.1 Kesterl (17)5.2 Unav3500 (18)5.3 MikroKoper (18)5.4 ArduPilot (19)5.5 Crazyflie (20)一、六种姿态控制原理示意图1 上下(高度)控制,就是四个螺旋桨同时增加(减小)转速;图2 前进、后退图3 左飞、右飞图4 类似打方向盘,改变航向二、四轴翼飞行器系统建模2.1假设条件:微小型四旋翼飞行器在三维空间中可视为刚体,飞行器在空间中的运动具有六个自由度,即飞行器质心在空间中的三个平移自由度和三个旋转自由度。
由于该飞行器一般为低空低速飞行,因此可以对其动力学模型的建立做如下假设:1)微小型四旋翼飞行器在研究中视为刚体,忽略其弹性影响,总质量m 为常数;2)将地球视为惯性系统,忽略地球自转和公转对飞行器的影响;3)假设地面为水平平面,忽略地球曲率的影响;4)重力加速度g为常数,不随地理位置和飞行高度的变化而变化;5)飞行器机机体几何外形完全对称且质量分布均勻,质心与几何中心重合。
2.2建立坐标系:图5机体坐标系B、地面坐标系EФ绕X轴方向的横滚角(rad);θ绕轴方向的俯仰角(rad);ψ绕Z轴方向的偏航角(rad):2.3转换矩阵推导:(可以查阅高等数学方向余弦,矩阵论中的旋转矩阵等资料)公式(1)公式(2)2.4非线性模型由于作用到飞行器上的合力和合力矩是四个螺旋奖所产生的力与力矩的矢量和,因此,他们之间存在极大地交叉耦合特性。
例如,横滚(俯仰)力矩的改变将会对侧向(纵向)加速度有一个直接的影响。
四轴飞行器 遥控 硬件+全套源代码 + 飞控Arm Cortex 硬件原理图PCB 联系
BK2425Low Power High Performance 2.4 GHz GFSK Transceiver Features Pin Assignments⏹2400-2483.5 MHz ISM band operation⏹Support 250Kbps, 1Mbps and 2 Mbps airdata rate⏹Programmable output power⏹Low power consumption⏹Tolerate +/- 60ppm 16 MHz crystal⏹Variable payload length from 1 to 32bytes⏹Automatic packet processing⏹ 6 data pipes for 1:6 star networks⏹ 1.9V to 3.6V power supply⏹4-pin SPI interface with maximum 8 MHzclock rate⏹20-pin 4x4mm QFN packageApplications⏹Wireless PC peripherals⏹Wireless gamepads⏹Wireless audio⏹Remote controls⏹Home automation⏹ToysBlock DiagramNC CDVDD VDD VSS VDD20 19 18 17 16CE 1 15 VDDCSN 2 14 VSSSCKBK2425 RF3 13MOSI 4 12 NCMISO 5 11 NC6 7 8 9 10IRQ NC NC XO XI四轴飞行器遥控硬件+全套源代码 + 飞控Arm Cortex 硬件原理图PCB 联系:QQ 766384919RFPFMData SlicerRx FIFOInterfaceSPICSN RFN SCKDemodulatorMOSIMISOIntegratedPowerPacketIRQ TDD RF Processing &ManagementTransceiver State Control CEFM ModulatorGaussianbanksRegistershaping Tx FIFOXTALP XTALNRevision 1.0 Copyright © 2013 Beken Corporation Jan, 2013 Page 1 of 30BK2425 Table of Contents1 General Description (3)2 Abbreviations (4)3 Pin Information (5)4 State Control (6)4.1 State Control Diagram (6)4.2 Power Down Mode (7)4.3 Standby-I Mode (7)4.4 Standby-II Mode (7)4.5 TX Mode (7)4.6 RX Mode (8)5 Packet Processing (8)5.1 Packet Format (8)5.1.1 Preamble (9)5.1.2 Address (9)5.1.3 Packet Control (9)5.1.4 Payload (10)5.1.5 CRC (10)5.2 Packet Handling (10)6 Data and Control Interface (11)6.1 TX/RX FIFO (11)6.2 Interrupt (11)6.3 SPI Interface (12)6.3.1 SPI Command (12)6.3.2 SPI Timing (13)7 Register Map (15)7.1 Register Bank 0 (15)7.2 Register Bank 1 (21)8 Electrical Specifications (22)9 Typical Application Schematic (23)10 Package and Die Bonding Information (24)10.1 Package Information (24)10.2 Die Bonding Information (25)10.3 PCB Bonding diagram (27)11 Order Information (28)12 Contact Information (29)13 Update History (30)BK2425 1 General DescriptionBK2425 is a GFSK transceiver operating in theworld wide ISM frequency band at 2400-2483.5 MHz. Burst mode transmission and upto 2Mbps air data rate make them suitable forapplications requiring ultra low powerconsumption. The embedded packet processingengines enable their full operation with a verysimple MCU as a radio system. Auto re-transmission and auto acknowledge givereliable link without any MCU interference.BK2425 operates in TDD mode, either as atransmitter or as a receiver.The RF channel frequency determines thecenter of the channel used by BK2425. Thefrequency is set by the RF_CH register inregister bank 0 according to the followingformula: F0= 2400 + RF_CH (MHz). Theresolution of the RF channel frequency is1MHz.A transmitter and a receiver must beprogrammed with the same RF channelfrequency to be able to communicate with eachother.The output power of BK2425 is set by theRF_PWR bits in the RF_SETUP register.Demodulation is done with embedded dataslicer and bit recovery logic. The air data ratecan be programmed to 250Kbps, 1Mbps or2Mbps by RF_DR_HIGH and RF_DR_LOWregister. A transmitter and a receiver must beprogrammed with the same setting.In the following chapters, all registers are inregister bank 0 except with explicit claim.RFPFMData SlicerRx FIFOInterfaceSPICSN RFN SCKDemodulatorMOSIMISOIntegratedPowerPacketIRQ TDD RF Processing &ManagementTransceiver State Control CEFM ModulatorGaussianbanksRegistershaping Tx FIFOXTALP XTALNFigure 1 BK2425 Chip Block DiagramBK2425 2 AbbreviationsACK AcknowledgementARC Auto Retransmission CountARD Auto Retransmission DelayCD Carrier DetectionCE Chip EnableCRC Cyclic Redundancy CheckCSN Chip Select NotDPL Dynamic Payload LengthFIFO First-In-First-OutGFSK Gaussian Frequency Shift KeyingGHz GigahertzLNA Low Noise AmplifierIRQ Interrupt RequestISM Industrial-Scientific-MedicalLSB Least Significant BitMAX_RT Maximum RetransmitMbps Megabit per secondMCU Microcontroller UnitMHz MegahertzMISO Master In Slave OutMOSI Master Out Slave InMSB Most Significant BitPA Power AmplifierPID Packet Identity BitsPLD PayloadPRX Primary RXPTX Primary TXPWD_DWN Power DownPWD_UP Power UpRF_CH Radio Frequency ChannelRSSI Received Signal Strength IndicatorRX ReceiveRX_DR Receive Data ReadySCK SPI ClockSPI Serial Peripheral InterfaceTDD Time Division DuplexTX TransmitTX_DS Transmit Data SentXTAL CrystalBK2425 3 Pin InformationNC CDVDD VDD VSS VDD20 19 18 17 16CE 1 15 VDDCSN 2 14 VSSBK2425 RFSCK 3 13MOSI 4 12 NCMISO 5 11 NC6 7 8 9 10IRQ NC NC XO XIFigure 2 BK2425 pin assignments (top view) for the QFN20 packagePIN Name Pin Function Description1 CE Digital Input Chip Enable Activates RX or TX mode2 CSN Digital Input SPI Chip Select, Active low3 SCK Digital Input SPI Clock4 MOSI Digital Input SPI Slave Data Input5 MISO Digital Output SPI Slave Data Output with tri-state option6 IRQ Digital Output Maskable interrupt pin, Active low7 NC No Connection8 NC No Connection9 XO Analog Output Crystal oscillator, node P (inverter output)10 XI Analog Input Crystal oscillator, node N (inverter input)11 NC No Connection12 NC No Connection13 RFN RF port RF output (PA) /Input (LNA), port N.14 VSS Ground Ground (0 V)15 VDD Power Power Supply (1.9 V to 3.6 V DC)16 VDD Power Supply (1.9 V to 3.6 V DC)17 VSS Ground Ground (0 V)18 VDD Power Power Supply (1.9 V to 3.6 V DC)19 CDVDD Analog Output Digital regulator output decoupling capacitor20 NC No ConnectionTable 1 BK2425 QFN20 pin functionsRevision 1.0Proprietary and Confidential Page 5 of 30BK24254 State Control4.1 State Control Diagram⏹ Pin signal: VDD, CE⏹ SPI register: PWR_UP, PRIM_RX, EN_AA, NO_ACK, ARC, ARD⏹System information: Time out, ACK received, ARD elapsed, ARC_CNT, TX FIFO empty, ACK packet transmitted, Packet receivedBK2425 has built-in state machines that control the state transition between different modes.When auto acknowledge feature is disabled, state transition will be fully controlled by MCU.Figure 3 PTX (PRIM_RX=0) state control diagramBK2425Figure 4 PRX (PRIM_RX=1) state control diagram4.2 Power Down ModeIn power down mode BK2425 is in sleep mode with minimal current consumption. SPI interface is still active in this mode, and all register values are available by SPI. Power down mode is entered by setting the PWR_UP bit in the CONFIG register to low.4.3 Standby-I ModeBy setting the PWR_UP bit in the CONFIG register to 1 and de-asserting CE to 0, the device enters standby-I mode. Standby-I mode is used to minimize average current consumption while maintaining short start-up time. In this mode, part of the crystal oscillator is active. This is also the mode which the BK2425 returns to from TX or RX mode when CE is set low.4.4 Standby-II ModeIn standby -II mode more clock buffers are active than in standby-I mode and much more current is used. Standby-II occurs when CE is held high on a PTX device with empty TX FIFO. If a new packet is uploaded to the TX FIFO in this mode, the device will automatically enter TX mode and the packet is transmitted.4.5 TX Mode⏹ PTX device (PRIM_RX=0)The TX mode is an active mode where the PTX device transmits a packet. To enter this mode from power down mode, the PTX device must have the PWR_UP bit set high, PRIM_RX bit set low, a payload in the TX FIFO, and a high pulse on the CE for more than 10µs.BK2425The PTX device stays in TX mode until it finishes transmitting the current packet. If CE = 0 it returns to standby-I mode. If CE = 1, the next action is determined by the status of the TX FIFO. If the TX FIFO is not empty the PTX device remains in TX mode, transmitting the next packet. If the TX FIFO is empty the PTX device goes into standby-II mode. It is important to never stay in TX mode for more than 4ms at one time.If the auto retransmit is enabled (EN_AA=1) and auto acknowledge is required (NO_ACK=0), the PTX device will enter TX mode from standby-I mode when ARD elapsed and number of retried is less than ARC.⏹ PRX device (PRIM_RX=1)The PRX device will enter TX mode from RX mode only when EN_AA=1 and NO_ACK=0 in received packet to transmit acknowledge packet with pending payload in TX FIFO.4.6 RX Mode⏹ PRX device (PRIM_RX=1)The RX mode is an active mode where the BK2425 radio is configured to be a receiver. To enter this mode from standby-I mode, the PRX device must have the PWR_UP bit set5 Packet Processinghigh, PRIM_RX bit set high and the CE pin set high. Or PRX device can enter this mode from TX mode after transmitting an acknowledge packet when EN_AA=1 and NO_ACK=0 in received packet.In this mode the receiver demodulates the signals from the RF channel, constantly presenting the demodulated data to the packet processing engine. The packet processing engine continuously searches for a valid packet. If a valid packet is found (by a matching address and a valid CRC) the payload of the packet is presented in a vacant slot in the RX FIFO. If the RX FIFO is full, the received packet is discarded.The PRX device remains in RX mode until the MCU configures it to standby-I mode or power down mode.In RX mode a carrier detection (CD) signal is available. The CD is set to high when a RF signal is detected inside the receiving frequency channel. The internal CD signal is filtered before presented to CD register. The RF signal must be present for at least 128 µs before the CD is set high.⏹ PTX device (PRIM_RX=0)The PTX device will enter RX mode from TX mode only when EN_AA=1 and NO_ACK=0 to receive acknowledge packet.5.1 Packet FormatThe packet format has a preamble, address, packet control, payload and CRC field.Preamble 1 byteAddress 3~5 byte Packet Control 9/0 bit Payload 0~32 byte CRC 2/1 bytePayload Length 6 bitPID 2 bitNO_ACK 1 bitFigure 5 Packet FormatBK24255.1.1PreambleThe preamble is a bit sequence used to detect 0 and 1 levels in the receiver. The preamble is one byte long and is either 01010101 or 10101010. If the first bit in the address is 1 the preamble is automatically set to 10101010 and if the first bit is 0 the preamble is automatically set to 01010101. This is done to ensure there are enough transitions in the preamble to stabilize the receiver.5.1.2AddressThis is the address for the receiver. An address ensures that the packet is detected by the target receiver. The address field can be configured to be 3, 4, or 5 bytes long by the AW register.The PRX device can open up to six data pipes to support up to six PTX devices with unique addresses. All six PTX device addresses are searched simultaneously. In PRX side, the data pipes are enabled with the bits in the EN_RXADDR register. By default only data pipe 0 and 1 are enabled.Each data pipe address is configured in the RX_ADDR_PX registers.Each pipe can have up to 5 bytes configurable address. Data pipe 0 has a unique 5 byte address. Data pipes 1-5 share the 4 most significant address bytes. The LSB byte must be unique for all 6 pipes.To ensure that the ACK packet from the PRX is transmitted to the correct PTX, the PRX takes the data pipe address where it received the packet and uses it as the TX address when transmitting the ACK packet.On the PRX, the RX_ADDR_Pn, defined as the pipe address, must be unique. On the PTX the TX_ADDR must be the same as the RX_ADDR_P0 on the PTX, and as the pipe address for the designated pipe on the PRX. No other data pipe can receive data until a complete packet is received by a data pipe that has detected its address. When multiple PTX devices are transmitting to a PRX, the ARD can be used to skew the auto retransmission so that they only block each other once.5.1.3Packet ControlWhen Dynamic Payload Length function is enabled, the packet control field contains a 6 bit payload length field, a 2 bit PID (Packet Identity) field and, a 1 bit NO_ACK flag.⏹Payload lengthThe payload length field is only used if the Dynamic Payload Length function is enabled.⏹PIDThe 2 bit PID field is used to detect whether the received packet is new or retransmitted. PID prevents the PRX device from presenting the same payload more than once to the MCU. The PID field is incremented at the TX side for each new packet received through the SPI. The PID and CRC fields are used by the PRX device to determine whether a packet is old or new. When several data packets are lost on the link, the PID fields may become equal to the last received PID. If a packet has the same PID as the previous packet, BK2425 compares the CRC sums from both packets. If the CRC sums are also equal, the last received packet is considered a copy of the previously received packet and discarded.⏹NO_ACKThe NO_ACK flag is only used when the auto acknowledgement feature is used. Setting the flag high, tells the receiver that the packet is not to be auto acknowledged.The PTX can set the NO_ACK flag bit in the Packet Control Field with the command: W_TX_PAYLOAD_NOACK. However, the function must first be enabled in the FEATURE register by setting theRevision 1.0Proprietary and Confidential Page 9 of 30BK2425EN_DYN_ACK bit. When you use this option, the PTX goes directly to standby-I mode after transmitting the packet and the PRX does not transmit an ACK packet when it receives the packet.5.1.4PayloadThe payload is the user defined content of the packet. It can be 0 to 32 bytes wide, and it is transmitted on-air as it is uploaded (unmodified) to the device.The BK2425 provides two alternatives for handling payload lengths, static and dynamic payload length. The static payload length of each of six data pipes can be individually set. The default alternative is static payload length. With static payload length all packets between a transmitter and a receiver have the same length. Static payload length is set by the RX_PW_Px registers. The payload length on the transmitter side is set by the number of bytes clocked into the TX_FIFO and must equal the value in the RX_PW_Px register on the receiver side. Each pipe has its own payload length.Dynamic Payload Length (DPL) is an alternative to static payload length. DPL enables the transmitter to send packets with variable payload length to the receiver. This means for a system with different payload lengths it is not necessary to scale the packet length to the longest payload.With DPL feature the BK2425 can decode the payload length of the received packet automatically instead of using the RX_PW_Px registers. The MCU can read the length of the received payload by using the command: R_RX_PL_WID.In order to enable DPL the EN_DPL bit in the FEATURE register must be set. In RX mode the DYNPD register has to be set. A PTX that transmits to a PRX with DPL enabled must have the DPL_P0 bit in DYNPD set. 5.1.5CRCThe CRC is the error detection mechanism in the packet. The number of bytes in the CRC is set by the CRCO bit in the CONFIG register. It may be either 1 or 2 bytes and is calculated over the address, Packet Control Field, and Payload.The polynomial for 1 byte CRC is X8 + X2 + X + 1. Initial value is 0xFF.The polynomial for 2 byte CRC is X16 + X12 + X5 + 1. Initial value is 0xFFFF.No packet is accepted by receiver side if the CRC fails.5.2Packet HandlingBK2425 uses burst mode for payload transmission and receive.The transmitter fetches payload from TX FIFO, automatically assembles it into packet and transmits the packet in a very short burst period with 1Mbps or 2Mbps air data rate.After transmission, if the PTX packet has the NO_ACK flag set, BK2425 sets TX_DS and gives an active low interrupt IRQ to MCU. If the PTX is ACK packet, the PTX needs receive ACK from the PRX and then asserts the TX_DS IRQ.The receiver automatically validates and disassembles received packet, if there is a valid packet within the new payload, it will write the payload into RX FIFO, set RX_DR and give an active low interrupt IRQ to MCU.When auto acknowledge is enabled (EN_AA=1), the PTX device will automatically wait for acknowledge packet after transmission, and re- transmit original packet with the delay of ARD until an acknowledge packet is received or the number of re-transmission exceeds a threshold ARC. If the later one happens, BK2425 will set MAX_RT and give an active low interruptRevision 1.0Proprietary and Confidential Page 10 of 30BK2425IRQ to MCU. Two packet loss counters (ARC_CNT and PLOS_CNT) are incremented each time a packet is lost. The ARC_CNT counts the number of retransmissions for the current transaction. The PLOS_CNT counts the total number of retransmissions since the last channel change. ARC_CNT is reset by initiating a new transaction. PLOS_CNT is reset by writing to the RF_CH register. It is possible to use the information in the OBSERVE _TX register to make an overall assessment of the channel quality.The PTX device will retransmit if its RX FIFO is full but received ACK frame has payload.As an alternative for PTX device to auto retransmit it is possible to manually set the BK2425 to retransmit a packet a number of times. This is done by the REUSE_TX_PL command.When auto acknowledge is enabled, the PRX device will automatically check the NO_ACK field in received packet, and if NO_ACK=0, it will automatically send an acknowledge packet to PTX device. If EN_ACK_PAY is set, and the acknowledge packet can also include pending payload in TX FIFO.6 Data and Control Interface 6.1TX/RX FIFOThe data FIFOs are used to store payload that is to be transmitted (TX FIFO) or payload that is received and ready to be clocked out (RX FIFO). The FIFO is accessible in both PTX mode and PRX mode.There are three levels 32 bytes FIFO for both TX and RX, supporting both acknowledge mode or no acknowledge mode with up to six pipes.⏹TX three levels, 32 byte FIFO⏹RX three levels, 32 byte FIFOBoth FIFOs have a controller and are accessible through the SPI by using dedicated SPI commands. A TX FIFO in PRX can store payload for ACK packets to three different PTX devices. If the TX FIFO contains more than one payload to a pipe, payloads are handled using the first in first out principle. The TX FIFO in a PRX is blocked if all pending payloads are addressed to pipes where the link to the PTX is lost. In this case, the MCU can flush the TX FIFO by using the FLUSH_TX command.The RX FIFO in PRX may contain payload from up to three different PTX devices.A TX FIFO in PTX can have up to three payloads stored.The TX FIFO can be written to by three commands, W_TX_PAYLOAD and W_ TX_PAYLOAD_NO_ACK in PTX mode and W_ACK_PAYLOAD in PRX mode. All three commands give access to the TX_PLD register. The RX FIFO can be read by the command R_RX _PAYLOAD in both PTX and PRX mode. This command gives access to the RX_PLD register.The payload in TX FIFO in a PTX is NOT removed if the MAX_RT IRQ is asserted.In the FIFO_STATUS register it is possible to read if the TX and RX FIFO are full or empty. The TX_REUSE bit is also available in the FIFO_STATUS register. TX_REUSE is set by the SPI command REUSE_TX_PL, and is reset by the SPI command: W_TX_PAYLOAD or FLUSH TX.6.2InterruptIn BK2425 there is an active low interrupt (IRQ) pin, which is activated when TX_ DS IRQ, RX_DR IRQ or MAX_RT IRQ are set high by the state machine in the STATUS register. The IRQ pin resets when MCU writes '1' to the IRQ source bit in the STATUS register. The IRQ mask in the CONFIGRevision 1.0Proprietary and Confidential Page 11 of 30BK2425register is used to select the IRQ sources that are allowed to assert the IRQ pin. By setting one of the MASK bits high, the corresponding IRQ source is disabled. By default all IRQ sources are enabled.The 3 bit pipe information in the STATUS register is updated during the IRQ pin high to low transition. If the STATUS register is read during an IRQ pin high to low transition, the pipe information is unreliable.6.3SPI Interface6.3.1SPI CommandThe SPI commands are shown in Table 3. Every new command must be started by a high to low transition on CSN.In parallel to the SPI command word applied on the MOSI pin, the STATUS register is shifted serially out on the MISO pin.The serial shifting SPI commands is in the following format:⏹<Command word: MSB bit to LSB bit(one byte)>⏹<Data bytes: LSB byte to MSB byte, MSBbit in each byte first> for all registers atbank 0 and register 9 to register 14 at bank1⏹<Data bytes: MSB byte to LSB byte, MSBbit in each byte first> for register 0 toregister 8 at bank 1Command# DataOperation Command name wordbytes(binary)R_REGISTER 000A AAAA 1 to 5 Read command and status registers. AAAAA = LSB byte first 5 bit Register Map Address1 to 5Write command and status registers. AAAAA = 5W_REGISTER 001A AAAA bit Register Map AddressLSB byte first Executable in power down or standby modes only.1 to 32 Read RX-payload: 1 – 32 bytes. A read operationR_RX_PAYLOAD 0110 0001 always starts at byte 0. Payload is deleted from FIFOLSB byte first after it is read. Used in RX mode.W_TX_PAYLOAD 1010 0000 1 to 32 Write TX-payload: 1 – 32 bytes. A write operation LSB byte first always starts at byte 0 used in TX payload.FLUSH_TX 1110 0001 0 Flush TX FIFO, used in TX modeFlush RX FIFO, used in RX modeFLUSH_RX 1110 0010 0 Should not be executed during transmission of acknowledge, that is, acknowledge package will not be completed.Used for a PTX deviceReuse last transmitted payload. Packets are repeatedly retransmitted as long as CE is high.REUSE_TX_PL 1110 0011 0 TX payload reuse is active untilW_TX_PAYLOAD or FLUSH TX is executed. TX payload reuse must not be activated or deactivated during package transmissionRevision 1.0Proprietary and Confidential Page 12 of 30BK2425 This write command followed by data 0x73 activates the following features:• R_RX_PL_WID• W_ACK_PAYLOAD• W_TX_PAYLOAD_NOACKA new ACTIVATE command with the same data deactivates them again. This is executable in power down or stand by modes only.ACTIVATE 0101 0000 1 The R_RX_PL_WID, W_ACK_PAYLOAD, andW_TX_PAYLOAD_NOACK features registers are initially in a deactivated state; a write has no effect, a read only results in zeros on MISO. To activate these registers, use the ACTIVATE command followed by data 0x73. Then they can be accessed as any other register. Use the same command and data to deactivate the registers again.This write command followed by data 0x53 toggles the register bank, and the current register bank number can be read out from REG7 [7]R_RX_PL_WID 0110 0000 Read RX-payload width for the topR_RX_PAYLOAD in the RX FIFO.Used in RX mode.Write Payload to be transmitted together with ACK packet on PIPE PPP. (PPP valid in the rangeW_ACK_PAYLOAD 1010 1PPP 1 to 32 from 000 to 101). Maximum three ACK packetLSB byte first payloads can be pending. Payloads with same PPP are handled using first in - first out principle. Writepayload: 1– 32 bytes. A write operation always startsat byte 0.W_TX_PAYLOAD_NO1011 0000 1 to 32 Used in TX mode. Disables AUTOACK on thisACK LSB byte first specific packet.NOP 1111 1111 0 No Operation. Might be used to read the STATUS registerTable 2 SPI command6.3.2SPI TimingS C KC S NW r i t e t o S P I r e g i s t e r:M O S I x C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 x D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 x M I S O H I - Z S 7 S 6 S 5 S 4 S 3 S 2 S 1 S 0 0 0 0 0 0 0 0 0 H i - Z R e a d f r o m S P I r e g i s t e r:M O S I x C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 xM I S O x S 7 S 6 S 5 S 4 S 3 S 2 S 1 S 0 D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 xFigure 6 SPI timingRevision 1.0Proprietary and Confidential Page 13 of 30BK2425 Cn: SPI command bitSn: STATUS register bitDn: Data Bit (LSB byte to MSB byte, MSB bit in each byte first)Note: The SPI timing is for bank 0 and register 9 to 14 at bank 1. For register 0 to 8 at bank 1, the byte order is inversed that the MSB byte is R/W before LSB byte.Figure 7 SPI NOP timing diagramSymbol Parameters Min Max UnitsTdc Data to SCK Setup 10 nsTdh SCK to Data Hold 20 nsTcsd CSN to Data Valid 38 nsTcd SCK to Data Valid 55 nsTcl SCK Low Time 40 nsTch SCK High Time 40 nsFsck SCK Frequency 0 8 MHzTr,Tf SCK Rise and Fall 100 nsTcc CSN to SCK Setup 2 nsTcch SCK to CSN Hold 2 nsTcwh CSN Inactive time 50 nsTcdz CSN to Output High Z 38 nsTable 3 SPI timing parameterRevision 1.0Proprietary and Confidential Page 14 of 30BK24257 Register MapThere are two register banks, which can be toggled by SPI command “ACTIVATE” followed with0x53 byte, and bank status can be read from Bank0_REG7 [7].7.1Register Bank 0AddressMnemonic Bit ResetType Description(Hex) Value00 CONFIG Configuration RegisterReserved 7 0 R/W Only '0' allowedMASK_RX_DR 6 0 R/W Mask interrupt caused by RX_DR1: Interrupt not reflected on the IRQ pin0: Reflect RX_DR as active low interrupton the IRQ pinMASK_TX_DS 5 0 R/W Mask interrupt caused by TX_DS1: Interrupt not reflected on the IRQ pin0: Reflect TX_DS as active low interrupton the IRQ pinMASK_MAX_RT 4 0 R/W Mask interrupt caused by MAX_RT1: Interrupt not reflected on the IRQ pin0: Reflect MAX_RT as active lowinterrupt on the IRQ pinEN_CRC 3 1 R/W Enable CRC. Forced high if one of the bits in the EN_AA is highCRCO 2 0 R/W CRC encoding scheme'0' - 1 byte'1' - 2 bytesPWR_UP 1 0 R/W 1: POWER UP, 0:POWER DOWNPRIM_RX 0 0 R/W RX/TX control,1: PRX, 0: PTX01 EN_AA Enable ‘Auto Acknowledgment’ FunctionReserved 7:6 00 R/W Only '00' allowedENAA_P5 5 1 R/W Enable auto acknowledgement data pipe 5ENAA_P4 4 1 R/W Enable auto acknowledgement data pipe 4ENAA_P3 3 1 R/W Enable auto acknowledgement data pipe 3ENAA_P2 2 1 R/W Enable auto acknowledgement data pipe 2ENAA_P1 1 1 R/W Enable auto acknowledgement data pipe 1ENAA_P0 0 1 R/W Enable auto acknowledgement data pipe 0 02 EN_RXADDR Enabled RX AddressesReserved 7:6 00 R/W Only '00' allowedERX_P5 5 0 R/W Enable data pipe 5.ERX_P4 4 0 R/W Enable data pipe 4.ERX_P3 3 0 R/W Enable data pipe 3.ERX_P2 2 0 R/W Enable data pipe 2.ERX_P1 1 1 R/W Enable data pipe 1.ERX_P0 0 1 R/W Enable data pipe 0.Revision 1.0 Proprietary and Confidential Page 15 of 30BK2425 03 SETUP_AW Setup of Address Widths(common for all data pipes)Reserved 7:2 000000 R/W Only '000000' allowedAW 1:0 11 R/W RX/TX Address field width'00' - Illegal'01' - 3 bytes'10' - 4 bytes'11' - 5 bytesLSB bytes are used if address width is below 5 bytes04 SETUP_RETR Setup of Automatic RetransmissionARD 7:4 0000 R/W Auto Retransmission Delay‘0000’ – Wait 250 us‘0001’ – Wait 500 us‘0010’ – Wait 750 us……..‘1111’ – Wait 4000 us(Delay defined from end of transmission tostart of next transmission)ARC 3:0 0011 R/W Auto Retransmission Count‘0000’ –Re-Transmit disabled‘0001’ – Up to 1 Re-Transmission on fail of AA……‘1111’ – Up to 15 Re-Transmission on fail of AA05 RF_CH RF ChannelReserved 7 0 R/W Only '0' allowedRF_CH 6:0 0000010 R/W Sets the frequency channel 06 RF_SETUP RF Setup RegisterReserved 7:6 0 R/W Only '00' allowedRF_DR_LOW 5 0 R/W Set Air Data Rate. See RF_DR_HIGH for encoding.PLL_LOCK 4 0 R/W Force PLL lock signal. Only used in testSet Air Data Rate.RF_DR_HIGH 3 1 R/W Encoding: RF_DR_LOW, RF_DR_HIGH: ‘00’ – 1Mbps‘01’ – 2Mbps (default)‘10’ – 250Kbps‘11’ – 2MbpsRF_PWR[1:0] 2:1Set RF output power in TX mode 11 R/W RF_PWR[1:0]Setup LNA gainLNA_HCURR 0 1 R/W 0:Low gain(20dB down)1:High gainStatus Register (In parallel to the SPI07 STATUS command word applied on the MOSI pin,the STATUS register is shifted serially outon the MISO pin)Register bank selection states. SwitchRBANK 7 0 R register bank is done by SPI command “ACTIVATE” followed by 0x530: Register bank 0。
四轴飞行器电路原理
四轴飞行器电路原理四轴飞行器是一种可以在空中盘旋、上升、下降、转弯等多种姿态下飞行的无人机。
其电路原理主要分为飞控系统、动力系统和通信系统三个方面。
首先是飞控系统,它是四轴飞行器的大脑,负责控制飞行器的姿态、姿态稳定、飞行路径规划等工作。
飞控系统主要由传感器、处理器、电源模块和输出设备组成。
传感器包括加速度计、陀螺仪和磁力计,用于感知飞行器的姿态和运动状态;处理器负责收集传感器数据、进行数据处理和计算,然后输出控制指令给电调;电源模块为整个飞控系统提供稳定的电源;输出设备包括电调和电机,负责接受处理器输出的指令,控制电机转速以实现飞行器的姿态调整和飞行控制。
其次是动力系统,动力系统包括电池、电调、电机和螺旋桨。
电池为整个飞行器提供电能,一般采用锂聚合物电池;电调是控制电机转速的设备,通过接收飞控系统的指令来调节电机的转速;电机是四轴飞行器的动力来源,通常采用无刷直流电机,它可以根据电调发送的脉冲信号来控制转速和方向;螺旋桨是转动的装置,可以将电机的动力转化为向下的气流,从而产生升力,完成飞行器的起飞、盘旋、降落等动作。
最后是通信系统,通信系统一般包括遥控器和接收机。
遥控器是飞行器的操纵设备,通过手柄操纵飞行器的姿态和飞行路径,它会将操纵指令通过无线信号发送给接收机;接收机负责接收遥控器发送的指令,并将指令传输给飞控系统,由飞控系统进行解析和执行,从而控制飞行器的飞行动作。
总的来说,四轴飞行器的电路原理主要包括飞控系统、动力系统和通信系统三个方面。
飞控系统是整个飞行器的大脑,负责控制飞行器的姿态和飞行路径;动力系统是飞行器的动力来源,包括电池、电调、电机和螺旋桨;通信系统是飞行器的操纵设备,包括遥控器和接收机,负责操控飞行器的姿态和飞行路径。
这三个系统密切配合,共同完成飞行器的飞行任务。
基于STM32控制的微型四轴飞行器
西华大学610039摘要:在对我很感兴趣的项目微型四轴飞行器进行了功能描述的基础上展开了对系统深入研究的方案设计。
该系统(装置)主要由飞控,遥控,蓝牙或WIFI模块,通信模块等组成。
飞控是由stm32f103作为主控,采用MPU6050作为惯性测量单元。
遥控是由arduino作为主控。
通信运用2.4G无线模块。
在AD环境中完成对飞控的的设计。
在keil 5中完成软件的设计。
然后,通过proteus软件完成飞控的模块的仿真与调试。
最后,分析了项目的计划完成情况。
关键词:四轴飞行器控制 stm32 通信设计引言随着社会的发展和科技的进步,我们迎来了新的时代。
在这个高速发展时代,所有的物品都在日新月异的变化。
我们小时候的纸飞机玩具变成了现在的遥控飞机,其中的四轴飞行器备受大众喜欢。
但是四轴飞行器的用处还有多,如林业,侦察,航拍,运输,娱乐观赏等领域,目前热门的航拍就是基于稳定四轴及云台搭建的平台实现,然后其他邻域应用还有相当的潜力。
四轴飞行器将会是很有潜力和未来需求的,代替人类运输,派遣去危险的地方拍摄,或者是交通,个人飞行器等等。
所以四轴飞行器以后一定可以成为主流产品,在生活的方方面面都可能会用到。
1项目1.1 项目描述近年来,国内科技领域对四轴飞行器的研究如火如荼,相关技术得到了迅速的发展。
随着信息化时代的蓬勃发展, 科学技术不断更新, 飞行器被广泛的应用在军事侦查、航拍以及民用快递运输等诸多行业。
四轴飞行器结构简单,操作灵活,单位体积内可提供巨大的升力,适合在狭窄环境中飞行,携带各种电子设备可执行各种任务,例如军事侦察、定位跟踪、农田监测等,在军事、民用等领域均有广泛的应用和广阔的前景。
本项目设计了一种基于STM32的微型四轴飞行器控制系统,以STM32单片机为主控制器,MPU6050为惯性测量单元模块核心,3.7V锂电池供电,通过蓝牙模块或wifi模块实现在手机App上来控制飞行器,或者通过自制遥控器来控制。
四旋翼飞行器控制系统硬件电路设计
四旋翼飞行器控制系统硬件电路设计首先,在硬件电路设计中,关键是选择合适的传感器。
常用的传感器包括加速度计、陀螺仪和磁力计等。
加速度计用于测量飞行器的线性加速度,陀螺仪用于测量飞行器的角速度,磁力计用于测量飞行器的方向。
这些传感器需要与处理器进行接口连接,并能够提供准确的数据。
因此,在硬件电路设计中,需要选取高性能的传感器,同时设计稳定可靠的电路板。
其次,处理器是控制系统的核心。
处理器的选择应综合考虑性能、功耗和成本等因素。
常用的处理器有单片机和微处理器。
单片机适用于简单的控制任务,如姿态控制和飞行模式切换等。
而微处理器适用于复杂的控制任务,如路线规划和数据处理等。
在硬件电路设计中,处理器需要与传感器和电调进行接口连接,并能够高效地处理控制指令。
此外,处理器还需要具备足够的计算能力和存储空间,以便实现飞行控制算法和数据记录功能。
电调是控制电机转速的关键组件。
通常,四旋翼飞行器需要四个电调以控制四个电机的转速。
电调需要接收处理器发送的PWM信号,并将其转换为适当的电机转速。
在硬件电路设计中,电调需要具备快速响应的能力,并能够输出稳定的PWM信号。
此外,电调还需要有适当的保护机制,以避免过载和短路等故障。
最后,电机是驱动飞行器旋转的关键组件。
电机的选择应综合考虑功率和效率等因素。
常用的电机有无刷电机和有刷电机。
无刷电机具有高效率和长寿命等优点,因此在硬件电路设计中通常选择无刷电机。
电机需要与电调进行接口连接,并能够输出适当的推力。
此外,电机还需要具备足够的扭矩和转速范围,以应对不同的飞行任务。
总之,四旋翼飞行器控制系统硬件电路设计涉及多个组件的选择和接口设计等方面。
在设计过程中,需要综合考虑传感器、处理器、电调和电机等因素,以实现飞行器的控制能力和飞行稳定性。
四轴飞行器简介
temp10[i][j]=Kg[i]*H[j];
for(i=0;i<2;i++)
for(j=0;j<2;j++)
temp11[i][j]=1-temp10[i][j];
for(i=0;i<2;i++)
for(j=0;j<2;j++)
{
for(k=0;k<2;k++)
P_optimal[i][j]+=temp11[i][k]*P_estimate[k][j];
Q为系统过程中的协方差
至此,已经有了现在状态的预测结果,接下来收集现在状态的测量值,结合预测值和测量值最后得出现在K时刻的最优估计值X(K|K)
第三步:
得到最优估计值之前需要将卡尔曼增益求出来:
第四步:
求出K时刻的最优估计值X(K|K):
X(K|K)=X(K|K-1)+ *[Z(K)-H*X(K|K-1)]
CNC碳管固定座4个
3k 12MM全碳碳管4根
铝合金机身板2块
塑料脚架1对
效果图如下:
图2.1四轴飞行器效果图
第三章
硬件的基本模块主要包括:控制模块、传感器模块、通讯模块、电机驱动模块这四大模块。
4.1控制模块
控制模块这部分需要处理数据,并作出控制决策。控制器只用过单片机,由于缺乏经验,要参考老师的意见。
第五步:
计算最优估计值的协方差P(K|K):
P(K|K)=[I- *H]*P(K|K-1)
试着编了一下程序:其中输入参数为经过处理转化后的加速度的角度,陀螺仪的角速度
四轴飞行器飞控原理
四轴飞行器飞控原理四轴飞行器飞控原理 (1)一、六种姿态控制原理示意 (3)二、四轴翼飞行器系统建模 (4)2.1假设条件: (4)2.2建立坐标系: (5)2.3转换矩阵推导: (6)2.4非线性模型 (7)2.5模型线性化 (11)三、基于PID的飞行控制 (15)四、硬件设计与实现 (17)4.1四轴飞行器硬件电路 (17)五、国内外四轴飞行器 (17)5.1 Kesterl (17)5.2 Unav3500 (18)5.3 MikroKoper (18)5.4 ArduPilot (19)5.5 Crazyflie (20)一、六种姿态控制原理示意图1 上下(高度)控制,就是四个螺旋桨同时增加(减小)转速;图2 前进、后退图3 左飞、右飞图4 类似打方向盘,改变航向二、四轴翼飞行器系统建模2.1假设条件:微小型四旋翼飞行器在三维空间中可视为刚体,飞行器在空间中的运动具有六个自由度,即飞行器质心在空间中的三个平移自由度和三个旋转自由度。
由于该飞行器一般为低空低速飞行,因此可以对其动力学模型的建立做如下假设:1)微小型四旋翼飞行器在研究中视为刚体,忽略其弹性影响,总质量m 为常数;2)将地球视为惯性系统,忽略地球自转和公转对飞行器的影响;3)假设地面为水平平面,忽略地球曲率的影响;4)重力加速度g为常数,不随地理位置和飞行高度的变化而变化;5)飞行器机机体几何外形完全对称且质量分布均勻,质心与几何中心重合。
2.2建立坐标系:图5机体坐标系B、地面坐标系EФ绕X轴方向的横滚角(rad);θ绕轴方向的俯仰角(rad);ψ绕Z轴方向的偏航角(rad):2.3转换矩阵推导:(可以查阅高等数学方向余弦,矩阵论中的旋转矩阵等资料)公式(1)公式(2)2.4非线性模型由于作用到飞行器上的合力和合力矩是四个螺旋奖所产生的力与力矩的矢量和,因此,他们之间存在极大地交叉耦合特性。
例如,横滚(俯仰)力矩的改变将会对侧向(纵向)加速度有一个直接的影响。
四轴飞行器PID控制算法解析
任务总结之控制算法篇本飞行器主要采用的是PID控制算法。
那么下面先对PID控制算法做一些简要的介绍,下图为PID控制算法的控制框图图1.1所谓PID 指的是Proportion-Integral-Differential,翻译成中文是比例-积分-微分。
PID 控制率也可以解释为:误差的过去(积分项),现在(比例项)和将来(微分项)的加权和(线性组合)。
PID 控制器是工程实际中应用最为广泛的控制器。
当被控对象的结构和参数不能完全掌握或者得不到精确的数学模型,控制理论的其他技术难以采用时,系统控制器的结构和参数必须依靠经验和现场调试来确定,这时应用PID 控制技术最为方便。
(1)比例(P)控制比例控制是使控制器的输出与输入误差信号e 成比例,仅有比例控制系统输出存在稳态误差。
(2)积分(I)控制此时控制器的输出与输入误差信号的积分成正比关系。
为了消除稳态误差,在控制器中必须引入“积分项”。
积分项的误差取决于时间的积分,随着时间的增加,积分项误差会增大。
这样,即便误差很小,积分项也会随着时间的增加而加大,它使控制器的输出增大,使稳态误差进一步减小,直至等于0.因此积分控制可以实现无静差控制。
(3)微分(D)控制微分控制中。
控制器的输出与输入误差信号的微分(即误差的变化率)成正比关系,控制系统存在较大滞后特性时,其输出的变化总是落后于误差的变化。
增加微分项,也就相当于它可以预测误差变化的趋势,提前抑制误差,避免被控变量的严重超调。
微分控制器能改善系统的动态特性。
由图1.1 可以写出模拟PID 控制器的数学表达式为:Kp 为比例系数;Ti 为积分时间常数,Td 为微分时间常数。
计算机控制是一种离散的采样控制,因此实际应用的是数字PID 控制器。
即将模拟PID 表达式离散化。
数字PID 位置型控制算法如下:其中T为采样时间对于电机速度的控制,我们采用的是位置型控制PI控制算法,能够达到我们所需要的调节效果。
四轴飞行器三相六臂全桥驱动电路
半导体器件应用网/news/197781_p1.html 四轴飞行器三相六臂全桥驱动电路【大比特导读】下面这篇文章针对四轴飞行器无位置传感器无刷直流电机的驱动控制,设计开发了三相六臂全桥驱动电路及控制程序。
设计采用ATMEGA16单片机作为控制核心,利用反电势过零点检测轮流导通驱动电路的6个MOSFET实现换向;直流无刷电机控制程序完成MOSFET上电自检、电机启动软件控制,PWM电机转速控制以及电路保护功能.....四轴飞行器是近来在专业与非专业领域都非常火爆的技术产品。
下面这篇文章针对四轴飞行器无位置传感器无刷直流电机的驱动控制,设计开发了三相六臂全桥驱动电路及控制程序。
设计采用ATMEGA16单片机作为控制核心,利用反电势过零点检测轮流导通驱动电路的6个MOSFET实现换向;直流无刷电机控制程序完成MOSFET上电自检、电机启动软件控制,PWM电机转速控制以及电路保护功能。
该设计电路结构简单,成本低、电机运行稳定可靠,实现了电机连续运转。
近年来,四轴飞行器的研究和应用范围逐步扩大,它采用四个无刷直流电机作为其动力来源。
无刷直流电机为外转子结构,直接驱动螺旋桨高速旋转。
无刷直流电机的驱动控制方式主要分为有位置传感器和无位置传感器的控制方式两种。
由于在四轴飞行器中的要求无刷直流电机控制器要求体积小、重量轻、高效可靠,因而采用无位置传感器的无刷直流电机。
本文采用的是朗宇X2212 kv980无刷直流电机。
无刷直流电机驱动控制系统包括驱动电路和系统程序控制两部分。
采用功率管的开关特性构成三相全桥驱动电路,之后使用DSP作为主控芯片,借助其强大的运算处理能力,实现电机的启动与控制,但电路结构复杂成本高,缺乏经济性。
直流无刷电机的换向采用反电势过零检测法,一旦检测到第三相的反电势过零点就为换向做准备。
反电势过零检测采用虚拟中性点的方法,通过检测电机各相的反电势过零点来判断转子位置。
而基于电机三相绕组端电压变化规律的电机电流换向理论,可以大大提高系统控制精度。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Open A VR Studio 4. It will ask you if you want to begin a new project, or open an existing project.
Choose Cancel and click on the connect icon.
It will open a new window with a connection dialogue asking you to select your programmer and connection port. With a programmer like the A VRISP mkII it is easy because when you select that programmer it brings back only one choice of port... USB. The A VR-ISP500 from Olimex is recognised as a STK500 and has the option to auto choose the port. If it fails to recognise the port,you may need to manually set the port for the programmer in your Windows device settings to COM1 up to COM4 for A
VR Studio to recognise it.
When you have chosen your programmer and port, click connect and you will be taken to the AV R programming dialogue.
In the A VR programming window go to the "Main" tab and make sure that the chip you are programming (e.g. Atmega168) is selected in the "Device and Signature Bytes" drop down menu. Also make sure that the" Programming mode and target settings are set to ISP. Make sure that the settings for the ISP mode have the ISP frequency set low enough to talk to the chip. I set my A VR-ISP500 programmer's frequency to 115.2 kHz. This is quite an important setting to get right. If you click on "Read Signature" and you get the response "Signature matches selected device" you have successfully managed to connect to your IC.
Also make sure that the target board or PCB is powered (You can check this by clicking on the HW Settings tab and checking if the programmer can see any voltage).
Now it is time to set the fuses so click on the "Fuses" tab. A VR Studio is very good in this respect as it will work out the fuse settings for your particular IC depending upon the check box options you choose.
Set the check boxes according to the following.
SELFPRGEN: unchecked
RSTDISBL: unchecked
DWEN: unchecked
SPIEN: checked
WDTON: unchecked
EESA VE: unchecked
BODLEVEL: Brown-out detection at VCC=1.8 V
CKDIV8 : unchecked
CKOUT: unchecked
SUT_CKSEL: Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65 ms The fuse setting output will be displayed at the bottom of the window.
Check the "Auto read" "Smart warnings" and "Verify after programming" options at the bottom of the window and then click program.
If all goes to plan, you should get OK response messages in the output section at the bottom of your window for Entering Programming mode, writing fuse address, reading fuse address, Fuse bits verification and leaving programming mode.
If you get error messages, then recheck your chip version and all the connections from your programmer to the board and that the power is on. Also make sure that your fuse settings are as described above.
Flash the Firmware
Click on the "Program" tab and have a look at the "Flash" section which is the 2nd section down. Check the "Input HEX file" check box. Then browse the unzipped firmware folder and click on your firmware HEX file suitable for the chip you are programming for an Atmega168. Then click "Program" in the Flash section of the window and you should get an OK response in the output section at the bottom of the window. Then click "Verify" to make sure that the program has been successfully uploaded and if you have an OK response coming back at the bottom of the window then you have successfully programmed the IC with the test program.
Design Schematics for the v.5.5 SMD PCB
Ya w Breakout Board Schematic。