Is it possible to control 2 light channels, 1 camera servo, gripper and one Relay with the pixhawk?
If so, how should the set-up be done?
Hi @SDI,
That should work fine. The output channels for all of those are configurable, although the servo_n_min/max_momentary
joystick functions (for the gripper) only apply to AUX pins 1-3, where AUX{n}
corresponds to the servo_{n}_*
functions. The relay functionalities are only available on AUX pins, and the desired pin is specified with the RELAY_PIN
parameter.
AUX6 is generally used for the leak sensor, but AUX 1-5 should be available for the additional functions you’ve specified, as well as MAIN 7 and 8 if you’re using a standard (6 thruster) BlueROV2 rather than the (8 thruster) heavy configuration.
When selecting channels for the lights and camera mount, the numbers start counting from MAIN 1, so AUX 1 = Channel 9.
We are using heavy config. We are not using the leak sensor so all six AUX are available. Would you be so kind to paste in a screen dump showing just where / which menu to use when assigning the pins? Would the following assignment be correct:
Aux 1: Camera servo
Aux 2: Gripper
Aux 3: Light 1
Aux 4: Light 2
Aux 5: Relay 1
Aux 6: Relay 2
?
Your suggested pins should work fine, as long as they’re configured to control what you’ve specified.
Use the Camera page to assign output channel 9:
Note: the min and max PWM limits can be changed to change the angles the servo can rotate to, although extending the range too much may result in issues with the cable pulling.
Use the Joystick page to assign the servo_2_min_momentary
and servo_2_max_momentary
joystick button functions to close and open the gripper:
Use the Lights page to assign output channels 11 and 12:
This is two relay outputs, when you originally only mentioned needing one, but that’s also fine.
Use Parameters page to set:
Param | Selection | Underlying Value |
---|---|---|
BRD_PWM_COUNT | Four PWMs | 4 |
RELAY_PIN | AUXOUT5 | 54 |
RELAY_PIN2 | AUXOUT6 | 55 |
Use the Joystick page to assign the relay_1_*
and relay_2_*
joystick button functions.
Thank you vey much. Yes, I do need only one one relay, but since there was a free slot… then why not prepare it
So I will change change from 6PEM back to: BRD_PWM_COUNT Four PWMs 4
Thank you.
Hi Eliot,
Im trying to run a relay with the pixhawk but I do not get the relay to work.
First, see attached PDF datasheet of the relay I have. Is this compatible to operate from the pixhawk?
744890_87032_manual_en.pdf (427.5 KB)
If yes, can you please advise med how to proberly connect and operate this one?
Hi @Stihus,
The datasheet says it’s triggered by a 5V signal, so it should be possible to use with the Pixhawk.
Note that you’ll need to provide 5V power to the power rail of the Pixhawk’s servo outputs (in the BlueROV2 this was done automatically, as a means of powering the Pixhawk itself). You’ll also need to set the parameters as above, although depending on your ArduSub version you may not need to set the BRD_PWM_COUNT
parameter.
Hi @EliotBR i am trying to set up the relay function as above.
BRD_PWM_COUNT is set to Four PWMs and I’m connected to AUX 5. Toggle relay 1 on/off is assigned on the joystick.
Im getting 5v on + and I’m getting 3.3v on “S” and the 3.3v on the signal line is indeed switching on/off but I’m needing 5v which I’m not entirely sure is possible. I’m reading mixed opinions online. Is there a setting that can be changed to get 5v rather than 3.3v?
Could you please elaborate on this please sir!
Hi @DRM_Marine1,
The signal lines are connected directly to the Pixhawk’s microcontroller, which runs on 3.3V, so it’s not possible to get that to output 5V instead. If you need a 5V signal then you’ll need to add some form of electronic switch, which you can power with 5V and trigger with the Pixhawk’s 3.3V output.