The application discloses a
motor control method, a controller, a motor, a refrigerator, a medium and a program product. A direct-current
bus voltage and a cross-axis current of a motor are acquired, and a direct-axis
voltage and a cross-axis
voltage are acquired. An initial direct-axis current is generated through
field weakening control according to the direct-axis voltage, the cross-axis voltage and the direct-current
bus voltage. A target frequency disturbance component caused by direct-current
bus voltage fluctuation and a direct-current component used for
field weakening control are separated from the initial direct-axis current. A phase of the target frequency disturbance component is calculated and optimized to obtain a target
alternating current component, with minimization of a
harmonic component of the target frequency in the cross-axis current as an optimization target. A direct-axis
reference current is synthesized according to the target
alternating current component and the direct-current component, and the motor is controlled according to the direct-axis
reference current. In the working condition of the direct-current
bus voltage fluctuation, energy
backflow can be effectively inhibited, current
harmonics can be reduced, torque pulsation can be reduced, and the running stability of the motor can be improved.