So this is a torque balance problem about your hinge point:

The scalar form of this is:

Tcyl = Fcyl*distance to hinge point.

But what we really want to work with is the vector form:

Tcyl = Fcyl x distance (where x represents the vector cross product)

Letting x represent horizontal distances (along the stationary base) and y representing vertical distances and the origin be at the hinge point where your bar is rotating about.

I’m going to assume you know a the value A1 which is the angle above the horizontal from the hinge point of the piece to the cylinder’s attachment point on the link and the distance between these two points. (In your extended images its around 30 deg, and retracted is ~120 deg)

We can find the x, y locations of the attachment point as:

xa = R*cos(A1), ya = R*sin(A1)

Let A2 be the angle above the horizontal from the rear hinge point (xh, yh) of the pneumatic cylinder to its attachment point to the link and L1 be the distance between this point Now, we also have

xa = xh + L1*cos(A2), ya = yh + L1*sin(A2) (two equations, two unknowns - L1 and A2)

So now we know the direction of the force which is what we needed. The torque it generates is a combination of the torques from its horizontal and vertical components: (define clockwise as negative - since I worked this out in the scalar instead of vector form, you need to handle the signs yourself)

Horizontal Component Fcyl,h = Fcyl*cos(A2)*

Tcyl,h = Fcylcos(A2)*ya = Fcyl*cos(A2)*R*sin(A1)

(As shown, this component should always be positive)

Vertical Component Fcyl,v = Fcyl*sin(A2)*

Tcyl,v = Fcylsin(A2)*xa = Fcyl*sin(A2)*R*cos(A1)

(As shown, this component should be negative for A1>90 deg)

Tcyl = Fcyl*R*(cos(A2)*sin(A1) + sin(A2)*cos(A1));

For solving how big the cylinder should be, you’ll need to do a similar problem with the weight of your actuated member/any external forces applied and solve for the torque that those forces generate.