Industrial robots experience posture-dependent inertial variation and interference forces between joints, which in turn generates undesired vibrations due to the inherent elasticity of the reduction gears, making it difficult to control each axis independently. Conventionally, dynamic compensation is used to compensate the robot dynamics and decouple each axis, while state feedback control based on a two-inertia model is used for dealing with the vibrations caused by the elasticity of the reduction gears. However, the control design for this approach usually assumes a fixed moment of inertia, so its performance is compromised when large and fast changes in the robot posture occurs. In this paper, a posture-variant approach that takes into account the posture-dependent inertial variation in real time is proposed to achieve exact dynamic compensation and independent control of each axis regardless of the robot posture. The state equations of the posture-variant two-inertia system model for each robot axis are discretized using the finite-difference time-domain (FDTD) method and adapted on both the dynamic compensation and feedback control parts, allowing to easily redesign the whole control system considering the inertial variation at each control cycle. The effectiveness of the method is confirmed by experimental verification on a 6-axis industrial robot.