MTF-02P
Optical Flow & 6m Range Sensor 2IN1
MTF-02P Optical Flow&Range Sensor
2IN1 sensor,small size with high performance, available for outdoor use
Specifications
- Output Interface: UART/115200/LVTTL
- Protocol: Micolink/Mavlink/MSP
- Output Rate: 50Hz
- Firmware Supported: Ardupilot/PX4/INAV/FMT
- TOF Range: 6m@90% reflectance/1K Lux; 4m@90% reflectance/70K Lux;
- Center Wavelength: 940nm
- Emitting Angle: 2 °
- Dead Zone: 2cm
- Ranging Accuracy: 2cm(<2m@90% reflectance); 1.5%(>2m@90% reflectance)
- Optical Flow FOV: 42 °
- Max Speed Measurement: 7m/s@1m height
- Ambient Light Demand of Optical Flow: >60Lux
- Optical Flow Working Distance: >8cm
- Power Consumption: 200mW (40mA@5V)
- Supply voltage: 5V
Protocol
MTF-02P supports multiple serial protocols such as Micolink/Mavlink/MSP, and is compatible with mainstream open-source flight controllers such as Ardupilot, PX4, INAV, etc.
You can easily switch its protocol by bridging the jumper on the back of the board.
The module protocol can also be switched using MicoAssistant, however, the jumper configuration takes precedence.
Default Orientation
Physical
- Dimensions: 21.6 x 16 x 6.5 mm
- Weight: 1.5g
Connector Definition
Micolink
The micolink is a lightweight protocol customized by MicoAir Tech, prepared for developers who are ready to write their own code to read sensor data.
Setup Tutorial For Ardupilot(4.1.x-4.6.x)
Step 1:
Configures the module to work in Ardupilot mode (bridging the jumper or using MicoAssitant).
Step 2:
Connect the MTF-02P module to the serial port of the flight controller, such as Telem2 on pixhawk.
Step 3:
Configure these parameters in the Mission Planner
SERIALn_BAUD 115
SERIALn_OPTIONS 1024
SERIALn_PROTOCOL 1
FLOW_TYPE 5
RNGFND1_TYPE 10
n depends on which serial port the MTF-02P connected, for example, n=2 when it connect to Telem2.
Step 4:
After that, we need to reboot the flight controller or just refresh the parameters in Mission Planner.
And then these parameters need to be configured.
RNGFND1_MAX_CM 600
RNGFND1_MIN_CM 1
RNGFND1_ORIENT 25
When you complete the above steps, you should be able to observe the optical flow and range sensor data on the Mission Planner’s “Status” page. The “opt_qua” and “rangefinder1” should have some value.
Step 5:
After the flight controller has recognized MTF-02P, we need to perform some configurations so that the sensor data can be used in EKF fusion.
If you just need to use optical flow to fly indoors and don’t consider using GPS outdoors, then you only need to configure EK3_SRC1.
AHRS_EKF_TYPE 3
EK3_SRC_OPTIONS 0
EK3_SRC1_POSXY 0
EK3_SRC1_POSZ 2
EK3_SRC1_VELXY 5
EK3_SRC1_VELZ 0
EK3_SRC1_YAW 1
But if you need to take into account both indoor and outdoor environments, then you may need to use a method that can switch the EK3 data source. Keep the EK3_SRC1 as default, and set EK3_SRC2 as follows.
AHRS_EKF_TYPE 3
EK3_SRC_OPTIONS 0
EK3_SRC2_POSXY 0
EK3_SRC2_POSZ 2
EK3_SRC2_VELXY 5
EK3_SRC2_VELZ 0
EK3_SRC2_YAW 1
Then set the RC6 channel to switch using optical flow as EKF3 source.RC6_OPTION 90
Now you can use RC6 channel to switch between using SRC1 or SRC2 as the data source of EK3.
When the RC6 value is in the low position, SRC1(GPS) will be used, and in the middle position, SRC2(Optical flow)will be use.
Step 6:
When all settings are completed, switch to loiter mode, unlock and take off.
Sometimes the flight controller may not be allowed to unlock in Loiter mode when the sensor is too close to the ground. You can unlock it in Althold mode and then switch to Loiter mode after taking off.
Setup Tutorial For INAV
Setup Optic Flow&Lidar(MTF-01) For INAV6 To Make Drones Hover And Fly Indoors Better (youtube.com)
Note: INAV 7.1.1 may have some bugs that can not work properly with the sensor. You need to upgrade to version 7.1.2 which have been tested well.
Setup Tutorial For PX4
PX4(1.11.x – 1.13.x):
MAV_1_CONFIG TELEMn
(n depends on which serial port you connect to)
Reboot the flight controller
MAV_1_MODE Normal
SER_TELn_BAUD 115200 8N1
SENS_FLOW_ROT No rotation
EKF2_AID_MASK use optical flow
EKF2_RNG_AID Range aid enable
EKF2_HGT_MODE Range sensor
PX4(1.14 – )
MAV_1_CONFIG TELEMn
(n depends on which serial port you connect to)
Reboot the flight controller
MAV_1_MODE Normal
SER_TELn_BAUD 115200 8N1
EKF2_OF_CTRL Enabled
EKF2_RNG_CTRL Enabled
EKF2_HGT_REF Range sensor
Reboot the flight controller
SENS_FLOW_ROT No rotation (This step can be skipped)