Motor control method and device, computer equipment, readable storage medium and program product

By using digital and analog converters in the rotation transformer to generate and adjust the pulse width modulation signal, the problem of inaccurate angle information caused by frequency mismatch between the MCU and the rotation transformer is solved, and the precise measurement and control of the motor rotor angle is realized.

CN119093797APending Publication Date: 2024-12-06CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411186461.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the existing soft decoding method of rotary transformer, the sampling frequency of the hardware circuit between the MCU and the rotary transformer is different from the carrier frequency, resulting in the obtained motor rotor angle information inaccurate.

Method used

The digital analog converter generates positive and negative pulse width modulation signals, converts them into sinusoidal excitation signals and cosine excitation signals, inputs them to the rotary transformer, outputs four differential positive cosine signals, and performs bias adjustment and proportional adjustments to obtain two The orthogonal differential cosine signal is further obtained from which the discrete envelope is obtained to obtain the current rotor angle.

Benefits of technology

Accurate measurement and control of the motor rotor angle is realized, and the accuracy of the motor drive system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119093797A_ABST
    Figure CN119093797A_ABST
Patent Text Reader

Abstract

The invention relates to a motor control method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: generating positive and negative pulse width modulation signals based on a digital-to-analog converter, and converting the pulse width modulation signals into sine excitation signals and cosine excitation signals based on a rotary transformer excitation circuit; inputting the sine excitation signal and the cosine excitation signal to the primary side of the rotary transformer, and outputting four paths of differential sine and cosine signals; performing offset adjustment and proportion adjustment on the four paths of differential sine and cosine signals to obtain two paths of orthogonal differential sine and cosine signals, and obtaining a discrete envelope line from the two paths of orthogonal differential sine and cosine signals; and obtaining a current rotor angle based on the discrete envelope line, and controlling the permanent magnet synchronous motor based on the current rotor angle. According to the method provided by the invention, the accurate rotor angle can be obtained, so that the motor is accurately controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor technology, and in particular to a motor control method, device, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] In order to obtain accurate motor rotor position in real time and meet the needs of permanent magnet synchronous motor drive system, the rotary transformer is widely used in the field of new energy vehicles because of its simple structure, high sensitivity, strong anti-interference, and strong adaptability to harsh environments. According to the decoding form of the rotary transformer, it can be divided into hard decoding and soft decoding. Because hard decoding requires a dedicated hard decoding chip and is expensive, the cost can be reduced by using soft decoding.

[0003] The current implementation of resolver soft decoding is to send a square wave signal through the pulse width modulation pin of the microcontroller chip (MCU), and then filter and amplify it through the hardware circuit to become a sinusoidal signal as the excitation signal input to the primary side of the resolver; the secondary side of the resolver outputs a sinusoidal signal based on the excitation signal, and the MCU samples the sinusoidal signal of the secondary side of the resolver, performs soft decoding on the sampled value, and obtains the rotor angle information of the motor. In this method, since the sampling frequency of the hardware circuit between the MCU and the resolver is different from the carrier frequency, the angle information obtained will be inaccurate. Summary of the invention

[0004] Based on this, it is necessary to provide a motor control method, device, computer equipment, computer-readable storage medium and computer program product that can obtain accurate angle information in response to the above technical problems.

[0005] In a first aspect, the present application provides a motor control method, the method comprising:

[0006] Generate positive and negative pulse width modulation signals based on a digital analog converter, and convert the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit;

[0007] Input the sine excitation signal and the cosine excitation signal to the primary side of the rotary transformer, and output four differential sine and cosine signals;

[0008] Performing offset adjustment and ratio adjustment on the four-channel differential sine and cosine signals to obtain two-channel orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two-channel orthogonal differential sine and cosine signals;

[0009] A current rotor angle is acquired based on the discrete envelope, and the permanent magnet synchronous motor is controlled based on the current rotor angle.

[0010] In one embodiment, the step of obtaining a discrete envelope from the two orthogonal differential sine and cosine signals comprises:

[0011] Based on the digital-to-analog converter, a peak signal corresponding to a preset sampling point is obtained from the two orthogonal differential sine and cosine signals;

[0012] The discrete envelope is obtained based on the peak signal.

