Moment unbalance is a critical issue in many mechanisms rotating around a certain axis. The common element for eliminating the moment unbalance is a spring attached to the rotary system which can nullify it only at a certain angle or position due to the cosine profile of the unbalance. In order to accomplish this at all angles, torsion bar systems following a cam profile are preferred instead. In this paper, a new method has been developed to generate the exact analytical cam profile on which torsion bar system will roll. Using the moment balance equations and the equations related to the geometry of the cam profile at rotated frames and torsion bar parameters, seven nonlinear differential equations with corresponding initial conditions are obtained. Solution of this set of nonlinear equations determined the cam profile, torsion bar torque profile and the overall system layout. Then, the problem transformed into an optimization problem with an objective of minimizing the maximum amount of torque induced on the torsion bar with certain geometrical and structural constraints, with initial conditions forming the search space. Systematical solution to this optimization problem created a blueprint for the design of a generic system in a constrained volume.