A controller adapted to control a rotary electric machine having saliency in a rotor via an inverter , the controller for rotary electric machine comprising: a current detection unit that detects current which flow into a winding provided in a stator of the rotary electric machine ; an angle estimation unit that estimates a rotational angle (Θ) of the rotor, based on current detection value; a current control unit that calculates a driving voltage command for driving the rotary electric machine , based on the current detection value; a command for estimation generation unit that generates a voltage command for estimation; a voltage command calculation unit that calculates a voltage command by adding the voltage command for estimation to the driving voltage command; a carrier generation unit that generates a carrier wave; and a voltage application unit that turns on and off switching devices which the inverter has and applies voltage to the winding, based on a comparison result between the voltage command and the carrier wave, wherein the command for estimation generation unit generates the voltage command for estimation of a preset one period (Th) on a stationary coordinate system fixed to the winding, wherein the carrier generation unit generates the carrier wave of the same one period (Th) as the one period (Th) of the voltage command for estimation, and wherein the angle estimation unit extracts a frequency component of the one period (Th) of the voltage command for estimation, from the current detection value, and estimates the rotational angle (Θ) based on the frequency component; characterized in that the carrier generation unit is adapted to generate a triangular wave of 1.5 periods which starts from a peak point of mountain and ends at a bottom point of valley or which starts from a bottom point of valley and ends at a peak point of mountain, as the carrier wave of one period (Th). a current detection unit that detects current which flow into a winding provided in a stator of the rotary electric machine ; an angle estimation unit that estimates a rotational angle (Θ) of the rotor, based on current detection value; a current control unit that calculates a driving voltage command for driving the rotary electric machine , based on the current detection value; a command for estimation generation unit that generates a voltage command for estimation; a voltage command calculation unit that calculates a voltage command by adding the voltage command for estimation to the driving voltage command; a carrier generation unit that generates a carrier wave; and a voltage application unit that turns on and off switching devices which the inverter has and applies voltage to the winding, based on a comparison result between the voltage command and the carrier wave, wherein the command for estimation generation unit generates the voltage command for estimation of a preset one period (Th) on a stationary coordinate system fixed to the winding, wherein the carrier generation unit generates the carrier wave of the same one period (Th) as the one period (Th) of the voltage command for estimation, and wherein the angle estimation unit extracts a frequency component of the one period (Th) of the voltage command for estimation, from the current detection value, and estimates the rotational angle (Θ) based on the frequency component; <EOS>