how to rig a car engine piston i need some help setting up what is basically the same as a piston in a car engine's cylinder. i know i can just use keyframes and NLA strips but im after a more dynamic approach that wont require a bunch of edits to change the speed or phase. ideally i want to connect the rotation to the up and down motion of the control handle im using for the rest of the parts but i am stumped.
i have animation nodes installed so solutions using that are also viable. suggestions appreciated as im at my wits end.

https://en.wikipedia.org/wiki/File:Piston.gif
This can be done with one driver and one look-at constraint.
The height of the piston-pin above the center of the crank is given by the following expression:
h = r * cos(A)+sqrt( (l**2)-( (r**2)*(sin(A)**2) )  )
where r is the radius of the crank, l is the length of the rod, and A is the rotation of the crank, as explained here.
With a crank of radius 1, and a rod of length 4, as illustrated, this reduces to:
sqrt(16-(sin(A)**2))+cos(A)
so this is the sort of expression you can put into a driver for the height of the piston(-pin), where A is the angle through which the crank is rotated.
The rod simply has to be parented to the crank, with its origin on the crank's circumference, and given a Locked Track constraint, making it look at the piston-pin.

If you parent both the piston-pin and the crank to another object, their transforms are evaluated in that object's space, and so the rig can be freely moved around, using their parent. In the example blendfile, it's the Empty called 'Basis'.