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:
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 :
BUG n°2 :
Hope this info will help you setting up your relay camera triggering, and save you the full day I spent on trial and errors....
Thank's for share Hugues, I'm trying to learn about relays and better trigger now, very usefull and clear.
Thanks for sorting this out and sharing the issues so we can ease the setup for the next person.
For Bug #1, I think the issue is most likely to be in the Mission Planner (I guess this is the GCS you're using) but I wasn't able to recreate it. That might mean that it's been fixed in a recent version of the MP (I'm using the latest beta which is ver 188.8.131.52) or maybe I just didn't follow the exact steps required. Could you try and upgrade to the latest mission planner (go to the Help screen and push "Check for Updates", wait a few minutes then restart the MP?
Bug #2 isn't technically a bug, it's more of a "short coming" :-) in that we don't have "Relay2", "Relay3" etc in the drop-down list and the camera shutter code always uses the first relay... so I guess until we enhance it we should make it more clear in the wiki that it only uses the first relay.
Thank you Hugues,
please let me what is a value of triggering latency at the present moment, before your improvements enterd into force and what is the expended triggering latency.
Do you video camera or camera to take pictures only ?
Thx Randy for these precisions. I will try the latest mission planner and report back.
For the second point, due to this "short coming", it is then not possible to use camera relay trigger and lidarlite simultaneously, do you confirm this or am I wrong with something ? (lidarlite uses normally two relays 54 & 55)
Hi Darius, good question. To be honest I do not know as I did not measure this latency yet. I was completely focused on resolving a workaround the two points mentioned above. I will try to measure that, thx for the suggestion.
Thanks for posting this Hugues.
Here are the settings I'm using for AUX5 (RC13=AUX5) configuration:
CAM_DURATION = 1
CAM_TRIGG_TYPE = 1 (Relay)
RC13_FUNCTION = 10 (camera_trigger)
RELAY_PIN = 54 (Pixhawk AUXOUT5)
In Mission Planner going to INITIAL SETUP>Camera Gimbal still sets CAM_TRIGG_TYPE back to 0 (Servo), so don't do that.