[0013] In one embodiment, obtaining the current rotor angle based on the discrete envelope includes:

[0014] performing fault detection on the discrete envelope;

[0015] Based on the fault detection result, performing arc tangent processing on the discrete envelope to obtain initial angle information;

[0016] The initial angle information is input into a third-order angle tracker, and the current rotor angle is output.

[0017] In one embodiment, the performing fault detection on the discrete envelope includes:

[0018] Performing a square operation on each of the two orthogonal differential sine and cosine signals;

[0019] Obtaining the square sum of the two orthogonal differential sine and cosine signals;

[0020] When the square sum is within a preset range, the step of performing arc tangent processing on the discrete envelope based on the fault detection result to obtain initial angle information is performed.

[0021] In one of the embodiments, when the current rotor angle is obtained, the interrupt service routine of the digital-to-analog converter is triggered. The current rotor angle is obtained periodically, and current sampling is performed during the period.

[0022] In one embodiment, the method further comprises:

[0023] Determining the triggering moment of the interrupt service routine as the position calculation moment of the digital-to-analog converter;

[0024] Acquire the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time;

[0025] The current rotor angle is compensated based on the rotor angular velocity and the time difference.

[0026] In a second aspect, the present application further provides a motor control device, the device comprising:

[0027] A generating module, used for generating positive and negative pulse width modulation signals based on a digital analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit;

[0028] An input module, used for inputting the sine excitation signal and the cosine excitation signal into the primary side of the rotary transformer, and outputting four differential sine and cosine signals;

[0029] An adjustment module, used for performing offset adjustment and ratio adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals;

[0030] An acquisition module is used to acquire a current rotor angle based on the discrete envelope, and control the permanent magnet synchronous motor based on the current rotor angle.

[0031] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0033] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0034] The motor control method, device, computer equipment, computer-readable storage medium and computer program product generate positive and negative pulse width modulation signals based on a digital-to-analog converter, and convert the pulse width modulation signals into sine excitation signals and cosine excitation signals based on a rotary transformer excitation circuit; input the sine excitation signals and cosine excitation signals to the primary side of the rotary transformer, and output four differential sine and cosine signals; adjust the bias and proportion of the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtain discrete envelopes from the two orthogonal differential sine and cosine signals; obtain the current rotor angle based on the discrete envelope, and control the permanent magnet synchronous motor based on the current rotor angle. The method provided in the present application can obtain an accurate rotor angle, thereby accurately controlling the motor. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0036] FIG1 is a schematic flow chart of a motor control method in one embodiment;

[0037] FIG2 is a schematic diagram of a process of obtaining a discrete envelope in one embodiment;

[0038] FIG3 is a schematic diagram of a third-order angle tracker in one embodiment;

[0039] FIG4 is a schematic diagram of compensating the current rotor angle in one embodiment;

[0040] FIG5 is a schematic flow chart of a motor control method in another embodiment;

[0041] FIG6 is a block diagram of a motor control device according to an embodiment;

[0042] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] In one embodiment, as shown in FIG1 , a motor control method is provided. This embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0045] S102, generating positive and negative pulse width modulation signals based on a digital-to-analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit.

[0046] The sine excitation signal and the cosine excitation signal refer to two different types of excitation signals using sine waveforms and cosine waveforms as excitation sources in the motor excitation system. These signals are used to generate an electromagnetic field in the excitation winding of the motor.

[0047] S104, inputting the sine excitation signal and the cosine excitation signal into the primary side of the rotary transformer, and outputting four differential sine and cosine signals.

[0048] Among them, the primary side of the rotary transformer refers to the end of the transformer connected to the excitation source. Usually, the primary winding receives the excitation voltage provided by a constant AC power supply; the four-way differential sine and cosine signal refers to a differential signal pair composed of four signals, each of which contains a sine wave and a cosine wave.

[0049] S106 , performing offset adjustment and ratio adjustment on the four-channel differential sine and cosine signals to obtain two-channel orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two-channel orthogonal differential sine and cosine signals.

[0050] The discrete envelope refers to a curve used to describe the trend of signal amplitude changes in discrete signal processing. It is formed by connecting the maximum amplitude of each point on the signal waveform.

