CN117652092A - Motor control system, method for controlling motor and electric device - Google Patents

Motor control system, method for controlling motor and electric device Download PDF

Info

Publication number
CN117652092A
CN117652092A CN202180033505.6A CN202180033505A CN117652092A CN 117652092 A CN117652092 A CN 117652092A CN 202180033505 A CN202180033505 A CN 202180033505A CN 117652092 A CN117652092 A CN 117652092A
Authority
CN
China
Prior art keywords
interrupt
phase
motor
stator winding
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202180033505.6A
Other languages
Chinese (zh)
Inventor
金绍勋
王钊
肖志锋
卢彦融
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN117652092A publication Critical patent/CN117652092A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/22Current control, e.g. using a current control loop
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P6/00Arrangements for controlling synchronous motors or other dynamo-electric motors using electronic commutation dependent on the rotor position; Electronic commutators therefor
    • H02P6/08Arrangements for controlling the speed or torque of a single motor

Abstract

The application provides a motor control system, a method for controlling a motor and electric equipment. Under the condition that the multiphase motor needs to be driven, the controller responds to the target interrupt and executes an interrupt service function corresponding to the target interrupt, and the controller is specifically used for: collecting reference currents and phase currents of multiphase stator windings in the multiphase motor in real time; a pulse modulated signal of the multi-phase stator winding is generated based on the reference current and the phase current of the multi-phase stator winding. Further, the controller may output a pulse modulation signal to the motor driving circuit, and the motor driving circuit may drive the multiphase motor to operate based on the pulse modulation signal. Based on the method and the device, the purpose of collecting current in real time and generating pulse modulation signals can be achieved by executing the interrupt service function, and the instantaneity and the accuracy of current sampling are ensured, so that the real-time stability of motor control is improved.

Description

