The invention relates to a
motor controller and a method. The
motor controller comprises a single-
chip microcomputer circuit, a photoelectric isolation circuit, an amplifying circuit, a switch circuit, a feedback circuit and a brushless motor. The single-
chip microcomputer circuit generates a pwm direct-current
signal, and adjusts the output of the pwm direct-current
signal according to a positionsignal and a steering
signal. The photoelectric isolation circuit is used for carrying out optoelectronic isolation on the pwm direct-current signal. The amplifying circuit is used for amplifying thepwm direct-current signal. The switch circuit is used for carrying out the conduction according to the pwm direct-current signal, and generating a pwm three-phase
square wave signal. The brushless motor generates a circular
magnetic field in the brushless motor according to the pwm three-phase
square wave signal so as to control the operation of the rotor of the brushless motor. The feedback circuit detects the input current of the brushless motor in real time, acquires the position and the steering of the rotor, generates current, position and steering signals and transmits the signals to the single-
chip microcomputer circuit. Compared with the prior art, the safety of the single-chip microcomputer circuit can be effectively ensured. Meanwhile, the anti-interference capability is high, and the circular
magnetic field is synthesized. The direct-
current voltage utilization rate is improved, and the cost is reduced.