Sport shooting #4 – Shoot at F4. Usually…

The following assumes that you have a basic understanding of aperture and how it affects shutter speed and depth-of-field. If you’d like a quick refresher, the following links should help:

Or use a search engine – there are lots of good explanations out there.

My recommendation is that you set your camera to F4, and then adjust your ISO to give you an acceptable shutter speed (I prefer 1/1000th or faster, though I’ll accept a bit lower if necessary).

If you know a bit about how the pros shoot, that may be a surprising recommendation. Most pros use big and expensive F2.8 lenses. So, why F4? Well, I think it’s the best compromise aperture, and will give you the highest percentage of good shots, especially if you’re starting out. In most cases…

To understand that “usually”, it’s useful (or at least I think it’s useful – you are welcome to post a comment telling me that I’m deluded) to discuss what a smaller aperture would do.

2.8 Gives us…

Blurrier background

A smaller aperture will definitely give you a nicer background. But it’s not going to turn those parents on the sidelines into a slightly mottled background, it’s going to turn them into slightly blurrier parents, with an emphasis on “slightly”. Blurrier is better, but I’m not sure you’re going to notice a the difference.

Less depth of field

The same thing that gave us a blurrier background gives us less depth-of-field on our subject. To take an example, my 40D @ 200mm and F4 gives a depth of field of about 5′, front and back. Step up to F2.8, and that reduces to about 4′. That doesn’t sound like a big difference, but it’s 1′ less margin for error in your autofocus system, and 1′ less range where two players can be. And I suspect that the calculated depths-of-field are a bit too big, since sharpness is so important in sports shots. I know I have shots at F4 where I wish for a bit more depth-of-field, and F2.8 makes it worse.

Worse lens performance

My 70-200mm F2.8 L lens is pretty darn sharp at F2.8. But it’s sharper at F4, and that’s for a lens that is explicitly designed to be very sharp wide open. Most lenses are better one stop down from the widest aperture.


So, I’m suggesting F4, yet I spent the money and deal with the weight of the F2.8 over the F4 variant of the same lens. Why?

It’s simple. Light. My daughter’s lacrosse team plays in the evening, and they also play on some pretty gloomy weekends, and that means I don’t consistently have the light that I want. If I don’t, my options are to bump up the ISO (more noise), reduce the shutter speed (blurry players), or shift to F2.8. That’s when the F2.8 really earns its keep.

If you shoot indoors or under stadium lights, you have my condolences. I’ll talk about indoor/night shooting in the future.

What if my lens only goes to F4?

If you only have a lens that goes to F4, I recommend trying both F4 and F5.6 and seeing what you think. If you have (for example) a Canon 70-200mm F4L, I think you’ll be happy with the F4 performance. But if your lens isn’t good enough, you may be looking at a lens upgrade, I’ll talk about that in a future post…

Robothon 2009

The offspring and I spent part of the last weekend at the Seattle Robotics Society’s Robothon 2009. My main involvement in robotics has been having a few friends who were quite adept, and doing a tiny bit of mindstorm programming.

On Saturday, we spent a fair amount of time at the Robo-Magellan competition, which is competition to build vehicle that can autonomously navigate from one orange cone to another. Most of the robots use GPS (WAAS okay, differential not okay), some sort of vision system, contact sensors, and a vision system to identify the cone. A pretty hard problem – out of 6 robots and 3 tries each, there was one successful run.

Watching the competition is a little like golf – lots of people following the robot to see how it’s doing, and clapping when something good happens. At one point, one of the robots came across this scene:

Notice the two kids at the left and right. What do they look like?

That’s right, they look like cones, and the robot attempted to move towards them (at speeds up to 1MPH or so) for a time, and there had to be some readjustment.

The whole idea of building one of these sounds like a very interesting project – integrating software and hardware towards solving a hard problem. I’m somewhat tempted trying to build one…

After the autonomous competition was over, we went back into the center house and watched some robot sumo:

These are really tiny bots – they can’t be more than 10cm on a side, and can’t weigh more than 500 grams (0.00055 tons). The cool thing is that all the robots are autonomous – they all have onboard intelligence (presumably microcontrollers) and sensors. Lots of fun to watch.


