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