A method, system, device, and medium for phase synchronization of a rotary transformer.

CN121923536BActive Publication Date: 2026-06-30GUANGDONG JIANGXINCHUANG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG JIANGXINCHUANG TECH CO LTD
Filing Date
2026-03-25
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, the phase difference caused by signal transmission path, filter phase shift and circuit delay in the rotary transformer under harsh environments cannot be accurately detected and synchronized, which affects the accuracy of angle resolution and the performance of the motor control system. At the same time, the traditional excitation signal generation method increases hardware cost and complexity.

Method used

The synchronous pulse signal output by the RPWM counter generates a sine wave excitation signal and a loop trigger signal. The sine and cosine signals are periodically acquired for zero-crossing detection, the phase difference is determined and phase synchronization compensation is performed, simplifying the hardware design and eliminating the need for an additional DAC or oscillation circuit.

Benefits of technology

It achieves high fidelity and control precision of signals under strong interference, improves the real-time performance and accuracy of phase difference detection, eliminates static angle deviation, and enhances the linearity of angle resolution and the stability of the rotary transformer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121923536B_ABST
    Figure CN121923536B_ABST
Patent Text Reader

Abstract

This application provides a phase synchronization method, system, device, and medium for a rotary transformer. It involves periodically acquiring sine and cosine signals output by the rotary transformer in response to a loop trigger counter outputting a loop trigger signal. Both the loop trigger signal and the sinusoidal excitation signal used to drive the rotary transformer are generated by converting a synchronization pulse signal output by an RPWM counter. Within each acquisition cycle, the sine and cosine signals are positively zero-crossing detected to obtain a zero-crossing detection result. Based on the zero-crossing detection result, the phase difference between the sine and cosine signals and the sinusoidal excitation signal in the current cycle is determined, and phase synchronization compensation is performed on the sinusoidal excitation signal based on the phase difference. This enhances the signal fidelity and control accuracy of the encoder under strong interference without increasing hardware costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electrical automation technology, and in particular to a phase synchronization method, system, device and medium for a rotary transformer. Background Technology

[0002] Resolvers (RCs) are widely used in motor control for angle position detection due to their stability and accuracy under harsh environments such as high temperature, vibration, and oil contamination. Currently, the mainstream technique is to use an angle tracking loop algorithm to analyze the angle of the sine and cosine signals output by the resolver. This algorithm has advantages such as fast response speed and good linearity of the analyzed angle. However, during the operation of the resolver, factors such as signal transmission path, filter phase shift, and circuit delay cause a phase difference between the excitation signal fed into the resolver and the sine and cosine signals fed back by the resolver. Accurate detection and synchronization of this phase difference is a key technical challenge in the angle tracking loop algorithm. Improper phase synchronization will directly affect the accuracy of angle analysis, leading to static deviations in the output angle, and in severe cases, even affecting the linearity of the analyzed angle, thereby reducing the overall performance of the motor control system.

[0003] On the other hand, resolvers require an external sinusoidal excitation signal of a specific frequency to function properly. Traditional excitation signal generation methods typically employ dedicated DAC chips or discrete oscillator circuits, which not only increases the design complexity of the peripheral circuits but also incurs high hardware costs. How to simplify the excitation signal generation circuit while effectively solving the phase synchronization problem between the excitation signal and the feedback signal, and improving the stability of loop calculations, has become a key technical challenge in this field. Summary of the Invention

[0004] The purpose of this application is to at least solve one of the technical problems existing in the prior art, and to provide a phase synchronization method, system, device and medium for a rotary transformer, which can enhance the signal fidelity and control accuracy of the encoder under strong interference without increasing hardware costs.

[0005] To achieve the above objectives, a first aspect of this application proposes a phase synchronization method for a rotary transformer, comprising:

[0006] In response to the loop trigger counter outputting the loop trigger signal, the sine and cosine signals output by the resolver are periodically acquired based on the loop trigger signal; wherein, the loop trigger signal and the sine excitation signal used to drive the resolver are both signals generated by converting the synchronous pulse signal output by the RPWM counter;

[0007] In each acquisition cycle, positive zero-crossing detection is performed on the sine and cosine signals to obtain the zero-crossing detection results. Based on the zero-crossing detection results, the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle is determined, and phase synchronization compensation is performed on the sine excitation signal based on the phase difference.

[0008] Furthermore, in some embodiments, the loop trigger signal is a pulse signal, and the sine and cosine signals output by the rotary transformer are periodically acquired based on the loop trigger signal, including:

[0009] The acquisition time is taken as the trigger time of each pulse of the loop trigger signal, and a sine and cosine signal is acquired once at each acquisition time;

[0010] A data collection cycle consists of a series of preset data collection times.

[0011] Furthermore, in some embodiments, positive zero-crossing detection is performed on the sine and cosine signals to obtain the zero-crossing detection result, including:

[0012] The phase count values ​​assigned to each acquisition moment;

[0013] At each acquisition time, detect whether the sine and cosine signals have a positive zero crossing. If so, the acquisition time when the sine and cosine signals have a positive zero crossing is determined as the zero crossing time.

