Start from the first half of the mech: a wheel that's driving a two part arm. Put the head of a bone exactly in every center of rotation of all joints (use Shift S, selection to cursor and cursor to selected, for precise placements).
Starting from the bone that drives the force A, B is simply son of A and acts as target for the IK bone chain C,D. E is simply son of D (keep offset), and it will be the IK target of the 2nd part IK chain.
Part 2 is simply another IK Chain, bone E is target for the IK chain F,G,H,I. The only difference is that every bone of the chain has locked the rotation axis that in real world would be constrained by its rigid nature.
Which axis to constraint it depends by the bone roll (you can set it in edit mode). A good habit is to rotate the roll so that the main rotation is along positive X Axis, and you can turn on axis visualization to help understanding which axis to lock.
I added on the end a third IK chain (L,M) form bone E head to bone H tail, just to drive the rotation of the smaller part of the piston, because it was getting a big rotation out of its natural axis (in your video this longitudinal extra rotation is absorbed by imprecision of the joints).