[0051] Specifically, the two orthogonal differential sine and cosine signals obtained after adjustment are sent to a digital-to-analog converter, and the digital-to-analog converter obtains discrete envelopes from the two orthogonal differential sine and cosine signals.

[0052] S108. Acquire a current rotor angle based on the discrete envelope, and control the permanent magnet synchronous motor based on the current rotor angle.

[0053] Among them, the discrete envelope line can be firstly subjected to fault detection, and then subjected to inverse tangent processing after the fault detection is passed to obtain angle information, and finally the angle information is processed by a third-order angle tracker to output the current rotor angle.

[0054] In the above motor control method, positive and negative pulse width modulation signals are generated based on a digital analog converter, and the pulse width modulation signals are converted into sine excitation signals and cosine excitation signals based on a rotary transformer excitation circuit; the sine excitation signals and cosine excitation signals are input to the primary side of the rotary transformer, and four differential sine and cosine signals are output; the four differential sine and cosine signals are biased and proportionally adjusted to obtain two orthogonal differential sine and cosine signals, and discrete envelopes are obtained from the two orthogonal differential sine and cosine signals; the current rotor angle is obtained based on the discrete envelope, and the permanent magnet synchronous motor is controlled based on the current rotor angle. The method provided in the present application can obtain an accurate rotor angle, thereby accurately controlling the motor.

[0055] In some embodiments, as shown in FIG2 , obtaining a discrete envelope from two orthogonal differential sine and cosine signals includes:

[0056] S202 . Based on a digital-to-analog converter, obtain a peak signal corresponding to a preset sampling point from two orthogonal differential sine and cosine signals.

[0057] S204: Obtain a discrete envelope based on the peak signal.

[0058] In this embodiment, the peak sampling method is used to collect discrete envelopes; the sine and cosine signal sampling interruption is triggered at the preset sampling point, so as to obtain the sine and cosine discrete envelope signals.

[0059] In this embodiment, the peak sampling method is used to collect the discrete envelope, so that the obtained discrete envelope is more accurate.

[0060] In some embodiments, obtaining the current rotor angle based on the discrete envelope line includes: performing fault detection on the discrete envelope line; based on the fault detection result, performing inverse tangent processing on the discrete envelope line to obtain initial angle information; inputting the initial angle information into a third-order angle tracker to output the current rotor angle.

[0061] Among them, a third-order angle tracker usually refers to a system that can measure and track angle changes. Its design or operation is based on the third-order dynamic model. In control theory and signal processing, the angle tracker is used to monitor and control the angular position or angular velocity of an object relative to a reference direction. The schematic diagram of the third-order angle tracker is shown in Figure 3.

[0062] The third-order angle tracker has strong tracking performance and good robustness, but there is a problem, that is, the uncertainty of the initial value of the integration of the third integrator of the third-order angle tracker, the position integrator, will cause the detection error of the starting position at the moment the system is powered on. Therefore, this embodiment improves it, that is, at the initial moment of power-on, the angle information obtained by the inverse tangent is used as the initial value of the integration of the position integrator, and the connection between the inverse tangent output and the position integrator is cancelled at the second step of the soft decoding system, thereby solving the problem that the uncertainty of the initial value of the integration of the position integrator will cause the detection error of the starting position at the moment the system is powered on, so as to obtain accurate initial position angle information.

[0063] In this embodiment, after the discrete envelope is fault-detected, the current rotor angle is obtained, so that the obtained current rotor angle is more accurate.

[0064] In some embodiments, fault detection is performed on a discrete envelope line, including: performing a square operation on each of two orthogonal differential sine and cosine signals; obtaining the sum of the squares of the two orthogonal differential sine and cosine signals; and when the sum of the squares is within a preset range, performing an inverse tangent operation on the discrete envelope line based on the fault detection result to obtain initial angle information.

[0065] Among them, the method for fault detection of discrete envelope is: determine whether the square sum of sine and cosine signals is within the range of 1±ϵ, where ϵ is a preset constant and can be set according to different situations and requirements.

[0066] In this embodiment, after the discrete envelope is fault-detected, the current rotor angle is obtained, so that the obtained current rotor angle is more accurate.

[0067] In some embodiments, when the current rotor angle is obtained, the interrupt service routine of the digital-to-analog converter is triggered. The current rotor angle is obtained periodically, and current sampling is performed during the period.