[0014] The phase count value corresponding to the zero-crossing moment, and the signal amplitude of the sine and cosine signals at the zero-crossing moment, are used as the zero-crossing detection results.

[0015] Furthermore, in some embodiments, the phase count values ​​assigned to each acquisition time include:

[0016] The acquisition time when the sine and cosine signals first cross the positive zero is taken as the starting phase time, and an incremental phase count value is assigned to the starting phase time and each acquisition time thereafter.

[0017] The phase count value at the initial phase moment is the initial value, and the phase count value at each subsequent acquisition moment is the phase count value at the previous acquisition moment plus a preset step size value.

[0018] Furthermore, in some embodiments, determining the phase difference between the sine and cosine signals and the sinusoidal excitation signal within the current period based on the zero-crossing detection result includes:

[0019] Compare the signal amplitudes at each zero-crossing time;

[0020] The phase count value corresponding to the zero-crossing moment when the signal amplitude is the largest is taken as the phase difference.

[0021] Furthermore, in some embodiments, phase synchronization compensation of the sinusoidal excitation signal based on the phase difference includes:

[0022] Calculate the phase difference angle between the sine and cosine signals and the sinusoidal excitation signal based on the phase difference.

[0023] The phase of the sinusoidal excitation signal is adjusted based on the phase difference angle so that the phase of the sine and cosine signals is synchronized with the phase of the sinusoidal excitation signal.

[0024] Furthermore, in some embodiments, the loop trigger signal is generated by a loop trigger counter based on a built-in loop count value;

[0025] The loop trigger counter is configured to increment the loop count value under the drive of the counting clock, generate and output a loop trigger signal when the loop count value reaches a preset count comparison value, and reset the loop count value to zero when a synchronization pulse signal is received.

[0026] To achieve the above objectives, a second aspect of this application provides a phase synchronization system for a rotary transformer, comprising:

[0027] The RPWM counter is used to connect to the signal conversion of the resolver and output a synchronous pulse signal to the signal conversion circuit so that the signal conversion circuit generates and outputs a sinusoidal excitation signal to the resolver to drive the resolver.

[0028] A loop-triggered counter is connected to an RPWM counter.

[0029] A phase synchronization processor is connected to a loop trigger counter and a rotary transformer, respectively.

[0030] The loop trigger counter is configured to increment the loop count value under the drive of the counting clock, generate and output a loop trigger signal when the loop count value reaches a preset count comparison value, and reset the loop count value to zero when a synchronization pulse signal is received.

[0031] The phase synchronization processor is configured to periodically acquire the sine and cosine signals output by the rotary transformer in response to the loop trigger counter outputting a loop trigger signal.

[0032] The phase synchronization processor is also configured to perform positive zero-crossing detection on the sine and cosine signals in each acquisition cycle, obtain the zero-crossing detection result, determine the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle based on the zero-crossing detection result, and perform phase synchronization compensation on the sine excitation signal based on the phase difference.

[0033] To achieve the above objectives, a third aspect of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the phase synchronization method of the rotary transformer described in the first aspect.

[0034] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the phase synchronization method of the rotary transformer described in the first aspect.

[0035] According to an embodiment of this application, a phase synchronization method, system, device, and medium for a rotary transformer have at least the following beneficial effects: Firstly, the synchronization pulse signal output by the RPWM counter is simultaneously converted into a sine wave excitation signal and a loop trigger signal, achieving a homogeneous binding between the excitation signal frequency and the internal loop calculation frequency. This fundamentally provides a synchronization basis for eliminating phase differences. Furthermore, by dynamically modifying the duty cycle of the synchronization pulse signal, the function of a DAC can be achieved, eliminating the need for a dedicated DAC or oscillation circuit, effectively simplifying the peripheral hardware design. Secondly, by periodically acquiring sine and cosine signals through the loop trigger signal and performing positive zero-crossing detection in each acquisition cycle, the phase offset between the excitation signal and the feedback signal can be captured in real time. The continuous detection mechanism dynamically tracks phase changes, significantly improving the real-time performance and accuracy of phase difference detection. Thirdly, by determining the phase difference of the current cycle based on the zero-crossing detection result and performing phase synchronization compensation, static angle deviations caused by circuit delays and signal transmission paths can be effectively eliminated, ensuring that the angle tracking loop always operates in a phase-aligned state, thereby improving the linearity and accuracy of angle resolution and maintaining the stability of the rotary transformer operation.

[0036] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description and the accompanying drawings. Attached Figure Description

[0037] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0038] The present application will be further described below with reference to the accompanying drawings and embodiments;

[0039] Figure 1 This is an optional flowchart of the phase synchronization method for a rotary transformer provided in the embodiments of this application;

[0040] Figure 2 This is an optional signal waveform diagram of the RPWM counter and loop trigger count output provided in the embodiments of this application;

[0041] Figure 3 This is an optional timing diagram for periodically acquiring sine and cosine signals triggered by a loop trigger signal, provided in an embodiment of this application.

[0042] Figure 4 This is an optional flowchart for positive zero-crossing detection of sine and cosine signals provided in an embodiment of this application;

