Open FPV VTX开源之嵌入式OSD配置

发布于:2025-02-10 ⋅ 阅读:(79) ⋅ 点赞:(0)

1. 源由

穿越机模拟图传延迟通常在10ms左右。

最近为什么OpenIPC这么热,主要原因就是该项目性能已经提高到35ms左右。

当然,要达到这个要求,并非简单的一个摄像头,还需要地面端(解码)、高刷率屏幕的支持。

打个比方:

  • 如果屏幕刷新率只有30FPS,1000ms/30FPS = 33.33ms/frame
  • 即使编码、解码、传输都完成了,时间上错过刷新周期,那么就是妥妥要额外在延迟33.33ms了

嵌入式OSD是飞控MCU通过SPI控制MAX7456芯片在图像上直接绘制,大致流程如下:

Analog Camera ----> MAX 7456 chip ----> Analog VTX ----> Antenna(Wireless) ----> RF Receiver(RX5808) ----> Goggles(Fat Shark)
                          ^
                          | SPI
                          |
                   Flight Controller

当前Open FPV VTX并不是嵌入式OSD配置交付。因此产品到手后需要做一个简单配置。

IMX335/415 Camera -- MIPI --> SSC30kq/SSC338q chip -- USB --> 8812AU/EU Tx ----> Antenna(Wireless) ----> 8812AU/EU Rx -- USB --> Ground Startion
                                     ^
                                     | UART
                                     |
                              Flight Controller

2. 安装

通常情况下,嵌入式OSD软件msposd已经安装,因此无需手动安装。

注:如果您的固件没有上述软件,请更新到最新的固件,参考:《OpenIPC开源FPV之固件sysupgrade升级》

 /
 ├──> /usr/bin/
 │   ├──> msposd
 │   └──> safeboot.sh
 ├──> /etc/vtxmenu.ini
 └──> /usr/share/fonts/
     ├──> font_ardu.png
     ├──> font_ardu_hd.png
     ├──> font_btfl.png
     ├──> font_btfl_hd.png
     ├──> font_inav.png
     ├──> font_inav_hd.png
     └──> truetype/UbuntuMono-Regular.ttf
  • msposd帮助信息:
# msposd --help
Ver: 861a97c Compiled at: 20241130_234711
Usage: msposd [OPTIONS]
Where:
        -m --master      Serial port to receive MSP (/dev/ttyAMA0 by default)
        -b --baudrate    Serial port baudrate (115200 by default)
        -o --output              UDP endpoint to forward aggregated MSP messages ()
        -c --channels    RC Channel to listen for commands (0 by default) and exec channels.sh. This command can be repeated. Channel values are 1-based.
        -w --wait        Delay after each command received(2000ms default)
        -r --fps         Max MSP Display refresh rate(5..50)
        -p --persist     How long a channel value must persist to generate a command - for multiposition switches (0ms default)
        -t --temp        Read SoC temperature
        -d --wfb         Monitors wfb.log file and reports errors via HUD messages
        -s --osd         Parse MSP and draw OSD over the video
        -a --ahi         Draw graphic AHI, mode [0-No, 2-Simple 1-Ladder, 3-LadderEx]
        -x --matrix      OSD matrix (0 - 53:20 , 1- 50:18 chars)
           --mspvtx      Enable mspvtx support
        -v --verbose     Show debug infot
        --help           Display this help

3. 摄像头配置

先把配置的改动放在这里,以diff方式给出:仅修改了router=0

# diff -Nr telemetry.conf.bak /etc/telemetry.conf
--- telemetry.conf.bak
+++ /etc/telemetry.conf
@@ -5,7 +5,7 @@
 baud=115200

 ### router: use simple mavfwd (0), classic mavlink-routerd (1) or msposd instead of mavfwd (2)
-router=0
+router=2

 wlan=wlan0
 bandwidth=20

首先,通过ssh方式登录系统

步骤一:备份/etc/telemetry.conf

$ cp /etc/telemetry.conf /root/telemetry.conf.bak

步骤二:修改/etc/telemetry.conf

$ vi /etc/telemetry.conf
$ diff -uN /root/telemetry.conf.bak /etc/telemetry.conf
--- /root/telemetry.conf.bak
+++ /etc/telemetry.conf
@@ -5,7 +5,7 @@
 baud=115200

 ### router: use simple mavfwd (0), classic mavlink-routerd (1) or msposd instead of mavfwd (2)
-router=0
+router=2

 wlan=wlan0
 bandwidth=20

在这里插入图片描述

步骤三:配置时区

Raspberry Pi Camera

$ sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

注1:不同时区的朋友,请根据自己所在时区进行设置。
注2:时区的目的是为了自定义OSD输出,详见:libcamera_mon 开源代码之树莓派3B+ Bookworm部署

OpenIPC Camera

根据所在时区表进行配置,比如:中国时区

$ echo "GMT-8" > /etc/TZ
$ export TZ=$(cat /etc/TZ)

1. 没有偏移的 GMT 时区

配置 说明
GMT0 格林尼治标准时间,无偏移。
UTC0 等价于 GMT0,无偏移。

2. 东时区(UTC+X)
东时区表示比 UTC 时间早,偏移量为正(+X)。

配置 偏移量 示例地区
GMT-1 UTC+1 小时 中欧时间(如法国、德国)。
GMT-2 UTC+2 小时 南非标准时间。
GMT-3 UTC+3 小时 莫斯科标准时间。
GMT-4 UTC+4 小时 迪拜标准时间。
GMT-5 UTC+5 小时 巴基斯坦标准时间。
GMT-6 UTC+6 小时 孟加拉标准时间。
GMT-7 UTC+7 小时 泰国标准时间。
GMT-8 UTC+8 小时 中国标准时间(北京)。
GMT-9 UTC+9 小时 日本标准时间。
GMT-10 UTC+10 小时 澳大利亚东部标准时间。
GMT-11 UTC+11 小时 所罗门群岛标准时间。
GMT-12 UTC+12 小时 新西兰标准时间。

3. 西时区(UTC-X)
西时区表示比 UTC 时间晚,偏移量为负(-X)。

配置 偏移量 示例地区
GMT+1 UTC-1 小时 亚速尔群岛标准时间。
GMT+2 UTC-2 小时 中大西洋标准时间。
GMT+3 UTC-3 小时 巴西利亚标准时间。
GMT+4 UTC-4 小时 大西洋标准时间。
GMT+5 UTC-5 小时 东部标准时间(美国)。
GMT+6 UTC-6 小时 中部标准时间(美国)。
GMT+7 UTC-7 小时 山地标准时间(美国)。
GMT+8 UTC-8 小时 太平洋标准时间(美国)。
GMT+9 UTC-9 小时 阿拉斯加标准时间。
GMT+10 UTC-10 小时 夏威夷标准时间。
GMT+11 UTC-11 小时 美属萨摩亚标准时间。
GMT+12 UTC-12 小时 贝克岛时间。

步骤四:重启摄像头

$ reboot

此时,mavfwd 将不会启动,取代它的是msposd进程,该进程就是嵌入式OSD软件。

4. 飞控配置

当飞控串口没有配置OSD协议的时候(或者默认MAVLink时),将会显示"Identifying Flight Controller …"

在这里插入图片描述

接下去将在各种飞控地面站上进行嵌入式OSD协议配置,详见以下介绍:

5. 参考资料

【1】Open FPV VTX开源之硬件规格及组成
【2】Open FPV VTX开源之第一次出图
【3】Open FPV VTX开源之默认MAVLink设置
【4】Open FPV VTX开源之图像化配置工具


网站公告

今日签到

点亮在社区的每一天
去签到