Sunday we came back to watch some radio-controlled combat vehicles, hosted by Washington Allied Robotics. As much as I like seeing two radio-controlled vehicles try to destroy each other, after a while it pales a bit – looking at their construction, there is chassis, motor, battery, and the radio and drive electronics. An interesting engineering challenge, but not really any code there. But, some have impressive weapons.

I think what we’re seeing here is the titanium spinner of the left bot hitting the titanium front plate of the right one. This is shot through plexiglass, so the quality isn’t great, but I do really like the branching in the left side of the sparks.

Some of the robots can fly:

At least for short periods.

Those are the highlights, but there are a lot of matches that are considerably less exciting. Overall, it’s a lot like watching hydroplane racing – 3 minutes of excitement followed by 30 minutes of waiting.

Sport shooting #3 – Focus

Sports shots are pretty intolerant of incorrect focus.

The focus software built into your camera does its best to give you crisp focus in all conditions, but since all it knows is what you’re pointing it at, it has to make some guesses and some compromises. There are a couple of things that you can do to give it more information so that it can make better decisions and improve the number of in-focus shots. You’ll notice the common thread in this post – rather than let the camera make choices for you, you are making the choices yourself.

Focus mode

There are two basic types of subjects – those that are static, and those that are moving. In the default mode (AI Focus on Canon, AF-A on Nikon), the camera looks at the subject and tries to figure out which autofocus approach works better.

My experience on the cameras I’ve used (Canon XT & 40D) is that the camera often makes the wrong choice. You can get better results by choosing the focus mode optimized for moving subjects (AI Servo or AF-C).

Focus points

Your camera has an array of focus points – individual spots in the scene where the camera can detect focus. The number and sophistication of those focus points depends on the model of the camera – my 40D has 9 focus points, and the new 7D that I’m pining for has 19 focus points.

Like the focus mode, the camera looks at all the focus points and tries to determine which ones are most important and then focuses on those. Sometimes it works well, sometimes you find that in that beautifully-composed and exposed image, the camera decided it was better to make sure the fan in the background be in focus than the players.

Like focus mode, you can help the camera out by telling it what you think is important. By setting on focus point, you know if you put that focus point on the part of the image that you want to be in focus, the camera will try to put it in focus. Say you’re shooting runners and you want their faces in focus, you choose a focus point at the top of the frame.

However, all focus points are not created equal. On my 40D, the center focus point is better – it will work for lenses with higher minimum apertures than the other ones, and it may give better results as well.

When I’m shooting most sports, I stick with the center focus point because I know it will work well and I’d rather give up a little framing and have to crop an image down rather than try to shift the focus point from shot to shot.


The camera chooses when it wants to focus, which can be inconvenient. You want to focus on the face of a player in a static situation and take the picture when the motion starts, but when you take the picture, the camera refocuses to what the focus point is on.

If your camera supports focus-on-demand, you can turn off the focus when you half-press the shutter and map the “focus now” function to a button on the back of the camera, which you press with your thumb. You now get full control on the focus, and on my 40D, the chosen focus point lights up red when the camera detects focus.

Enabling this is not without a downside. First, instead of just following the action, keeping the focus point where you want it, and pressing the shutter-release when it makes sense to take a picture, you also need to press the focus button (and sometimes hold it) at the appropriate point. For me, it took 4 games before I was approaching parity with the performance I was getting with the camera controlling focus, and a few more before I saw any benefits. And you run the risk of forgetting to press the focus button in other situations, like when you are taking a wonderfully wind-blown team photograph in perfect light. Not that I’ve ever done that.

I have this set all the time on aperture-priority on my camera. It’s possible to set it up on one of the custom modes on my camera – so it only does that when you turn the mode dial to C1 – but the power-off/on behavior in that mode resets the ISO so it doesn’t work for me.

It was a fair bit of pain to learn to do this but it’s made a noticeable difference in the quality of my images.

Release priority

One more small point about focus.

Canon cameras in AI servo mode operate in what is known as “release focus” for the first frame in a sequence. That means that the camera doesn’t delay taking the picture even if the camera hasn’t achieved focus. Later frames are “focus priority”, which means the camera knows when it’s going to take the picture and tries to have focus at that point.

