Camera trigger type 'Relay' does not function

We have been flying an APM2 quad with a relay triggered CHDK camera for several weeks, but we are running into a roadblock when configuring our Pixhawk (Iris platform) to perform camera triggering via relay.

In my tests I have been able to set CAM_TRIGG_TYPE to 0 for servo, CH7_OPT to 9 for camera trigger, then RC9_FUNCTION to 10 for camera trigger. Using a multimeter I am able to observe a change in DC voltage between the - and S “Aux Out 1” pins on the Pixhawk, when triggering via CH7, and the duration of this voltage change will properly correspond to the CAM_DURATION value.

However, with CAM_TRIGG_TYPE set to 1 for relay, RELAY_PIN* to 13 for APM2 A9 pin, CH7_OPT still set to 9 for camera trigger, and RC9_FUNCTION set to 0 for disable I am unable to observe any change in DC voltage between the - and S “Aux out 1” pins on the Pixhawk.

    • the RELAY_PIN value may be the culprit here? The options for RELAY_PIN in Mission Planner are documented as follow:

13:APM2 A9 pin
47:APM1 relay
111:PX4 FMU Relay1
112:PX4 FMU Relay2
113:PX4IO Relay1
114:PX4IO Relay2
115:PX4IO ACC1
116:PX4IO ACC2

I have tried all of these values and been unable to observe any response on the Aux Out 1 pins while triggering via CH7.

Francisco A. at 3DR via email asserted that: “The Pin equivalent to the one used on the CHDK camera tutorial is the RC9, which is mapped to the APMs A9 Pin. This pin the equivalent of the Aux Out #1 Pin on the Pixhawk.”

However there was no confirmation that a RELAY_PIN value of 13 is recognized or valid for Pixhawk.

Craig E. at 3DR offered this: “You’re going to be the first person to attempt CHDK on Pixhawk. You can count the outputs on the Pixhawk as the equivalent of RC1-8 and the auxiliary outputs as the equivalent of RC9-RC14”

So while I have been able to configure servo triggering on RC9 / Aux 1, I have not been able to achieve relay triggering or find definitive information as to what RELAY_PIN value(s) are valid for the Pixhawk and their corresponding physical pins.

Looking in the AP_Relay.cpp code for ArduCopter-3.1 shows definitions for APM1, APM2 and PX4:

#if CONFIG_HAL_BOARD == HAL_BOARD_APM1
#define RELAY_PIN 47
#elif CONFIG_HAL_BOARD == HAL_BOARD_APM2 || CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
#define RELAY_PIN 13
#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
#define RELAY_PIN 111
#else
// no relay for this board
#define RELAY_PIN -1
#endif

Elsewhere in the code, specifically AP_BattMonitor.h there is a singular reference to Pixhawk with HAL_BOARD_PX4 combined with ARCH_BOARD_PX4FMU_V2:

#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4 && defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
// pixhawk

define AP_BATT_VOLT_PIN 2

define AP_BATT_CURR_PIN 3

define AP_BATT_VOLTDIVIDER_DEFAULT 10.1

define AP_BATT_CURR_AMP_PERVOLT_DEFAULT 17.0

And while I will be the first to say that I am not familiar with the code and libraries for ArduCopter, I have to wonder if for Pixhawk’s hardware there just has not been any implementation for RELAY_PIN yet?

Thank you,

Austin Forsyth

You should consider raising this as an issue here github.com/diydrones/ardupilot/issues?

Thanks for the link Bill, I re-posted over there.

Cheers,

A

Actually we have this posted in four places already. Since you spoke with me yesterday I have looked into this and this function is not currently supported on Pixhawk. Please standby. We are working on a fix.

@ Craig3DR,

which also means the nick and roll ports are still missing for a camera?
And we have no support for external Copterleds as A7 (arming) or A6 (GPS) on APM 2.5?

regards Peter

As a reference here is the Pixhawk’s Aux Out pins map information:

Aux Out:
1 - RC9
2 - RC10
3 - RC11
4 - RC12
5 - RC13
6 - RC14

@Peter,

The leds for arming and GPS are implemented in Pixhawk by the RGB led, it is possible to add an external RGB led via I2C port, but unfortunately it is not available at the store.

LED meanings:
copter.ardupilot.com/wiki/common … D_Meanings
Page 10 of 3drobotics.com/wp-content/upload … l-rev5.pdf

[quote=“micropet”]which also means the nick and roll ports are still missing for a camera?
[/quote]
No, Pitch (Nick when translated from german) & Roll is supported as they are servo outputs. It’s only the digital signal out (relay) that is currently missing

[quote=“RogelioN”]
The leds for arming and GPS are implemented in Pixhawk by the RGB led, it is possible to add an external RGB led via I2C port, but unfortunately it is not available at the store.[/quote]
The LED is shipped with each Pixhawk, so it’s not required to be able to buy it separately

[quote=“RogelioN”]As a reference here is the Pixhawk’s Aux Out pins map information:

Aux Out:
1 - RC9
2 - RC10
3 - RC11
4 - RC12
5 - RC13
6 - RC14[/quote]

Yes, this is detailed in my post above. We have this information. I can set RC9 functions and observe voltage on Aux 1, as a servo action but not a digital command.

RogelioN - the question is what are the valid RELAY_PIN values for Pixhawk, and how do they correspond to the physical Aux Out pins?

For example, the valid RELAY_PIN value for APM2 is “13” and that value corresponds to physical pin A9.

And the answer seems to be that there hasn’t been any code implementation of RELAY_PIN for Pixhawk hardware, yet.

@Craig - let me know if you would like me to load a trunk build to verify functionality, and I will leave my testing set up in place:

@Bill,

The Pixhawk has a built in RGB led, but the external RGB led is not included, from the guide here is what is included:

1 Pixhawk board with SD card
2 Buzzer
3 Safety switch
4 SD card USB adapter
5 Micro-USB cable
6 Six-wire cable x2
7 Power module
8 I2C splitter module
9 Four-position I2C splitter cable
10 Three-wire servo cable
11 Mounting foam

3drobotics.com/wp-content/upload … l-rev5.pdf

@a_forsyth,

Yes, from Bill’s previous information it seems to be that there is no code implementation for RELAY_PIN yet.

As Craig, said, devs are working on a fix. Unfortunately we don’t have a way to slow down time to make it appear instantly :wink:

@Rogelio: Mine came with the external LED in the box, you may want to confirm what they are actually packing, as I can only speak from experience.

I confirmed and the external RGB is not included

Bill,

Do you perhaps mean the arming LED / button?

I mean the external LED. Maybe that was included because it was for developers, and for it to be tested.

I also have a developer PIXHAWK. There was no external LED in the package.

So we are missing:
pitch
roll
Relay
GPS Led
Arming Led

regards Peter

Can the supporting code for RELAY_PIN on the Pixhawk support using any of the Aux Out pins, so that we may configure full gimbal control [and other things] without excluding functions of one or the other?

Howdy developers,

If it is possible to give an estimate on when code may be available to test, so we can start anticipating when to schedule Pixhawk/Iris downtime?

Thanks!

Austin