In the paper a generalized guaranteed cost output-feedback robust gain-scheduled PID controller synthesis is presented for affine linear parameter-varying systems under polytopic model uncertainty. The controller synthesis is generalized in a sense that it covers robust, robust gain-scheduled, and robust switched (with arbitrary switching algorithm) PID controller design. The proposed centralized/decentralized controller method is based on Bellman-Lyapunov equation, guaranteed cost, and parameter-dependent quadratic stability. The proposed sufficient robust stability and performance conditions are derived in the form of bilinear matrix inequalities (BMI) which can efficiently be solved or further linearized. As the main result, the suggested performance and stability conditions without any restriction on the controller structure are convex functions of the scheduling and uncertainty parameters. Hence, there is no need for applying multi-convexity or other relaxation techniques and consequently the proposed solution delivers a less conservative design method. The viability of the novel design technique is demonstrated and evaluated through numerical examples.