So, even if you aren’t going to change the focus point or use focus-on-demand, it helps a lot of you stake sequences of shots rather than single shots – the later shots are more likely to be good.

Micro adjustment

Guess I wasn’t quite done.

The auto-focus system works through the collaboration of the camera and the lens. The camera detects the focus and drives the lens to perfect focus.

Well, it’s not quite that simple. Cameras and lenses are both physical devices and manufacturing tolerances mean that some of them focus really well, while other will back focus (the true focus point is actually behind the subject) or front focus (the true focus point is behind the subject). It’s the luck of the draw.

If you do focus tests – which I might talk about at some point, until then you can search the interwebs – you can tell how your camera/lens perform, and then send the lens and/or the camera (they work together) off to your manufacturer for calibration.

Or… you can buy a camera body that supports micro adjustment. You test the focus, and then you can dial in a little adjustment to get things just the way you want it. Another reason I’m pining for the 7D.

Sport shooting #2 – Field Position

Or, “Where to stand…”

One of my goals in shooting sports is to get images that you can’t get as a spectator. Not only do I want to freeze the motion of the players, I’d like to get perspectives that are different from what you usually see. And I’d like to create images with as few distractions as possible.

Location has a lot to do with that. The following assumes that you are shooting a sport that takes place on a field or court, but the basic principles should apply to most sports.

Where does the action take place?

First off, you’ll want to figure out where the action that you care about takes place. If you are shooting soccer, the majority of the action takes place in the midfield, though shots and scoring take place at the ends.

In girl’s lacrosse, on the other hand, the majority of the action occurs near the goals, though this varies depending upon the specific rules that are in effect for the game (the rules are different for different ages).

So, it pays to be an informed spectator.

What do I want to cover?

I’m typically shooting to try to capture the whole game, and ideally that will feature all the players on the team. I’ll shoot from different spots so I can get both defensive and offensive players, and do this in both halves so I can get the outside players when they’re close to me.

If you are shooting for a single player, you will probably make different choices.

Where am I allowed to stand?

Different sports at different levels will put different constraints on where you can be. My goal is to remain within the league rules, and to conform to the desires of the coaches and the officials. The more official the sport, the more serious people are going to be about photography.

If you’re just getting started, it’s a nice courtesy to talk to the officials before the game, tell them what you’re planning on doing, and let them know that they should let you know if you are doing anything they’d prefer you not to do. Same with the coaches.

If you are allowed on any part of the endlines, try to stand at least 10 yards off the end of the field. This makes you much less obvious and intrusive.

Finally, you will likely run into parents who will avoid this, and go into places where they shouldn’t be. My advice is to ignore them.

Sun and Background

If the sun is mostly overhead, the sun direction is less important, but if it’s low, you will get much better results if you shoot with the sun behind you. If you are lucky enough to be able to shoot late afternoon games that are sunny, you have an opportunity to get sun that will get inside helmets or other headgear and a nice golden color, and my advice is to do what you can to take advantage of it.

In other situations, the background is going to have more of an impact on the quality of your shots. Take some time looking around the field when you arrive and decide what direction you prefer to get the best backgrounds. The ends of fields are often pretty clear, so shooting from the ends can be a benefit.


In many cases, you’ll want to use the standard “standing up” position, and I do this a lot when I’m moving around between positions. But look for different perspectives – last year I took some nice shots from a high balcony about 50′ above a field, and I regularly take shots lying down at the end of the field (but only on dry turf fields…).

Special situations

Shooting goalkeepers is hard. They are facing away from the endlines, and they’re a long way away from the sidelines, and even if you have enough reach to capture them, they’re often facing the other side. And they may not be very busy during some games.

The solution is to go out on the field and shoot them during warmup. That gets you 20 yards from them instead of 50, and you can easily get 50-60 nice shots in a few minutes.


You’re either a photographer, or you’re a spectator. If you’re out close to the field, you should act like you’re part of the field – no cheering, no talking to the players, etc. It’s a privilege to be out there, so don’t abuse it.

Sport shooting #1 – starting equipment

In many areas of photography, you can get nice results with high-end point-and-shoot cameras (such as the Canon G series), and sometimes with a cheaper point-and-shoot.

