I'm trying to design a two-stage "arm" which articulates from an attached base. The arm uses a pulley and cable at the "elbow" and a hydraulic cylinder mounted on the lower stage to lift the upper stage (similar to a boom truck).

For a given arm length L, pulley diameter D, and maximum weight W at the end of the arm, how can I determine the maximum required hydraulic cylinder pull force (F) required to lift the arm from a horizontal orientation? 

If there's a formula where I can plug in the values, I can experiment with different arm lengths, pulley circumferences, and weights to hopefully achieve a satisfactory result.

Here's a rough drawing. Thanks for any pointers, links, etc.

[![enter image description here][1]][1]


 [1]: https://i.sstatic.net/kdj47.png