[0043] Figure 5 This is an optional flowchart provided in an embodiment of this application for determining the phase difference based on the zero-crossing detection result;

[0044] Figure 6 This is an optional flowchart provided in this application embodiment for performing phase synchronization compensation of a sinusoidal excitation signal based on phase difference;

[0045] Figure 7 This is an optional simplified framework diagram of the phase synchronization system for a rotary transformer provided in the embodiments of this application;

[0046] Figure 8 This is an optional internal structure framework diagram of the phase synchronization processor provided in the embodiments of this application;

[0047] Figure 9 This is a schematic diagram of an optional hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0048] This section will describe in detail the specific embodiments of this application. Preferred embodiments of this application are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of this application, but they should not be construed as limiting the scope of protection of this application.

[0049] In the description of this application, the use of "first" and "second" is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of the indicated technical features. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0050] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0051] Currently, the mainstream technique for angle analysis of the sine and cosine signals output by resolvers is the angle tracking loop algorithm, which offers advantages such as fast response speed and good linearity of the analyzed angle. However, during resolver operation, factors such as signal transmission path, filter phase shift, and circuit delay lead to a phase difference between the excitation signal fed into the resolver and the sine and cosine signals fed back by the resolver. Accurate detection and synchronization of this phase difference is a key technical challenge in the angle tracking loop algorithm. Improper phase synchronization directly affects the accuracy of angle analysis, resulting in static deviations in the output angle, and in severe cases, even affecting the linearity of the analyzed angle, thereby reducing the overall performance of the motor control system.

[0052] On the other hand, resolvers require an external sinusoidal excitation signal of a specific frequency to function properly. Traditional excitation signal generation methods typically employ dedicated DAC chips or discrete oscillator circuits, which not only increases the design complexity of the peripheral circuits but also incurs high hardware costs. How to simplify the excitation signal generation circuit while effectively solving the phase synchronization problem between the excitation signal and the feedback signal, and improving the stability of loop calculations, has become a key technical challenge in this field.

[0053] Based on this, embodiments of this application provide a phase synchronization method, system, device and medium for a rotary transformer, which can enhance the signal fidelity and control accuracy of the encoder under strong interference without increasing hardware costs.

[0054] Therefore, the embodiments of this application will be further described below with reference to the accompanying drawings.

[0055] Reference Figure 1As shown, Figure 1 This is an optional flowchart of a phase synchronization method for a rotary transformer provided in the embodiments of this application. The method may include, but is not limited to, steps S101 to S102.

[0056] Step S101: In response to the loop trigger counter outputting a loop trigger signal, the sine and cosine signals output by the rotary transformer are periodically acquired based on the loop trigger signal.

[0057] The loop trigger signal and the sinusoidal excitation signal used to drive the rotary transformer are both generated by converting the synchronous pulse signal output by the RPWM counter.

[0058] It should be noted that the synchronization pulse signal is a PWM signal. The RPWM counter is used as the base clock source in the angle tracking loop. On one hand, the synchronization pulse signal RPWM_FRE_SYNC is dynamically adjusted by the duty cycle and then fed into an external hardware low-pass filter, thus converting it into a sinusoidal excitation signal of a specific frequency. This sinusoidal excitation signal is provided to the resolver to drive its operation. On the other hand, the RPWM counter generates the synchronization pulse signal RPWM_FRE_SYNC during operation. This synchronization pulse signal is output to the loop trigger counter for synchronization. Under the action of the synchronization pulse signal, the loop trigger counter generates a loop trigger signal, which is used to trigger subsequent phase tracking and angle tracking loop calculations. Therefore, both the sinusoidal excitation signal and the loop trigger signal originate from the same synchronization pulse signal RPWM_FRE_SYNC output by the RPWM counter. Figure 2 As shown, Figure 2 This is an optional signal waveform diagram of the RPWM counter and loop trigger counter output provided in the embodiments of this application. The synchronization pulse signal and the synchronization pulse signal are synchronously correlated in frequency and phase. That is, the sine wave excitation signal and the loop trigger signal are also synchronously correlated in frequency and phase, which provides an accurate synchronization basis for the subsequent calculation of the phase difference between the excitation signal and the feedback signal.

[0059] Furthermore, in some embodiments, the loop trigger signal LOOP_TRK_TRIG is a pulse signal. The process of periodically acquiring the sine and cosine signals output by the rotary transformer based on the loop trigger signal specifically includes the following steps: using the trigger time of each pulse of the loop trigger signal as the acquisition time, and acquiring the sine and cosine signals once at each acquisition time. Specifically, refer to... Figure 3 As shown, Figure 3This embodiment of the application provides an optional timing diagram for periodically acquiring sine and cosine signals triggered by a loop trigger signal. Each output of a loop trigger signal LOOP_TRK_TRIG by the loop trigger counter represents the arrival of a pulse trigger moment. At each pulse trigger moment, the system performs one acquisition of the sine and cosine signals output by the resolver, and this moment is taken as the acquisition moment. In this way, the acquisition action is strictly synchronized with the pulse of the loop trigger signal, and each pulse trigger moment corresponds to one signal acquisition, thereby realizing the periodic sampling of sine and cosine signals. A consecutive preset number of pulse trigger moments and their corresponding acquisitions constitute an acquisition cycle. The above acquisition process is repeated within each acquisition cycle, so that the sampling points are evenly distributed within the period of the excitation signal, providing accurate raw data for subsequent phase difference detection.