Sports photography is not one of those. For sports shots, you want:

  1. Short exposure times, so that you can freeze the player’s motion.
  2. Good autofocus, so you can focus on the player.
  3. Telephoto lenses, so you can get close enough to the action.
  4. A decent-sized sensor, so the level of noise is acceptable.

Put those all together, and the answer you get is “SLR”. I’m a Canon guy, so I’ll talk in those terms, but there are equivalent choices in Nikon’s line since the two biggies are always fighting for the top of the heap.

At the entry-level, you need:

  • A DSLR of relatively recent vintage.
  • A lens that goes to 200mm (preferably a zoom, ‘cause it’s easier to use).

That puts you at perhaps $500-$750 at the low end, and that will be enough to get started shooting sports if you are shooting outside during the day.

I will warn you at the outset that sports photography can be an expensive passion. The midrange camera bodies and lenses are on the order of $1K each, and the ones the pros use are in the $4K-$7K range for the bodies or lenses.

I started with a Canon Rebel XT (about $750 at the time), and a Canon 28-135 F4.5-5.6 zoom lens (say, $300).

Sport Shooting

Or, “so you want to take pictures of your kids”…

I’ve spent the fast few years teaching myself how to do sports photography, so I could take pictures of my daughter’s soccer and lacrosse teams. Or, to be more correct, progressing from “really bad at sports photography” to “okay at sports photography”.

I found a few sources on the way to help me out, and I’d like to pass on some of the tips that I’ve either been told or found out along the way, and with a bit of luck – and a lot of practice – you’ll be producing some nice images of your own in no time.

I’m going to talk about things in rough order of complexity – I’ll start out with the things that are more basic and move towards the more complex (and/or expensive) ones.

I hope you find this helpful…

Zoo pictures…

During our summer vacation, we took a trip to the San Francisco zoo.

This was a family vacation, which means that I need to balance the amount of time I spend at a single exhibit trying to get a shot I want with the patience of my family. That means a single lens, which in this case was my 70-200mm F2.8 L lens on my Canon 40D. Because the sensor on the 40D lens is smaller than a 35mm frame, the 70-200mm lens is really a 112-320mm lens (or acts like one), which is enough reach to get as close as I want in most cases. If I’d had more time, I might have brought my 1.4x teleconvertor, giving me a 160mm-440mm lens (or something like that).

One of the things that I’ve learned shooting sports is that it’s all about the eyes. Gorillas are really hard to get eyes on because their fur is so dark that you don’t get much light back there, but I was luck enough to catch this one. The hanging strap is unfortunate, though I might be able to clone it out with a lot of work. The focus itself isn’t perfect.

This one is better technically (though I really wish he took more pride in grooming and got rid of that grass on his shoulder), though the eyes aren’t quite as good. I might be able to pull them out a bit with some work.

Here I got lucky. First of all, both of the lions were active, and second, the SF zoo has this really nice big chain-link fence that’s just the right size for the 4” hood on my zoo lens. This guy was just sitting there, eating grass, and then he got something he didn’t like, and proceeded to lick for about a minute. This shot is nice and sharp – if you look at the original, you can see the papillae on the bottom of the tongue.

Did I mention that I like this lens?

The only thing bad about the shot is the female lion in the upper-right corner.

The zoo had some birds out on perches on a grassy spot, giving me the chance to get this shot, one of my best ones for a long time. The detail around the eyes is great, and it’s pretty much the way it came out of the camera.

Finally, I grabbed a snap of this animal:

Notice the detail of this shot – that’s the strap from my old Rebel XT, which has been repurposed as a camera for my daughter. It’s actually been a lot of fun shooting with her.

All originals (and a few more shots) are here.

Flash snap

This past week the parts for my project have shown up. I got a surplus 10A solid-state relay for about $8 on eBay (I’m perplexed why SSRs are so expensive – there are like $2 worth of parts in a $20 part), 12 20W lights, and a substantial 600W transformer from intermatic.

The transformer is actually 2 300W transformers rather than a single 600W one. I wanted to verify that the SSR that I got was working, so I got out one of the lights, carefully wired up the primary of the transformer to an extension cord and the 12V output to the light, and plugged it in.

