作者:yangjian
1 坐标系变换
火箭的运动方程是基于牛顿运动学方程推导,牛顿运动学方程是在惯性坐标系下成立的,目标的运动必须以固定的惯性坐标系为参考。本文研究带尾翼控制的火箭,火箭主要是由火箭发动机产生推力使箭体向上运动,由舵机控制尾翼产生使箭体旋转的力矩,这些在箭体坐标系下描述更合适,因此需要坐标系的变换。
惯性坐标系
惯性坐标系是与地球固连的坐标系,通常选择NED坐标系,其原点在地面上一点,
![equation?tex=%5Cmathbf%7Bi%7D%5E%7Bi%7D](https://i-blog.csdnimg.cn/blog_migrate/b2c75d7eae7228e09fd34d854f88b830.png)
![equation?tex=%5Cmathbf%7Bj%7D%5E%7Bi%7D](https://i-blog.csdnimg.cn/blog_migrate/733c4402b754b661dfa76a4d61cb3078.png)
![equation?tex=%5Cmathbf%7Bk%7D%5E%7Bi%7D](https://i-blog.csdnimg.cn/blog_migrate/82dd1510d0d78adbb680e9bf4ffa17dc.png)
箭体坐标系
箭体坐标系
![equation?tex=%5Cmathbf%7Bi%7D%5E%7Bb%7D](https://i-blog.csdnimg.cn/blog_migrate/d36cd33f9e8f0486fb173567c41457d5.png)
![equation?tex=%5Cmathbf%7Bj%7D%5E%7Bb%7D](https://i-blog.csdnimg.cn/blog_migrate/d097ac912da00ed54c95f7f377287433.png)
![equation?tex=%5Cmathbf%7Bi%7D%5E%7Bb%7D](https://i-blog.csdnimg.cn/blog_migrate/d36cd33f9e8f0486fb173567c41457d5.png)
![equation?tex=%5Cmathbf%7Bk%7D%5E%7Bb%7D](https://i-blog.csdnimg.cn/blog_migrate/c5282ea47552ff3cc7f94fad8b234084.png)
欧拉角
弹体(即弹体坐标系)相对地面坐标系的姿态,通常用3个角度(称欧拉角)来确定,
俯仰角
![equation?tex=%5Ctheta](https://i-blog.csdnimg.cn/blog_migrate/679f2e1de0bb439ac572e914fed0f16f.png)
偏航角
![equation?tex=%5Cpsi](https://i-blog.csdnimg.cn/blog_migrate/35a08b2431f5e28bbc8f9377d48fe2c3.png)
![equation?tex=+%7Bi%7D%5E%7Bv%7D](https://i-blog.csdnimg.cn/blog_migrate/ab73e1a79aec50749e6b18b134d070c8.png)
倾斜(滚动)角
![equation?tex=%5Cphi](https://i-blog.csdnimg.cn/blog_migrate/a84b1e00ae490f5dbf83f19fced51508.png)
惯性坐标系到箭体坐标系变换
箭体坐标可由惯性坐标系经过三次旋转变化得到。
旋转次序为:
![equation?tex=%5Cpsi](https://i-blog.csdnimg.cn/blog_migrate/35a08b2431f5e28bbc8f9377d48fe2c3.png)
![equation?tex=%5Ctheta](https://i-blog.csdnimg.cn/blog_migrate/679f2e1de0bb439ac572e914fed0f16f.png)
![equation?tex=%5Cpsi](https://i-blog.csdnimg.cn/blog_migrate/35a08b2431f5e28bbc8f9377d48fe2c3.png)
![equation?tex=%7BR%7D_%7Bi%7D%5E%7B+b%7D](https://i-blog.csdnimg.cn/blog_migrate/40202c64ca2bb306353149864d98e824.png)
![equation?tex=%5Cnewcommand%7B%5Ccth%7D%7Bc_%7B%5Ctheta%7D%7D+%5Cnewcommand%7B%5Csth%7D%7Bs_%7B%5Ctheta%7D%7D+%5Cnewcommand%7B%5Ccps%7D%7Bc_%7B%5Cpsi%7D%7D+%5Cnewcommand%7B%5Csps%7D%7Bs_%7B%5Cpsi%7D%7D+%5Cnewcommand%7B%5Ccph%7D%7Bc_%7B%5Cphi%7D%7D+%5Cnewcommand%7B%5Csph%7D%7Bs_%7B%5Cphi%7D%7D++%5Cbegin%7Balign%2A%7D+%5Cmathcal%7BR%7D_%7Bi%7D%5E%7B+b%7D%28%5Cphi%2C%5Ctheta%2C%5Cpsi%29++%26%3D+++++%5Cbegin%7Bpmatrix%7D+++++++++1+%26+0+%26+0+%5C%5C+++++++++0+%26+%5Ccos%5Cphi+%26+%5Csin%5Cphi+%5C%5C+++++++++0+%26+-%5Csin%5Cphi+%26+%5Ccos%5Cphi+++++%5Cend%7Bpmatrix%7D+++++%5Cbegin%7Bpmatrix%7D+++++++++%5Ccos%5Ctheta%26+0+%26+-%5Csin%5Ctheta+%5C%5C+++++++++0+%26+1+%26+0+%5C%5C+++++++++%5Csin%5Ctheta+%26+0+%26+%5Ccos%5Ctheta+++++%5Cend%7Bpmatrix%7D+++++%5Cbegin%7Bpmatrix%7D+++++++++%5Ccos%5Cpsi+%26+%5Csin%5Cpsi+%26+0+%5C%5C+++++++++-%5Csin%5Cpsi+%26+%5Ccos%5Cpsi+%26+0+%5C%5C+++++++++0+%26+0+%26+1+++++%5Cend%7Bpmatrix%7D+%5Cnotag+%5C%5C+%26%3D+++++%5Cbegin%7Bpmatrix%7D+++++%5Ccth+%5Ccps+%26+%5Ccth+%5Csps+%26+-%5Csth+%5C%5C+++++%5Csph+%5Csth+%5Ccps+-+%5Ccph+%5Csps+%26+%5Csph+%5Csth+%5Csps+%2B+%5Ccph+++++%5Ccps+%26+%5Csph+%5Ccth+%5C%5C+++++%5Ccph+%5Csth+%5Ccps+%2B+%5Csph+%5Csps+%26+%5Ccph+%5Csth+%5Csps+-+%5Csph+++++%5Ccps+%26+%5Ccph+%5Ccth+++++%5Cend%7Bpmatrix%7D+%5Cend%7Balign%2A%7D](https://i-blog.csdnimg.cn/blog_migrate/81c8bd3d145d1953cfdb413d4a45ea31.png)
python代码实现如下:
def _Euler2Rotation(self, _phi, _theta, _psi):
phi = float(_phi)
theta = float(_theta)
psi = float(_psi)
c_phi = np.cos(phi)
s_phi = np.sin(phi)
c_theta = np.cos(theta)
s_theta = np.sin(theta)
c_psi = np.cos(psi)
s_psi = np.sin(psi)
R_roll = np.array([[1, 0, 0],
[0, c_phi, s_phi],
[0, -s_phi, c_phi]])
R_pitch = np.array([[c_theta, 0, -s_theta],
[0, 1, 0],
[s_theta, 0, c_theta]])
R_yaw = np.array([[c_psi, s_psi, 0],
[-s_psi, c_psi, 0],
[0, 0, 1]])
R = np.matmul(np.matmul(R_roll, R_pitch), R_yaw )
return R.T
四元数
因为火箭是以俯仰角90度的姿态垂直与地面发射,采用欧拉角变换矩阵会出现万象锁。使用四元数变换不会出现这种情况。
四元数与欧拉角的转换关系: