四旋翼无人机位置环PID期望姿态输出公式推导

θ = p i t c h , γ = r o l l , ψ = y a w \theta=pitch, \gamma=roll, \psi=yaw θ=pitch,γ=roll,ψ=yaw,有
[ F x F y F z ] = C b n [ 0 0 f ] = [ sin ⁡ γ cos ⁡ ψ − cos ⁡ γ sin ⁡ ψ sin ⁡ θ − sin ⁡ γ sin ⁡ ψ − cos ⁡ γ cos ⁡ ψ sin ⁡ θ cos ⁡ γ cos ⁡ θ ] f \left[\begin{matrix} F_x\\F_y\\F_z \end{matrix}\right] = \boldsymbol{C}_b^n\left[\begin{matrix} 0\\0\\f \end{matrix}\right] = \left[\begin{matrix} \sin\gamma\cos\psi-\cos\gamma\sin\psi\sin\theta \\ -\sin\gamma\sin\psi-\cos\gamma\cos\psi\sin\theta \\ \cos\gamma\cos\theta \end{matrix}\right]f FxFyFz=Cbn00f=sinγcosψcosγsinψsinθsinγsinψcosγcosψsinθcosγcosθf
其中 f f f为无人机 b b b系下的总拉力, F x , F y , F z F_x,F_y,F_z Fx,Fy,Fz为东北天坐标系下对应的期望力,欧拉角旋转顺序为Z-X-Y,航向角北偏东为正,范围0~360°。

期望拉力(高度环)

观察上式可得出,期望拉力
f d = F z cos ⁡ γ cos ⁡ θ f_d=\frac{F_z}{\cos\gamma\cos\theta} fd=cosγcosθFz

期望俯仰角

对公式(1)进行稍微变换, F x sin ⁡ ψ + F y c o s ψ F_x\sin\psi+F_ycos\psi Fxsinψ+Fycosψ,得
F x sin ⁡ ψ + F y c o s ψ = f ( sin ⁡ γ cos ⁡ ψ sin ⁡ ψ − cos ⁡ γ sin ⁡ ψ sin ⁡ θ sin ⁡ ψ − sin ⁡ γ sin ⁡ ψ cos ⁡ ψ − cos ⁡ γ cos ⁡ ψ sin ⁡ θ cos ⁡ ψ ) = − ( cos ⁡ γ sin ⁡ θ ) f = − ( cos ⁡ γ sin ⁡ θ ) F z cos ⁡ γ cos ⁡ θ = − tan ⁡ θ F z \begin{aligned} F_x\sin\psi+F_ycos\psi&= f(\sin\gamma\cos\psi\sin\psi-\cos\gamma\sin\psi\sin\theta\sin\psi-\sin\gamma\sin\psi\cos\psi-\cos\gamma\cos\psi\sin\theta\cos\psi)\\&= -(\cos\gamma\sin\theta)f\\&= -(\cos\gamma\sin\theta)\frac{F_z}{\cos\gamma\cos\theta}\\&= -\tan\theta F_z \end{aligned} Fxsinψ+Fycosψ=f(sinγcosψsinψcosγsinψsinθsinψsinγsinψcosψcosγcosψsinθcosψ)=(cosγsinθ)f=(cosγsinθ)cosγcosθFz=tanθFz

期望俯仰角 θ d \theta_d θd
θ d = arctan ⁡ ( − F x sin ⁡ ψ + F y c o s ψ F z ) \theta_d=\arctan(-\frac{F_x\sin\psi+F_ycos\psi}{F_z}) θd=arctan(FzFxsinψ+Fycosψ)

期望横滚角

对公式(1)进行稍微变换, F x cos ⁡ ψ − F y s i n ψ F_x\cos\psi-F_ysin\psi FxcosψFysinψ,得
F x cos ⁡ ψ − F y s i n ψ = f ( sin ⁡ γ cos ⁡ ψ cos ⁡ ψ − cos ⁡ γ sin ⁡ ψ sin ⁡ θ cos ⁡ ψ + sin ⁡ γ sin ⁡ ψ sin ⁡ ψ + cos ⁡ γ cos ⁡ ψ sin ⁡ θ sin ⁡ ψ ) = ( sin ⁡ γ ) f = sin ⁡ γ F z cos ⁡ γ cos ⁡ θ = tan ⁡ γ F z cos ⁡ θ \begin{aligned} F_x\cos\psi-F_ysin\psi&= f(\sin\gamma\cos\psi\cos\psi-\cos\gamma\sin\psi\sin\theta\cos\psi+\sin\gamma\sin\psi\sin\psi+\cos\gamma\cos\psi\sin\theta\sin\psi)\\&= (\sin\gamma)f\\&= \sin\gamma\frac{F_z}{\cos\gamma\cos\theta}\\&= \tan\gamma\frac{F_z}{\cos\theta} \end{aligned} FxcosψFysinψ=f(sinγcosψcosψcosγsinψsinθcosψ+sinγsinψsinψ+cosγcosψsinθsinψ)=(sinγ)f=sinγcosγcosθFz=tanγcosθFz
期望横滚角 γ d \gamma_d γd
γ d = arctan ⁡ ( cos ⁡ θ F x cos ⁡ ψ − F y s i n ψ F z ) \gamma_d=\arctan(\cos\theta\frac{F_x\cos\psi-F_ysin\psi}{F_z}) γd=arctan(cosθFzFxcosψFysinψ)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值