Configuring Ardupilot and Cockpit for scaling laser switching on/off

Hi there,

We’ve put together a scaling laser for the BlueROV2 and would like to switch this on/off using the standard X-box controller interface. Thinking that Shift (A) + Y might be a good setup.

Steps achieved so far:

  1. Physically wired in a relay module (Arduino compatible 2 channel - but only single chan in use). Attached to Navigator servo channel 14.

  2. Set SERVO14_FUNCTION = -1 meaning GPIO.

Then I get stuck…. I’m trying to work out how to configure servo channel 14 to toggle on Shift (A) + Y. I take it this is configure via Cockpit’s controller settings page (?) I’ve managed to display the table with SHIFT functions and have gone to Edit the settings for Button 3 (Y button). I’m not sure what to choose from this list to achieve what I need.

Any assistance appreciated!

Hi @Jono,

There’s a guide for the relevant setup in this post. Have a read of that, and feel free to follow up if you’ve still got questions afterwards :slight_smile:

1 Like

Hi @EliotBR . Attempting to follow those instructions. Managed to set RELAY1_FUNCTION to Relay, but then when it comes to setting RELAY1_PIN to Servo PWM channel 14 there doesn’t appear to be an option for that. Please advise.

We choose PWM Servo Channel 14 as it’s next to the standard lumen light channel (13) which seemed logical.

The Navigator’s servo pins don’t appear in the list, but they’re just their numbers. For pin 14 you’d use a custom value of 14.

Hi @Jono -
Did you restart the autopilot after setting the function? The Pin parameter won’t appear until you do so…

you can restart only the autopilot process from the power icon in the lower left of BlueOS, as documented here.

Hi @tony-white and @EliotBR . I’m helping Jono with this….

Yes, should’ve mentioned sorry, did the reboot and RELAY1_PIN comes up in the list.

Yes, that makes sense. I had a look for Custom as an option (expecting to see something like that), but I couldn’t see it. I’ll check again and confirm. As a work around I’ll try exporting / editing / importing the file.

1 Like

Which software are you using to set parameters?

In BlueOS there’s a “Custom” checkbox when you click a parameter, that then changes the dropdown options into an entry field.

In QGroundControl there’s an “Advanced Settings” checkbox that then displays the option to set custom values.

Sorry guys. not sure how i missed that Custom checkbox! All sorted now.

1 Like