MR60

3689579752?profile=original

 

How-to guide: Pixhawk auto camera trigger (without CHDK)

1. Introduction:

 

If, like me, you are not using a canon camera, you then do not have access to the CHDK canon firmware which provides advanced automation scripts to automate your camera trigger on your UAV.

There exist on the market other great alternatives for all camera brands (some of them are functionally richer and simpler to use than CHDK). As an example in this guide, I will use the "Stratosnapper V2". This is a little smart thing that allows you to trigger any camera brand (Sony, Canon, Nikon, etc) by many ways : infrared, cable, LANC, etc.

If you'd like more details on this little marvel read here.

I personally prefer the "IR trigger mode" the best because it does not require an extra cable connected to your camera, which is a must when you are using a brushless gimbal. It supposes of course your camera supports an IR trigger function; I thus assume the use of a Sony NEX5 in this guide, widely used for aerial photography among UAV'iers.

Then there is another obstacle for many of us : how does Pixhawk work to trigger such a triggering device in auto mission ? There is a lot of posts on diydrones.com about how to do this with APM, but not much yet on the recent Pixhawk. Therefore this guide will try to document it.

I will end the guide with a practical auto photo taking mission example (making sure it really works!).

 

2. Parts and hardware connections:

 

Let's start by a general hardware scheme showing all the required parts and general cabling:

3689579691?profile=original

The parts are:

 

2.1 Pixhawk board

 

One or more of the 6 AUX ports can be used on Pixhawk (AUX1=RC9, AUX2=RC10, AUX3=RC11, etc.):

3689579804?profile=original

In this guide I chose port 2 which corresponds to AUX2 as is illustrated in this detailed view :

3689579825?profile=original

By default, only the three first AUX ports can be used (1 to 3, or RC9 to RC11).

