In this paper, we study the balance control for the rotary inverted pendulum system with two joints both subject to uncertainty. To facilitate the experiment, we apply a classical energy-based swing-up control, eschewing compensation for the uncertainty. In balance control, we employ a novel approach in the form of a modified signal compensation-based balance control, which models the uncertainty as its previously sampled term and its variation. The signal compensation-based balance control involves three steps. First, for the linearized discrete-time state-space model around the upright equilibrium point, we design the main control signal by using the pole-placement technique. Second, we estimate the discrete-time model of the system by using the least squares identification method, thereby unveiling key points in the identification procedure. The discrete-time model presents the uncertainty as a previously sampled term and its variation. Third, we design two discrete-time compensation signals for the previously sampled term and the variation. By combining the main control signal and the two compensation signals, we formulate the balance control law. We further optimize the signal compensation-based balance control by adding an extra parameter, successfully circumventing the critical stability problem, and analyze the performance of the closed-loop system. Numerical simulation and comparative experiments demonstrate its effectiveness and strong robustness against the uncertainty in frictions and modeling errors of the system.