The invention provides a motor rotor position
harmonic compensation method and
system and
electronic equipment, and the method comprises the steps: obtaining a first sinusoidal
signal and a first cosine
signal of at least two continuous periods through a magnetic
encoder, and carrying out the offset correction and
amplitude correction of the first sinusoidal
signal and the first cosine signal, obtaining a second sinusoidal signal and a second cosine signal; according to the second sinusoidal signal and the second cosine signal of the previous period, calculating a motor position theta by using an arc tangent
algorithm; and according to the motor position theta, calculating a
phase deviation # imgabs0 # by using a trigonometric function, and performing
phase compensation on the second sinusoidal signal and the second cosine signal of the
current period by using the
phase deviation # imgabs1 # to obtain a compensated third sinusoidal signal and a compensated third cosine signal. Through the method, the
phase deviation can be calculated based on the simple trigonometric function,
phase compensation is achieved, the calculation amount is small, cost is low, the method is more suitable for an
embedded system, and due to the small calculation amount, real-time correction can be achieved, and reliability is high.