You should be aiming to use enough yeast to wrap fermentation up in a week to 10 days - use the yeast pitching calc at www.mrmalty.com to make sure you are pitching enough yeast. 3 weeks is too long. Make sure you are aerating the cold wort properly before pitching. Make sure the wort is cooled below 70 before pitching. Preferably you don't want the temp of the fermenting beer to rise over 70 degrees for the first 2 or 3 days, but on your system that may not be possible, though it is certainly ideal.
I'd recommend harvesting yeast not long after fermentation is actually finished and keep the generation from 6-9 or less. Don't use yeast from higher gravity fermentation (not much higher than 1.065). Make sure your water has at least 50 ppms of calcium or you can have sluggish fermentations.
Fresh, healthy yeast and plenty of it. Aeration, yeast nutrients (I like the wyeast nutrient), and temp control are your keys to healthy fermentations.
Thanks, these are all good tips. What do you think the chances are that I didn't pitch enough yeast if I reused the entire yeast slurry from the previous batch? I'd like to get a microscope soon so that I can do some basic cell counting and pitch more accurate and consistent amounts. We don't oxygenate our wort yet so that could be part of the problem. I don't think the fermentation temps were the problem because they rarely fluctuate and every time I check the chamber temperature, we are at 69 degrees. I've almost finished building my BrewPi though, so that will help with that. We probably collected the yeast too late as the beer had been sitting on it for about 3 weeks when we collected it. Thanks for the tips, they are much appreciated.