[0068] Among them, the interrupt service routine is usually used to handle the digital analog converter output completion interrupt, timer interrupt or other interrupts related to the operation of the digital analog converter. When an interrupt request occurs, the processor will suspend the currently executing task and jump to the interrupt service routine to handle the request. After the interrupt service routine is executed, the processor will return to the interrupted task to continue execution.

[0069] In this embodiment, by triggering the interrupt service routine of the digital-to-analog converter, the subsequent compensation process is made more accurate.

[0070] In some embodiments, the method also includes: determining the triggering moment of the interrupt service program as the position calculation moment of the digital-to-analog converter; obtaining the time difference between the position calculation moment and the current sampling moment, and the rotor angular velocity corresponding to the triggering moment; and compensating the current rotor angle based on the rotor angular velocity and the time difference.

[0071] Among them, in the FOC control of the motor, it is necessary to obtain the rotor angle information of the motor at all times. Take this as an example: when the motor is under FOC control, the carrier frequency scheduling period is T1, and the period for obtaining the rotor angle information is T2, where T2>T1, so it is necessary to compensate for the angle information obtained. When it enters the FOC vector operation, it will obtain the trigger current sampling timestamp and perform current sampling after a period of time, and it is necessary to obtain the rotor position information at the current sampling time to ensure the accuracy of the motor vector control. When obtaining the rotor position information, it will enter the digital analog converter result interrupt, obtain the digital analog converter position calculation timestamp in this interrupt, and calculate the rotor position. Since the rotor angle information acquisition cycle is different from the scheduling cycle of FOC vector control, in order to ensure the accuracy of the rotor position information during current sampling, it is necessary to compensate it. The compensation time is Δt, where Δt is the difference between the digital analog converter position calculation timestamp and the current sampling timestamp, θ1=θ0+ωΔt, where θ1 is the rotor position at the moment of current sampling, θ0 is the rotor angle calculated when entering the digital analog converter result interrupt, and ω is the rotor angular velocity when entering the digital analog converter result interrupt. The schematic diagram of the compensation process is shown in Figure 4.

[0072] In this embodiment, the current rotor angle is compensated so that the rotor angle finally obtained is more accurate.

[0073] In one embodiment, another motor control method is provided, a flowchart of which is shown in FIG5 , and the method includes the following contents:

[0074] First, based on the DSADC (digital analog converter) module, positive and negative PWM (pulse width modulation) signals are generated. The positive and negative PWM signals are converted into sine and cosine excitation signals through the resolver excitation circuit and sent to the primary side of the resolver. The sine and cosine excitation signals generate four differential sine and cosine signals after passing the resolver. The four sine and cosine signals are sent to the DSADC module after bias adjustment and ratio adjustment. The DSADC module collects the discrete envelopes of the two orthogonal differential sine and cosine signals. Fault detection is performed on the discrete envelopes of the two orthogonal differential sine and cosine signals. After the fault detection is passed, the discrete envelopes of the two orthogonal differential sine and cosine signals are processed by inverse tangent to obtain angle information, which is output as rotor angle information after passing the third-order angle tracker to control the motor.

[0075] For the discrete envelope acquisition step of two-way orthogonal differential sine and cosine signals, the peak sampling method is used to collect the peak value of the orthogonal differential sine and cosine signal and obtain its discrete envelope. The sampling point time of the sine and cosine signal is obtained by calibration. The sampling point time is the peak point of the orthogonal differential signal, which triggers the sampling interrupt of the sine and cosine signal, thereby obtaining the discrete envelope signal of the sine and cosine.

[0076] Fault detection is performed on the discrete envelopes of the two orthogonal differential sine and cosine signals collected. The method adopted is to determine whether the sum of the squares of the sine and cosine signals is within the range of 1±ϵ, where ϵ is a preset constant that can be set according to different situations and requirements.