Flash Snap!

The light got really really bright for a really short period of time, and the snap was circuit breaker tripping.

I’m surprised. It’s pretty hard to mess up hooking up a transformer – there are two AC supply wires, two wires on the transformer, and polarity doesn’t matter. I check my connections and make sure that there are no shorts, and try it again.


No flash this time because the light got toasted the first time. I pull out my Fluke Multimeter, set it to resistance, and put it across the primary, where it reads 0.1 Ohms. Same reading across the primary of the second transformer. Let’s see, 120 Volts across .1 ohm = 1200 amps, which makes it pretty obvious why the circuit tripped.

It’s really not as simple as measuring the resistance, since transformers are inductors, and resistance isn’t the same thing as impedance, so I go upstairs to make a sandwich, and do a little thinking. What I need is a way to do some measurements of the transformer with a low-voltage AC current across it. I remember there’s an old trick where you put a bulb inline with the load – that limits the current to what the bulb will pass.

I hook up a 7watt nightlight bulb I use to debug my light projects in line with the transformer, and plug it in. At 7 watts, it pulls 7 / 120 = 58mA of current, which means that (V = IR), it has a resistance of 120 / 0.058 = about 2100 ohms.

A voltmeter on the transformer shows 0.25 volts. That’s pretty low. If 0.25 volts results in 58mA through the transformer, putting a full 120 volts on it would give us a current of 480 * 0.058A = 28 Amps, or about 3300 watts. That’s a lower-end result – I actually think it’s quite a bit worse since 3300 watts would only be a mild overage on the circuit, and that level of current takes a fair bit of time (say, half a second) to trip a breaker. I think it’s more likely that we’re looking at 100 amps or so.

And guess what – the second transformer is exactly the same as the first. Must be a manufacturing defect with some of the windings shorted together.

It makes a father proud

Last Friday morning, I was sitting at the kitchen table reading the paper, eating breakfast, and listening to music.

My daughter stuck her head around the corner, smiled, looked at me, and said two words:

“Baba O’Reilly”

Which was her way of demonstrating a fairly obscure bit of music knowledge.

Anybody care to explain why I’m proud?

Outdoor lighting project – controller

The requirements of the control system are pretty simple:

  • Be controlled with a single pushbutton.
  • Support on and off.
  • Turn off the light automatically after a suitable period of time

That’s pretty simple – simple enough that you can do it with an 8-pin AVR controller, like the atTiny12. That programs fine in my STK500 development kit, but on the low-pin-count controllers, many of the pins have shared functions related to programming, so you have to attach/detach them each programming cycle. That’s why I’m using one of the attiny861s that I have left over from another project, where I have plenty of pins. The cost difference doesn’t matter at all in a one-off design.

I spend the usual frustrating time remembering how to set up the programmer so it works. The key to remember is that you need a current build of Atmel’s avr studio so that you can look in the help file to see how to do the wiring. I wasted a couple of hours and almost lost the Magic Smoke before I remembered where to find the information.

The next step is to get the controller configured correctly. Even the simpler AVRs have a ton of options. I’m going to be using one of the timers, so I need to set up the timer registers correctly. In this case, I want a 16-bit counter (set bit 7 of TCCR0A to 1), and I want to divide the 8MHz clock by 256 (set bit 3 off TCCR0B to 1), and so on. All the information is in the atmel data sheet (the 236 page data sheet…) for the controller, but it takes a fair bit of work to get it right.

Or, you can buy a copy of codevision AVR. Not only does that let you write in C rather than assembler, it has a program wizard that lets you use human-understandable settings rather than hex values. So, in this case, you can go into the wizard and say that you want timer 0 to run at 31250 Hz, use a 16-bit counter, and call an interrupt when it overflows, and it will generate the source code (with comments) that does just that. Only two annoying things about it:

  1. It puts all the initialization code at the beginning of main and then the main loop at the end, so you’re constantly having to scroll over that code to get to your main loop.
  2. When you want to update the code, you have to run the wizard and then cut & paste the updated code in the proper place – it can’t fill in the areas you want.

Neither of these are more than a little annoyance. As you can tell I’m a big fan of AVR studio.

