In my plane, I use a elrs radio system and the Mavlink feature to have the telemetry back on my PC with mission planner.
Yesterday I installed a rangefinder Micoair MT-15 which transmit data to the flight controller through the serial port. The rangefinder works fine but… I discover that mission complains saying “sensor lost“ and my mission planner was taking forever to retrieve the configuration parameters. A check to the communication stats is saying me there is some packet loss.
The problem disappear if I unplug the rangefinder. I checked with an oscilloscope and the rangefinder is sending packets at 50Hz. So my hypothesis is that this serial stream is flooding the processor keeping it busy.
How can I deal with this issue? Is there any option available in ardupilot to discard some packets?
I finally lowered the rate to 10Hz and the problem is now solved.
But I’m curious to know if there’s any way to solve it on the ardupilot side. A common failure on sensor side is the so called “bubbling idiot failure”, where a sensor start flooding the serial with a lot of messages
The problem is probably primarily caused by the low Mavlink data transmission rate of the ELRS radio system. The Ardupilot Mavlink stream rate can be adjusted using the StreamRate parameters, and reduced if necessary, without changing the speed of data transmission from the sensor to the flight controller.
You can test this by setting the rangefinder’s data rate back again and connecting the flight controller directly to the mission planner via a USB cable. I don’t think there will be any data loss. The bottleneck will be the ELRS-mavlink-Rc connection.
If your rangefinder uses MAVLink you should disable forwarding messages to and from that port using IIRC MAVx_OPTIONS, then the rangefinder can operate at any rate without flooding the ELRS tunnel.
Sounds interesting. Yes. My rangefinder uses MAVlink1
But sorry, I need to know more.
What MAVlink forwarding exactly is?
I can’t found any parameter called “MAV1_OPTIONS” or “MAV2_OPTIONS”, etc. in the full parameter list. Should I enable something else to see them?
For what the x of the MAVx_OPTIONS stands for? I see in the Full parameter list on the website that there are 32 MAV parameters. What should be the mapping between the serial port on which my rangefinder is connected and the corresponding MAVx_OPTIONS?
I found a clue in the serial option form, but nothing on the ardupilot documentation…
That’s the option you are looking for, it will be moved to MAVx_OPTIONS soon™.
MAVLink messages are supposed to be forwarded between components and vehicles. The rules are fairly simple and few messages got treatment that would allow vehicle only routing.
IIRC the MAVx_options should map incrementally to MAVLink serial ports then there should be some for CAN and Ethernet virtual serial ports, though I don’t know the details @Yuri_Rage .
I switched back the rangefinder update rate to 50Hz and checked the “Don’t forward mavlink to/from” option on the serial5 options bitfield.
It worked as expected and telemetry is now clean.
So were just raw rangefinder packets sent over the datalink to saturate the bandwidth and not a serial port overload.