[0060] In a preferred embodiment, the loop trigger signal LOOP_TRK_TRIG is generated by a loop trigger counter based on a built-in loop count value. The loop trigger counter is configured to increment the loop count value under the drive of a counting clock, generate and output the loop trigger signal LOOP_TRK_TRIG when the loop count value reaches a preset count comparison value LOOP_TRK_CMPA, and reset the loop count value to zero when a synchronization pulse signal RPWM_FRE_SYNC is received. Specifically, refer again... Figure 3 As shown, the loop trigger counter increments the loop count value under the drive of the counting clock enable signal LOOP_TRK_EN. When the loop count value reaches the preset count comparison value LOOP_TRK_CMPA, a loop trigger signal is generated and output. This trigger signal is used to trigger subsequent phase tracking and angle tracking loop calculations, and simultaneously triggers an ADC sampling of the sine and cosine signals. By configuring the count comparison value LOOP_TRK_CMPA, the generation time of the loop trigger signal can be flexibly set, allowing the ADC sampling time to avoid the moment when the complementary PWM signal level flips, thereby effectively reducing the interference of signal fluctuations on the sampling results, improving the sampling accuracy of the ADC, and thus improving the resolution accuracy of the angle tracking loop. Simultaneously, when the RPWM count value built into the RPWM counter reaches its set count comparison value RPWM_PRD, a synchronization pulse signal RPWM_FRE_SYNC is generated. This synchronization pulse signal is sent to the loop trigger counter, immediately resetting the loop count value to zero. By configuring the RPWM count value of the RPWM counter and the loop count value of the loop trigger counter to be equal or proportional, the frequency of the sinusoidal excitation signal and the frequency of the loop trigger signal can be kept in a precise multiple relationship, ensuring that there are an integer number of sampling points within one excitation signal cycle. This provides a precise synchronization basis for the detection and calculation of the phase difference between the subsequent excitation signal and the feedback signal.

[0061] Step S102: In each acquisition cycle, the sine and cosine signals are positively zero-crossing detected to obtain the zero-crossing detection result. Based on the zero-crossing detection result, the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle is determined, and the phase synchronization compensation of the sine excitation signal is performed based on the phase difference.

[0062] Specifically, within each acquisition cycle, the system performs positive zero-crossing detection on the acquired sine and cosine signals. A positive zero-crossing point refers to the instantaneous value of the signal voltage as it crosses from the negative half-axis to the positive half-axis, a point where the signal change rate is at its maximum, making it easy to detect accurately. During the detection process, within one acquisition cycle, the system sequentially judges the sine and cosine signals at each sampling moment according to a preset sampling frequency. When the sine and cosine signals change from negative to positive and cross zero voltage, the sampling moment is determined to be a positive zero-crossing point and recorded. Next, the system determines the phase difference between the sine and cosine signals and the sinusoidal excitation signal within that cycle based on the positive zero-crossing point information recorded within one acquisition cycle. Specifically, this can be achieved by selecting the count value corresponding to the most representative zero-crossing point from multiple positive zero-crossing points as the phase difference. This phase difference characterizes the degree of delay of the sine and cosine signals relative to the excitation signal. Subsequently, the system calculates the phase difference angle based on the determined phase difference, and performs phase synchronization compensation on the sinusoidal excitation signal based on the phase difference angle. The compensation method is to use the phase difference angle as an adjustment amount to correct the initial phase of the internal reference signal of the angle tracking loop, so that the phase of the internal reference signal is precisely aligned with the phase of the feedback sine and cosine signals. This ensures that the subsequent angle analysis calculation is based on the phase-aligned signal, eliminates the static angle deviation caused by phase shift, and improves the accuracy and linearity of the angle output.

[0063] In steps S101 to S102, the synchronous pulse signal output by the RPWM counter is simultaneously converted into a sine wave excitation signal and a loop trigger signal, realizing the homogeneous binding of the excitation signal frequency and the internal loop calculation frequency. This fundamentally provides a synchronization basis for eliminating phase differences. Furthermore, by dynamically modifying the duty cycle of the synchronous pulse signal, the function of a DAC can be achieved without the need for a dedicated DAC or oscillation circuit, effectively simplifying the peripheral hardware design. Secondly, by periodically acquiring sine and cosine signals through the loop trigger signal and performing positive zero-crossing detection in each acquisition cycle, the phase offset between the excitation signal and the feedback signal can be captured in real time. The continuous detection mechanism dynamically tracks phase changes, significantly improving the real-time performance and accuracy of phase difference detection. Moreover, by determining the phase difference of the current cycle based on the zero-crossing detection result and performing phase synchronization compensation, static angle deviations caused by circuit delays and signal transmission paths can be effectively eliminated, ensuring that the angle tracking loop always operates in a phase-aligned state. This improves the linearity and accuracy of angle resolution and maintains the stability of the rotary transformer.

