The invention provides an electronic control device capable of suppressing
noise of a motor at the time of carrier frequency switching. An electronic control device for controlling an
electric motor for driving a vehicle is provided with a switching condition storage unit (122), a driving load calculation unit (121), a switching condition determination unit (123), and a frequency
control unit (124). A switching condition storage unit (122) stores switching conditions in which the rotational speed of the motor is lower than a predetermined
lower limit value and the torque command of the motor is greater than a predetermined upper
limit value. The travel load calculation unit (121) calculates the travel load (Lt) of the vehicle on the basis of the rotational speed (
omega) of the motor and the torque command (Tc). A switching condition determination unit (123) determines, on the basis of a travel load (Lt) of a vehicle, a rotational speed (
omega) of a motor, and a torque command (Tc), whether or not a switching condition is satisfied after a prescribed time has elapsed. When the switching condition determination unit (123) determines that the switching condition is satisfied, the frequency
control unit (124) reduces the carrier frequency of the motor when the torque command of the motor is equal to or less than the upper
limit value.