In the never ending quest to improve camera triggering via Pixhawk, one of my objective was to reduce as much as possible the triggering latency. That is the time between the moment the autopilot processes a trigger instruction (sent out on a predefined Pixhawk AUX ouput) and the effective image capture by the camera. There are improvements that are out of reach for me : how fast runs the APM firmware on Pixhawk, how fast the camera effectively triggers. The most significant improvement I coiuld try is to reduce any latency between the Pixhawk output and camera input, i.e. to suppress any intermediate processing or electronics integrated circuits in between. I usually used an intermediate electronics circuit such as stratosnapper or similar to trigger pictures.
Instead I searched for a direct cabling method. This requires to make your own (or purchase it if your camera model is supported by the cable makers) micro usb cable that will plug the camera directly to a Pixhawk AUX port. Pixhawk is then configured , for this AUX port, as a "relay". A relay is not a PWM signal that is usually used on the output ports. A relay signal is simply a 3.3V square impulse that is produced on the signal wire of this output AUX port.
To configure a relay output on Pixhawk, you will not find the complete information on the current wiki, but I'm sure, after this post, this incredible wiki guy at 3DR will add and complete it.
There are five parameters to setup for Arducopter, and four for Arduplane:
- Ch7_Opt : select "camera trigger" option
- Camera shutter : select the "RC" relay output you connect the cable to : it must be one of RC9, RC10 or RC11 (RC12 to RC14 are unfortunately not available in the list in mission planner)
- BRD_PWM_Count : select 0 to have all 6 AUX ports act as relays, 2 for having 4 of them (AUX3 to AUX6), 4 for having two of them (AUX5, AUX6)
- CAM_TRIG_TYPE : 1 (for relay)
- In all parameters tree list, under "Relay", setthe value of "Relay_PIN" : must be a value corresponding to your chosen AUX port. If RC9 then enter "50", if RC10 then enter "51", if RC11 then enter "52"
- Same as copter but there is no "Ch7_Opt" parameter to set.
In order to make it work, the 3.3V signal produced by a Pixhawl relay is a non standard voltage, which should normally be 5V on most cameras. Therefore you still need an minimalistic intermediate circuit to raise the 3.3V to 5V. It can be done with one transistor and 2 resistors as follows (sorry for my basic drawing skills):
Now there are two strong limitations and probably what we could call bugs (developers will correct me if I am wrong). These bugs were tested in Arduplane 3.3, 3.4 and Arducopter 3.2.1 (not tested in 3.3 but most probably still present as nothing in the release notes states a correction about this):
BUG n°1 :
- As soon as you display the "camera gimbal" screen, in order to just view (or modify) the "camera shutter" option, the parameter "CAM_TRIG-TYPE" will systematically be reset to zero (instead of remaining at value 1, configured for relay).
- Workaround : this screen should be the first you view/modify BEFORE any of the four other parameters.
BUG n°2 :
- In the parameters list, under the "relay" section, you will find RELAY_PIN, RELAY_PIN2, RELAY_PIN3, REALY_PIN4 (by the way it seems arducopter is limited to two REALY_PINs, while Arduplane is limited to four REALY_PINs). For camera triggering with relay, onlyRELAY_PIN works; no other RELAY_PINx will work.
- Workaround : use only RELAY_PIN.
- Constraints : excludes the simultaneous use of a LIDARlite and camera triggering with relay.
Hope this info will help you setting up your relay camera triggering, and save you the full day I spent on trial and errors....