[0077] Compensate for the rotor information angle obtained by the inverse tangent: In the FOC (Field-Oriented Control) control of the motor, it is necessary to obtain the rotor angle information of the motor at all times. Take this as an example: when the motor is under FOC control, the carrier frequency scheduling period is T1, and the period for obtaining the rotor angle information is T2, where T2>T1, so it is necessary to compensate for the angle information obtained. When it enters the FOC vector operation, it will obtain the trigger current sampling timestamp and perform current sampling after a period of time, and it is necessary to obtain the rotor position information at the current sampling time to ensure the accuracy of the motor vector control. When obtaining the rotor position information, it will enter the DSADC result interrupt, obtain the DSADC position calculation timestamp in this interrupt, and calculate the rotor position. Since the rotor angle information acquisition cycle is different from the scheduling cycle of FOC vector control, in order to ensure the accuracy of the rotor position information during current sampling, it is necessary to compensate it. The compensation time is Δt, where Δt is the difference between the DSADC position calculation timestamp and the current sampling timestamp, θ1=θ0+ωΔt, where θ1 is the rotor position at the moment of current sampling, θ0 is the rotor angle calculated when entering the DSADC result interrupt, and ω is the rotor angular velocity when entering the DSADC result interrupt.

[0078] The third-order angle observer has strong tracking performance and good robustness, but there is a problem, that is, the uncertainty of the initial value of the integration of the third integrator of the third-order angle observer, the position integrator, will cause the detection error of the starting position at the moment the system is powered on. Therefore, this patent improves it, that is, at the initial moment of power-on, the angle information obtained by the inverse tangent is used as the initial value of the integration of the position integrator, and the connection between the inverse tangent output and the position integrator is cancelled at the second step of the soft decoding system, thereby solving the problem that the uncertainty of the initial value of the integration of the position integrator will cause the detection error of the starting position at the moment the system is powered on, so as to obtain accurate initial position angle information.

[0079] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0080] Based on the same inventive concept, the embodiment of the present application also provides a motor control device for implementing the motor control method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more motor control device embodiments provided below can refer to the limitations of the motor control method above, and will not be repeated here.

[0081] In an exemplary embodiment, as shown in FIG6 , a motor control device 600 is provided, comprising: a generating module 601 , an input module 602 , an adjusting module 603 and an acquiring module 604 , wherein:

[0082] The generating module 601 is used to generate positive and negative pulse width modulation signals based on a digital-to-analog converter, and convert the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit.

[0083] The input module 602 is used to input the sine excitation signal and the cosine excitation signal into the primary side of the rotary transformer, and output four differential sine and cosine signals.

[0084] The adjustment module 603 is used to perform offset adjustment and ratio adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtain discrete envelopes from the two orthogonal differential sine and cosine signals.

[0085] The acquisition module 604 is used to acquire the current rotor angle based on the discrete envelope, and control the permanent magnet synchronous motor based on the current rotor angle.

[0086] In some embodiments, the adjustment module 603 is further used to obtain a peak signal corresponding to a preset sampling point from the two orthogonal differential sine and cosine signals based on the digital-to-analog converter; and obtain the discrete envelope based on the peak signal.

[0087] In some embodiments, the acquisition module 604 includes:

[0088] A detection unit is used to perform fault detection on the discrete envelope.

[0089] The inverse tangent processing unit is used to perform inverse tangent processing on the discrete envelope based on the fault detection result to obtain initial angle information.

[0090] An input unit is used to input the initial angle information into a third-order angle tracker and output the current rotor angle.

[0091] In some embodiments, the detection unit is also used to perform a square operation on each of the two orthogonal differential sine and cosine signals; obtain the sum of the squares of the two orthogonal differential sine and cosine signals; and when the sum of the squares is within a preset range, execute the step of performing inverse tangent processing on the discrete envelope based on the fault detection result to obtain initial angle information.

[0092] In some embodiments, the motor control device 600 is specifically configured to trigger the interrupt service program of the digital-to-analog converter at the moment of acquiring the current rotor angle. The current rotor angle is acquired periodically, and current sampling is performed within the period.

[0093] In some embodiments, the motor control device 600 is also used to determine the triggering time of the interrupt service program as the position calculation time of the digital-to-analog converter; obtain the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time; and compensate the current rotor angle based on the rotor angular velocity and the time difference.

[0094] Each module in the above motor control device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0095] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, a near field communication (NFC) or other technologies. When the computer program is executed by the processor, a motor control method is implemented.

