【惯性导航姿态仪】 01 -Mini INS/GPS 资料设计文档

该文档介绍了MiniINS/GPS系统的设计,包括MPU6050、HMC5983L磁力计、BMP180压力传感器和Ublox GPS的硬件连接及数据通信协议。通过STM32微控制器,传感器数据经I2C和串口协议传输,并实现加速度、陀螺仪、磁力计和气压数据的上位机报告功能,同时提供了解算后的姿态数据输出。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

简介

嗯,就是这个东西:

在这里插入图片描述

应用框架:

在这里插入图片描述

硬件连接:

在这里插入图片描述

MPU-6050

可以看出MPU6050 是跟STM32 通过I2C BUS 进行通信的 ( BUS 就是协议的意思)

在这里插入图片描述

磁力计 HMC5983L

磁力计就相当于一个电子罗盘的意思(能指出东西南北)
具体磁力计我还不太懂 ,但是可以确定是容易受到铁棒影响,而且这玩意挺重要的
从文档看出还是用IIC来传输 而且它是通过一个MPU6050 传输到STM32F

在这里插入图片描述

压力传感器 BMP180

压力传感器是用来读取气压的,直接与STM32相连

在这里插入图片描述

Ublox GPS

GPS 是通过串口来读取的
在这里插入图片描述

Mini INS/GPS 接口定义

接口定义

在这里插入图片描述

物理特性

在这里插入图片描述

硬件相连

在这里插入图片描述

数据通信协议

在这里插入图片描述

/**************************实现函数********************************************
*函数原型: 
void UART1_ReportMotion
(int16_t ax,int16_t ay,int16_t az,int16_t gx,
int16_t gy,int16_t gz, int16_t hx,int16_t hy,int16_t hz)
*功  能: 向上位机发送当前传感器的输出值 
输入参数: int16_t ax 
加速度 X轴ADC输出 
范围 :一个有符号整型 
int16_t ay 加速度 Y轴ADC输出 范围 :一个有符号整型
int16_t az 加速度 Z轴ADC输出 范围 :一个有符号整型 
int16_t gx 陀螺仪 X轴ADC输出 范围 :一个有符号整型
int16_t gy 陀螺仪 Y轴ADC输出 范围 :一个有符号整型
int16_t gz 陀螺仪 Z轴ADC输出 范围 :一个有符号整型 
int16_t hx 磁罗盘 X轴ADC输出 范围 :一个有符号整型
int16_t hy 磁罗盘 Y轴ADC输出 范围 :一个有符号整型 
int16_t hz 磁罗盘 Z轴ADC输出 范围 :一个有符号整型 输出参数:没有 *******************************************************************************/
 void UART1_ReportMotion(int16_t ax,int16_t ay,int16_t az,
 int16_t gx,int16_t gy,int16_t gz, int16_t hx,int16_t hy,int16_t hz) 
 { unsigned int temp=0xaF+9;
  char ctemp; UART1_Put_Char(0xa5);
   UART1_Put_Char(0x5a); UART1_Put_Char(14+8);
    UART1_Put_Char(0xA2); if(ax<0)ax=32768-ax;
     ctemp=ax>>8; UART1_Put_Char(ctemp);
      temp+=ctemp; ctemp=ax; 
      UART1_Put_Char(ctemp); 
      temp+=ctemp; 
      if(ay<0)ay=32768-ay; 
      ctemp=ay>>8; UART1_Put_Char(ctemp);
       temp+=ctemp;
        ctemp=ay; 
        UART1_Put_Char(ctemp); 
        Temp+=ctemp;
         if(az<0)az=32768-az;
          ctemp=az>>8; 
          UART1_Put_Char(ctemp); 
          Temp+=ctemp; ctemp=az; UART1_Put_Char(ctemp); temp+=ctemp; if(gx<0)gx=32768-gx; ctemp=gx>>8; UART1_Put_Char(ctemp); Temp+=ctemp; ctemp=gx; UART1_Put_Char(ctemp); temp+=ctemp; if(gy<0)gy=32768-gy; ctemp=gy>>8; UART1_Put_Char(ctemp); temp+=ctemp; Ctemp=gy; UART1_Put_Char(ctemp); temp+=ctemp; if(gz<0)gz=32768-gz; ctemp=gz>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=gz; UART1_Put_Char(ctemp); temp+=ctemp; if(hx<0)hx=32768-hx; ctemp=hx>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=hx; UART1_Put_Char(ctemp); temp+=ctemp; if(hy<0)hy=32768-hy; ctemp=hy>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=hy; UART1_Put_Char(ctemp); temp+=ctemp; if(hz<0)hz=32768-hz; Ctemp=hz>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=hz; UART1_Put_Char(ctemp); Temp+=ctemp; UART1_Put_Char(temp%256); UART1_Put_Char(0xaa); }

解算之后数据帧
在这里插入图片描述

/**************************实现函数********************************************
*函数原型: void UART1_ReportIMU(int16_t yaw,int16_t pitch,int16_t roll ,int16_t alt,int16_t tempr,int16_t press)
*功  能: 向上位机发送经过解算后的姿态数据 输入参数:int16_t yaw 经过解算后的航向角度。单位为0.1度 0 -> 3600 对应 0 -> 360.0度
int16_t pitch 解算得到的俯仰角度,单位 0.1度。-900 - 900 对应 -90.0 -> 90.0 度
int16_t roll 解算后得到的横滚角度,单位0.1度。 -1800 -> 1800 对应 -180.0 -> 180.0度
int16_t alt 气压高度。 单位0.1米。 范围一个整型变量 int16_t tempr 温度 。 单位0.1摄氏度 范围:直到你的电路板不能正常工作 int16_t press 气压压力。单位10Pa 一个大气压强在101300pa 这个已经超过一个整型的范围。需要除以10再发给上位机 int16_t IMUpersec 姿态解算速率。运算IMUpersec每秒。 输出参数:没有 *******************************************************************************/ void UART1_ReportIMU(int16_t yaw,int16_t pitch,int16_t roll ,int16_t alt,int16_t tempr,int16_t press,int16_t IMUpersec) { unsigned int temp=0xaF+2; char ctemp; UART1_Put_Char(0xa5); UART1_Put_Char(0x5a); UART1_Put_Char(14+2); UART1_Put_Char(0xA1); if(yaw<0)yaw=32768-yaw; ctemp=yaw>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=yaw; UART1_Put_Char(ctemp); temp+=ctemp; if(pitch<0)pitch=32768-pitch; ctemp=pitch>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=pitch; UART1_Put_Char(ctemp); temp+=ctemp; if(roll<0)roll=32768-roll; ctemp=roll>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=roll; UART1_Put_Char(ctemp); Temp+=ctemp; if(alt<0)alt=32768-alt; ctemp=alt>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=alt; UART1_Put_Char(ctemp); temp+=ctemp; if(tempr<0)tempr=32768-tempr; ctemp=tempr>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=tempr; UART1_Put_Char(ctemp); temp+=ctemp; if(press<0)press=32768-press; ctemp=press>>8; UART1_Put_Char(ctemp); temp+=ctemp; ctemp=press; UART1_Put_Char(ctemp); temp+=ctemp; UART1_Put_Char(temp%256); UART1_Put_Char(0xaa); }
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

-ATAO----

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值