[0064] Furthermore, refer to Figure 4 As shown, Figure 4 This is an optional flowchart for positive zero-crossing detection of sine and cosine signals provided in the embodiments of this application. The method may include, but is not limited to, steps S201 to S203.

[0065] Step S201: Assign phase count values ​​to each acquisition time.

[0066] Step S202: Detect whether the sine and cosine signals have crossed the zero in the positive direction at each acquisition time. If so, determine the acquisition time when the sine and cosine signals cross the zero in the positive direction as the zero-crossing time.

[0067] Step S203: Take the phase count value corresponding to the zero-crossing moment and the signal amplitude of the sine and cosine signals at the zero-crossing moment as the zero-crossing detection result.

[0068] Specifically, the system first assigns a corresponding phase count value (Index) to each acquisition moment within each acquisition cycle. The phase count value (Index) identifies the temporal position of each acquisition moment within that acquisition cycle. The assignment method can be to increment the value sequentially according to the order of the acquisition moments. For example, the phase count value (Index) for the first acquisition moment can be set to 0 or 1, and the phase count value (Index) for subsequent acquisition moments can be incremented by 1 until the end of the acquisition cycle. In this way, each acquisition moment obtains a unique phase count value (Index) corresponding to its occurrence sequence. This phase count value (Index) reflects the temporal position of that moment within the entire acquisition cycle, and also reflects the phase of the sine and cosine signals at different acquisition moments. For example, Index=0 represents phase 0, and Index=1 represents phase 1.

[0069] During each acquisition moment, the system performs positive zero-crossing detection on the sine and cosine signals output by the rotary transformer. A positive zero-crossing point refers to the instantaneous value of the signal voltage as it crosses from the negative half-axis to the positive half-axis, resulting in zero. During the detection process, the system sequentially judges the signal state at each acquisition moment according to a preset sampling frequency. When the signal changes from a negative value to a positive value and crosses zero voltage, the acquisition moment is determined to be a positive zero-crossing moment for either the sine or cosine signal, and this acquisition moment is identified as the zero-crossing moment. For each acquisition moment identified as a zero-crossing moment, the system extracts the corresponding phase count value (Index) and records the instantaneous voltage value of the sine or cosine signal acquired at that zero-crossing moment as the signal amplitude. The phase count value reflects the phase of the corresponding sine or cosine signal within the acquisition period at that zero-crossing moment, and the signal amplitude reflects the intensity of the corresponding sine or cosine signal at that zero-crossing moment. The system associates and stores the phase count value (Index) and its corresponding signal amplitude for each zero-crossing moment; both constitute the zero-crossing detection result. The zero-crossing detection results record the timing information of all positive zero-crossing points and their corresponding signal strengths within the acquisition period, providing a complete data foundation for subsequent selection of the optimal phase difference based on amplitude comparison.

[0070] In a preferred embodiment, the process of allocating phase count values ​​for each acquisition moment includes the following steps: taking the acquisition moment when the sine and cosine signals first cross zero in a positive direction as the starting phase moment, and sequentially allocating incremental phase count values ​​for the starting phase moment and each acquisition moment after the starting phase moment; wherein, the phase count value at the starting phase moment is the initial value, and the phase count value at each acquisition moment after the starting phase moment is the phase count value at the previous acquisition moment plus a preset step value.

[0071] Specifically, at the beginning of each acquisition cycle, the system determines the starting phase by detecting the positive zero-crossing point of the sine and cosine signals output by the rotary transformer. When the sine and cosine signals cross from the negative half-axis to the positive half-axis and the instantaneous voltage value is zero, the system determines this moment as the starting phase moment and marks the corresponding acquisition moment as the phase zero point. This starting phase moment serves as the timing reference for the entire acquisition cycle and is used for allocating phase count values ​​for all subsequent acquisition moments. After the starting phase moment is determined, the system assigns an initial phase count value to this starting phase moment, usually set to 0 or 1, with the specific value determined according to the counter design conventions or system configuration. Subsequently, for each acquisition moment after the starting phase moment, the system sequentially allocates incremental phase count values ​​according to chronological order. The allocation method is as follows: at the arrival of each acquisition moment, the system adds a preset step size value to the current latest phase count value, and uses the increased value as the phase count value for the current acquisition moment. The step size is typically set to 1, meaning that the phase count value increments by 1 at each acquisition time, resulting in a natural number sequence of 0, 1, 2, 3… or 1, 2, 3, 4… for the phase count values ​​at each acquisition time. The step size can also be configured to other fixed values, such as 0.5 or 2, depending on the system's sampling frequency and accuracy requirements. However, for ease of subsequent calculations and timing correspondence, an integer step size is usually used.

