Disclosure of Invention
The invention aims to provide a system and a method for detecting the number of pole pairs of a permanent magnet synchronous motor and electronic equipment, and aims to solve the problems that the number of pole pairs of the existing permanent magnet synchronous motor is complex, many steps are needed to be operated manually, and the efficiency of detecting the number of pole pairs of the permanent magnet synchronous motor is reduced.
In a first aspect, the present invention provides a method for detecting the number of pole pairs of a permanent magnet synchronous motor, where the system includes:
the system comprises a motor, an encoder pulse number accumulation module, a pole pair number calculation module, an angle control accumulation module and a motor control module which are sequentially connected in a head-to-tail closed loop manner, and further comprises an open-loop angle setting module connected with the motor control module;
the angle control accumulation module is used for inputting an initial electrical angle and a preset electrical angle increment to the motor control module, and under the condition that the motor is in a rotating state, controlling the electrical angle to accumulate an electrical angle counting value once and reset the electrical angle to the initial electrical angle when the electrical angle is increased to a preset angle threshold value each time based on the preset electrical angle increment;
the motor control module is used for acquiring the d-axis voltage and the q-axis voltage of the motor provided by the open-loop angle setting module, and controlling the motor to be in a corresponding target rotation state based on the d-axis voltage of the motor, the q-axis voltage of the motor, the initial electrical angle and the preset electrical angle increment;
the encoder pulse number accumulation module is used for determining an initial pulse count value and an initial electrical angle accumulation value under the condition that a Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state, and determining a corresponding electrical angle count value and a corresponding target electrical angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value;
the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value.
Under the condition of adopting above-mentioned technical scheme, the PMSM pole pair number detecting system that this application embodiment provided, the system includes: the system comprises a motor, an encoder pulse number accumulation module, a pole pair number calculation module, an angle control accumulation module and a motor control module which are sequentially connected in a head-to-tail closed loop manner, and further comprises an open-loop angle setting module connected with the motor control module; the angle control accumulation module is used for inputting an initial electrical angle and a preset electrical angle increment to the motor control module, and under the condition that the motor is in a rotating state, controlling the electrical angle to accumulate an electrical angle counting value once and reset the electrical angle to the initial electrical angle when the electrical angle is increased to a preset angle threshold value each time based on the preset electrical angle increment; the motor control module is used for acquiring the motor d-axis voltage and the motor q-axis voltage provided by the open-loop angle setting module, and controlling the motor to be in a corresponding target rotation state based on the motor d-axis voltage, the motor q-axis voltage, the initial electrical angle and the preset electrical angle increment; the encoder pulse number accumulation module is used for determining an initial pulse count value and an initial electrical angle accumulation value under the condition that a Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state, and determining a corresponding electrical angle count value and a corresponding target electrical angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value; the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value, the detection of the pole pair number of the permanent magnet synchronous motor can be completed without manual operation, the process is simple and easy to implement, the pole pair number detection efficiency of the permanent magnet synchronous motor is improved, and the integration in a motor control algorithm is facilitated.
In a possible implementation manner, the motor control module includes a current coordinate inverse transformation module, a space vector pulse width modulation algorithm module and a three-phase bridge, where one end of the current coordinate inverse transformation module is connected to the open-loop angle setting module, and the space vector pulse width modulation algorithm module and the three-phase bridge are sequentially connected to the current coordinate inverse transformation module, and the other end of the three-phase bridge is connected to the motor;
the motor control module is configured to obtain a d-axis voltage and a q-axis voltage of the motor provided by the open-loop angle setting module, and control the motor to be in a corresponding target rotation state based on the d-axis voltage of the motor, the q-axis voltage of the motor, the initial electrical angle, and the predetermined electrical angle increment, and includes:
the current coordinate inverse transformation module is used for acquiring a motor d-axis voltage and a motor q-axis voltage provided by the open-loop angle setting module, and performing current coordinate inverse transformation processing on the motor d-axis voltage and the motor q-axis voltage based on the motor d-axis voltage, the motor q-axis voltage, the initial electrical angle and the preset electrical angle increment to obtain a motor d-axis reference voltage and a motor q-axis reference voltage;
the space vector pulse width modulation algorithm module is used for determining the duty ratio of a pulse width modulation wave based on the d-axis reference voltage and the q-axis reference voltage of the motor and controlling the three-phase bridge to be in a corresponding opening state based on the duty ratio;
and the three-phase bridge is used for controlling the motor to be in the corresponding target rotation state under the condition of being in the opening state.
In a possible implementation manner, the encoder pulse number accumulation module is configured to determine an initial pulse count value and an initial electrical angle accumulation value when a Z-phase pulse is detected for the first time in a process that the motor is in the target rotation state, and determine a corresponding electrical angle count value and a corresponding target electrical angle accumulation value when the initial pulse count value is accumulated to a target pulse count threshold, and includes:
the encoder pulse number accumulation module is used for determining the initial pulse count value and determining the corresponding electrical angle as the initial electrical angle accumulated value under the condition that the Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state;
the encoder pulse number accumulation module is further configured to obtain the corresponding electrical angle count value and the corresponding target electrical angle accumulated value when the initial pulse count value is accumulated to the target pulse count threshold value.
In one possible implementation manner, the pole pair number calculation module is configured to determine the pole pair number of the permanent magnet synchronous motor based on the target electrical angle accumulated value, the electrical angle count value, the pulse count threshold value, and the initial electrical angle accumulated value, and includes:
the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value;
(ii) a Wherein, the
Represents a rounding function, said n representing said pulse count threshold; the m represents the electrical angle count value; theta is a value of
1 Representing the initial electrical angle accumulation value; theta is described
2 Representing the target electrical angle accumulated value; and P represents the pole pair number of the permanent magnet synchronous motor.
In a possible implementation manner, the preset angle threshold is 360 degrees.
In a second aspect, the present invention further provides a method for detecting a number of pole pairs of a permanent magnet synchronous motor, which is applied to any one of the systems for detecting a number of pole pairs of a permanent magnet synchronous motor in the first aspect, and the method includes:
the angle control accumulation module inputs an initial electrical angle and a preset electrical angle increment to the motor control module, and when the motor is in a rotating state, the control electrical angle accumulates an electrical angle count value once and resets the electrical angle to the initial electrical angle when the control electrical angle is increased to a preset angle threshold value each time based on the preset electrical angle increment;
the motor control module acquires the d-axis voltage and the q-axis voltage of the motor provided by the open-loop angle setting module, and controls the motor to be in a corresponding target rotation state by the initial electrical angle and the preset electrical angle increment;
the encoder pulse number accumulation module determines an initial pulse count value and an initial electrical angle accumulation value under the condition that the motor is in the target rotation state and detects Z-phase pulses for the first time, and determines a corresponding electrical angle count value and a corresponding target electrical angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value;
the pole pair number calculation module determines the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value.
In a possible implementation manner, the motor control module includes a current coordinate inverse transformation module, a space vector pulse width modulation algorithm module and a three-phase bridge, where one end of the current coordinate inverse transformation module is connected to the open-loop angle setting module, and the space vector pulse width modulation algorithm module and the three-phase bridge are sequentially connected to the current coordinate inverse transformation module, and the other end of the three-phase bridge is connected to the motor;
the motor control module obtains motor d-axis voltage and motor q-axis voltage that the open loop angle set module provided, and initial electrical angle and predetermined electrical angle increment control the motor is in corresponding target rotation state, includes:
the current coordinate inverse transformation module acquires a motor d-axis voltage and a motor q-axis voltage provided by the open-loop angle setting module, the initial electrical angle and the preset electrical angle increment, and performs current coordinate inverse transformation processing on the motor d-axis voltage and the motor q-axis voltage to obtain a motor d-axis reference voltage and a motor q-axis reference voltage;
the space vector pulse width modulation algorithm module determines the duty ratio of a pulse width modulation wave based on the d-axis reference voltage and the q-axis reference voltage of the motor, and controls the three-phase bridge to be in a corresponding opening state based on the duty ratio;
and under the condition that the three-phase bridge is in an opening state, the motor is controlled to be in the corresponding target rotation state.
In a possible implementation manner, the encoder pulse number accumulation module determines an initial pulse count value and an initial electrical angle accumulation value when detecting a Z-phase pulse for the first time in the process that the motor is in the target rotation state, and determines a corresponding electrical angle count value and a corresponding target electrical angle accumulation value when the initial pulse count value is accumulated to a target pulse count threshold value, including:
the encoder pulse number accumulation module determines the initial pulse count value and determines the corresponding electrical angle as the initial electrical angle accumulated value under the condition that the Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state;
and the encoder pulse number accumulation module acquires the corresponding electrical angle count value and the corresponding target electrical angle accumulated value under the condition that the initial pulse count value is accumulated to the target pulse count threshold value.
In one possible implementation, the pole pair number calculation module determines the number of pole pairs of the permanent magnet synchronous motor based on the target electrical angle accumulated value, the electrical angle count value, the pulse count threshold value, and the initial electrical angle accumulated value, and includes:
the pole pair number calculation module determines the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value;
(ii) a Wherein, the
Representing a rounding function, said n representing said pulse count threshold; the m represents the electrical angle count value; theta is a value of
1 Representing the initial electrical angle accumulation value; theta is described
2 Representing the target electrical angle accumulated value; p represents the pole pair number of the permanent magnet synchronous motor。
The beneficial effects of the method for detecting the number of pole pairs of the permanent magnet synchronous motor provided in the second aspect are the same as those of the system for detecting the number of pole pairs of the permanent magnet synchronous motor described in the first aspect or any possible implementation manner of the first aspect, and are not described herein again.
In a third aspect, the present invention also provides an electronic device, including: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the permanent magnet synchronous motor pole pair number detection method described in any possible implementation manner of the second aspect.
The beneficial effect of the electronic device provided by the third aspect is the same as that of the permanent magnet synchronous motor pole pair number detection method described in the second aspect or any possible implementation manner of the second aspect, and details are not repeated here.
Detailed Description
In order to facilitate clear description of technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. For example, the first threshold and the second threshold are only used for distinguishing different thresholds, and the sequence order of the thresholds is not limited. Those skilled in the art will appreciate that the terms "first," "second," and the like do not denote any order or importance, but rather the terms "first," "second," and the like do not denote any order or importance.
It is to be understood that the terms "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion.
In the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b combination, a and c combination, b and c combination, or a, b and c combination, wherein a, b and c can be single or multiple.
Fig. 1 shows a schematic structural diagram of a pole pair number detection system of a permanent magnet synchronous motor according to an embodiment of the present application, and as shown in fig. 1, the pole pair number detection system of the permanent magnet synchronous motor includes:
the system comprises a motor 101, an encoder pulse number accumulation module 102, a pole pair number calculation module 103, an angle control accumulation module 104 and a motor control module 105 which are sequentially connected in a head-to-tail closed loop manner, and further comprises an open-loop angle setting module 106 connected with the motor control module 105;
the angle control accumulation module 104 is configured to input an initial electrical angle θ and a predetermined electrical angle increment to the motor control module 105, and when the motor is in a rotating state, accumulate an electrical angle count value once and reset the electrical angle to the initial electrical angle when a control electrical angle increases to a preset angle threshold each time based on the predetermined electrical angle increment;
the preset angle threshold value is 360 degrees, the angle control accumulation module can set the initial electrical angle required by the switch control to start from 0, the preset electrical angle increment is increased every time, the motor starts to rotate, and when the initial electrical angle is increased to 360 degrees, the electrical angle starts to accumulate from 0.
The motor control module 105 is configured to obtain a motor d-axis voltage Vd and a motor q-axis voltage Vq provided by the open-loop angle setting module 106, and control the motor to be in a corresponding target rotation state based on the motor d-axis voltage Vd, the motor q-axis voltage Vq, the initial electrical angle and the predetermined electrical angle increment;
in the application, specific values of the motor d-axis voltage Vd and the motor q-axis voltage Vq which are required to be fixed for open-loop control are not specifically limited, and can be adjusted according to actual application scenarios.
The encoder pulse number accumulation module 102 is configured to determine an initial pulse count value and an initial electrical angle accumulation value when a Z-phase pulse is detected for the first time in the process that the motor 101 is in the target rotation state, and determine a corresponding electrical angle count value and a corresponding target electrical angle accumulation value when the initial pulse count value is accumulated to a target pulse count threshold value;
the pole pair number calculation module 103 is configured to determine the number of pole pairs of the permanent magnet synchronous motor based on the target electrical angle accumulated value, the electrical angle count value, the pulse count threshold value, and the initial electrical angle accumulated value.
To sum up, the permanent magnet synchronous motor pole pair number detection system that this application embodiment provided, the system includes: the system comprises a motor, an encoder pulse number accumulation module, a pole pair number calculation module, an angle control accumulation module and a motor control module which are sequentially connected in a head-to-tail closed loop manner, and further comprises an open-loop angle setting module connected with the motor control module; the angle control accumulation module is used for inputting an initial electrical angle and a preset electrical angle increment to the motor control module, and under the condition that the motor is in a rotating state, controlling the electrical angle to accumulate an electrical angle counting value once and reset the electrical angle to the initial electrical angle when the electrical angle is increased to a preset angle threshold value each time based on the preset electrical angle increment; the motor control module is used for acquiring the d-axis voltage and the q-axis voltage of the motor provided by the open-loop angle setting module, and controlling the motor to be in a corresponding target rotation state based on the d-axis voltage of the motor, the q-axis voltage of the motor, the initial electrical angle and the preset electrical angle increment; the encoder pulse number accumulation module is used for determining an initial pulse count value and an initial electrical angle accumulation value under the condition that a Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state, and determining a corresponding electrical angle count value and a corresponding target electrical angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value; the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value, the detection of the pole pair number of the permanent magnet synchronous motor can be completed without manual operation, the process is simple and easy to implement, the pole pair number detection efficiency of the permanent magnet synchronous motor is improved, and the integration in a motor control algorithm is facilitated.
Optionally, referring to fig. 1, the motor control module 105 includes an inverse current coordinate transformation (replay) module 1051 having one end connected to the open loop angle setting module 106, and a space vector pulse width modulation algorithm (Svpwm) module 1052 and a three-phase bridge 1053 sequentially connected to the inverse current coordinate transformation module 1051, wherein the other end of the three-phase bridge 1053 is connected to the motor 101;
the motor control module 105 is configured to obtain a d-axis voltage and a q-axis voltage of the motor provided by the open-loop angle setting module 106, and control the motor to be in a corresponding target rotation state based on the d-axis voltage of the motor, the q-axis voltage of the motor, the initial electrical angle, and the predetermined electrical angle increment, including:
the current coordinate inverse transformation module 1051 is configured to obtain a motor d-axis voltage and a motor q-axis voltage provided by the open-loop angle setting module 106, and perform current coordinate inverse transformation processing on the motor d-axis voltage and the motor q-axis voltage based on the motor d-axis voltage, the motor q-axis voltage, the initial electrical angle, and the predetermined electrical angle increment to obtain a motor d-axis reference voltage va and a motor q-axis reference voltage vb.
The space vector pulse width modulation algorithm module 1052 is configured to determine a duty ratio of a pulse width modulation wave based on the d-axis reference voltage and the q-axis reference voltage of the motor, and control the three-phase bridge to be in a corresponding on state based on the duty ratio.
In the application, the d-axis reference voltage and the q-axis reference voltage of the motor can be calculated to obtain the duty ratio of 6 paths of output Pulse Width Modulation (PWM), and the corresponding switch of the three-phase bridge is controlled to be in an open state.
And the three-phase bridge 1053 is used for controlling the motor to be in the corresponding target rotation state under the condition of being in the open state.
Optionally, the encoder pulse number accumulation module is configured to determine the initial pulse count value and determine the corresponding electrical angle as the initial electrical angle accumulated value when a Z-phase pulse is detected for the first time in a process that the motor is in the target rotation state;
in the application, the encoder pulse number accumulation module records the Z-phase pulse number of the photoelectric encoder, and the Z-phase pulse of the photoelectric encoder is generated once per revolution of the encoder.
The encoder pulse number accumulation module is further configured to acquire the corresponding electrical angle count value and the corresponding target electrical angle accumulated value when the initial pulse count value is accumulated to the target pulse count threshold value.
The target pulse counting threshold value is n, the specific numerical value of the target pulse counting threshold value is not specifically limited in the embodiment of the application, and the adjustment can be performed according to the practical application scene, and the target electrical angle accumulated value refers to the electrical angle accumulated value when the Z-phase pulse is detected for the last time, namely the initial pulse counting value accumulated value and the target pulse counting threshold value.
Optionally, the pole pair number calculating module is configured to determine the pole pair number of the permanent magnet synchronous motor based on the target electrical angle accumulated value, the electrical angle count value, the pulse count threshold value, and the initial electrical angle accumulated value, and includes:
the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value;
(ii) a Wherein, the
Represents a rounding function, said n representing said pulse count threshold; the m represents the electrical angle count value; theta is a value of
1 Representing the initial electrical angle accumulation value; theta is described
2 Representing the target electrical angle accumulated value; and P represents the pole pair number of the permanent magnet synchronous motor.
To sum up, the permanent magnet synchronous motor pole pair number detection system that this application embodiment provided, the system includes: the system comprises a motor, an encoder pulse number accumulation module, a pole pair number calculation module, an angle control accumulation module and a motor control module which are sequentially connected in a head-to-tail closed loop manner, and further comprises an open-loop angle setting module connected with the motor control module; the angle control accumulation module is used for inputting an initial electrical angle and a preset electrical angle increment to the motor control module, and under the condition that the motor is in a rotating state, controlling the electrical angle to accumulate an electrical angle counting value once and reset the electrical angle to the initial electrical angle when the electrical angle is increased to a preset angle threshold value each time based on the preset electrical angle increment; the motor control module is used for acquiring the motor d-axis voltage and the motor q-axis voltage provided by the open-loop angle setting module, and controlling the motor to be in a corresponding target rotation state based on the motor d-axis voltage, the motor q-axis voltage, the initial electrical angle and the preset electrical angle increment; the encoder pulse number accumulation module is used for determining an initial pulse count value and an initial electric angle accumulation value under the condition that a Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state, and determining a corresponding electric angle count value and a corresponding target electric angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value; the pole pair number calculation module is used for determining the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value, the detection of the pole pair number of the permanent magnet synchronous motor can be completed without manual operation, the process is simple and easy to implement, the pole pair number detection efficiency of the permanent magnet synchronous motor is improved, and the integration in a motor control algorithm is facilitated.
Fig. 2 shows a schematic flow chart of a method for detecting the number of pole pairs of a permanent magnet synchronous motor provided in an embodiment of the present application, which is applied to the system for detecting the number of pole pairs of a permanent magnet synchronous motor shown in fig. 1, and as shown in fig. 2, the method includes:
step 201: the angle control accumulation module inputs an initial electrical angle and a predetermined electrical angle increment to the motor control module, and controls the electrical angle to accumulate an electrical angle count value once and reset the electrical angle to the initial electrical angle each time a preset angle threshold is increased based on the predetermined electrical angle increment, when the motor is in a rotating state.
Step 202: and the motor control module acquires the d-axis voltage and the q-axis voltage of the motor provided by the open-loop angle setting module, and controls the motor to be in a corresponding target rotation state by the initial electrical angle and the preset electrical angle increment.
The specific implementation process of step 202 may include:
substep S1: the current coordinate inverse transformation module acquires the motor d-axis voltage and the motor q-axis voltage provided by the open-loop angle setting module, the initial electrical angle and the preset electrical angle increment, and performs current coordinate inverse transformation processing on the motor d-axis voltage and the motor q-axis voltage to obtain a motor d-axis reference voltage and a motor q-axis reference voltage;
and a substep S2: the space vector pulse width modulation algorithm module determines the duty ratio of a pulse width modulation wave based on the d-axis reference voltage and the q-axis reference voltage of the motor, and controls the three-phase bridge to be in a corresponding opening state based on the duty ratio;
substep S3: and under the condition that the three-phase bridge is in an opening state, the motor is controlled to be in a corresponding target rotation state.
Step 203: the encoder pulse number accumulation module determines an initial pulse count value and an initial electric angle accumulation value under the condition that the motor is in the target rotation state and detects a Z-phase pulse for the first time, and determines a corresponding electric angle count value and a corresponding target electric angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value.
Optionally, the specific implementation process of step 203 may include:
substep A1: the encoder pulse number accumulation module determines the initial pulse count value under the condition that the motor is in the target rotation state and detects a Z-phase pulse for the first time, and determines the corresponding electrical angle as the initial electrical angle accumulation value;
substep A2: and the encoder pulse number accumulation module acquires the corresponding electrical angle count value and the corresponding target electrical angle accumulated value under the condition that the initial pulse count value is accumulated to the target pulse count threshold value.
Step 204: the pole pair number calculation module determines the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value.
Specifically, the pole pair number calculation module determines the pole pair number of the permanent magnet synchronous motor based on the target electrical angle accumulated value, the electrical angle count value, the pulse count threshold value and the initial electrical angle accumulated value;
(ii) a Wherein, the
Representing a rounding function, said n representing said pulse count threshold; the m represents the electrical angle count value; theta is a value of
1 Representing the initial electrical angle accumulation value; theta is a value of
2 Representing the target electrical angle accumulated value; and P represents the pole pair number of the permanent magnet synchronous motor.
To sum up, in the method for detecting the number of pole pairs of a permanent magnet synchronous motor according to the embodiment of the present application, the angle control accumulation module inputs an initial electrical angle and a predetermined electrical angle increment to the motor control module, and when the motor is in a rotating state, the control electrical angle increments an electrical angle count value once and resets the electrical angle to the initial electrical angle each time when the predetermined electrical angle increment is increased to a preset angle threshold value; the motor control module acquires the d-axis voltage and the q-axis voltage of the motor provided by the open-loop angle setting module, and controls the motor to be in a corresponding target rotation state by the initial electrical angle and the preset electrical angle increment; the encoder pulse number accumulation module determines an initial pulse count value and an initial electric angle accumulation value under the condition that a Z-phase pulse is detected for the first time in the process that the motor is in the target rotation state, and determines a corresponding electric angle count value and a corresponding target electric angle accumulation value under the condition that the initial pulse count value is accumulated to a target pulse count threshold value; the pole pair number calculation module determines the pole pair number of the permanent magnet synchronous motor based on the target electric angle accumulated value, the electric angle counting value, the pulse counting threshold value and the initial electric angle accumulated value. The detection of the number of pole pairs of the permanent magnet synchronous motor can be completed without manual operation, the process is simple, the implementation is easy, the efficiency of detecting the number of pole pairs of the permanent magnet synchronous motor is improved, and the integration in a motor control algorithm is facilitated.
The method for detecting the number of pole pairs of the permanent magnet synchronous motor provided by the invention can realize the method for detecting the number of pole pairs of the permanent magnet synchronous motor shown in fig. 1, and is not repeated here for avoiding repetition.
The present application further provides an electronic device, comprising: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause performance of the permanent magnet synchronous motor pole pair number detection method of fig. 2.
The electronic device in the embodiment of the present invention may be an apparatus, and may also be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiment of the present invention is not particularly limited.
The electronic device in the embodiment of the present invention may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present invention are not limited in particular.
Fig. 3 shows a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 3, the electronic device 300 includes a processor 310.
As shown in fig. 3, the processor 310 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of programs according to the present invention.
As shown in fig. 3, the electronic device 300 may further include a communication line 340. Communication link 340 may include a path to transfer information between the aforementioned components.
Optionally, as shown in fig. 3, the electronic device may further include a communication interface 320. The communication interface 320 may be one or more. The communication interface 320 may use any transceiver or the like for communicating with other devices or communication networks.
Optionally, as shown in fig. 3, the electronic device may further include a memory 330. The memory 330 is used to store computer-executable instructions for performing aspects of the present invention and is controlled for execution by the processor. The processor is used for executing the computer execution instructions stored in the memory, thereby realizing the method provided by the embodiment of the invention.
As shown in fig. 3, memory 330 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disks, laser disks, optical disks, digital versatile disks, blu-ray disks, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 330 may be separate and coupled to the processor 310 via a communication line 340. The memory 330 may also be integrated with the processor 310.
Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in this embodiment of the present invention.
In one implementation, as shown in FIG. 3, processor 310 may include one or more CPUs, such as CPU0 and CPU1 of FIG. 3, for example.
In one embodiment, as shown in fig. 3, a terminal device may include a plurality of processors, such as the processor in fig. 3. Each of these processors may be a single core processor or a multi-core processor.
Fig. 4 is a schematic structural diagram of a chip according to an embodiment of the present invention. As shown in fig. 4, the chip 400 includes one or more than two (including two) processors 310.
Optionally, as shown in fig. 4, the chip further includes a communication interface 320 and a memory 330, and the memory 330 may include a read-only memory and a random access memory and provide operating instructions and data to the processor. The portion of memory may also include non-volatile random access memory (NVRAM).
In some embodiments, as shown in FIG. 4, memory 330 stores elements, execution modules, or data structures, or a subset thereof, or an expanded set thereof.
In the embodiment of the present invention, as shown in fig. 4, by calling an operation instruction stored in the memory (the operation instruction may be stored in the operating system), a corresponding operation is performed.
As shown in fig. 4, the processor 310 controls the processing operation of any one of the terminal devices, and the processor 310 may also be referred to as a Central Processing Unit (CPU).
As shown in fig. 4, memory 330 may include both read-only memory and random access memory and provides instructions and data to the processor. A portion of the memory 330 may also include NVRAM. For example, in applications where the memory, communication interface, and memory are coupled together by a bus system that may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus. For clarity of illustration, however, the various buses are designated as bus system 410 in FIG. 4.
As shown in fig. 4, the method disclosed in the above embodiments of the present invention may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor may be a general purpose processor, a Digital Signal Processor (DSP), an ASIC, an FPGA (field-programmable gate array) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
In one aspect, a computer-readable storage medium is provided, in which instructions are stored, and when the instructions are executed, the functions performed by the terminal device in the foregoing embodiments are implemented.
In one aspect, a chip is provided, where the chip is applied in a terminal device, and the chip includes at least one processor and a communication interface, where the communication interface is coupled with the at least one processor, and the processor is configured to execute instructions to implement the functions performed by the pole pair number detection method of the permanent magnet synchronous motor in the foregoing embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are performed in whole or in part. The computer may be a general purpose computer, special purpose computer, computer network, terminal, user equipment, or other programmable device. The computer program or instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The usable medium may be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape; or an optical medium, such as a Digital Video Disc (DVD); it may also be a semiconductor medium, such as a Solid State Drive (SSD).
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.