Prevent Loose Bone Joints
You can use the Theorem of Pythagoras:
I added three bones, for clarity:
j3 is simply child of Crank.
j2 uses a copy loc constraint to copy only X loc of j3
j1 is the traget of Rod track to constraints, and piston copies loc of j1.
We know that a = square root of (square c - square b) by the Pythagoras theorem.
c is a fixed value, equals to Rod bone lenght.
b is equal to the distance between j2 and j3.
We want that the x loc of j1 is equal to x loc of j3 + a.
So I've set a driver on its X loc to follow this formula.
In the drivers panel the first variable uses a &quot;distance&quot; operator, while the second variable (varj3) use a transform channel (x loc of j3 bone).
The fixed number .067 is simply the square of the rod bone lenght, measured in Blender units (I suggest to do the operations using  blender units, then switch back to imperials when you have finished).