A motor controller which eliminates a positioning operation between a
power semiconductor element and a base plate to improve the assembly
process is provided. The motor controller has a power semiconductor
element closely contacted with a heatsink and mounted in a first base
plate, wherein a spacer having an engaging section formed therein as a
hole for the power semiconductor element is interposed between the
heatsink and the base plate, and the power semiconductor element is
positioned in the spacer. Further, the peripheral wall of the hole is
arranged so as to shut off a space between a terminal projecting from the
side of the power semiconductor element and the heatsink.