I have a Nikon D40X with the IR cut filter removed, but the focus is really off- infinity becomes 3m on a 50mm lens. According to my calculations the sensor needs to move forwards (closer to the shutter) by 0.7mm, but I don't see an easy way to do it. Any suggestions? I couldn't find a cheap replacement clear filter for the D40X.
I think you definitely should have a clear filter.
Cheap is a relative thing, and a few dollars more for a working camera is worthwhile. I'd first ask MaxMax, Kolari, or LifePixel, because they will know the correct replacement glass. In fact,
Life Pixel – Nikon D40x DIY Digital Infrared Conversion Tutorial makes it clear they know what you need.
If you just want glass, Edmund Optics certainly has all sorts of optical glass starting at modest two-digit $ costs. The really cheap alternative would be to get something like microscope slide glass from some lab equipment supplier and cut it to size; blank slides are commonly 25.4x76.2x1mm and the index of glass is usually around 1.5.
The other catch is, how do you know the focus issue is a 0.7mm shift? The truth is that most lenses are not designed to bring NIR into focus in the same plane as visible light, so the focus plane for them in NIR can be significantly different depending on wavelength and which lens you use. The result is that full-spectrum focus can be a compromise between visible and NIR focus points, and obtaining that compromise for some lenses might require being able to focus visible light somewhat past infinity. In other words, if there's a specific lens you want to use, you might want to tweak your cover glass optical thickness a bit from what is optimal for visible light...
PS: You might see a tiny bit of CA from lenses designed for your sensor stack and used without a cover glass -- comparable to the issue when using designed-for-film lenses on digital cameras with a cover glass. The effect is usually very small unless you have a thick cover glass, like the 4mm ones in MFT cameras.