A motor controller for an air conditioner having a converter converting AC utility power into DC power and an inverter having a plurality of switching elements, the inverter receiving the DC power, converting the received DC power into AC power by switching operations of the switching elements, and supplies the AC power to a motor, the motor controller comprising: a current detector arranged to detect a current flowing in the motor; a temperature detector arranged to detect a temperature in the motor controller or a temperature ambient to the motor controller; and a controller arranged to calculate a loading based on at least one of room temperature, setup temperature, and inner unit capacity, and set a final target frequency at which to drive the motor based on the calculated loading and at least one of the detected current and the detected temperature, characterised in that the controller comprises: a speed evaluator to evaluate the speed of rotator of the motor based on the detected current flowing in the motor; a current command generator to generate current commands based on the evaluated speed; a voltage command generator to generate voltage commands based on the generated current commands; and a switching control signal output unit to output a switching control signal to drive the switching elements of the inverter, characterised in that the controller further comprises: a first target frequency setup unit arranged to set up a first target frequency based on the loading: a second target frequency setup unit arranged to set up a second target frequency based on at least one of the detected current and the detected temperature; and a final target frequency setup unit arranged to set up the lower one of the first target frequency and the second target frequency as the final target frequency. a current detector arranged to detect a current flowing in the motor; a temperature detector arranged to detect a temperature in the motor controller or a temperature ambient to the motor controller; and a controller arranged to calculate a loading based on at least one of room temperature, setup temperature, and inner unit capacity, and set a final target frequency at which to drive the motor based on the calculated loading and at least one of the detected current and the detected temperature, characterised in that the controller comprises: a speed evaluator to evaluate the speed of rotator of the motor based on the detected current flowing in the motor; a current command generator to generate current commands based on the evaluated speed; a voltage command generator to generate voltage commands based on the generated current commands; and a switching control signal output unit to output a switching control signal to drive the switching elements of the inverter, characterised in that the controller further comprises: a first target frequency setup unit arranged to set up a first target frequency based on the loading: a second target frequency setup unit arranged to set up a second target frequency based on at least one of the detected current and the detected temperature; and a final target frequency setup unit arranged to set up the lower one of the first target frequency and the second target frequency as the final target frequency. a speed evaluator to evaluate the speed of rotator of the motor based on the detected current flowing in the motor; a current command generator to generate current commands based on the evaluated speed; a voltage command generator to generate voltage commands based on the generated current commands; and a switching control signal output unit to output a switching control signal to drive the switching elements of the inverter, characterised in that the controller further comprises: a first target frequency setup unit arranged to set up a first target frequency based on the loading: a second target frequency setup unit arranged to set up a second target frequency based on at least one of the detected current and the detected temperature; and a final target frequency setup unit arranged to set up the lower one of the first target frequency and the second target frequency as the final target frequency. a first target frequency setup unit arranged to set up a first target frequency based on the loading: a second target frequency setup unit arranged to set up a second target frequency based on at least one of the detected current and the detected temperature; and a final target frequency setup unit arranged to set up the lower one of the first target frequency and the second target frequency as the final target frequency. a second target frequency setup unit arranged to set up a second target frequency based on at least one of the detected current and the detected temperature; and a final target frequency setup unit arranged to set up the lower one of the first target frequency and the second target frequency as the final target frequency.