Skip to content
Arthur Benemann edited this page Mar 15, 2013 · 1 revision

Have you ever wanted to take a photo like that below with your APM setup? In the text below you will find one possible way to do so and a little about other ways. The article covers automatic still photography from a plane using the !ArduPilot Mega platform. Some of this will apply to other systems and setups (copters and video for example). Of course the opposite is true also - there is much RC aerial photography advice out there on forums and various websites that you can apply to your APM setup.

This article and the methods discussed are still very much in the development phase and needs help to finish. For short comments please use the comments section below. For longer, or more complicated discussions may we suggest this forum thread.

Sorry, this article uses an earlier version of APM (pre Beta 1). Unlikely but you may need to change pieces of mission code.

http://ardupilot-mega.googlecode.com/svn/ArduPilotMegaImages/Aerial_Photo_eg2.jpg

Plane Choice

Any plane that has excess power and lift can be used. Usually planes that are medium to large, with large noses and inherent stability will give the most consistent results and ease of build. The Skywalker is just one that fits these requirements. Flying wings are certainly good for vertical pictures and probably better in windy conditions. Helicopters and our own ArduCopter Quad may be the better choice for short distance flights and small landing fields.

Camera Choice

Any small and low priced digital camera is a great place to start (and maybe stay with). Avoid cameras with optical image stabilisation as the community verdict seems to be that this cannot handle the propellor vibration and results in blurs in stills or wobbles (known as the 'jello' effect) in video. Weight is important too. Most planes will fly OK with an extra 120 grams or so. Using a 200 to 300 gram camera can make flights and finding the COG difficult. Mount a wood block of equivalent weight if you want to fly before you buy.

Camera Angle

Vertical will give the looking straight down viewpoint photo and is a good place to start. More dramatic viewpoints and often more recognisable can be achieved with angles other than vertical. Mount about 40 degrees deviation from vertical to obtain mainly ground photos but with oblique view. About 70 degrees off vertical will give you a lot more sky giving scenic photos (from Draganfly).

Shutter Triggering Options

There are a surprising range of options available to get the shutter to click. Some options require a certain brand of camera or higher priced, enthusiast models. If you want to research the options see pages like Blip or rc-airplane-world. To see a £4 camera hacked for this purpose go here

Servo Build

In brief: Select a 9 g micro servo. Pre-check the servo arms full throw. When at full throw the shutter button must be fully depressed. Hot glue a small circle of EPO foam to servo arm (about 2 mm wider than arm) this allows a firm push without breaking the camera. Hot glue the 9 g micro servo on its side to the camera so at full throw the shutter button will be pressed fully. Note: Setting the servo to far will mean the glued bond on the servo will break and you will not be able take picture again until you reattach it.

See last section for more detail and photos of the servo build.

Camera Mount Build

The camera needs to be mounted securely and yet it also needs to dampen vibrations from the motor. It is difficult to achieve both aims at the same time. The many ways that the flying community has used to mount the camera on the plane include: soft foam, stiff foam, neoprene tubes (mount camera on tube side), surgical tube, rubber bands, nylon bolt (direct stiff attachment) and velcro. Tubes have been used mostly on helis. We make no specific recommendation here as the best or easiest has still to be decided and also depends on the airframe. Even so, velcro plus rubber bands (for extra security) is quick to set up and will give you reasonable photo results.

The soft foam barrier/mount is untried but seems to have the most versatility. It can be found in Tim's T-copter pages. This is a soft foam layer glued between the airframe and ply to mount his camera on. You may need to experiment with the type of foam. Please post some pics in the forum thread if you use it.

APM Channel Choice

Any of the upper four Ouput Channels of the APM is suitable - the choice is up to you. In the examples here, CH_6 has been used which is the seventh connector when counting from one.

Testing

  1. You will find it useful to first try out the servo throw and camera timings by doing some manual work. Connect the camera servo to say the rudder output channel and run APM in manual mode. (watch out for or disable the propellor). Determine what throw PWM values and times are appropriate for your setup. You may need a helper to hold servo on or tack glue it on. Aim for full throw to trigger the camera. Any other values allow for startup glitches to break your servo gluing.

  2. In a medium size space outside you can try out the triggering with a test mission. Set the waypoints further apart than your WP_RADIUS. Disconnect 2 wires of your motor or use THROTTLE_OUT parameter to keep propellor off. Walk around the waypoints and watch the camera trigger. You won't need wings for this. Below is the start of the camera test mission code. You will need real waypoints for this test code. The PWM value for 'hover arm over shutter', and perhaps even the trigger 2000 value, may now need tweaking to obtain a reliable trigger. A second photo at waypoint might occur and it is up to you whether that is an issue. float mission[][5] = { // first circuit {CMD_SERVO, CH_6, 1700, 0, 0}, // BG hover servo arm over shutter release button {CMD_SERVO, CH_6, 1700, 0, 0}, // BG hover servo arm over shutter release button {CMD_LOITER_TIME, 60, 40, -31.993901,115.993009}, // Loiter for over your current location to allow hover arm command to work. {CMD_SERVO, CH_6, 1700, 0, 0}, // {CMD_WAYPOINT, 0, 5, -31.994005,115.993164}, // 1 (back right cnr of my block) {CMD_REPEAT, CH_6_TOGGLE, 2000, 0, 1}, // Camera click. // // repeat cmd_waypoint with cmd_repeat a few times. Repeating circuit in mission code also helps debugging.

