A control device for an electric compressor comprising: an inverter; a shot-pulse control unit configured to provide, at a time of starting a permanent-magnet synchronous motor, a pulse signal to the inverter, the inverter including a plurality of arms corresponding to respective phases U, V, and W of a stator of the permanent-magnet synchronous motor, to provide a predetermined current to each of the phases of the stator for such a short time that a rotor does not rotate; a detecting unit configured to detect a voltage drop at a shunt resistor provided in series to a stator circuit, indicative of a current flowing through each of the phases when the predetermined current is provided to each of the phases; and an estimating unit configured to estimate a position of the rotor by comparing values detected by the detecting unit, characterized in that the inverter is configured to turn on a U-phase gate of an upper arm, a V-phase gate of a lower arm, and a W-phase gate of a lower arm for the short time, and when the short time passes, turn off the U-phase gate of the upper arm while leaving on the V-phase gate of the lower arm and the W-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the U-phase, turn on a V-phase gate of an upper arm, the W-phase gate of the lower arm, and a U-phase gate of a lower arm for the short time, and when the short time passes, turn off the V-phase gate of the upper arm while leaving on the W-phase gate of the lower arm and the U-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the V-phase, turn on a W-phase gate of an upper arm, the U-phase gate of the lower arm, and the V-phase gate of the lower arm for the short time, and when the short time passes, turn off the W-phase gate of the upper arm while leaving on the U-phase gate of the lower arm and the V-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the W-phase. an inverter; a shot-pulse control unit configured to provide, at a time of starting a permanent-magnet synchronous motor, a pulse signal to the inverter, the inverter including a plurality of arms corresponding to respective phases U, V, and W of a stator of the permanent-magnet synchronous motor, to provide a predetermined current to each of the phases of the stator for such a short time that a rotor does not rotate; a detecting unit configured to detect a voltage drop at a shunt resistor provided in series to a stator circuit, indicative of a current flowing through each of the phases when the predetermined current is provided to each of the phases; and an estimating unit configured to estimate a position of the rotor by comparing values detected by the detecting unit, characterized in that the inverter is configured to turn on a U-phase gate of an upper arm, a V-phase gate of a lower arm, and a W-phase gate of a lower arm for the short time, and when the short time passes, turn off the U-phase gate of the upper arm while leaving on the V-phase gate of the lower arm and the W-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the U-phase, turn on a V-phase gate of an upper arm, the W-phase gate of the lower arm, and a U-phase gate of a lower arm for the short time, and when the short time passes, turn off the V-phase gate of the upper arm while leaving on the W-phase gate of the lower arm and the U-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the V-phase, turn on a W-phase gate of an upper arm, the U-phase gate of the lower arm, and the V-phase gate of the lower arm for the short time, and when the short time passes, turn off the W-phase gate of the upper arm while leaving on the U-phase gate of the lower arm and the V-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the W-phase. turn on a U-phase gate of an upper arm, a V-phase gate of a lower arm, and a W-phase gate of a lower arm for the short time, and when the short time passes, turn off the U-phase gate of the upper arm while leaving on the V-phase gate of the lower arm and the W-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the U-phase, turn on a V-phase gate of an upper arm, the W-phase gate of the lower arm, and a U-phase gate of a lower arm for the short time, and when the short time passes, turn off the V-phase gate of the upper arm while leaving on the W-phase gate of the lower arm and the U-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the V-phase, turn on a W-phase gate of an upper arm, the U-phase gate of the lower arm, and the V-phase gate of the lower arm for the short time, and when the short time passes, turn off the W-phase gate of the upper arm while leaving on the U-phase gate of the lower arm and the V-phase gate of the lower arm, whereupon the detecting unit detects a value indicative of a current flowing through the W-phase.