產品發表 包羅萬象 模型拍賣 綜合討論 直昇機 飛機 同協會 回首頁

台灣遙控模型-RCTW

 找回密碼
 申請
查看: 3932|回復: 0

inav 穿越機 室內 定高 停懸 光流計 雷射 MATEK 3901 LOX optical flow

[複製鏈接]
發表於 2021年4月5日 11:36 AM | 顯示全部樓層 |閱讀模式
本帖最後由 teawood 於 2021年4月7日 12:38 AM 編輯

MATEK 3901 LOX optical flow

最近在玩的東西
除了花飛還能玩定位
22049181222991_626.jpg


在戶外可以當放電器喔

使用光流計開啟定高定位模式不能開啟GPS(有接的話)
飛行模式需同時開啟
ARM
ANGLE
NAV ALTHOKD
NAV POSHHOLD
SURFACE

假如全白地板反而只能定高
地板上放一個相反色的黑色物體
可以增加定位準度

基本上CLI先把紅字全打進去就可以了

摔機不負責


雖然要玩定高定點pixhawk用ARDUPILOT可能會比較好
教學也比較多

下面搬說明書過來而已
讓自己好記+分享讓網友好找

Setting up Optic Flow in INAV 2.2.x

Version 0.1
setup_optic flow_in_INAV_rev1.zip (92.27 KB, 下載次數: 693)
http://www.mateksys.com/download ... ow_in_INAV_rev1.pdf


Hardware requirements
To use optic flow capabilities of INAV you need two sensors - optic flow (to measure sliding)
and rangefinder (to measure distance to surface).
Tested sensors:
1. Combination of Cheerson CX-OF + VL53L0X laser rangefinder
2. MATEK Optic Flow / Lidar board

Connecting and configuring the hardware
The easiest to connect board in MATEK Optic Flow / Lidar - you need one Serial port to get all
of the data from the board (optic flow and rangefinder). The next paragraph applies to that
board.
After you connected the board you need to go to INAV Configurator and configure the Serial
port to MSP protocol and 115200 baud and select “MSP” for both Optic Flow and Rangefinder:
螢幕擷取畫面 (4).png


If you have connected and configured everything correctly, you should have all sensors active
and ready. At the bare minimum you should have Gyro, Accel, Baro, Flow and Sonar ready and
active to get optic flow working.
螢幕擷取畫面 (5).png

Aligning the hardware
As a first step, obviously, you should have your board aligned properly, accelerometer
calibrates and machine flight tested in ANGLE and ALTHOLD modes, without any modifiers
(sonar and flow). As with GPS/Baro-assisted modes good ANGLE performance is very
important.
Second step is aligning the optic flow sensor. This is a critical step that is equally important as
getting compass alignment right for GPS-enabled flights. With optical flow sensor misaligned
behavior of POSHOLD will be random.
Unfortunately, as of version 2.2.1 there is no GUI-friendly way to align the optic flow sensor, so
this step might be a bit complicated. First, go to CLI and set debug mode to FLOW_RAW:
set debug_mode = FLOW_RAW
save




Then, find a spot of well-lit and contrast terrain:
1. Optic flow needs contrast texture it can observe to measure motion. It won’t work on
solid color, low contract surface or in the low light.
2. Laser rangefinder needs a relatively reflective surface to work properly - it won’t work
over dark surface. Furry carpet is also not a very good example of terrain.
Open the “Sensors” tab. Then lift the quad 50-70cm over the surface and tilt it from one side to
the other by roll and then by pitch axis. The max tilt should be around 30-40 degrees, optic flow
should always be looking down at the surface. Make sure that you only tilt the quad without
moving it over the terrain. Observe the graphs and make sure Debug 0 looks similar to Debug 2
and Debug 1 is similar to Debug 3:

Change the “align_opflow” parameter in CLI and retry the procedure until your Debug 0 looks
similar to Debug 2 and Debug 1 is similar to Debug 3.

螢幕擷取畫面 (7).png
Because optic flow sensor is looking down, there are only 4 possible values of “align_opflow”
that make sense: CW0FLIP, CW90FLIP, CW180FLIP and CW270FLIP.
Note : that those values are relative to the FC board, not the frame, so if your FC is mounted
upside down, possible values would be CW0, CW90, CW180 and CW270.
Optic flow calibration
With INAV 2.2.1 this is easy - just go to Configurator, open the “Calibration” tab and follow
instructions for “Optic Flow Calibration”. You will have 30 seconds to tilt the quad in a way you
did in “Aligning the hardware” section. For MATEK Opflow board and Cheerson CX-OF sensor
(and probably other sensors based on PMW3901 chip) the optic flow scale (CLI variable
“opflow_scale”) value is 9-10.

Flight modes
There is no specific flight mode for optic flow. From flight modes perspective it’s the same
“POSHOLD” mode as you would use with GPS.
To enable terrain following altitude hold you need to enable “SURFACE” mode together with
“ALTHOLD” or “POSHOLD”. The “SURFACE” works as a modifier to altitude hold controller and
changes its behavior to use altitude above ground level (AGL) instead of altitude above launch
point.
If your machine doesn’t have a compass, you won’t be able to select “POSHOLD” in flight
modes. To override requirement for compass there is one important CLI parameter you need
to enable:
set inav_allow_dead_reckoning = ON
save




Keep in mind that dead reckoning may cause unexpected results when you actually use
compass. If you intend to fly with GPS and compass on the same machine - don’t enable this
parameter.

Tuning
Both terrain following and optic flow offer much better accuracy compared to GPS and
barometer, so PosXY, VelXY, PosZ and VelZ PIDs could be much higher than default ones.
Here are PID settings that were tested with success:
set nav_mc_vel_z_p = 150
set nav_mc_vel_z_i = 250
set nav_mc_vel_z_d = 25
set nav_mc_pos_xy_p = 80
set nav_mc_vel_xy_p = 50
set nav_mc_vel_xy_i = 40
set nav_mc_vel_xy_d = 60
save







評分

參與人數 1積分 +5 收起 理由
chyeh + 5

查看全部評分





上一篇:請問電腦版FPV模擬程式
下一篇:想入門2軸阿凡達機.
您需要登錄後才可以回帖 登錄 | 申請

本版積分規則

世界各國訪RCTW統計

手機版|台灣遙控模型-RCTW

GMT+8, 2024年4月26日 03:09 PM

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回復 返回頂部 返回列表