So, back to the project. First, we need a way to handle the turning the lights off, and for that we need a timebase. We’re going to use 10 Hz (for reasons that will become apparent later), and it would be most convenient to get an interrupt at that rate. Since the interrupt will happen whenever the 16-bit timer overflows, we need a timebase where the count fits in 16bits (ie  65535). Looking at our options, we see that we can get 8 Mhz / 256 = 31250 Hz as our timer frequency. If we can send an interrupt every 3125 counts, we’ll have our 10 Hz. So…. We take 65535 – 3125 = 62410 = F3CA, and initialize the counter to that value after every interrupt.

And that gives us 10Hz. Or, actually, it gives us 10Hz +/- about 10%, which is the factory calibration tolerance of the internal oscillator. It’s possible to get a better calibration than this by writing to the OSCCAL register – Atmel claims you can get +/- 1% through that approach – but it’s not something needed for this application, so we’ll just stick with whatever we get.

Now that we have that, we can write our interrupt service routine.

// Timer 0 overflow interrupt service routine
interrupt [TIM0_OVF] void timer0_ovf_isr(void)
        // Reinitialize Timer 0 value – 1 second timeout…
    if (timeRemainingTenths > 0)
        if ((timeRemainingTenths % 600 == 0) &&
            (timeRemainingTenths <= 3000))
            PORTA.2 = 0;
            PORTA.2 = 1;
        PORTA.2 = 0;

We have a timeRemainingTenths that sets the timeout value. The if condition handles flashing the lights off for 1/10 second the last 5 minutes so that I can turn off the snowblower and walk back over and hit the button again.

That leaves only the button-control handling code to write. As part of this, I need to handle debouncing the switch: when a mechanical switch closes, it doesn’t close fully but instead bounces open and closed a few times. This bouncing is slow enough that it’s easy for a microcontroller to detect it multiple times, so you need to debounce the switch. There is are dedicated debounce ICs to deal with this – such as the Maxim 6816 series – but in most cases you can do it in software. Or you could use a hall-effect switch that doesn’t need debouncing. The downside of debouncing is that it slows the speed of response.

In this case I don’t need the quick response, so the code is pretty simple:

void Wait(int seconds)
    waitCounter = 0;
    while (waitCounter < seconds * 10)

// Declare your global variables here

void main(void)

    while (1)
        if (PINB.0 == 0)
            PORTA.2 = 1;
            timeRemainingTenths = 60 * 60 * 10; // 1 hour 

                // Held down, turn off lights…
            if (PINB.0 == 0)
                timeRemainingTenths = 0;
                PORTA.2 = 0;

If you look back at the interrupt service routine, you’ll see that the waitCounter variable gets updated at 10Hz. The wait routine uses this variable to provide a way for us to wait a specific number of seconds.

The sensing code takes a bit of explanation. In digital electronics, the concepts “0” and “1” refer to voltage ranges. The crossover point depends on particular semiconductor chemistry used in the electronics, but assume that it’s 2.5 volts in this case (ie 50% of the 5 volt supply we’re using). So, any voltage above 2.5 volts is 1, and below 2.5 volts is 0. If we hook a switch up to a digital input and connect it to ground, when we press the button, the input voltage goes to zero, and the input value is 0. Then, we let go of the button, and the input goes to some indeterminate state. It might be zero, it might be 1, it might go back and forth.

We get around that by using what is called a pull-up resistor, which is connected to Vcc (5V in this case). If the button isn’t pressed, that ensures that we get a high voltage (a 1), and then when it is pressed, we still get zero.

In the past – say in 1980 – you’d use a kind of logic known as TTL, and you had to be really careful how you hooked things up and what values you used, since TTL was a pretty rough approximation of the term “digital”. These days, most logic families are a lot easier to deal with, and in fact on the AVR microcontrollers have built-in switchable pullup resistors.

All of that is a long way of explaining why the code looks for a low value to determine when a switch is pressed rather than a high one.

The code itself is simple. As soon as the button is pressed, we set the time remaining to an hour, and then we wait a second to debounce. If the button is still pressed after a second, we turn off the switch, and then wait 2 seconds to debounce after that press.

That’s about it.



So, we look at pin 0 on the B port, and if it’s zero (pulled to