[0072] Through the above allocation method, each acquisition moment obtains a unique phase count value that strictly corresponds to its temporal sequence within the acquisition period. This phase count value not only identifies the temporal position of the acquisition moment but also directly reflects the phase offset of that moment relative to the starting phase point, which is equivalent to mapping the sampling point on the time axis to discrete phase points in the phase domain. For example, if the acquisition period corresponds to N acquisition moments, the phase count value increases sequentially from 0 to N-1 or 1 to N, with each phase count value corresponding to a fixed phase angle position. This allocation method provides an accurate phase reference for the positive zero-crossing detection of subsequent acquisition moments, allowing the detected zero-crossing moment to be directly characterized by its phase count value within the acquisition period, facilitating subsequent phase difference calculation and synchronization compensation.

[0073] In steps S201 to S203, by assigning phase count values ​​to each acquisition moment, a precise correspondence between the acquisition moment and the phase of the sine and cosine signals is established, ensuring that each sampling point has a unique phase identifier. This provides an accurate timing reference for subsequent zero-crossing detection and phase difference calculation. Secondly, positive zero-crossing detection is performed at each acquisition moment, and the acquisition moment in which a positive zero-crossing occurs is determined as the zero-crossing moment. This detection method fully utilizes the characteristics of the positive zero-crossing point—the largest rate of change of the signal and ease of precise capture—effectively improving the accuracy and reliability of zero-crossing detection. Thirdly, the phase count value corresponding to the zero-crossing moment and the signal amplitude at that moment are used together as the zero-crossing detection result. This result not only records the precise phase position of the zero-crossing point within the excitation signal period but also retains the signal strength information at that moment, providing a complete data foundation for subsequent selection of the optimal phase difference based on amplitude comparison. Compared to detection methods that only record the zero-crossing moment, this application records both the phase count value and the signal amplitude simultaneously. This allows the system to select the zero-crossing point with the highest signal-to-noise ratio and the strongest reliability from multiple zero-crossing points based on the amplitude magnitude, thus effectively suppressing the impact of signal fluctuations and noise interference on phase detection and further improving the accuracy of phase synchronization and the stability of the angle tracking loop.

[0074] Furthermore, refer to Figure 5 As shown, Figure 5 This is an optional flowchart provided in the embodiments of this application for determining the phase difference based on the zero-crossing detection result. The method may include, but is not limited to, steps S301 to S303.

[0075] Step S301: Compare the signal amplitudes corresponding to each zero-crossing time.

[0076] Step S302: Take the phase count value corresponding to the zero-crossing moment when the signal amplitude is the largest as the phase difference.

[0077] Specifically, within each acquisition cycle, the system compares the signal amplitudes corresponding to all recorded zero-crossing moments. Because the sine and cosine signals output by the rotary transformer may be affected by circuit noise, electromagnetic interference, or amplitude fluctuations during transmission, the signal amplitudes differ at different zero-crossing moments. The magnitude of the signal amplitude directly reflects the energy intensity of the sine and cosine signals at that moment; a larger amplitude means a higher signal-to-noise ratio and less susceptibility to noise interference, thus increasing the reliability and stability of the zero-crossing detection. By comparing the signal amplitudes at each zero-crossing moment, the system can identify the zero-crossing point detected under optimal signal quality conditions.

[0078] Then, the system extracts the phase count value corresponding to the zero-crossing moment with the largest amplitude and determines this phase count value as the phase difference of the current acquisition cycle. This phase count value characterizes the precise phase position of this zero-crossing moment within the excitation signal cycle, that is, the offset of this moment relative to the starting phase point. Since this zero-crossing moment has the highest signal amplitude, its zero-crossing detection result is least affected by noise and can best reflect the actual phase offset between the sine and cosine signals and the excitation signal. Subsequent phase synchronization compensation based on this phase difference can significantly improve the accuracy of compensation, effectively eliminate phase errors introduced by circuit delays and signal transmission paths, and thus improve the resolution accuracy of the angle tracking loop. At the same time, by repeating the above amplitude comparison and phase difference selection process in each acquisition cycle, the system can track phase changes in real time, dynamically adjust the compensation amount, and ensure that the zero-crossing point with the best signal quality is always selected as the basis for phase difference calculation, thereby enhancing the system's anti-interference capability and long-term stability.

[0079] Furthermore, refer to Figure 6 As shown, Figure 6 This is an optional flowchart provided by an embodiment of the present application for phase synchronization compensation of a sinusoidal excitation signal based on the phase difference. The method may include, but is not limited to, steps S401 to S402.

[0080] Step S401: Calculate the phase difference angle between the sine and cosine signals and the sine excitation signal based on the phase difference.

[0081] Step S402: Adjust the phase of the sinusoidal excitation signal based on the phase difference angle so that the phase of the sine and cosine signals are synchronized with the phase of the sinusoidal excitation signal.