If you have reliable triggering of camera you are ready to fly.

If you only get the camera focusing and not triggering check that your throw goes deep enough. If throw is good you may need to increase the undo_event from the default of 2 to 3, 4 or 5 so that the trigger is pushed down for longer time. Increasing the hover arm PWM also lengthens this time and reduces the delay between waypoint and photo taken.

Mission Code Example

To obtain a level plane at photo point add an extra waypoint directly in front of the one you want photo at. Hopefully the plane will fly level through the desired photo point (rather than banking for next waypoint). The photo enclosed shows banking and blur.

The code is much the same as the test mission: float mission[][5] = { // first circuit {CMD_SERVO, CH_6, 1700, 0, 0}, // BG hover servo arm over shutter release button {CMD_SERVO, CH_6, 1700, 0, 0}, // BG hover servo arm over shutter release button // {CMD_WAYPOINT, 0, 40, -32.017783,115.898563}, // 1 {CMD_REPEAT, CH_6_TOGGLE, 2000, 0, 1}, // Camera click. // repeat above two commands

APM code example

Instead of using the mission file to plan pictures it can now be done in the coding of the Ardupilot Mega. The complete code to use is here and will be updated whenever significant changes are made. It is currently not in the main code but works fine. The WP_activity sketch allows you to pass a waypoint and do something (like take a picture). The Camera sketch controls a servo to press the shutter button, currently it moves through 90° for the button press. So when you use the sketch be sure to setup the values as you will use them. void waypoint_check() { if(wp_index > 1 && wp_index <=18){ // Between these waypoints it will do the part in the middle wp_radius = 10; if(wp_distance < wp_radius){ // Set a boundary of accuracy but the waypoint may be missed and not set off the camera if set too low APM_RC.OutputCh(CH_6,1500+(90*10.31)); // Camera click - full clockwise rotation delayMicroseconds(5000); // Delay APM_RC.OutputCh(CH_6,1500); // Return servo to mid position } } } You will notice that APM_RC.OutputCh(CH_6,1500+(90 x 10.31) is used in servo_cam change the 90 value to change the movement of the servo (range -90 to 90). APM_RC.OutputCh(CH_6,1500) would put the servo arm in the center position, which is the button press in the code.

Once you have done all of this you must add the waypoint_check() call to the slow loop function in the ArdupilotMega sketch. Like this picture shows.

Camera setup.

Dependent upon what camera you will have an array of options to make your photos clearer.

  • Exposure - controls the time the shutter is open for. More time = more blur, so set this as short as possible.
  • Focus - set it to manual and put it to infinity. That way you will always be focused as long as your plane is above about 25 metres.
  • ISO - Higher the number the higher the sensitivity to light. On a bright day ISO100 should be fine, overcast will send you to ISO600, with dusk being ISO1600. Of course all cameras are different so it will take a few tries to get it right.

Issues Outstanding - Help is Needed

Aspects that need improving are:

  • Blurry photos (from motor vibrations or quick banking)
  • Camera Mount (mount that is secure but does not transmit vibrations)
  • Delay between waypoint and shutter click is excessive (the shorter it is the better position accuracy)
  • Taking photo when plane's attitude is level (i.e. plane not banking for next waypoint)

Please help us with these: with brief comments below or for longer discussuions in the forum thread.

Servo Build Detail

The servo needs to be mounted near the shutter button so that when it rotates it will press the button. Above shows the correct alignment of the servo to the shutter button. Once you have aligned the servo glue it down.

Foam must be used to soften the servo arms movement when pressing the shutter button. The servo could easily rip itself off the camera without the foam there. What happens is the foam depresses the shutter button first but can absorb up to 0.5mm of extra movement allowing you some error for misalignment or overzealous rotation. In picture one you see Brett Glossop's camera setup and choice to put the foam on the shutter button instead of the arm. In picture two you see a side view of Brett's install including glue and foam mount.

Clone this wiki locally