Here is a worked example of the algorithm I came up with to solve the problem I discussed here (they show more how it works in theory than in practice; in practice, quite a few of these steps can be left out).

Part 1 Robot arm maths - worked example (part 1)

Part 2

Part 3 Robot arm maths - worked example (part 3)

Sorry about the JPEGs, but hosting a Mathematica CDF in the page turned out to be a pain in the arse.