# PWM channel control for auxiliary functions

Source: https://forum.modalai.com/topic/2172/pwm-channel-control-for-auxiliary-functions
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2-io
Posted: 2023-05-18 23:29:09 UTC by Filip Slezak
Replies: 3 · Views: 1758

## Filip Slezak · 2023-05-18 23:29:09 UTC

Hi all,

How should I go about controlling the PWM channel 7 or 8 (hexacopter airframe) from VOXL2 code and/or remote control? I can't find where the AUX channels are mapped 

Thx

## Reply by wilkinsaf · 2023-05-19 04:05:53 UTC

This was completed with the VOXL Flight Core: https://www.youtube.com/watch?v=fxfyrUW3EyA

Not sure if it helps on the VOXL2 IO

## Reply by Filip Slezak · 2023-05-20 02:52:21 UTC

Yes, thanks. Although incomplete 🙂
Need to configure `quad_x_io.main.mix` (`find / -name "filename"`) with the code below where X is the channel defined in the 2nd link below (AUX1 5 or AUX2 6) 

```
# Hexacopter X airframe config
R: 6x ...
# For each AUX channel
M: 1
S: 3 X ...
```
Writing this from home, sorry for '...' but simply copy the config to quad_x.main.mix to quad_x_io.main.mix, both these files are loaded on boot and if the io board is connected it overrides the former

AUX1 will be on pin7 and AUX2 on pin8.

1) https://docs.px4.io/v1.12/en/concept/mixing.html
2) https://docs.modalai.com/voxl2-io-user-guide/#supported-mixers-and-airframe-setup

Or properly rename the file and change the name being loaded in the px4 startup script but I didn't do that to avoid issues in case it's used by something else too...

## Reply by Filip Slezak · 2023-05-20 02:59:18 UTC

Any tips on how to control this from ROS for offboard mode?
