A controller of an injection molding machine which compensates a delay in an injection velocity changeover and a delay at the time of changeover to the pressure-holding process, and is capable of more accurate and stable injection velocity control and changing control from the injection velocity control to pressure control. In the injection process, a motion command is outputted in every sampling period τ according to the command injection velocity. When a screw position overshoots the set velocity changeover positions Psw(2) and Psw(1), a motion command based on a velocity command of the next interval is outputted from the next period. However, there is time lag between the point when the set changeover position is reached and the point when the motion command is changed after detection thereof. There generates a motion deficiency in a motion amount shown by mark A and overshoot shown by B. Motion commands of the next period or the next and subsequent several periods are compensated with errors in the motion amount caused by the time lag used as compensation amounts A′ and B′. The generated error motion amount is immediately compensated, which enables accurate velocity changing control. By performing the compensation in the same manner when the injection velocity control is switched to the holding pressure control, it is possible to suppress the peak pressure and the dispersion.