After a lot of fiddling, I got the first of 6 mechanical legs, each with several joints and ending in wheels, working the way I wanted. I thought it had been so hard because of some simple oversights. Now I'm not so sure.
After copying the setup for the first leg to the second leg, even a slight movement of the IK bone causes it to twist like a dead spider leg. The axes of rotation of the joints are limited through the IK section of their bone properties. The first leg doesn't have a range set on the axis each joint is free to move in, but it still works very well. I can even tweak the joints individually so the bend is distributed over the joints the way I want. I don't understand why the other one is so different. I have looked for something different and don't see anything.
What is making this go so wrong?