[0082] During steps S401 to S402, when calculating the phase difference angle between the sine / cosine signal and the sinusoidal excitation signal based on the phase difference, the system first determines the phase count value corresponding to the phase difference in step S302 and converts it into an angle value. Since the phase difference is a discrete value obtained by sequentially allocating values ​​within the period of the sine / cosine signal, each phase count value corresponds to a specific phase position in the excitation signal period. Therefore, the phase difference angle can be obtained by multiplying the phase count value by the angle value corresponding to a unit phase interval. In one embodiment, the angle value corresponding to the unit phase interval is 360 degrees divided by the period length of one acquisition cycle. The period length refers to the total number of acquisition moments within the acquisition cycle, i.e., phase difference angle = 360° * phase difference / total number of acquisition moments within the acquisition cycle. For example: (Refer to...) Figure 3 As shown, Figure 3If a single acquisition cycle includes 20 acquisition moments, then the cycle length is 20, meaning the phase difference angle within that acquisition cycle = 360° * phase difference / 20. In another embodiment, the angle value corresponding to this unit phase interval can be calculated based on the ratio between the frequency of the sinusoidal excitation signal and the sampling frequency. Through the above conversion, the system obtains the phase difference angle expressed in degrees or radians, which quantifies the actual phase offset of the sine and cosine signals relative to the excitation signal.

[0083] When adjusting the phase of the sinusoidal excitation signal based on the phase difference angle to synchronize the phase of the sine and cosine signals with that of the sinusoidal excitation signal, the system applies this phase difference angle as a compensation to the generation stage of the excitation signal. Specifically, during the generation of the reference signal within the angle tracking loop, the system superimposes the phase difference angle as a phase offset onto the initial phase of the reference signal, causing the phase of the reference signal to shift accordingly relative to the original reference. After the phase-adjusted excitation signal is output to the resolver, the resulting sine and cosine feedback signals are precisely aligned in phase with the adjusted excitation signal. Alternatively, based on the synchronization mechanism of the loop trigger counter, the system adjusts the starting phase of the synchronization pulse signal generated by the RPWM counter, thereby directly changing the output phase of the sinusoidal excitation signal to synchronize it with the feedback sine and cosine signals. Regardless of the specific adjustment method used, the essence of phase synchronization is to eliminate the phase difference introduced by factors such as circuit delay and filter phase shift, ensuring that the excitation signal and the feedback signal are at the same phase reference in the angle tracking loop. This allows subsequent angle analysis calculations to be performed based on the phase-aligned signals, avoiding static angle errors caused by phase offsets.

[0084] Reference Figure 7 and Figure 8 As shown, Figure 7 This is an optional simplified framework diagram of the phase synchronization system for a rotary transformer provided in an embodiment of this application. Figure 8 This is an optional internal structure framework diagram of the phase synchronization processor provided in the embodiments of this application. A second aspect of the embodiments of this application proposes a phase synchronization system 700 for a rotary transformer, comprising:

[0085] RPWM counter 701 is used to connect to the signal conversion circuit of the rotary transformer and output a synchronous pulse signal to the signal conversion circuit so that the signal conversion circuit generates and outputs a sinusoidal excitation signal to drive the rotary transformer.

[0086] Loop-triggered counter 702 is connected to RPWM counter 701;

[0087] Phase synchronization processor 703 is connected to loop trigger counter 702 and rotary transformer respectively;

[0088] The loop trigger counter 702 is configured to increment the loop count value under the drive of the counting clock, generate and output a loop trigger signal when the loop count value reaches a preset count comparison value, and reset the loop count value to zero when a synchronization pulse signal is received.

[0089] The phase synchronization processor 703 is configured to periodically acquire the sine and cosine signals output by the rotary transformer in response to the loop trigger counter 702 outputting a loop trigger signal.

[0090] The phase synchronization processor 703 is also configured to perform positive zero-crossing detection on the sine and cosine signals in each acquisition cycle, obtain the zero-crossing detection result, determine the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle based on the zero-crossing detection result, and perform phase synchronization compensation on the sine excitation signal based on the phase difference.

[0091] The phase synchronization system 700 of the aforementioned rotary transformer is based on the same inventive concept as the phase synchronization method of the rotary transformer. It simultaneously converts the synchronization pulse signal output by the RPWM counter into a sine wave excitation signal and a loop trigger signal, achieving a homogeneous binding between the excitation signal frequency and the internal loop calculation frequency. This fundamentally provides a synchronization basis for eliminating phase differences. Furthermore, by dynamically modifying the duty cycle of the synchronization pulse signal, it can function as an equivalent DAC, eliminating the need for a dedicated DAC or oscillation circuit, effectively simplifying the peripheral hardware design. Secondly, by periodically acquiring sine and cosine signals through the loop trigger signal and performing positive zero-crossing detection in each acquisition cycle, it can capture the phase shift between the excitation signal and the feedback signal in real time. The continuous detection mechanism dynamically tracks phase changes, significantly improving the real-time performance and accuracy of phase difference detection. Moreover, by determining the phase difference of the current cycle based on the zero-crossing detection result and performing phase synchronization compensation, it can effectively eliminate static angle deviations caused by circuit delays and signal transmission paths, ensuring that the angle tracking loop always operates in a phase-aligned state, thereby improving the linearity and accuracy of angle resolution and maintaining the stability of the rotary transformer operation.

[0092] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the phase synchronization method for the rotary transformer described above. This electronic device can be any smart terminal, including mobile phones, tablets, and in-vehicle computers.

