An apparatus having a speed control loop and a current control loop, for controlling a permanent-magnet synchronous motor having a rotor having permanent magnets as magnetic poles for driving the rotor, and an angular position detector mounted on a rotatable shaft of the permanent-magnet synchronous motor and having an A- and B-phase pulse train generating means for generating a number of A- and B-phase pulses per rotation which have respective electrical angles that are 90.degree. out of phase with each other and a C-phase pulse train generating means for generating a C-phase pulse per rotation, the angular position detector being assembled so as to output a C-phase pulse when a magnetic pole reference of the rotor reaches a predetermined angle of a stator, said apparatus comprising:
- a main circuit and a control circuit;
- said main circuit comprising a converter for converting an alternating current into a direct current and outputting the direct current, a smoothing capacitor for smoothing the direct current outputted from the converter, and an inverter for energizing the permanent-magnet synchronous motor;
- said control circuit comprising speed detecting means for converting a signal from said angular position detector into a speed signal and outputting the speed signal, speed control means for controlling a speed of the permanent-magnet synchronous motor with said speed signal and a speed command, angle signal detecting means for generating an angular displacement signal for a current command which is produced using counts of the A- and B-phase pulses counted in synchronism with the rotation of the rotor with the position of a C-phase pulse from the angular position detector being used as a magnetic pole reference of the rotor when the C-phase pulse is outputted, first current command generating means for generating a current command based on an output signal supplied from said speed control means and an output signal supplied from said angle signal detecting means, detecting an angular displacement of the magnetic poles of the rotor of the permanent-magnet synchronous motor using counts of the A- and B-phase pulses subsequently counted in synchronism with the rotation of the rotor when a C-phase pulse is thereafter detected during rotation of the permanent-magnet synchronous motor, and thereafter outputting a magnetic pole reference detection completion signal, second current command generating means for outputting an alternating current command having a constant amplitude and a low frequency, current command switch means for switching between outputting the current command outputted from the first current command generating means and outputting the current command outputted from the second current command generating means, magnetic pole detection command generating means for starting said second current command generating means and switching said current command switch means to said second current command generating means in an initial stage before a normal operation command is given to the permanent-magnet synchronous motor after a power supply voltage is applied to the permanent-magnet synchronous motor, and switching said current command switch means to said first current command generating means when said magnetic pole reference detection completion signal is outputted, current detecting means for detecting a current outputted from said inverter to the permanent-magnet synchronous motor, and current control means for controlling a current of said inverter with the current command supplied from said current command switch means and a detected signal from said current detecting means.