The part of servo control that directly deals with this is often referred to as “Feed forward” control. It can be thought of as what internal commands are needed such that the user’s motion commands are followed without any error, assuming of course a sufficiently accurate model of both the motor and load is known