# ArduPilot on Voxl2

Source: https://forum.modalai.com/topic/3640/ardupilot-on-voxl2
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: flight-core-v2
Posted: 2024-07-13 04:55:19 UTC by Andrew Tridgell
Replies: 42 · Views: 25337

## Andrew Tridgell · 2024-07-13 04:55:19 UTC

Support for ArduPilot on QURT (the RTOS used on Voxl-2) is now merged in ArduPilot master
Basic instructions on building and installing are here:

https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_HAL_QURT/ap_host/service

Pre-built binaries are available here:
 - https://firmware.ardupilot.org/Copter/latest/QURT/
 - https://firmware.ardupilot.org/Plane/latest/QURT/
 - https://firmware.ardupilot.org/Rover/latest/QURT/

This should still be considered experimemtal, with active development happening with @Eric-Katzfey and myself.

Flight video here on an autonomy dev kit copter:
https://www.youtube.com/watch?v=l6c65-E-lzg

Enjoy!

## Reply by Eric Katzfey (ModalAI staff) · 2024-07-20 00:09:52 UTC

@Andrew-Tridgell Here is the start of our ModalAI ArduPilot documentation: https://docs.modalai.com/voxl-ardupilot/

## Reply by TomP · 2024-08-14 07:35:52 UTC (in reply to Eric Katzfey)

@Eric-Katzfey I understand that you have not yet tested Arduplane. Apart from that, it could work, right? I want to test Arduplane together with the I/O board because I use a normal ESC which needs a pwm signal.

## Reply by Eric Katzfey (ModalAI staff) · 2024-08-14 15:05:42 UTC (in reply to TomP)

@TomP It's missing support for that I/O board right now. So you would either have to add that yourself or wait for support to be added.

## Reply by TomP · 2024-08-15 12:23:48 UTC (in reply to Eric Katzfey)

@Eric-Katzfey When could the support for this be added?

## Reply by Alex Kushleyev (ModalAI staff) · 2024-08-15 15:24:40 UTC (in reply to TomP)

@TomP , if you wanted to try this yourself, a minimal integration of the VOXL2 IO board (M0065) can be done by sending out a single UART packet which contains the PWM output values.