[0096] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0097] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: generating positive and negative pulse width modulation signals based on a digital-to-analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit; inputting the sine excitation signal and the cosine excitation signal to the primary side of the resolver, and outputting four differential sine and cosine signals; performing bias adjustment and proportional adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals; obtaining a current rotor angle based on the discrete envelope, and controlling the permanent magnet synchronous motor based on the current rotor angle.

[0098] In one embodiment, the method of obtaining a discrete envelope from the two orthogonal differential sine and cosine signals implemented when the processor executes a computer program includes: based on the digital-to-analog converter, obtaining a peak signal corresponding to a preset sampling point from the two orthogonal differential sine and cosine signals; and obtaining the discrete envelope based on the peak signal.

[0099] In one embodiment, the current rotor angle is obtained based on the discrete envelope line when the processor executes a computer program, including: performing fault detection on the discrete envelope line; based on the fault detection result, performing inverse tangent processing on the discrete envelope line to obtain initial angle information; inputting the initial angle information into a third-order angle tracker to output the current rotor angle.

[0100] In one embodiment, the fault detection of the discrete envelope line implemented when the processor executes the computer program includes: performing a square operation on each of the two orthogonal differential sine and cosine signals; obtaining the square sum of the two orthogonal differential sine and cosine signals; and when the square sum is within a preset range, executing the step of performing inverse tangent processing on the discrete envelope line based on the fault detection result to obtain initial angle information.

[0101] In one embodiment, when the processor executes a computer program, the interrupt service program of the digital-to-analog converter is triggered at the moment of acquiring the current rotor angle. The current rotor angle is acquired periodically, and current sampling is performed within the period.

[0102] In one embodiment, the method implemented when the processor executes the computer program also includes: determining the triggering time of the interrupt service program as the position calculation time of the digital-to-analog converter; obtaining the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time; and compensating the current rotor angle based on the rotor angular velocity and the time difference.

[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: generating positive and negative pulse width modulation signals based on a digital-to-analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit; inputting the sine excitation signal and the cosine excitation signal to the primary side of the resolver, and outputting four differential sine and cosine signals; performing bias adjustment and proportional adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals; obtaining a current rotor angle based on the discrete envelope, and controlling the permanent magnet synchronous motor based on the current rotor angle.

[0104] In one embodiment, the method of obtaining a discrete envelope from the two orthogonal differential sine and cosine signals implemented when the computer program is executed by the processor includes: based on the digital-to-analog converter, obtaining a peak signal corresponding to a preset sampling point from the two orthogonal differential sine and cosine signals; and obtaining the discrete envelope based on the peak signal.

[0105] In one embodiment, the computer program implemented when executed by the processor obtains the current rotor angle based on the discrete envelope line, including: performing fault detection on the discrete envelope line; based on the fault detection result, performing inverse tangent processing on the discrete envelope line to obtain initial angle information; inputting the initial angle information into a third-order angle tracker to output the current rotor angle.

[0106] In one embodiment, the computer program implemented by the processor for performing fault detection on the discrete envelope line includes: performing a square operation on each of the two orthogonal differential sine and cosine signals; obtaining the square sum of the two orthogonal differential sine and cosine signals; and when the square sum is within a preset range, executing the step of performing inverse tangent processing on the discrete envelope line based on the fault detection result to obtain initial angle information.

[0107] In one embodiment, when the computer program is executed by the processor, the interrupt service program of the digital-to-analog converter is triggered at the moment of acquiring the current rotor angle. The current rotor angle is acquired periodically, and current sampling is performed within the period.

[0108] In one embodiment, the method implemented when the computer program is executed by the processor also includes: determining the triggering time of the interrupt service program as the position calculation time of the digital-to-analog converter; obtaining the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time; and compensating the current rotor angle based on the rotor angular velocity and the time difference.

[0109] In one embodiment, a computer program product is provided, comprising a computer program, which implements the following steps when executed by a processor: generating positive and negative pulse width modulation signals based on a digital-to-analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit; inputting the sine excitation signal and the cosine excitation signal into the primary side of the resolver, and outputting four differential sine and cosine signals; performing bias adjustment and proportional adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals; obtaining a current rotor angle based on the discrete envelope, and controlling the permanent magnet synchronous motor based on the current rotor angle.

[0110] In one embodiment, the method of obtaining a discrete envelope from the two orthogonal differential sine and cosine signals implemented when the computer program is executed by the processor includes: based on the digital-to-analog converter, obtaining a peak signal corresponding to a preset sampling point from the two orthogonal differential sine and cosine signals; and obtaining the discrete envelope based on the peak signal.

[0111] In one embodiment, the computer program implemented when executed by the processor obtains the current rotor angle based on the discrete envelope line, including: performing fault detection on the discrete envelope line; based on the fault detection result, performing inverse tangent processing on the discrete envelope line to obtain initial angle information; inputting the initial angle information into a third-order angle tracker to output the current rotor angle.

[0112] In one embodiment, the computer program implemented by the processor for performing fault detection on the discrete envelope line includes: performing a square operation on each of the two orthogonal differential sine and cosine signals; obtaining the square sum of the two orthogonal differential sine and cosine signals; and when the square sum is within a preset range, executing the step of performing inverse tangent processing on the discrete envelope line based on the fault detection result to obtain initial angle information.

[0113] In one embodiment, when the computer program is executed by the processor, the interrupt service program of the digital-to-analog converter is triggered at the moment of acquiring the current rotor angle. The current rotor angle is acquired periodically, and current sampling is performed within the period.

[0114] In one embodiment, the method implemented when the computer program is executed by the processor also includes: determining the triggering time of the interrupt service program as the position calculation time of the digital-to-analog converter; obtaining the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time; and compensating the current rotor angle based on the rotor angular velocity and the time difference.

[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0116] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0118] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A motor control method, characterized in that: The method comprises: Generate positive and negative pulse width modulation signals based on a digital analog converter, and convert the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit; Input the sine excitation signal and the cosine excitation signal to the primary side of the rotary transformer, and output four differential sine and cosine signals; Performing offset adjustment and ratio adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals; A current rotor angle is acquired based on the discrete envelope, and the permanent magnet synchronous motor is controlled based on the current rotor angle.