Motor control system, method for controlling motor and electric device Technical Field
The present disclosure relates to the field of power electronics, and in particular, to a motor control system, a method for controlling a motor, and an electric device.
Background
The steering system is used for controlling the change, maintenance or restoration of the direction of the vehicle, and can also transmit road surface conditions to a driver or an automatic driving data processing center, so that the driver can drive safely.
At present, the steering system can adopt a full redundancy design, the structural schematic diagram of the steering system can be shown as fig. 1, the steering system can comprise an A system and a B system, wherein the B system is used for sending a motor control instruction to the A system, and the A system is used for controlling the motor to work based on the motor control instruction when receiving the motor control instruction. The system B is also used for carrying out data interaction with the system A, so that the working state and the working mode of the system A and the information data required by controlling the motor are detected, and when the working state of the system A is detected to be abnormal, the motor is controlled to work normally based on the information data required by controlling the motor. However, when the working state of the B system is abnormal, the B system outputs an abnormal motor control command to the a system, and at this time, the a system controls the motor to work based on the abnormal motor control command, which causes the motor to shake, and thus causes poor real-time stability of motor control.
Disclosure of Invention
The motor control system, the motor control method and the electric equipment can execute an interrupt service function to achieve the purposes of collecting current in real time and generating pulse modulation signals, so that the instantaneity and the accuracy of current sampling are ensured, and the real-time stability of motor control is further improved.
In a first aspect, the present application provides a motor control system comprising a controller and a motor drive circuit, wherein the controller is connectable to a multi-phase motor comprising multi-phase stator windings via the motor drive circuit. In the case where it is desired to drive the multiphase motor, the controller may be configured to respond to a target interrupt and execute an interrupt service function corresponding to the target interrupt. The controller executing the interrupt service function corresponding to the target interrupt comprises the following steps: collecting reference currents (also called zero currents) and phase currents of the multiphase stator windings in real time; a pulse modulated signal of the multi-phase stator winding is generated based on the reference current and the phase current of the multi-phase stator winding. The target interrupt is a hardware interrupt, and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function corresponding to the target interrupt. In other words, the target interrupt has the highest interrupt priority, that is, the target interrupt is not interrupted by other interrupts, thereby ensuring punctuality in executing the interrupt service function. The controller is further configured to output the pulse modulated signal to the motor drive circuit after generating the pulse modulated signal of the multiphase stator winding, at which time the motor drive circuit is configured to drive the multiphase motor to operate based on the pulse modulated signal input by the controller.
In the application, as the target interrupt is a hardware interrupt and has the highest interrupt priority, the exclusivity of the interrupt service function is ensured not to be nested by other interrupts, so that the punctuality of executing the interrupt service function is ensured, and the whole process of executing the interrupt service function is not limited by time and space resources of a controller; in the steps of executing the interrupt service function, the purposes of collecting the reference current and the phase current in real time and generating the pulse modulation signal can be achieved, so that the real-time performance and accuracy of current sampling are ensured, the real-time stability of motor control is further improved, and the applicability is strong.
With reference to the first aspect, in a first possible implementation manner, the controller includes a control unit and a plurality of first counters, where count start times of the plurality of first counters are the same, that is, the plurality of first counters start counting at the same time; the number of the plurality of first counters is the same as the number of stator windings in the multi-phase motor. The plurality of first counters can be used for triggering the target interrupt, so that the control unit can be ensured to respond to the target interrupt in time, and the applicability is higher.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, since a duration of a first counting period of the plurality of first counters is equal to a duration of an interrupt period of the target interrupt, the target interrupt is triggered when the count duration of the plurality of first counters reaches the duration of the first counting period at the same time. The first counting period is understood to mean the counting period of each of the plurality of first counters, i.e. the duration of the counting periods of the plurality of first counters is identical. In the process of triggering the target interrupt, since the counting start time of the plurality of first counters is the same and the duration of the counting period of the plurality of first counters is the same, the plurality of first counters can be ensured to trigger the target interrupt at the same time, so that the problem of time delay caused by the fact that the target interrupt cannot be triggered at the same time is avoided, the instantaneity and the punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, and the applicability is higher.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner, since a duration of a first counting period of the plurality of first counters is equal to a duration of an interrupt period of the target interrupt, when a number of times that the count duration of the plurality of first counters reaches the duration of the first counting period simultaneously is greater than or equal to a preset number of times threshold, the target interrupt is triggered. The first counting period is understood to mean the counting period of each of the plurality of first counters, i.e. the duration of the counting periods of the plurality of first counters is identical. In the process of triggering the target interrupt, the direct triggering of the target interrupt can be avoided by setting the preset time threshold, so that the time of triggering the target interrupt is greatly reduced, the instantaneity and punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, the motor control efficiency is higher, and the applicability is stronger.
With reference to the second possible implementation manner of the first aspect or the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the controller further includes an analog-to-digital converter and a second counter, where the second counter is coupled to the plurality of first counters, and a count start time of the second counter is the same as a count start time of the plurality of first counters to keep synchronization of the time axis, that is, the second counter and the plurality of first counters start counting simultaneously. After the first counters trigger the target interrupt, the control unit may be configured to respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt, where the control unit includes the following steps: after the counting time length of the first second counter reaches the time length of the second counting period and the preset time length is passed, the analog-to-digital converter can acquire the reference current of the multiphase stator winding in real time, so that the real-time property and accuracy of reference current sampling are ensured; after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, the analog-to-digital converter can acquire the phase currents of the multi-phase stator winding in real time, so that the instantaneity and the accuracy of phase current sampling are ensured. The second counting period may be understood as a counting period of the second counter, and a duration of the second counting period needs to be set to be half of a duration of the first counting period, where the preset duration may be a duration set by a user or a duration configured by the control unit. In the steps included in the interrupt service function executed by the control unit, when the counting duration of the second counter meets a certain condition, the analog-to-digital converter is triggered to collect the reference current and the phase current of the multiphase stator winding in real time, and the whole current sampling process is not interrupted by any other interrupt, so that the real-time performance and accuracy of current sampling are ensured, and the applicability is stronger.
With reference to any one of the first aspect to the fourth possible implementation manners of the first aspect, in a fifth possible implementation manner, the executing, by the controller, an interrupt service function corresponding to the target interrupt, further includes the following steps: and obtaining comparison current values of the multiphase stator windings based on the reference current and the phase current of the multiphase stator windings, and rising the comparison current values of the multiphase stator windings into pulse modulation signals of the multiphase stator windings based on the comparison current values of the multiphase stator windings so as to complete the calculation process of a motor control algorithm. In the steps included in the execution of the interrupt service function by the control unit, the calculation process of the motor control algorithm is not interrupted by other interrupts, so that the high efficiency, the monopolization and the instantaneity of the motor control algorithm can be ensured, the running stability of the multiphase motor is ensured, and the applicability is higher.
In a second aspect, the present application provides a method of controlling an electric machine in which a controller is responsive to a target interrupt and performs an interrupt service function corresponding to the target interrupt to achieve the objective of acquiring reference currents and phase currents of a multi-phase stator winding in a multi-phase electric machine in real time and generating a pulse modulated signal of the multi-phase stator winding based on the reference currents and phase currents of the multi-phase stator winding. The target interrupt is a hardware interrupt, and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function corresponding to the target interrupt. In other words, the target interrupt has the highest interrupt priority, that is, the target interrupt is not interrupted by other interrupts, thereby ensuring punctuality in executing the interrupt service function. After generating the pulse modulation signal of the multi-phase stator winding, the controller may output the pulse modulation signal to the motor driving circuit, and drive the multi-phase motor to operate based on the pulse modulation signal through the motor driving circuit. In the application, as the target interrupt is a hardware interrupt and has the highest interrupt priority, the exclusivity of the interrupt service function is ensured not to be nested by other interrupts, so that the punctuality of executing the interrupt service function is ensured, and the whole process of executing the interrupt service function is not limited by time and space resources of a controller; in the steps of executing the interrupt service function, the purposes of collecting the reference current and the phase current in real time and generating the pulse modulation signal can be achieved, so that the real-time performance and accuracy of current sampling are ensured, the real-time stability of motor control is further improved, and the applicability is strong.
With reference to the second aspect, in a first possible implementation manner, before the controller responds to the target interrupt, the controller triggers the target interrupt when the count durations of the plurality of first counters reach the duration of the first count period, that is, the plurality of first counters may be used to trigger the target interrupt. The first counting period is understood as a counting period of each second counter of the plurality of first counters, that is to say, the duration of the counting period of the plurality of first counters is the same, and the duration of the first counting period is equal to the duration of the interrupt period of the target interrupt; the first counters start to count at the same time, that is, the first counters start to count at the same time; the number of the first counters is the same as the number of the stator windings in the multiphase motor; the plurality of first counters may be disposed within the controller. In the process of triggering the target interrupt, since the counting start time of the plurality of first counters is the same and the duration of the counting period of the plurality of first counters is the same, the plurality of first counters can be ensured to trigger the target interrupt at the same time, so that the problem of time delay caused when the target interrupt cannot be triggered at the same time is avoided, the instantaneity and the punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, and the applicability is stronger.
With reference to the second aspect, in a second possible implementation manner, before the controller responds to the target interrupt, the controller triggers the target interrupt when the number of times that the count durations of the plurality of first counters reach the duration of the first count period is greater than or equal to a preset number of times threshold, that is, the plurality of first counters may be used to trigger the target interrupt. The first counting period is understood as a counting period of each second counter of the plurality of first counters, that is to say, the duration of the counting period of the plurality of first counters is the same, and the duration of the first counting period is equal to the duration of the interrupt period of the target interrupt; the first counters start to count at the same time, that is, the first counters start to count at the same time; the number of the first counters is the same as the number of the stator windings in the multiphase motor; the plurality of first counters may be disposed within the controller. In the process of triggering the target interrupt, the direct triggering of the target interrupt can be avoided by setting the preset time threshold, so that the time of triggering the target interrupt is greatly reduced, the instantaneity and punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, the motor control efficiency is higher, and the applicability is stronger.
With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a third possible implementation manner, after the triggering of the target interrupt by the plurality of first counters, the controller may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt, and specifically includes the following steps: after the counting time length of the first second counter reaches the time length of the second counting period and the preset time length is passed, the reference current of the multiphase stator winding is acquired in real time through the analog-to-digital converter, so that the real-time property and accuracy of reference current sampling are ensured; after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, the phase current of the multiphase stator winding is collected in real time through the analog-to-digital converter, so that the instantaneity and the accuracy of phase current sampling are ensured. Wherein the count start time of the second counter is the same as the count start time of the plurality of first counters, that is, the second counter and the plurality of first counters start counting at the same time to keep synchronization of the time axis; the second counting period may be understood as a counting period of the second counter, and a duration of the second counting period needs to be set to be half of a duration of the first counting period, where the preset duration may be a duration set by a user or a duration configured by the controller; the analog-to-digital converter and the second counter may be disposed within the controller, and the second counter is coupled to the plurality of first counters. In the steps specifically included in the interrupt service function executed by the controller, when the counting duration of the second counter meets a certain condition, the analog-to-digital converter is triggered to collect the reference current and the phase current of the multiphase stator winding in real time, and the whole current sampling process is not interrupted by any other interrupt, so that the real-time performance and the accuracy of the current sampling are ensured, and the applicability is stronger.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the controller executes an interrupt service function corresponding to the target interrupt, and specifically further includes the following steps: and obtaining a comparison current value of the multiphase stator winding based on the reference current and the phase current of the multiphase stator winding, and generating a pulse modulation signal of the multiphase stator winding based on the comparison current value of the multiphase stator winding so as to complete the calculation process of the motor control algorithm. In the steps included in the interrupt service function executed by the controller, the calculation process of the motor control algorithm is not interrupted by other interrupts, so that the high efficiency, the monopolization and the instantaneity of the motor control algorithm can be ensured, the running stability of the multiphase motor is ensured, and the applicability is higher.
In a third aspect, the present application provides an electrically powered device comprising a multiphase motor and a motor control system as provided in any one of the fifth possible embodiments of the first aspect to the first aspect described above. The electric devices herein may include, but are not limited to, electric automobiles, ventilation devices, punching devices, crystal devices, water pumps, and various machine tools. In this application, motor control system can promote multiphase motor control's real-time stability when driving multiphase motor work, has further improved electric equipment's work efficiency, and the suitability is strong.
In the application, the target interrupt has the highest interrupt priority and adopts the hardware interrupt, so that the whole process of executing the interrupt service function corresponding to the target interrupt is not limited by time and space resources of the controller, the exclusivity of the interrupt service function can be ensured not to be embedded by other interrupts, and the punctuality of executing the interrupt service function is ensured; in the steps of executing the interrupt service function, the purposes of collecting the reference current and the phase current of the multiphase stator winding in real time and generating the pulse modulation signal can be achieved, the real-time performance and the accuracy of current sampling are ensured, and therefore the real-time stability of motor control is improved, and the applicability is strong.
Drawings
FIG. 1 is a schematic structural view of a steering system;
fig. 2 is a schematic diagram of an application scenario of the motor control system provided in the present application;
FIG. 3 is a schematic diagram of a motor control system according to the present disclosure;
FIG. 4 is another schematic diagram of a motor control system provided herein;
FIG. 5 is a schematic diagram of a control timing of the first counter and the second counter provided in the present application;
FIG. 6 is another control timing diagram of the first counter and the second counter provided herein;
FIG. 7 is a schematic diagram of control logic of the controller provided herein;
FIG. 8 is a flow chart of a method of controlling a motor provided herein;
FIG. 9 is a flow chart illustrating the execution of the interrupt service function provided herein.
Detailed Description
The motor control system that this application provided is applicable to metallurgical field, electric power field, petrochemical field, coal field, mine field, building materials field, papermaking field, municipal administration field, water conservancy field, shipbuilding field, a plurality of application fields such as harbour loading and unloading field. The motor control system provided by the application is suitable for electric equipment, can be used for driving a multiphase motor to enable the electric equipment to work, can include, but not limited to, electric automobiles, electric amusement equipment, electric trains, electric bicycles, golf carts, ventilation equipment, stamping equipment, crystal equipment, water pumps and various machine tools, and can be specifically determined according to practical application scenes, and is not limited herein.
The motor control system provided by the application can be suitable for application scenes of different electric devices, such as an electric automobile application scene, an electric recreation device application scene and the like, and the application scene of the electric automobile is taken as an example for illustration. Referring to fig. 2, fig. 2 is a schematic application scenario diagram of the motor control system provided in the present application. As shown in fig. 2, the electric vehicle includes a motor control system that may include, but is not limited to, a steering system, a braking system, and a thermal management system in the electric vehicle, and a three-phase motor. The motor control system comprises a controller and a motor driving circuit connected with the controller, wherein the motor driving circuit can be connected with a three-phase motor (namely an alternating current motor driven by three-phase alternating current). In the driving process of the electric automobile, the controller can generate pulse modulation signals of the three-phase stator windings based on reference currents and phase currents of the three-phase stator windings in the three-phase motor and output the pulse modulation signals to the motor driving circuit. At this time, the motor driving circuit may drive the three-phase motor to operate based on the pulse modulation signal to make the electric vehicle travel. However, when the motor control system is in an environment with severe disturbance, the controller cannot collect the reference current of the three-phase stator winding, and the priority of current (reference current and phase current) sampling is not high, which may result in poor real-time stability of motor control.
In order to improve the real-time stability of motor control, the controller can respond to target interruption and execute an interruption service function corresponding to the target interruption, and is used for achieving the purposes of collecting the reference current and the phase current of the three-phase stator winding in real time and generating pulse modulation signals of the three-phase stator winding based on the reference current and the phase current of the three-phase stator winding. It can be understood that, because the target interrupt is a hardware interrupt and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function, the target interrupt is not interrupted by other interrupts and tasks, and the punctuality of executing the interrupt service function is ensured, thereby ensuring the real-time and accuracy of current (such as reference current and phase current) sampling and further generating a more accurate pulse modulation signal. Further, the controller can output more accurate pulse modulation signals to the motor driving circuit, at this time, the motor driving circuit can drive the three-phase motor to work based on more accurate pulse modulation signals so as to enable the electric automobile to run, thereby improving the real-time stability and smoothness of motor control, further improving the working efficiency of the electric automobile, and improving the comfort and safety of drivers, and the applicability is stronger.
The motor control system and the operation principle thereof provided in the present application will be exemplified with reference to fig. 3 to 7.
Referring to fig. 3, fig. 3 is a schematic structural diagram of the motor control system provided in the present application. As shown in fig. 3, the motor control system 1 includes a controller 10 and a motor driving circuit 11, wherein the controller 10 can be connected to a multi-phase motor (motor) including multi-phase stator windings therein through the motor driving circuit 11. The controller 10 may also be referred to as a microcontroller (micro control unit, MCU), the motor driving circuit 11 may also be referred to as a motor control pre-driver (pre-driver), and the motor driving circuit 11 may be integrated on a chip to obtain a motor pre-driving chip. The multi-phase motor herein may include, but is not limited to, a three-phase motor and a six-phase motor, and the specific type of the multi-phase motor may be determined according to the actual application scenario, without limitation. For example, in the case where the multi-phase motor is a three-phase motor, the multi-phase stator winding may be a three-phase stator winding, and a phase difference between each phase of the three-phase stator winding may be 120 °; in the case of a symmetrical six-phase motor, the multi-phase stator windings may be six-phase stator windings, the phase difference between the phases of which may be 60 °.
In some possible embodiments, the controller 10 may respond to a target interrupt and execute an interrupt service function corresponding to the target interrupt in the event that it is desired to drive the multiphase motor. Wherein the target interrupt may be a hardware interrupt, which may also be referred to as a hard real-time interrupt, which refers to an interrupt that has a rigid and unchangeable time limit and does not allow any errors beyond the time limit to occur. The interrupt herein refers to a process in which the controller 10 temporarily suspends the execution of a currently running program due to an internal event or an external event (e.g., a target interrupt) during the normal running of the program, shifts to the execution of a program corresponding to the internal event or the external event (e.g., an interrupt service function), and returns to the program that was suspended after the execution of the program corresponding to the internal event or the external event. The target interrupt has an interrupt priority higher than that of other interrupts received by the controller 10 during execution of the interrupt service function, that is, the target interrupt is not interrupted by other interrupts and tasks (i.e., the target interrupt has the highest interrupt priority), thereby ensuring punctuality of executing the interrupt service function. An interrupt service function, which may also be referred to as an interrupt service routine, is understood herein to be a program code written in advance.
Wherein, the controller 10 executes the interrupt service function corresponding to the target interrupt, which may include the following steps: collecting the reference current and the phase current of the multiphase stator winding in real time; a pulse modulated signal of the multi-phase stator winding is generated based on the reference current and the phase current of the multi-phase stator winding. Since driving the multiphase motor does not require a duty cycle of the pulse modulated signal of 1, the interval duration between the acquisition time of the reference current of the multiphase stator winding and the acquisition time of the phase current of the multiphase stator winding is the same as half the duration of the interruption period of the target interruption. Further, after generating the pulse modulation signal of the multiphase stator winding, the controller 10 may output the pulse modulation signal of the multiphase stator winding to the motor driving circuit 11, wherein the pulse modulation signal may also be referred to as a pulse width modulation signal or simply referred to as a PWM signal, and the pulse modulation signal may be understood as a signal corresponding to a motor control command for driving the multiphase motor to operate. At this time, the motor driving circuit 11 may generate control currents of the multi-phase stator windings based on the pulse modulation signals of the multi-phase stator windings, and drive the multi-phase motor to operate based on the control currents of the multi-phase stator windings.
It can be appreciated that, since the above-mentioned target interrupt has the highest interrupt priority and adopts the hardware interrupt, the exclusivity of the interrupt service function is ensured not to be nested by other interrupts, so that the punctuality of executing the interrupt service function is ensured, and the whole process of executing the interrupt service function corresponding to the target interrupt is not limited by the time and space resources of the controller 10; meanwhile, the controller 10 does not need to schedule pure hardware behaviors to execute the interrupt service function corresponding to the target interrupt, so that the resource overhead of software time and space is reduced, the cost is lower, and the applicability is higher. In addition, in the steps included in the interrupt service function executed by the controller 10, the purposes of collecting the reference current and the phase current of the multiphase stator winding in real time and generating the pulse modulation signal of the multiphase stator winding can be achieved, the real-time performance and the accuracy of current sampling are ensured, and more accurate pulse modulation signals are generated to drive the multiphase motor to work, so that the real-time stability of motor control is improved, and the applicability is strong.
In some possible embodiments, please refer to fig. 4, fig. 4 is another schematic structural diagram of the motor control system provided in the present application. As shown in fig. 4, the controller 10 shown in fig. 3 includes a control unit 100 and a plurality of first counters (e.g., first counter 102a to first counter 102 n), where each of the first counter 102a to first counter 102n is a high-precision counter. The present application may refer to one or more functional modules of the controller 10 having a function of responding to a target interrupt and executing an interrupt service function collectively as a control unit 100, where the control unit 100 may be a virtual functional module, a control chip, or a control board. Wherein the count start times of the first counter 102a to the first counter 102n are the same, that is, the first counter 102a to the first counter 102n start counting at the same time; the number of first counters 102a to 102n is the same as the number of stator windings in the above-described multiphase motor. For example, in the case where the multi-phase motor is a three-phase motor including three stator windings, the number of the first counters 102a to 102n may be 3. That is, in the case where the multi-phase motor is a three-phase motor, three first counters are included in the controller 10. In the case where the multi-phase motor is a six-phase motor including six stator windings, the number of the first counters 102a to 102n is 6. That is, in the case where the multi-phase motor is a six-phase motor, six first counters are included in the controller 10 described above.
In some possible embodiments, the first counter 102a to the first counter 102n may be used to trigger the target interrupt. Specifically, when the count periods of the first counter 102a to the first counter 102n reach the period of the first count period, the target interrupt is triggered. The first counting period may be understood as a counting period (period) of each of the first counter 102a to the first counter 102n, that is, a duration of the counting period of the first counter 102a to the first counter 102n is the same, and the duration of the first counting period is equal to a duration of an interrupt period of the target interrupt. In the process of triggering the target interrupt, since the count starting times of the first counter 102a to the first counter 102n are the same and the count periods of the first counter 102a to the first counter 102n are the same, the first counter 102a to the first counter 102n can be ensured to trigger the target interrupt simultaneously, so that the problem of time delay caused when the target interrupt cannot be triggered simultaneously is avoided, and further, the punctuality of the control unit 100 responding to the target interrupt and executing the interrupt service function is ensured, and the applicability is stronger.
Optionally, in some possible embodiments, the target interrupt may be triggered when the number of times that the count durations of the first counter 102a to the first counter 102n reach the duration of the first count period is greater than or equal to a preset number of times threshold. It should be noted that, since the time period from the first counter 102a to the first counter 102n reaches the first count period at the same time and then is cleared, the number of times that the time period from the first counter 102a to the first counter 102n reaches the first count period is greater than or equal to the preset number of times threshold. In contrast, when the number of times that the count periods of the first counter 102a to the first counter 102n reach the period of the first count period is smaller than the preset number of times threshold, the interrupt is triggered but the interrupt is not the target interrupt, that is, the target interrupt is not triggered at this time. The first counting period may be understood as a counting period (period) of each of the first counter 102a to the first counter 102n, that is, a duration of the counting period of the first counter 102a to the first counter 102n is the same, and the duration of the first counting period is equal to a duration of an interrupt period of the target interrupt; the preset number of times threshold may be a threshold set by a user or a threshold configured by a system. In the process of triggering the target interrupt, the direct triggering of the target interrupt can be avoided by setting the preset time threshold, so that the time of triggering the target interrupt is greatly reduced, the instantaneity and punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, the motor control efficiency is higher, and the applicability is stronger.
In some possible embodiments, as shown in fig. 4, the controller 10 shown in fig. 3 further includes an analog-to-digital converter 101 and a second counter (such as a second counter 103), where the second counter 103 is coupled to the first counter 102a to the first counter 102n, and the second counter 103 is a high-precision counter. The analog-to-digital converter (analog to digital converter, which may be abbreviated as ADC) herein may also be referred to as an AD converter, an analog-to-digital converter (i.e., a/D converter). It will be appreciated that since the first to second counters 102a to 102n and 103 are different types of clocks, the second counter 103 needs to be coupled to the first to first counters 102a to 102n, that is, the first to first and second counters 102a to 102n and 103 need to maintain consistency in time steps by period matching (period-match) which may indicate that the second and first counters 103 and 102a to 102n maintain synchronization of time axes. In other words, the second counter 103 and the first to first counters 102a to 102n need to start counting at the same time, i.e., the count start time of the second counter 103 is the same as the count start time of the first to first counters 102a to 102 n. The first to the first counter 102a to 102n and the second counter 103 may constitute an acquisition comparison module (capture compare cnit, CCU) that may be used to trigger target interrupts and current (i.e., reference current and phase current of the multi-phase stator winding) sampling, thereby improving the punctuality of triggering target interrupts and current sampling.
In some possible embodiments, after the first counter 102a to the first counter 102n trigger the target interrupt, the control unit 100 may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt. The control unit 100 executing the interrupt service function corresponding to the target interrupt specifically includes the following steps: step 1, after the counting time length of the first second counter 103 reaches the time length of the second counting period and the preset time length elapses, the analog-to-digital converter 101 can collect the reference current of the multiphase stator winding, so that the real-time performance and accuracy of reference current sampling are ensured; step 2, after the count duration of the second counter 103 reaches the duration of the second count period and the preset duration passes, the analog-to-digital converter 101 can collect the phase currents of the multiphase stator winding, so that the real-time performance and accuracy of phase current sampling are ensured; and 3, obtaining a comparison current value (comparison value) of the multi-phase stator winding based on the reference current and the phase current of the multi-phase stator winding, and generating a pulse modulation signal of the multi-phase stator winding based on the comparison current value of the multi-phase stator winding so as to complete the calculation process of a motor control algorithm. In the above steps 1 and 2, since the zero clearing is performed each time the count duration of the second counter 103 reaches the duration of the second count period, there is a duration of the second count period reached by the second counter 103 after the count duration of the first second counter 103 reaches the duration of the second count period. The second counting period may be understood as a counting period of the second counter 103, and a duration of the second counting period needs to be set to half a duration of the first counting period, and the preset duration may be a duration set by a user or a duration configured by the control unit 100.
In the step 1 and the step 2, when the counting time length of the second counter 103 meets a certain condition, the analog-to-digital converter 101 is triggered to collect the reference current and the phase current of the multiphase stator winding in real time, and the whole current sampling process is not interrupted by any other interrupt or task, so that the real-time performance and the accuracy of the current sampling are ensured; in the step 3, since the calculation process of the motor control algorithm is not interrupted by tasks in other interrupts, the high efficiency, the monopolization and the real-time performance of the motor control algorithm can be ensured, thereby ensuring the running stability of the multiphase motor and having stronger applicability. Further, the control unit 100 can output the pulse modulation signal of the multiphase stator winding to the motor driving circuit 11 to drive the multiphase motor to work, so that the real-time stability and smoothness of motor control are improved, and the applicability is stronger.
In some possible embodiments, the control timings of the first counter 102a to the first counter 102n and the second counter 103 are shown in fig. 5, and fig. 5 is a schematic diagram of the control timings of the first counter and the second counter provided in the present application. In the process of triggering the target interrupt, the counting frequency (may be denoted as f 12) of the first counter 102a to the first counter 102n, the duration of the first counting period (may be denoted as t1, such as 62.5 μs or other values), and the timing chart corresponding to the Count values (may be denoted as Count 12) of the first counter 102a to the first counter 102n may be shown as 5a in fig. 5, where the Count values Count12 of the first counter 102a to the first counter 102n reach the period number (may be denoted as period 1) when the Count duration of the first counter 102a to the first counter 102n reaches t 1. In the process of the control unit 100 responding to the target interrupt and executing the interrupt service function, the duration of the second counting period of the second counter 103 (may be denoted as t2, such as 31.25 μs or other values), and the timing chart corresponding to the Count value of the second counter 103 (may be denoted as Count 13) may be shown as 5b in fig. 5, when the Count duration of the second counter 103 reaches t2, the Count value Count13 of the second counter 103 reaches a period number (may be denoted as period 2), and the preset duration configured by the second counter 103 may be denoted as t3 (such as 0.4 μs or other values).
In some possible embodiments, in the case where the motor control system 1 is a steering system in an electric vehicle, it is also necessary to acquire the motor steering angle of the multiphase motor to change the direction in which the electric vehicle is driven. The first counter 102a to the first counter 102n trigger the target interrupt when the count duration reaches the duration t1, and at this time, the control unit 100 may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt. Wherein, the control unit 100 executing the interrupt service function corresponding to the target interrupt may include the following steps: after the counting time period of the first second counter 103 reaches the time period t2 and the preset time period t3 elapses (the time corresponding to the point a shown by 5b in fig. 5 above), the analog-to-digital converter 101 will collect the reference current of the multiphase stator winding in real time, and the control unit 100 will collect the motor steering angle of the multiphase motor; after the count duration of the second counter 103 reaches the duration t2 and the preset duration t3 elapses (the time corresponding to the point B shown as 5B in fig. 5 above), the analog-to-digital converter 101 will collect the phase currents of the multiphase stator winding in real time; the reference current and the phase current of the multiphase stator winding are calculated by the motor control algorithm to obtain a comparison current value of the multiphase stator winding, and the comparison current values of the multiphase stator winding are compared by the first counter 102a to the first counter 102n to generate a pulse modulation signal (such as an external output inversion signal) of the multiphase stator winding, so as to complete the calculation process of the motor control algorithm.
In the steps included in the interrupt service function executed by the control unit, the acquisition process of the reference current and the phase current of the multiphase stator winding is not interrupted by any other interrupt or task, so that the real-time performance and the accuracy of current sampling can be realized; because the calculation process of the motor control algorithm is not interrupted by tasks in other interruptions, the high efficiency, the monopolization and the instantaneity of the motor control algorithm can be ensured, and the running stability of the multiphase motor is ensured; at this time, under the condition of abnormal operation of the system, the beat matching of the current sampling and motor control algorithm can be ensured, the anti-interference capability is stronger, and the running stability of the multiphase motor is further improved. Further, the control unit 100 may output the pulse modulation signal of the multi-phase stator winding and the motor steering angle of the multi-phase motor to the motor driving circuit 11. At this time, the motor driving circuit 11 can drive the motor to work based on the pulse modulation signals of the multiphase stator windings, and control the multiphase motor based on the motor steering angle so as to change the driving direction of the electric automobile, and meanwhile, the real-time stability and smoothness of motor control are improved, and the applicability is stronger.
In some possible embodiments, the control timings of the first counter 102a to the first counter 102n and the second counter 103 may also be referred to fig. 6, and fig. 6 is another schematic control timing diagram of the first counter and the second counter provided in the present application during the whole process of driving the multiphase motor to operate. The timing charts corresponding to the Count values (which may be denoted as Count 12) of the first counter 102a to the first counter 102n and the Count value (which may be denoted as Count 13) of the second counter 103 may be shown in fig. 6 in a motor driving period (which may also be referred to as a motor control period), where the motor control period refers to a complete period for driving the multiphase motor, and for example, the duration of the motor control period may be 250 μs or other values. When the count durations of the first counter 102a to the first counter 102n each reach the duration t1, an interrupt is triggered but is not a target interrupt, i.e., the target interrupt is not triggered at this time. The counting time period from the first counter 102a to the first counter 102n may be understood as a time period corresponding to the Count value Count12, and the time corresponding to the time period when the counting time periods from the first counter 102a to the first counter 102n all reach the time period t1 may be the time corresponding to the point C1 shown in fig. 6, that is, the time corresponding to the point C1 may not trigger the target interrupt. When the count duration from the first counter 102a to the first counter 102n reaches the duration t1 for the second time, the target interrupt is triggered, that is, when the count duration from the first counter 102a to the first counter 102n reaches the duration t1 for the number of times 2 (i.e., the preset number of times threshold value), the target interrupt is triggered. The time corresponding to when the count durations of the second first counter 102a to the first counter 102n reach the duration t1 may be the time corresponding to the point C2 shown in fig. 6, that is, the time corresponding to the point C2 triggers the target interrupt.
Further, after triggering the target interrupt, the control unit 100 may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt. Wherein, the control unit 100 executing the interrupt service function corresponding to the target interrupt may include the following steps: after the count duration of the first second counter 103 reaches the duration t2 and after the preset duration t3 (the time corresponding to the point D shown in fig. 6 above), the analog-to-digital converter 101 may collect the reference current of the multiphase stator winding from the motor driving circuit 11 in real time, where the point D may be understood as a reference current sampling point or a zero current sampling point; after the count duration of the second counter 103 reaches the duration t2 and after the preset duration t3 (the time corresponding to the point E shown in fig. 6, the analog-to-digital converter 101 may collect the phase currents of the multi-phase stator winding from the motor driving circuit 11 in real time, where the point E may be understood as a phase current sampling point, and the interval time between the time corresponding to the point D and the time corresponding to the point E is the duration t2; and calculating the reference current and the phase current of the multiphase stator winding through a motor control algorithm to obtain a comparison current value of the multiphase stator winding so as to generate a pulse modulation signal of the multiphase stator winding. In the above steps, in the case that the analog-to-digital converter 101 includes the current register, the analog-to-digital converter 101 stores the reference current of the multi-phase stator winding in the current register after collecting the reference current of the multi-phase stator winding from the motor driving circuit 11, and stores the collected phase current of the multi-phase stator winding in the current register after the reference current of the multi-phase stator winding is read by the control unit 100, at this time, the control unit 100 can read the phase current of the multi-phase stator winding from the current register, thereby achieving the purpose of synchronously reading and updating the reference current and the phase current, and thus ensuring the real-time and accuracy of current sampling.
Further, the control unit 100 may output the pulse modulation signal of the multiphase stator winding to the motor driving circuit 11 to drive the multiphase motor to operate. As shown in fig. 6, the point C1, the point C2, the point C3, and the point C4 may be understood as interrupt trigger points, where the point C3 may be understood as interrupt trigger points when the count durations of the first counter 102a to the first counter 102n all reach the time period t1 for the third time, and the point C4 may be understood as interrupt trigger points when the count durations of the first counter 102a to the first counter 102n all reach the time period t1 for the fourth time, where the time corresponding to the point C3 and the time corresponding to the point C4 trigger interrupts but the interrupts are not target interrupts (i.e., do not trigger target interrupts). Therefore, in the whole process of driving the multiphase motor to work, the target interruption is not triggered at the moment corresponding to the point C1, the moment corresponding to the point C3 and the moment corresponding to the point C4, and the target interruption is triggered at the moment corresponding to the point C2. That is, the control unit 100 only responds to the target interrupt at the moment corresponding to the point C2, and executes the interrupt service function corresponding to the target interrupt, so that the number of times of executing the interrupt service function is greatly reduced, and thus, the number of current sampling times and the number of times of executing the motor control algorithm are reduced, the flow is simpler, and the applicability is stronger. The control unit 100 executes an interrupt service function corresponding to the target interrupt, so that the purposes of synchronously updating the reference current and the phase current and executing a motor control algorithm can be achieved, the real-time performance and the accuracy of current sampling and motor control algorithm execution are further ensured, the running stability of the multiphase motor is improved, and the applicability is higher.
In some possible embodiments, for convenience of description, the controller 10 includes three first counters for example, where the three first counters include three phase stator windings (such as a U-phase stator winding, a V-phase stator winding, and a W-phase stator winding), and the three first counters include a first counter 102a, a first counter 102b, and a first counter 102n. Referring to fig. 7, fig. 7 is a schematic control logic diagram of the controller provided in the present application. As shown in fig. 7, after the first counter 102a, the first counter 102b, and the first counter 102n trigger the target interrupt, the control unit 100 may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt. The specific steps of the control unit 100 executing the interrupt service function include the following steps: after the counting time period of the first second counter 103 reaches the time period t2 and after a preset time period t3 is passed (or offset), the analog-to-digital converter 101 can acquire the reference current of the U-phase stator winding, the reference current of the V-phase stator winding and the reference current of the W-phase stator winding from the motor driving circuit 11, and after the counting time period of the second counter 103 reaches the time period t2 and after a preset time period t3, the analog-to-digital converter 101 can acquire the phase current of the U-phase stator winding, the phase current of the V-phase stator winding and the phase current of the W-phase stator winding from the motor driving circuit 11, so that the reference current and the phase current of the three-phase stator winding can be acquired quickly, and the current sampling efficiency is higher; based on the reference current and the phase current of the U-phase stator winding, the reference current and the phase current of the V-phase stator winding and the reference current and the phase current of the W-phase stator winding, a comparison current value of the U-phase stator winding, a comparison current value of the V-phase stator winding and a comparison current value of the W-phase stator winding are obtained, and based on the comparison current value of the U-phase stator winding, the comparison current value of the V-phase stator winding and the comparison current value of the W-phase stator winding, pulse modulation signals of the U-phase stator winding, the V-phase stator winding and the W-phase stator winding are generated.
Further, the control unit 100 may output the pulse modulation signal of the U-phase stator winding, the pulse modulation signal of the V-phase stator winding, and the pulse modulation signal of the W-phase stator winding to the motor driving circuit 11. At this time, the motor driving circuit 11 may obtain the control current of the U-phase stator winding, the control current of the V-phase stator winding, and the control current of the W-phase stator winding based on the pulse modulation signal of the U-phase stator winding, the pulse modulation signal of the V-phase stator winding, and the pulse modulation signal of the W-phase stator winding to drive the three-phase motor to operate. It can be appreciated that in the steps specifically included in the execution of the interrupt service function by the control unit 100, it is ensured that the motor control algorithm is not interrupted by any other interrupt, thereby ensuring the efficiency and the exclusivity of the motor control algorithm; in addition, under the condition of abnormal operation of the system, the beat matching performance of current sampling and motor control algorithm execution is guaranteed, the anti-interference capability is stronger, and therefore the real-time stability of motor control is improved, and the applicability is stronger.
In the motor control system 1 provided in the present application, since the target interrupt has the highest interrupt priority and adopts the hardware interrupt, the whole process of executing the interrupt service function corresponding to the target interrupt is not limited by the time and space resources of the controller 10, so that the exclusivity of the interrupt service function is not nested by other interrupts, thereby ensuring the punctuality of executing the interrupt service function; in the steps included in the interrupt service function executed by the controller 10, the purpose of collecting the reference current and the phase current of the multiphase stator winding in real time and generating the pulse modulation signal can be achieved, and the real-time performance and accuracy of current sampling are ensured, so that the real-time stability of motor control is improved, and the applicability is strong.
Referring to fig. 8, fig. 8 is a flow chart of a method for controlling a motor provided in the present application. As shown in fig. 8, the method includes the following steps S101 to S102:
in step S101, the controller responds to the target interruption and executes an interruption service function corresponding to the target interruption to collect reference currents and phase currents of the multi-phase stator windings in the multi-phase motor, and generates pulse modulation signals of the multi-phase stator windings based on the reference currents and the phase currents of the multi-phase stator windings.
In some possible embodiments, the target interrupt is a hardware interrupt, and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function, that is, the interrupt priority of the target interrupt is highest and is not given to interrupt by other interrupts, so that the punctuality of executing the interrupt service function is ensured. The multi-phase motor herein may include, but is not limited to, a three-phase motor and a six-phase motor, and the specific type of the multi-phase motor may be determined according to the actual application scenario, without limitation. For example, in the case where the multi-phase motor is a three-phase motor, the multi-phase stator winding may be a three-phase stator winding, and a phase difference between each phase of the three-phase stator winding may be 120 °; in the case of a symmetrical six-phase motor, the multi-phase stator windings may be six-phase stator windings, the phase difference between the phases of which may be 60 °.
In some possible embodiments, before the controller responds to the target interrupt, the controller triggers the target interrupt when the count duration of the plurality of first counters reaches the duration of the first count period, that is, the plurality of first counters may be used to trigger the target interrupt. The first counting period is understood as a counting period of each second counter of the plurality of first counters, that is to say, the duration of the counting period of the plurality of first counters is the same, and the duration of the first counting period is equal to the duration of the interrupt period of the target interrupt; the first counters start to count at the same time, that is, the first counters start to count at the same time; the plurality of first counters may be disposed in the controller, and the number of the plurality of first counters is the same as the number of stator windings in the multi-phase motor. For example, in the case where the multi-phase motor is a three-phase motor including three stator windings, the number of the plurality of first counters may be 3, that is, three first counters are included in the controller. In the case of a six-phase motor, comprising six stator windings, a number of first counters of 6 is available, i.e. six first counters are included in the controller. In the process of triggering the target interrupt, since the counting start time of the plurality of first counters is the same and the duration of the counting period of the plurality of first counters is the same, the plurality of first counters can be ensured to trigger the target interrupt at the same time, so that the problem of time delay caused when the target interrupt cannot be triggered at the same time is avoided, the instantaneity and the punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, and the applicability is stronger.
Optionally, in some possible embodiments, the controller may trigger the target interrupt when the number of times that the count durations of the plurality of first counters reach the duration of the first count period is greater than or equal to a preset number of times threshold, that is, the plurality of first counters may be used to trigger the target interrupt. It should be noted that, because the count duration of the plurality of first counters is cleared after reaching the duration of the first count period at the same time, there are cases where the number of times that the count duration of the plurality of first counters reaches the duration of the first count period is greater than or equal to the preset number of times threshold. Otherwise, when the number of times that the count duration of the plurality of first counters reaches the duration of the first count period is smaller than the preset number of times threshold, the controller triggers an interrupt but the interrupt is not a target interrupt, that is, the target interrupt is not triggered at this time. The counting start time of the plurality of first counters is the same as the duration of a counting period (namely, a first counting period), and the duration of the first counting period is equal to the duration of an interruption period of the target interruption; the number of the plurality of first counters is the same as the number of stator windings in the multi-phase motor described above. In the process of triggering the target interrupt, the direct triggering of the target interrupt can be avoided by setting the preset time threshold, so that the time of triggering the target interrupt is greatly reduced, the instantaneity and punctuality of the interrupt service function corresponding to the execution target interrupt can be ensured, the motor control efficiency is higher, and the applicability is stronger.
In some possible embodiments, after the plurality of first counters trigger the target interrupt, the controller may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt. Wherein, the controller executing the interrupt service function corresponding to the target interrupt comprises the following steps: after the counting time length of the first second counter reaches the time length of the second counting period and the preset time length is passed, the reference current of the multiphase stator winding is acquired in real time through the analog-to-digital converter, so that the real-time property and accuracy of reference current sampling are ensured; after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, the phase current of the multiphase stator winding is acquired in real time through the analog-to-digital converter, so that the instantaneity and the accuracy of phase current sampling are ensured; and obtaining a comparison current value of the multiphase stator winding based on the reference current and the phase current of the multiphase stator winding, and generating a pulse modulation signal of the multiphase stator winding based on the comparison current value of the multiphase stator winding so as to complete the calculation process of the motor control algorithm. In the above step, since the zero clearing is performed each time after the count duration of the second counter reaches the duration of the second count period, there is a duration of the second count period after the count duration of the first second counter reaches the duration of the second count period.
The second counter is coupled to the first counters to keep synchronization of the time axis, and the second counter and the first counters are high-precision counters. The second counting period may be understood as a counting period of the second counter, and a duration of the second counting period needs to be set to be half of a duration of the first counting period, where the preset duration may be a duration set by a user or a duration configured by the controller; the analog-to-digital converter and the second counter may be disposed within the controller, and the second counter may be coupled to the plurality of first counters. In the steps included in the interrupt service function executed by the controller, when the counting time length of the second counter meets a certain condition, the analog-to-digital converter is triggered to collect the reference current and the phase current of the multiphase stator winding in real time, and the whole current sampling process is not interrupted by any other interrupt or task, so that the real-time performance and the accuracy of current sampling are ensured; because the calculation process of the motor control algorithm is not interrupted by tasks in other interruptions, the high efficiency, the monopolization and the instantaneity of the motor control algorithm can be ensured, thereby ensuring the running stability of the multiphase motor and having stronger applicability.
In some possible embodiments, the executing, by the controller, the interrupt service function corresponding to the target interrupt specifically includes the following steps: after the counting time length of the first second counter reaches the time length of the second counting period and the preset time length is passed, the reference current of the multiphase stator winding is collected from the motor driving circuit through the analog-to-digital converter, so that the reference current can be quickly collected, and the current sampling efficiency is higher; after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, the phase current of the multiphase stator winding is collected from the motor driving circuit through the analog-to-digital converter, so that the phase current can be rapidly collected, and the current sampling efficiency is higher; and calculating the reference current and the phase current of the multiphase stator winding through a motor control algorithm to obtain a comparison current value of the multiphase stator winding, and generating a pulse modulation signal of the multiphase stator winding based on the comparison current value of the multiphase stator winding so as to complete the calculation process of the motor control algorithm.
In the steps specifically included in the interrupt service function executed by the controller, the reference current and the phase current of the multiphase stator winding can be rapidly collected from the motor driving circuit, and the current sampling efficiency is higher; because the calculation process of the motor control algorithm is not interrupted by tasks in other interruptions, the high efficiency, the monopolization and the instantaneity of the motor control algorithm can be ensured, and the running stability of the multiphase motor is ensured; at this time, under the condition of abnormal operation of the system, the beat matching of the current sampling and motor control algorithm can be ensured, the anti-interference capability is stronger, and the running stability of the multiphase motor is further improved.
In step S102, the controller outputs the pulse modulation signal to the motor driving circuit, and drives the multiphase motor based on the pulse modulation signal through the motor driving circuit.
In some possible embodiments, the controller may obtain the control current of the multi-phase stator winding based on the pulse modulation signal of the multi-phase stator winding through the motor driving circuit, and drive the multi-phase motor to operate based on the control current of the multi-phase stator winding. Under the condition that the controller is arranged in a steering system in the electric automobile and the multi-phase motor is a three-phase motor in the electric automobile, the steering angle of the motor of the three-phase motor is required to be collected to control the driving direction of the electric automobile. Wherein, because the multiphase motor is three-phase motor, therefore including three first counters in the controller. Referring to fig. 9, fig. 9 is a schematic flow chart of the interrupt service function execution provided in the present application. As shown in fig. 9, the controller may trigger the target interrupt when the number of times that the count durations of the three first counters reach the duration of the first count period at the same time is equal to a preset number of times threshold. Further, the controller may respond to the target interrupt and execute an interrupt service function corresponding to the target interrupt, and specifically includes the following steps: collecting reference current of a three-phase stator winding through an analog-to-digital converter after the counting time length of the first second counter reaches the time length of the second counting period and the preset time length is passed, and collecting the motor steering angle of the three-phase motor; after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, collecting phase current of the three-phase stator winding through the analog-to-digital converter; a pulse modulated signal for the three-phase stator winding is generated based on the reference current and the phase current of the three-phase stator winding, at which time the interrupt service function has been performed.
When the number of times (which may be simply referred to as the number of times) that the count durations of the three first counters reach the duration of the first count period simultaneously is smaller than the preset number of times threshold, the controller may obtain the current number of times based on the number of times, where the current number of times is the sum of the number of times and the number of times/n (the number of times=the number of times+the number of times/n as shown in fig. 9). The number of times can be understood as the triggering number of the interrupt; n may be determined by the duration of a complete motor control period and the duration of an interrupt period, e.g., n may be the value of the duration of the motor control period divided by the duration of the interrupt period. At this time, the controller triggers a target interrupt when detecting that the current frequency is equal to a preset frequency threshold, responds to the target interrupt, and executes an interrupt service function of the target interrupt; and after the interrupt service function is executed, the interrupt service function is exited, so that the motor steering angle and the pulse modulation signals of the three-phase stator windings are obtained. Further, the controller outputs pulse modulation signals of the motor steering angle and the three-phase stator winding to the motor driving circuit, the motor driving circuit drives the three-phase motor to work based on the pulse modulation signals, and the three-phase motor is controlled based on the motor steering angle so as to change the driving direction of the electric automobile, and meanwhile, the real-time stability of motor control is improved, and the applicability is stronger.
In a specific implementation, more operations executed by the controller in the method for controlling a motor provided in the present application may refer to the implementation manner executed by the controller (or the control unit) in the motor control system and the working principle thereof shown in fig. 3 to 7, which are not described herein.
In the method provided by the application, the target interrupt has the highest interrupt priority and adopts the hardware interrupt, so that the whole process of executing the interrupt service function corresponding to the target interrupt is not limited by the time and space resources of the controller, the exclusivity of the interrupt service function can be ensured not to be nested by other interrupts, and the punctuality of executing the interrupt service function is ensured; in the steps included in the implementation of the interrupt service function, the purposes of collecting the reference current and the phase current of the multiphase stator winding in real time and generating the pulse modulation signal can be achieved, the real-time performance and the accuracy of current sampling are ensured, and therefore the real-time stability of motor control is improved, and the applicability is strong.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

  1. The motor control system is characterized by comprising a controller and a motor driving circuit, wherein the controller is connected with a multiphase motor through the motor driving circuit, and the multiphase motor comprises multiphase stator windings;
    the controller is used for responding to a target interrupt and executing an interrupt service function corresponding to the target interrupt to acquire reference current and phase current of the multi-phase stator winding, and generating pulse modulation signals of the multi-phase stator winding based on the reference current and the phase current of the multi-phase stator winding, wherein the target interrupt is a hardware interrupt, and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function corresponding to the target interrupt;
    the controller is also used for outputting the pulse modulation signal to the motor driving circuit;
    the motor driving circuit is used for driving the multiphase motor based on the pulse modulation signal.
  2. The system of claim 1, wherein the controller comprises a control unit and a plurality of first counters having the same count start time as the number of stator windings in the multiphase motor;
    Wherein the plurality of first counters are used to trigger the target interrupt.
  3. The system of claim 2, wherein the target interrupt is triggered when the count duration of the plurality of first counters each reaches the duration of a first count period;
    the duration of the first counting period is equal to the duration of the interrupt period of the target interrupt.
  4. The system according to claim 2, wherein the target interrupt is triggered when the number of times the count duration of the plurality of first counters reaches the duration of the first count period is greater than or equal to a preset number of times threshold;
    the duration of the first counting period is equal to the duration of the interrupt period of the target interrupt.
  5. The system of claim 3 or 4, wherein the controller further comprises: an analog-to-digital converter and a second counter coupled to the plurality of first counters, a count start time of the plurality of first counters being the same as a count start time of the second counter;
    the analog-to-digital converter acquires the reference current of the multiphase stator winding after the counting time length of the second counter reaches the time length of the second counting period for the first time and after the preset time length is passed, and acquires the phase current of the multiphase stator winding after the counting time length of the second counter reaches the time length of the second counting period for the second time and after the preset time length is passed;
    The duration of the second counting period is half of the duration of the first counting period.
  6. The system of any one of claims 1-5, wherein the controller is specifically configured to:
    obtaining a comparison current value of the multi-phase stator winding based on a reference current and a phase current of the multi-phase stator winding;
    a pulse modulated signal of the multi-phase stator winding is generated based on the compared current values of the multi-phase stator winding.
  7. A method of controlling an electric machine, comprising:
    the controller responds to a target interrupt and executes an interrupt service function corresponding to the target interrupt to acquire reference currents and phase currents of a multi-phase stator winding in the multi-phase motor, and generates pulse modulation signals of the multi-phase stator winding based on the reference currents and the phase currents of the multi-phase stator winding, wherein the target interrupt is a hardware interrupt, and the interrupt priority of the target interrupt is higher than the interrupt priority of other interrupts received by the controller in the process of executing the interrupt service function;
    the controller outputs the pulse modulation signal to the motor driving circuit, and drives the multiphase motor based on the pulse modulation signal through the motor driving circuit.
  8. The method of claim 7, comprising, prior to the controller responding to a target interrupt and executing an interrupt service function corresponding to the target interrupt:
    the controller triggers the target interrupt when the count duration of the plurality of first counters reaches the duration of a first count period, wherein the count starting time of the plurality of first counters is the same, the number of the first counters is the same as the number of stator windings in the multiphase motor, and the duration of the first count period is equal to the duration of the interrupt period of the target interrupt.
  9. The method of claim 7, comprising, prior to the controller responding to a target interrupt and executing an interrupt service function corresponding to the target interrupt:
    the controller triggers the target interrupt when the times of the count time lengths of the plurality of first counters reaching the time length of the first count period are larger than or equal to a preset time threshold, wherein the count starting time of the plurality of first counters is the same, the number of the first counters is the same as the number of stator windings in the multiphase motor, and the time length of the first count period is equal to the time length of the interrupt period of the target interrupt.
  10. The method of claim 8 or 9, wherein the controller responding to a target interrupt and executing an interrupt service function corresponding to the target interrupt comprises:
    the controller responds to the target interrupt and executes an interrupt service function corresponding to the target interrupt, so that after the counting time length of the second counter reaches the time length of a second counting period and a preset time length is passed, the reference current of the multiphase stator winding is collected through the analog-to-digital converter, and after the counting time length of the second counter reaches the time length of the second counting period and the preset time length is passed, the phase current of the multiphase stator winding is collected through the analog-to-digital converter;
    the counting start time of the plurality of first counters is the same as the counting start time of the second counter, and the duration of the second counting period is half of the duration of the first counting period.
  11. The method of claim 10, wherein the controller responds to a target interrupt and executes an interrupt service function corresponding to the target interrupt, further comprising:
    the controller responds to a target interrupt and executes an interrupt service function corresponding to the target interrupt to obtain a comparison current value of the multi-phase stator winding based on a reference current and a phase current of the multi-phase stator winding, and generates a pulse modulation signal of the multi-phase stator winding based on the comparison current value of the multi-phase stator winding.
  12. An electrically powered device comprising a multi-phase motor and a motor control system as claimed in any one of claims 1 to 6.
CN202180033505.6A 2021-12-07 2021-12-07 Motor control system, method for controlling motor and electric device Pending CN117652092A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/135920 WO2023102704A1 (en) 2021-12-07 2021-12-07 Electric motor control system, method for controlling electric motor, and electric device

Publications (1)

Publication Number Publication Date
CN117652092A true CN117652092A (en) 2024-03-05

Family

ID=86729505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180033505.6A Pending CN117652092A (en) 2021-12-07 2021-12-07 Motor control system, method for controlling motor and electric device

Country Status (2)

Country Link
CN (1) CN117652092A (en)
WO (1) WO2023102704A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025312B (en) * 2009-09-16 2014-01-29 株式会社东芝 Motor control device and electrical equipment
CN104796048B (en) * 2015-04-15 2017-05-10 华中科技大学 Alternating-current motor current loop parallelism digital control implementation method
CN106026804B (en) * 2016-08-09 2018-09-25 王大方 A kind of brushless DC motor without position sensor without hardware filtering phase change method
CN111555688B (en) * 2020-05-12 2023-11-21 中国电子科技集团公司第四十三研究所 Digital control method and system for high-bandwidth current loop
CN112398374B (en) * 2020-10-16 2022-11-15 北京国科环宇科技股份有限公司 Control system and control method of three-phase brushless direct current motor

Also Published As

Publication number Publication date
WO2023102704A1 (en) 2023-06-15

Similar Documents

Publication Publication Date Title
US8456117B2 (en) Driving brushless DC (BLDC) motors
JP2011234517A (en) Power drive controller and power unit
JP5079055B2 (en) Power converter
CN102971956B (en) Power conversion system
US6373219B1 (en) Motor control system and motor control method
US8093845B2 (en) Controller and MCU chip for controlling 3-phase brushless DC motor
EP4007158A1 (en) Control method and controller
US7629756B2 (en) Method and apparatus for controlling asynchronous motors
CN117652092A (en) Motor control system, method for controlling motor and electric device
KR101792040B1 (en) Parallel inverter system
JP6652918B2 (en) Motor drive control device
US8952636B2 (en) Data communication device that carries out serial communication in order to control motor
CN110739897A (en) AC servo driver and AC servo driving system
CN111316562B (en) Motor control device
JP6828515B2 (en) Motor control device
CN106169892A (en) System and method for operating a Hall sensor
JP6642111B2 (en) Motor control device
CN113659880A (en) Dual-processor brushless direct current motor driving system and method for minimally invasive surgery
CN110912488B (en) Motor control method and system
EP3229367B1 (en) Power converter and control method of power converter
JP2014154043A (en) Electronic control device and information processor
JP5954107B2 (en) Motor control device
CN202918235U (en) Brushless DC motor speed-adjusting device based on DSP
CN111953244A (en) Belt speed re-throwing method, system and device of permanent magnet synchronous motor
EP3131193B1 (en) Power conversion device and power conversion control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination