Like most, I use a gopro camera with my quadcopter. While I like the video of the gopro a lot, the photographs leave a bit to be desired. They are always extreme wide-angle and they are always JPG instead of the more tweak-able RAW format.
Some time ago I saw a blurb about software that could be put on Canon pocket cameras that greatly increase their functionality AND allow scripts to be written. The software is called CHDK. A few weeks ago I finally got around to researching CHDK.
The CHDK website is here. No one is going to tell you there is no risk to using this software on your camera; however, it doesn’t replace the camera firmware. Instead the software is loaded into memory at boot time. So if you insert an SD card without the CHDK software, your camera will work like it did before CHDK. It seems, chances are slim anything bad will happen.
After looking at CHDK, I was pretty impressed with everything it can do. It extends the abilities of your camera greatly. You can adjust shutter speed, aperature, ISO, focus, bracket, etc., just like a DSLR. Not quite as easy as a DSLR, but still pretty darn flexible.
It not only shoots in RAW, but will convert the RAW image to DNG which can be read by many photo apps including Picasa. Most importantly, you can use Adobe’s Camera Raw on these files to develop the image as you see fit.
Finally, and the most critical item for this little project, you can write basic-like scripts to control the camera. If you can’t program at all, there is an included script that simply shoots the camera at a fixed interval that you specifiy (say every 2 seconds).
Sourcing a Canon Camera
Once I found that CHDK would let me fire a Canon pocket camera at timed intervals, I was ready to try. I just needed a camera. On the home page is a list of cameras that are supported. So I started searching eBay for something very cheap, with at least reasonable optics, and compatible with CHDK.
I found a used Canon SD750 which I ‘won’ for $15 + $5 shipping. I believe the primary reason I scored this camera so cheap was because the auto lens cover is broken. That’s not an issue for me.
The Canon SD750 is a reasonable choice for experimenting. Now that I see how to make it all work, I would probably be willing to spring for something better. The SD750 has a 7MPix sensor. The focal length range is 35mm-105mm (in wide format the gopro is 12mm). I wouldn’t mind seeing the low end a bit wider, but for experimenting, that should be a pretty good range.
This camera does NOT have an anti-shake system. That is the ONE thing I would do different next time. Even with a gimbal there is going to be camera movement.
Setting up CHDK
The exact details of getting CHDK installed and running are beyond the scope of this document; however, their website is quite good and the user manual was very useful, though (as of this writing) it is for version 1.2 while 1.3 is the current release.
After messing around getting CHDK running manually, I stumbled upon the STICK utility which does all of the work for you.
One word of advice: use an SD card with <= 4GB of capacity, at least until you get used to the software. If the SD card is >4GB, it is formatted in 2 partitions, with the pictures on the 2nd partition and getting directly to that partition is not straight forward (I was downloading pictures thru the Camera’s USB connection to get to them).
There is a function in the SD menu to swap partitions. I have not played with it yet, but I imagine that can be used to gain access to the pictures directly.
Also, DO NOT use the camera’s format utility to erase pictures. It will erase the CHDK software as well. Use the camera’s erase function. If you are creating RAW(DNG) files, erase will not get rid of those. Go into the CHDK file browser and use the purge raw option.
When trying to use the CHDK menu, I have found it is a very good idea to be in playback mode, THEN bring up the menu. If in shooting mode, the menu often gets overwritten.
There are a couple of settings in Canon’s configuration, at least for the SD750, that I needed to make for it to work smoothly with CHDK. First, turn “Touch Icons” off. If on, pressing the thumb-controller causes the menu to get overlaid.
Turn “Review” off. Besides saving battery when taking continuous shots while airborne, you cannot take the next picture until the review exits.
The specific CHDK settings I find useful for this project are
- Save Raw: On
- DNG Format: On
To me, the most important of CHDK’s features is the ability to execute scripts because I need to be able to shoot the camera every couple of seconds. Further, I’d like to be able to change the focal length (zoom) on regular intervals.
So I wrote the following script. It shoots n number of pictures, zooms in 1/2 way, shoots another n, zooms in fully, shoots another n pics, and then returns to the minimum zoom setting. It then repeats this process as many times as specified:
@title Zoom Interval @param c Cycles @default c 1 @param t Seconds between @default t 1 @param p Pics per Zoom @default p 1 set_lcd_display 0 if i < 1 then i=1 if t < 1 then t=1 if p < 1 then p=1 m=get_zoom_steps for i=1 to c set_zoom 0 for k=1 to p shoot sleep t*1000 next k set_zoom m/2 for k=1 to p shoot sleep t*1000 next k set_zoom m for k=1 to p shoot sleep t*1000 next k next i set_lcd_display 1 end
The script works great! That feature, by itself, is enough to warrant having CHDK.
Mounting the Camera
Oops, this is one thing I didn’t consider before buying a camera. Hey, it’s a pocket camera it will fit!
Uh, no, it didn’t. I forgot how small the gimbal mount for the gopro is. It is just about the size of the gopro. There was no way a point and shoot would fit inside the gimbal.
As it turns out, my gimbal is such that I simply mounted the camera upside down to the bottom of it:
I’m not a big fan of this forward mounted gimbal. The gopro does not stay as steady as I would like. The pocket camera is worse, but since it is shooting only stills, that isn’t really a problem.
Also, since the camera is mounted upside down, the pictures will all be upside down, but most photo apps should be able to fix that problem (I could flip all of the pics at once in Adobe’s Camera Raw).
The knob holding the camera in place I purchased way back when I built a pole mounted camera. I believe this uses 1/4″ thread. I purchased a knob with that thread from the hillman parts bins found in every Ace Hardware store. I then cut it to the proper length to bind the camera tight to the gimbal.
The Canon Camera in Flight
For the most part, the camera did a pretty good job. Here is a picture at 35mm and another one of the same scene at 105mm:
These pictures give you a good idea of the difference in zooms.
Because this camera is significantly heavier than the go pro, the battery life was shorter. The battery I used usually lasts 15 minutes. If it lasted 10 minutes with the point-and-shoot camera, then it was just barely that long.
Further, since my gimbal is not centered, it required holding the stick back more than normal to keep the quadcopter hovering in place (I didn’t bother trying to trim it for one flight). That didn’t help the battery life.
The one problem I definitely noted is too many pictures were blurry. I let the camera simply run in auto mode, so it selected whatever apture/shutter speeds it wanted. Generally, if the shutter speed fell below 1/250, the picture was often blurry. In the future, I will look at modifying the script to force the shutter speed to 1/250 or 1/500 and let it adjust the aperature/ISO accordingly. This would also be mitigated somewhat if I were using a camera with anti-shake ability.
This project worked out quite nicely and was very inexpensive. In the future, if I can find a reasonable priced Canon pocket camera with a wider low end focal length (more like 25-28mm) and anti-shake mode I will pick it up.
The biggest problem with this camera setup is actually getting your subject in the frame, especially in zoom mode. An FPV camera would be very useful.
My quadcopter is nowhere near capable of listing an DSLR, but if you are interested in doing so, there is software called Magic Lantern that is much like CHDK except designed for Canon DSLRs.