Pedaling a bike anim

Hi there everbody

Does anyone know where I can find a tutorial on …I’m not sure what this would be called…articulated motion? relative motion? I am making an animation of a guy riding a bike. The user inputs the gear to change his pedaling speed.

I can make the wheels change speed and the gears change speed and size.

I don’t know how to fix his foot to the rotating pedal circle, with a fixed hip point and the knee moving appropriately inbetween.

If anyone can point me in the right direction that would be fabulous!

Thnx!!!