2. The method according to claim 1, characterized in that The step of obtaining a discrete envelope from the two orthogonal differential sine and cosine signals comprises: Based on the digital-to-analog converter, a peak signal corresponding to a preset sampling point is obtained from the two orthogonal differential sine and cosine signals; The discrete envelope is obtained based on the peak signal.

3. The method according to claim 1, characterized in that The obtaining the current rotor angle based on the discrete envelope includes: performing fault detection on the discrete envelope; Based on the fault detection result, performing arc tangent processing on the discrete envelope to obtain initial angle information; The initial angle information is input into a third-order angle tracker, and the current rotor angle is output.

4. The method according to claim 3, characterized in that The performing fault detection on the discrete envelope line comprises: Performing a square operation on each of the two orthogonal differential sine and cosine signals; Obtaining the square sum of the two orthogonal differential sine and cosine signals; When the square sum is within a preset range, the step of performing arc tangent processing on the discrete envelope based on the fault detection result to obtain initial angle information is performed.

5. The method according to claim 1, characterized in that At the moment of acquiring the current rotor angle, the interrupt service program of the digital-to-analog converter will be triggered. The current rotor angle is acquired periodically, and current sampling will be performed within the period.

6. The method according to claim 5, characterized in that The method further comprises: Determining the triggering moment of the interrupt service routine as the position calculation moment of the digital-to-analog converter; Acquire the time difference between the position calculation time and the current sampling time, and the rotor angular velocity corresponding to the triggering time; The current rotor angle is compensated based on the rotor angular velocity and the time difference.

7. A motor control device, characterized in that: The device comprises: A generating module, used for generating positive and negative pulse width modulation signals based on a digital analog converter, and converting the pulse width modulation signals into a sine excitation signal and a cosine excitation signal based on a resolver excitation circuit; An input module, used for inputting the sine excitation signal and the cosine excitation signal into the primary side of the rotary transformer, and outputting four differential sine and cosine signals; An adjustment module, used for performing offset adjustment and ratio adjustment on the four differential sine and cosine signals to obtain two orthogonal differential sine and cosine signals, and obtaining discrete envelopes from the two orthogonal differential sine and cosine signals; An acquisition module is used to acquire a current rotor angle based on the discrete envelope, and control the permanent magnet synchronous motor based on the current rotor angle.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.