- the function that creates the packet can be found [here](https://github.com/modalai/px4-firmware/blob/voxl2-esc-uart-debug/src/drivers/voxl2_io/voxl2_io_packet.c#L162) and it is used in the voxl2_io px4 driver [here](https://github.com/modalai/px4-firmware/blob/voxl2-esc-uart-debug/src/drivers/voxl2_io/voxl2_io.cpp). You simply provide an array of pwm values (in nanoseconds). This packet is variable length and supports 1,2,4,6, or 8 outputs.
- this would be a minimal implementation, which does not include querying the VOXL2 IO board, checking it's version, etc, which is normally done in our PX4 driver. However, it could unblock your work if you are looking to fly a fixed wing ASAP.
- the packet wrapping function uses the same structure as used for the ModalAI ESC, so that code should already exist in ArduPilot and can be re-used.

Just to add, make sure the latest M0065 firmware is loaded
- https://docs.modalai.com/voxl2-io-user-guide/
- https://docs.modalai.com/voxl2-io-firmware/

The VOXL2 IO board firmware currently operates in one-shot mode pwm, that is for one PWM command packet there will be one pulse generated without a delay. The communication baud rate with the VOXL2 IO firmware is 921600.

Alex

## Reply by Eric Katzfey (ModalAI staff) · 2024-08-15 15:48:27 UTC (in reply to TomP)

@TomP said in [ArduPilot on Voxl2](/post/18623):
> When could the support for this be added?

Unfortunately, we don't have a fixed date for that support yet. We are striving to support ArduPilot on VOXL 2 by end of this year and that would include support for the IO board. Otherwise I would say keep your eye on the commits going in to AP to see if something comes in sooner.

## Reply by TomP · 2024-08-15 16:18:24 UTC (in reply to Eric Katzfey)

@Eric-Katzfey That is a manageable period of time for me. We can use it to plan our product roadmap. Thank you very much and keep up the good work.

## Reply by TomP · 2024-11-02 15:59:18 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Is there an update on the timeline yet?

Best regards 
Tom

## Reply by TomP · 2024-12-02 14:33:44 UTC

@Andrew-Tridgell @Eric-Katzfey I wanted to ask again about the current roadmap regarding Arduplane and the IO board for PWM.

Best regards
Tom

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-02 20:10:03 UTC (in reply to TomP)

@TomP We are still shooting for the end of this year. I would like to know what external peripherals you would like to support though. I'm guessing GPS, magnetometer, RC, a PWM based motor ESC, and some servos for flight surface control? Also an airspeed sensor? A distance sensor? What kind of RC are you expecting to use? There are some I/O limitations with VOXL 2 so want to make sure that what you want to build can be supported by what we are putting together.

## Reply by TomP · 2024-12-08 22:13:37 UTC (in reply to Eric Katzfey)

@Eric-Katzfey We use GPS, compass and the IO board for a PWM-controlled ESC and two servos. We also need two more PWM channels for gimbal control. That's it.

We do not use an RC. The control is purely via MAVLink. Joystick inputs are made via the MAVLink command MANUAL_CONTROL. Data is transmitted via the mobile network.

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-20 18:18:43 UTC (in reply to TomP)

@TomP I have updated the documentation at https://docs.modalai.com/voxl-ardupilot/. The VOXL 2 IO board with up to 4 PWM outputs is now supported and has been tested on a quadcopter with 4 PWM ESCs. You should be able to use this for arduplane now. We are putting together our own fixed wing test platform and hope to begin testing soon.

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-20 18:22:16 UTC (in reply to Eric Katzfey)

@Eric-Katzfey I will need to add the support for up to 8 PWM outputs on VOXL 2 IO board. Right now it only supports 4. You should be able to do test flights without the gimbal with 4 PWM outputs.

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-24 23:49:37 UTC (in reply to TomP)

@TomP The update to support all 8 PWM outputs from the IO board is now in mainline. You can get it in the latest build posted here: https://firmware.ardupilot.org/Copter/latest/QURT/

## Reply by TomP · 2025-03-27 13:44:00 UTC

Hi,

How can I configure the battery monitor for ArduPlane on the VOXL2-Mini? 
Which value do I have to enter for BATT_MONITOR and which values for BATT_I2C_ADDR and BAT_I2C_BUS?

The "VOXL 2 Mini Power" transmits the current and voltage measurement data via I2C.

Best regards,
Tom

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-27 16:20:56 UTC (in reply to TomP)

@TomP It should just scan the available I2C ports and automatically detect the VOXL 2 mini power module if it has been connected. Is it not detecting it?

## Reply by TomP · 2025-03-27 19:05:06 UTC (in reply to Eric Katzfey)

@Eric-Katzfey No, this is not detected. The configuration does not seem to be correct either. The parameter list mentions "Analog Voltage and Current" and corresponding pins.
Here is a screenshot:
![Arduplane_VOXL2_Mini.png](https://forum.modalai.com/assets/uploads/files/1743102246443-arduplane_voxl2_mini.png)

## Reply by TomP · 2025-03-28 14:46:52 UTC

Hi,

There is another problem. The PWM board does not output PWMs. I have also measured this with an oscilloscope. According to SERVO_OUTPUT_RAW, however, the FC should output PWM values.

Do I have to set another parameter in Arduplane so that the VOXL 2 I/O Expander Board is controlled correctly?

I use the VOXL2-Mini J19 connector: GND, pin 7, pin 8 and VREG_3P3V_RC for the power supply.

Here is my setup:
![WhatsApp Image 2025-03-28 at 15.35.26.jpeg](https://forum.modalai.com/assets/uploads/files/1743172777406-whatsapp-image-2025-03-28-at-15.35.26.jpeg)

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 18:28:57 UTC (in reply to TomP)

@TomP Okay, yes, sorry, you need to set BATT_MONITOR to 21 for INA2xx and need to set BATT_I2C_BUS to 1 for that power monitor to come up. I'll investigate the PWM issue.

## Reply by TomP · 2025-03-28 19:00:54 UTC (in reply to Eric Katzfey)

@Eric-Katzfey The battery monitor works. Thank you very much! I'm sure the PWM will also work and then it's off to the test flight. :)

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 20:56:39 UTC (in reply to TomP)

@TomP What are the settings of all the SERVO(x)_ params?

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 21:07:41 UTC (in reply to TomP)

@TomP If you set the SERVO(x)_FUNCTION parameters according to this: https://ardupilot.org/plane/docs/servo-functions.html#overview do you get any PWM output?

## Reply by TomP · 2025-03-28 21:17:06 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Here are my settings (no PWM output):

SERVO1_FUNCTION,4
SERVO1_MAX,1900
SERVO1_MIN,1100
SERVO1_REVERSED,0
SERVO1_TRIM,1500
SERVO2_FUNCTION,19
SERVO2_MAX,1900
SERVO2_MIN,1100
SERVO2_REVERSED,0
SERVO2_TRIM,1500
SERVO3_FUNCTION,70
SERVO3_MAX,1900
SERVO3_MIN,1100
SERVO3_REVERSED,0
SERVO3_TRIM,1100
SERVO4_FUNCTION,21
SERVO4_MAX,1900
SERVO4_MIN,1100
SERVO4_REVERSED,0
SERVO4_TRIM,1500
SERVO5_FUNCTION,0
SERVO5_MAX,1900
SERVO5_MIN,1100
SERVO5_REVERSED,0
SERVO5_TRIM,1500
SERVO6_FUNCTION,0
SERVO6_MAX,1900
SERVO6_MIN,1100
SERVO6_REVERSED,0
SERVO6_TRIM,1500
SERVO7_FUNCTION,0
SERVO7_MAX,1900
SERVO7_MIN,1100
SERVO7_REVERSED,0
SERVO7_TRIM,1500
SERVO8_FUNCTION,0
SERVO8_MAX,1900
SERVO8_MIN,1100
SERVO8_REVERSED,0
SERVO8_TRIM,1500

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 21:36:28 UTC (in reply to TomP)

@TomP Hmm, that looks correct. On my test setup running ArduPlane with those values I see output values being sent to the M0065 board. I'm wondering if there is a connectivity issue between the VOXL 2 mini and the IO board.

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 21:41:11 UTC (in reply to TomP)

@TomP Can you tell me how you have connected the UART pins on M0065 to the UART pins on VOXL 2 mini? Like the actual pin numbers that are connected?

## Reply by TomP · 2025-03-28 21:50:59 UTC (in reply to Eric Katzfey)

@Eric-Katzfey I can rule out connection problems. I checked the contacts on the VOXL2-Mini and the IO board with a continuity tester. Everything is well connected.

I know that with ardupilot you can at least control the servos without arming. Is this perhaps implemented differently here? Then I would have to calibrate the sensors etc. to test this.

![voxl2_mini_durchgangspruefer.png](https://forum.modalai.com/assets/uploads/files/1743198653581-voxl2_mini_durchgangspruefer.png)

## Reply by TomP · 2025-03-28 21:56:47 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Here is the pin configuration (J19 on VOXL2-Mini to J4 on IO Board):

VOXL2-Mini-----IO Board
9-----------------1
8-----------------3
7-----------------2
6-----------------4

(I mistyped the table at the beginning. I have corrected the typo.)

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:37:21 UTC (in reply to TomP)

@TomP Yep, that all looks fine. Shoot. I may need to send you a new package with extra debug information to help debug this since by default there really isn't much we can see.

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:40:53 UTC (in reply to TomP)

@TomP Can you stop ardupilot and then run this command on VOXL 2 mini? `voxl-2-io detect`

## Reply by TomP · 2025-03-28 22:41:29 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [ArduPilot on Voxl2](/post/21593):
> Yep, that all looks fine. Shoot. I may need to send you a new package with extra debug information to help debug this since by default there really isn't much we can see.

What do you mean by that?
*"a new package with extra debug information"*

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:43:07 UTC (in reply to TomP)

@TomP A new voxl-ardupilot package with debug information added. But we may not need that. Try `voxl-2-io detect` and then if that is successful then try `voxl-2-io scan`

## Reply by TomP · 2025-03-28 22:46:12 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [ArduPilot on Voxl2](/post/21596):
> @TomP A new voxl-ardupilot package with debug information added. But we may not need that. Try `voxl-2-io detect` and then if that is successful then try `voxl-2-io scan`

voxl2-mini:~$ voxl-2-io detect
enabling bridge
bridge enabled
[INFO] Detected VOXL2 IO on default port (2).

ESC detected: ModalAi I/O Expander (M0065)

disabling bridge
bridge disabled
voxl2-mini:~$ voxl-2-io scan
enabling bridge
bridge enabled
Successfully pinged VOXL2 IO on default port (2).
INFO: VOXL2 IO Information:
---------------------
        Board      : version 35 : ModalAi I/O Expander (M0065)
        UID        : 0x8108322152518882066BFF54
        Firmware   : version 1, hash 6b5ec459
        Bootloader : version 0, hash 5ba5857f
---------------------
disabling bridge
bridge disabled

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:51:12 UTC (in reply to TomP)

@TomP Okay, I think that firmware needs to be upgraded. Can you try voxl-2-io and choose upgrade_firmware?

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:57:43 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Or just `voxl-2-io upgrade_firmware`?

## Reply by TomP · 2025-03-28 22:57:58 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [ArduPilot on Voxl2](/post/21598):
> voxl-2-io

It works! Many thanks for the great support! :)
The firmware upgrade was the solution.

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 22:59:27 UTC (in reply to TomP)

@TomP Wonderful! So glad to hear. And I would really love to hear how the flight testing goes. We've never tried a VOXL 2 (or VOXL 2 mini) on a fixed wing (with ArduPilot) so be careful and triple check to make sure everything looks setup correctly before launching.

## Reply by TomP · 2025-03-28 23:06:55 UTC (in reply to Eric Katzfey)

@Eric-Katzfey said in [ArduPilot on Voxl2](/post/21601):
> @TomP Wonderful! So glad to hear. And I would really love to hear how the flight testing goes. We've never tried a VOXL 2 (or VOXL 2 mini) on a fixed wing (with ArduPilot) so be careful and triple check to make sure everything looks setup correctly before launching.

It is an honor for me to report. We will be careful. Of course, a crash can also occur independently of the VOXL2. This is a new drone that we are building.

What might be relevant for you is that we have found a gimbal that will fit one of your cameras with a bit of hardware hacking. The gimbal can also be controlled via serial interface using Ardupilot. We have already successfully tested this with the VOXL2-Mini.
![WhatsApp Image 2025-03-29 at 00.03.08.jpeg](https://forum.modalai.com/assets/uploads/files/1743203207502-whatsapp-image-2025-03-29-at-00.03.08.jpeg)

## Reply by Eric Katzfey (ModalAI staff) · 2025-03-28 23:52:11 UTC (in reply to TomP)

@TomP Oh, yes, this is all great news! Very exciting to hear! I will send an email to your account with some follow up questions.

## Reply by Sam Kiley · 2025-09-16 18:11:55 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

I am also messing around with Ardupilot on a fixed wing, and wondering if any sort of voxl-io conf is needed for passthrough the PWM and CRSF RC? in a previous SDK, I believe there was a voxl-io-server, which no longer exists in 1.5 SDK, from what I can tell.
I have upgraded the firmware and followed along with the rest of the thread.
Thanks for any info.

## Reply by Eric Katzfey (ModalAI staff) · 2025-09-16 18:27:42 UTC (in reply to Sam Kiley)

@Sam-Kiley No need for any voxl-io configuration. voxl-io-server is for use with PX4, not ArduPilot. The ArduPilot firmware will detect if there is a VOXL ESC connected or a VOXL 2 IO board connected. If it detects the IO board then you will have up to 8 channels of PWM available.

## Reply by adiprin1 · 2025-10-01 20:15:03 UTC

I would like to add a UART device to the starling 2 max running arducopter. can i use the VOXL 2 IO board's UART output to connect it to an a serial device? if so, what would the UART number be within arducopter?

## Reply by Eric Katzfey (ModalAI staff) · 2025-10-02 15:33:54 UTC (in reply to adiprin1)

@adiprin1 Can you please start a new forum topic for this? And please include information about the device that you are looking to attach? Thanks!
