Configure MTF-01 Sensor By Using Ardupilot’s Serial Passthrough Function
When using the MicoAir MTF-01 optical flow sensor, you may need to configure this sensor first on the MicoAssistant software and a USB-TTL module should used for it.
In case you can’t find a TTL module around you, there is still another way that might do the job.
Ardupilot has a function call “Serial Passthrough” that allows the autopilot to route serial protocol messages between serial ports on the autopilot including the USB port. Then we can use this function to complete the configuration of the MTF-01 sensor without a USB-TTL module.
Preparation
- MicoAir MTF-01 optical flow&lidar 2IN1 sensor
- MicoAir743 flight controller – ArduCopter 4.5.1 (Any flight controller running ardupilot can be used)
- Mission Planner 1.3.81
- MicoAssistant Software
Step1
First connect the MTF-01 sensor to the Telem1/Serial1 port of the flight controller, as shown in the figure below.
Step2
Connect the flight controller to the PC via USB, open the Mission Planner and connect the flight controller.
Find SERIAL1 in the “Full Parameter List”, and set
- SERIAL1_BAUD = 115
- SERIAL1_PROTOCOL = 1
- SERIAL1_OPTIONS = 1024 (Don’t forward mavlink to/from)
Click “Write Params” on the right, then reboot the flight controller
Step3
Reconnect the flight controller on Mission Planner again . In the “Full Parameter List”, and set
- SERIAL_PASS2 = 1 (enable passthrough on Serial1)
- SERIAL_PASSTIMO = 30 (gives you enough time to connect with the MicoAssistant)
Click “Write Params” , after a few seconds, the flight controller will enter serial passthrough mode. And note that The flight controller cannot be rebooted at this time, otherwise it will exit serial passthrough mode after restarting.
Step4
Press the “Disconnect” button on the Mission Planner but leave the USB cable from the PC to the flight controller connected
Then open the MicoAssistant software, select the port number of the flight controller, such as COM12 here, select 115200 for the baudrate, and click the connection icon.
If everything goes well, the MicoAssistant will recognize the MTF-01 sensor and show the sensor data.
Click the settings icon on the right to bring up the configuration page.
You can modify the output protocol of the MTF-01 here. When using on Ardupilot, you should select “Mav_APM“, then click “WRITE” to write the parameters to the sensor.
2 thoughts on “Configure MTF-01 Sensor By Using Ardupilot’s Serial Passthrough Function”
Hello, Is it possible to enable serial pass through using INAV instead of Ardupilot?
I figured it out. Set serial pass through, choose port, set baud, choose txrx, press enter, then disconnect and open Micoassistant and choose correct COM port. (serialpassthrough 1 115200 txrx)