Set up the leg module as you normally would. The ball bone (controller), set it following this video:
Please read the video description to solve the new problem within this solution.