Lumen Intergation for BlueBoat

Hi there,

I was wondering if it’s possible to integrate the Lumens on a BlueBoat without modifying QGC. I know that within BlueOS, it’s possible to set a specific value as a PWM output. However, QGC doesn’t seem to allow controlling that PWM port in the same way as the servo_x_min_momentary / servo_x_max_momentary functions used for button mapping on the BlueROV2. These functions are available for the BlueROV2, but not for the BlueBoat.

I noticed that the GimbalUp and GimbalDown functions appear in the QGC button mapping function list. Is it possible to link these functions to act like the lights1_dimmer / lights2_brighter functions available on the BlueROV2? If so, which PWM Navigator port corresponds to the gimbal PWM outputs?

Thanks in advance!

Best regards,
Sietse

Hi @sietse -
You’re correct, there is no easy way to control relay or servo signal peripherals with the BlueBoat, compared to the BlueROV2 - this is due to differences between ArduSub and ArduRover.
Our software team is working on making this supported! Currently an RC radio controller / receiver with SBUS is one potential solution, or using Mission Planner instead of QGC. Controlling the pins via Lua or python script is also possible.
While the gimbal functions appear, I’m not certain if they are possible to assign to a pin. I’ll try and find out!

Hi @sietse,

If you don’t need fine-grained control then it might be sufficient to set up some custom MAVLink commands in QGC, which would at least allow you to set the lights to some pre-defined brightness levels, and potentially several if you’re ok with adding on-screen buttons for them or sacrificing an extra joystick button or few :slight_smile:

Incremental control unfortunately doesn’t have an existing MAVLink command, so would best be handled by a firmware modification or a Lua script.

Hey @EliotBR ,

Thank you so much!

I tried using the code. The relay on and off function worked with the virtual button, but I was not able to press the servo HIGH and servo LOW virtual buttons. I got the MAV_CMD_DO_SET_SERVO command error when I press the virtual button.

Does it have something to do with the way I set my parameters?

I’ve set my RELAY1_FUNCTION to 1 (to enable), RELAY1_PIN to 5 (since I use pin 5 on the navigator as my PWM pin for the lumens), and SERVO5_FUNCTION to GPIO.

This is the correct parameter procedure to use the virtual buttons with the following .json?:

{
  "version":    1,
  "fileType":   "CustomActions",
  "actions":
  [
  {
    "label":        "Servo5 HIGH",
    "description":  "Sets servo 5 to a high PWM value",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1900
  },
  {
    "label":        "Servo5 LOW",
    "description":  "Sets servo 5 to a low PWM value",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1000
  },
  {
    "label":        "Relay1 ON",
    "description":  "Turns on relay 1",
    "mavCmd":       181,
    "param1":       0,
    "param2":       1
  },
  {
    "label":        "Relay1 OFF",
    "description":  "Turns off relay 1",
    "mavCmd":       181,
    "param1":       0,
    "param2":       0
  }
  ]
}

What could be the issue in my process?

Thanks in advance!

~ Sietse

Edit: I’m using my BlueBoat with QGC 4.4 and ArduRover 4.5.4

Yes, I suspect the parameter values are your issue - the relay controls are for when you want to turn something on/off, whereas servo controls are for when you want to send a servo-style PWM signal to the pin. Lumens can technically be controlled by either approach, but the autopilot can only do one at a time, so if you’ve configured output number 5 as a GPIO pin for use with relay control, then when you try to command it to provide a servo output it rejects the command.

If you’re just wanting to control the Lumen, and with multiple brightness levels, then you’ll want to use servo functions, not relay ones. Accordingly you can leave the RELAY1_FUNCTION as disabled, and the SERVO5_FUNCTION should be set to Disabled (0) so that it can be controlled by MAVLink servo set commands (sent by you, or auto mode in a mission).

A more useful set of commands in that case could be something like:

{
  "version":    1,
  "fileType":   "CustomActions",
  "actions":
  [
  {
    "label":        "Lights OFF",
    "description":  "Turns off the Lumen lights on pin 5.",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1100
  },
  {
    "label":        "Lights DULL",
    "description":  "Sets the pin 5 Lumens to a dull brightness level.",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1300
  },
  {
    "label":        "Lights MIDDLE",
    "description":  "Sets the pin 5 Lumens to a middle brightness.",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1500
  },
  {
    "label":        "Lights BRIGHT",
    "description":  "Sets the pin 5 Lumens to a bright level.",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1700
  },
  {
    "label":        "Lights FULL",
    "description":  "Sets the pin 5 Lumens to full brightness.",
    "mavCmd":       183,
    "param1":       5,
    "param2":       1900
  }
  ]
}

Hey @EliotBR!

Thank you much! I switched off the relay functions and Disabled (0) the SERVO5_FUNCTION and it worked!

Also thank you so much for the optimized code :))

Cheers!

1 Like

Hi @sietse -
Glad you got things working! I’d love to see your lumen equipped BlueBoat - maybe consider posting in our Builds category or in this thread? Thanks!