To trigger the IR device, we need a servo output (PWM signal), not a relay signal. We will see later what parameters configuration is required in mission planner screens (we can for example also configure 6 AUX ports as PWM outputs ; more details later - let's finish the hw description first).

 

2.2 IR trigger device

 

Here an illustration of "stratosnapper" with its inputs/outputs:

3689579765?profile=original

You may notice two servo leads are connected on the input side of stratosnapper.

This is one of the most important point in this guide : a servo lead must be used to power the IR device from a BEC (5V in this case); the power provided by the second servo lead coming from Pixhawk AUX2 port DOES NOT provide enough power to make it work !!!

Either you have powered the Pixhawk ouputs rail with a BEC and you are fine, either you must provide a separate BEC power to the IR device. This is also true for any other type of device you will connect on Pixhawk : DOT NOT expect pixhawk to power these devices (and certainly not servos as we already knew in the context of the previous generation flight controller, APM2.x).

Stratosnapper works with a servo lead on one of its 4 servo inputs (yes, you may control stratosnapper from 4 different inputs, isn't that great ?). The servo inputs may be various things : push-button, stick, two way switch, three way switch, etc (all configured by a GUI configuration utility from your PC via usb).

3689579723?profile=original

And it ouputs on a IR cable to trigger a IR led that must be placed in front of your camera IR sensor:

3689579786?profile=original

2.3 IR Led positionning and camera gimbal

 

The IR led works perfectly, even under a bright sun (verified on the field); it works even quite faraway from the sensor (no problem 5 inches away of the Sony NEX5 sensor) and works fine in any orientation versus the sensor.

3689579799?profile=originalShown here is a picture of X8 Mr Grey (formerly known as Mr Red when was used with APM; my wife had only grey flower pots I could snatch to cover the new Pixhawk & electronics). The Sony NEX5 is held in a 2-axis stabilized brushless gimbal (NEX5 not shown...used to take this picture).

 

Here below a zoomed view of the IR LED positionning and gimbal:

3689579848?profile=original

Gardeners & farmers are notoriously UAV friendly; after getting a flower pot to protect your electronics, snatch also some green gardening wire which is very handy to shape your IR LED cable, so it is correctly positionned in front of the camera's IR sensor.

 

3. Software and parameters configuration:

 

3.1 Mission planner:

 

We need to configure Pixhawk to output a servo command on AUX2 (RC10) to trigger stratosnapper which will in turn trigger the IR LED which will in turn trigger the camera. And this needs to happen automatically during an auto mission.

 

How do we do this ? By using the CAM_TRIGG_DIST function or by using a programmed DO_DIGICAM_CONTROL command. In this guide we will only document the CAM_TRIGG_DIST function.

 

The CAM_TRIGG_DIST function will command your UAV to take picture everytime it has moved a certain distance (in meters). This is very useful to take pictures at precise distance intervals during geomapping missions or photogrammetry missions.

To configure CAM_TRIGG_DIST, go in mission planner, click on config/tuning to open the full parameters list. In this list you will find three parameters to configure:

 

3689579734?profile=original

-CAM_TRIGG_DIST : defines in meters the distance between two camera triggers. For an auto mission, leave value at zero. It will be changed automatically during the mission by a DO_SET command, to avoid taking pictures before and after the useful parts of your auto mission.

 

-CAM_TRIG_TYPE : defines if you want the Pixhawk AUX output used to control a relay or to ouput a PWM signal. In the case of an IR device we need a PWM servo signal, so we set it to a value of zero.

 

-CH7_OPT: internal firmware parameter. In this case, it does NOT correspond to the CH7 of your receiver. You must set it to a value of 9 to indicate the firmware that it must do a camera trigger to the AUX ouput (which will be defined in the camera gimbal setup screen).

 

Next, we need to define to which AUX ouput we want this servo/PWM signal produced. To do this, open "Initial setup", then "Optional Hardware", then "Camera Gimbal":

3689579854?profile=original

In the shutter drop down list, select which AUX port you'd like to use (RC10 = AUX2 in my example).

 

Then do not forget to adapt the "pushed" and "not pushed" PWM values that will trigger your IR device (stratosnapper in my example). Tune also the duration to the required button pressure duration to trigger your camera (for a Sony NEX5, I set it to 10 = equivalent of 1 second button pressure).

 

3.2 IR device configuration (stratosnapper V2):

 

Every IR device comes with its own configuration method. Stratosnapper comes with an ultra easy GUI interface to define which PWM values will trigger what port. It is explained in this video:

(http://player.vimeo.com/video/67660032)

 

4. Concrete application : test auto mission, applying all of the above

 

Finally lets' apply all of the above in a true auto mission on the field,

I configured this test auto mission as an example:

 

3689579925?profile=original

To create this auto mission, we can use a very convenient "SURVEY" function of mission planner. You start by drawing a polygon of the zone you'd like to photograph.

Then you right click on the map to select "Survey(Grid)":

 

3689579876?profile=original

It will then show you a configuration screen that will allow you to define which camera make/model you are using and other rather self explanatory parameters (like how much overlap you want between pictures, lens size, etc). The tool will then automatically define for you which is the best CAM_TRIGG_DIST parameter! :

 

3689579953?profile=original

After clicking on "Accept", you will get automatically a list of waypoints starting with a "DO_SET_CAM_TRIGG_DIST" command that will set the distance in meters between two camera triggers during your mission. It ends with another "DO_SET_CAM_TRIGG_DIST" to set the parameter back to zero (stops the shooting).

 

DO NOT forget to add at least a waypoint (take -off) before and another waypoint (land or RTL) after the last waypoint.

 

After this is done, after you have passed through your checklist, after you have got all of the authorizations, etc, -> you are then ready to arm, flick the auto switch and off you go!

 

The above test auto mission lead to this result below. It is a stiched panorama of about 15 pictures; shown here as a reduced thumbnail image (because the full size image is too large at about 107 Mbytes). Click on image for better resolution:

 

3689579897?profile=original

I hope this will help you in your own auto-photo-shoot missions!

Cheers,

Hugues

 

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Hi again

    Can I ask you this please? Which wires did you use from the modified USB cable that connects the strattosnaper to the Canon camera?

    Cheers

  • HI Hugues,

    Thanks very much for your reply. The Canon accepts the standard mini USB connector, it should be ok you think?

    In the strattosnaper software , do you set the push button configuration to trigger the shutter? Is this the correct function to use?

    Thanks

  • MR60

    Hi Spyros, thx, glad this blog is is useful.

    Yes you should be able to use the wire output of stratosnapper. However check if a special cable is needed or not, as I do not know what kind of interface it is on the sx280.

  • Hi Hugues,

    Bravo and thank you very much for your input. I have read this many times. One question, do you think I could trigger a Canon SX280 using the wire output from the strattosnaper and connect it to the USB port of the camera? Then all I would have to do is set the PWM values in the Shutter menu in Mission Planner and it should work?

    Thanks

  • Hi guys,

    Does anyone know if stratosnapper can trigger a Canon SX280 using a wire connection?

    Thanks

    Spyros

  • MR60

    Hi Marshall, thx.

    What you setup in the stratosnapper GUI dépends on the control knob you will be using on your Tx. In my case I was using a three position switch on my Taranis radio, so I selected the three way switch in strato GUI.

    In the GUI you should be able to test and visualize the effect of your switch by a vertical line that represents the position of your switch (typically if your switch is in a high PWM position, a vertical line in the strato GUI should be displayed on the right side and vice versa if your switch is in a low PWM position)

    Hope this helps...

  • Hugues: When you set up the StratoSnapper using the GUI what do you set as the channels? The choices are Push Button, 2 Way Switch, 3 Way Switch and Stick. But since I will be having the APM control the shutter by DO_SET_CAM_TRIGG_DIST what do I set the Control Type to on the StratoSnapper GUI?


    Thank you very much again for your Pixhawk setup instructions.. I wish everyone was as precise as your instructions. I followed it to set up my APM as there is zero information that I could find on how to use a StratoSnapper with the APM.
    Best regards,
    Marshall
  • Hi Hughes,  Great tips! Over a year ago, before diverting my focus to dronespeak.com, I had found the bulky HDMI-AV unit, and had bench-tested some swivel adapters that were unreliable and very difficult to repair. Plus I was worried about damaging the NEX5N's connector (thanks to a tip from Luc Maximilien). That ultralight cable is a great find! I will also be looking for CAT6 S/FTP cabling for shielding.

  • MR60

    Hi John,

    looked at the link you've posted: i'm worried it does not include any camera anti vibration system. Ideally you also do not want any cable between the camera gimbal and the external elements like quad frame or FPV equipment. Indeed we do not want anything to impede the free movement of the brushlee gimbal.

    As we still need an AV cable from the camera to the FPV sub system we at least need a link connection (Video+Ground wires). The question is which method/cables will impede the less the camera gimbal movement. And of course add as little weight as possible to your craft.

    I have tested two ways to do it and only one of the two proved worthy. The first method I tried was to use this very compact HDMI to analog video converter that plugs directly to the Sony NEX output:

    3701685637?profile=originalIt does not work in practice very well because it acts as an antenna, capturing all EMI interference and when you fly you get unstable rolling video and interferences. I actually sent my unit back to the seller, it was unusable.

    Then, second method I tested is the more bulky HDMI-AV unit like this one:

    3701685693?profile=original

     this unit requires an HDMI cable plugged on the NEX camera which is not ideal for freedom of movement as required by a brushless gimbal. However there exist a very thin HDMI cable like this one (only 3 grams!):

    3701685647?profile=original

    I have hacked this HDMI bulky unit for some modifications : wrap it in aluminum and exchange the cinch AV connectors by a reguler servo connector. I have then fixed the unit directly on the gimbal itself (so it moves with it) with velcro so that the only cable that links the gimbal to the mutlicopter frame (i.e. FPV system) are only two thin servo wires (video+ground). In this way there is no impedance to the brushless gimbal movement.

    The overall setup looks maybe a bit more bulky and is not so pretty but it works much better than any other method I've tried (and I've tried it with simultaneous 433 telemetry, 2.4 RC, GPS and 1.3Ghz FPV : not a single interference during flights). I must admit too I have shielded all telemetry, minimOSD and video cables using netwrok CAT6 S/FTP cabling.

    This is the setup I currently use with good results:

    3701685766?profile=originalSuch a setup required me to rebalance the brushless gimbal obviously and retune its PID values. But you only need to do it once for all.

  • A bit off topic, but I just noticed this gimbal/quad configuration for those who also want to shoot video with a NEX5, while having a video feed from a built-in HDMI to AV converter in the gimbal controller.

This reply was deleted.