[0093] Please see Figure 9 , Figure 9This is a schematic diagram of an optional hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes:

[0094] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the phase synchronization method of the rotary transformer provided in the embodiments of this application.

[0095] The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 to execute the phase synchronization method of the rotary transformer provided in the embodiments of this application.

[0096] The input / output interface 903 is used to implement information input and output;

[0097] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0098] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0099] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0100] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, provides a phase synchronization method for a rotary transformer.

[0101] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0102] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0103] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0104] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0105] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0106] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0107] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0108] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0109] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A phase synchronization method of a rotary transformer, characterized by, include: In response to the loop trigger counter outputting a loop trigger signal, the sine and cosine signals output by the resolver are periodically acquired according to the loop trigger signal; wherein, the loop trigger signal and the sine excitation signal used to drive the resolver are both signals generated by converting the synchronous pulse signal output by the RPWM counter; In each acquisition cycle, the sine and cosine signals are positively zero-crossing detected to obtain the zero-crossing detection result. Based on the zero-crossing detection result, the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle is determined, and the sine excitation signal is phase-synchronized compensated based on the phase difference. The loop trigger counter has a built-in loop count value. The process of the loop trigger counter outputting the loop trigger signal includes the following steps: incrementing the loop count value under the drive of the counting clock; generating and outputting the loop trigger signal when the loop count value reaches a preset counting comparison value; and resetting the loop count value to zero when the synchronization pulse signal is received.

2. The phase synchronization method of claim 1, wherein, The loop trigger signal is a pulse signal, and the step of periodically acquiring the sine and cosine signals output by the rotary transformer based on the loop trigger signal includes: Each pulse triggering time of the loop trigger signal is used as the acquisition time. The sine and cosine signals are acquired once at each acquisition time, and a corresponding time count value is assigned to each acquisition time. A collection cycle is formed by a series of predetermined collection times.

3. The phase synchronization method of claim 2, wherein, The step of performing positive zero-crossing detection on the sine and cosine signals to obtain the zero-crossing detection result includes: A phase count value is assigned to each of the aforementioned acquisition times; At each of the acquisition times, it is detected whether the sine and cosine signals have crossed the zero in the positive direction. If so, the acquisition time when the sine and cosine signals cross the zero in the positive direction is determined as the zero crossing time. The phase count value corresponding to the zero-crossing moment, and the signal amplitude of the sine and cosine signals at the zero-crossing moment, are used as the zero-crossing detection result.

4. The phase synchronization method according to claim 3, characterized in that, The process of assigning phase count values ​​for each acquisition time includes: The acquisition time when the sine and cosine signals first cross positive zero is taken as the starting phase time, and an incremental phase count value is sequentially assigned to the starting phase time and each acquisition time thereafter. Wherein, the phase count value at the starting phase moment is an initial value, and the phase count value at each acquisition moment after the starting phase moment is the phase count value at the previous acquisition moment plus a preset step size value.

5. The phase synchronization method of claim 3, wherein, Determining the phase difference between the sine and cosine signals and the sinusoidal excitation signal within the current period based on the zero-crossing detection result includes: Compare the signal amplitudes corresponding to each of the zero-crossing moments; The phase count value corresponding to the zero-crossing moment with the largest signal amplitude is taken as the phase difference.

6. The phase synchronization method of claim 1, wherein, The step of performing phase synchronization compensation on the sinusoidal excitation signal based on the phase difference includes: Calculate the phase difference angle between the sine and cosine signals and the sinusoidal excitation signal based on the phase difference; The phase of the sinusoidal excitation signal is adjusted based on the phase difference angle so that the phase of the sine and cosine signals is synchronized with the phase of the sinusoidal excitation signal.

7. A phase synchronization system for a resolver, characterized by include: An RPWM counter is used to connect to the signal conversion circuit of the rotary transformer and output a synchronous pulse signal to the signal conversion circuit so that the signal conversion circuit generates and outputs a sinusoidal excitation signal to the rotary transformer for driving the rotary transformer. A loop-triggered counter, which is connected to the RPWM counter; A phase synchronization processor, which is connected to the loop trigger counter and the rotary transformer respectively; The loop trigger counter is configured to increment the built-in loop count value under the drive of the counting clock, generate and output a loop trigger signal when the loop count value reaches a preset count comparison value, and reset the loop count value to zero when the synchronization pulse signal is received. The phase synchronization processor is configured to output the loop trigger signal in response to the loop trigger counter, and periodically acquire the sine and cosine signals output by the rotary transformer according to the loop trigger signal; The phase synchronization processor is further configured to perform positive zero-crossing detection on the sine and cosine signals in each acquisition cycle, obtain a zero-crossing detection result, determine the phase difference between the sine and cosine signals and the sine excitation signal in the current cycle based on the zero-crossing detection result, and perform phase synchronization compensation on the sine excitation signal based on the phase difference.

8. An electronic device, characterized in that, The electronic device is provided with a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the phase synchronization method of the rotary transformer according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a processor-executable program that, when executed by a processor, implements the phase synchronization method for a rotary transformer as described in any one of claims 1 to 6.