Phase shift detection method, device and equipment of rotary transformer circuit system and medium
By using a fast comparator and timer input device to capture timestamps in a resolver circuit system, the phase offset value of the resolver is calculated, solving the problems of high resource consumption and high hardware complexity in the prior art, and realizing low-cost, high-precision phase delay calculation.
Patent Information
- Application Number
- CN202411394050.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-07
AI Technical Summary
Existing resolver circuit systems incur high resource consumption and complex hardware circuit design when calculating phase delay, which increases hardware costs. How to obtain the phase delay of resolver circuit systems at low cost is an urgent problem to be solved.
By using the fast comparator and timer input devices in the main control chip, the edge timestamps of the mixing signal and the sinusoidal PWM signal are captured, the time offset between the target mixing signal and the standard excitation sinusoidal signal is calculated, and the phase offset value of the resolver circuit system is determined without the need to introduce a carrier recovery device.
It reduces the hardware complexity and chip cost of the rotary transformer circuit system, simplifies the calculation process, and meets the requirements for real-time high-precision position control.
Smart Images

Figure CN119269883A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of signal processing technology, and in particular to a phase shift detection method, device, equipment and medium for a rotary transformer circuit system. Background Art
[0002] A resolver (also referred to as a resolver) is a sensor whose output voltage changes with the rotor angle, usually consisting of an excitation winding and a two-phase orthogonal return winding. Figure 1 As shown, when the excitation winding is passed through a high-frequency excitation reference signal, each return winding will induce a sine mixing signal and a cosine mixing signal. By decoding these two mixing signals, the rotor angle can be obtained.
[0003] The existing resolver circuit system mainly generates an excitation reference signal through a sinusoidal PWM (Pulse Width Modulation) signal modulated based on a standard sinusoidal signal. Due to the error factors in the use of the resolver circuit system, such as mechanical accuracy or circuit board line transmission delay, there is a phase delay (also called phase offset or phase shift) between the mixing signal and the theoretical excitation reference signal. Therefore, it is necessary to pre-calculate the phase delay and compensate it in the resolver solution of the resolver circuit system to improve the solution accuracy.
[0004] At present, the main method is to add carrier recovery devices such as phase-locked loop circuits to the resolver circuit system to recover the phase delay each time the resolver is resolved. This method is computationally complex and has high resource overhead. At the same time, it increases the design complexity of the hardware circuit and the hardware cost. Therefore, how to obtain the phase delay of the resolver circuit system at a low cost is an important problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present invention provide a phase shift detection method, device, equipment and medium in a rotary transformer circuit system, so as to accurately calculate the phase offset value of the rotary transformer circuit system without introducing additional hardware circuits.
[0006] According to one aspect of an embodiment of the present invention, a phase shift detection method of a rotary transformer circuit system is provided. The rotary transformer circuit system includes a main control chip, a peripheral circuit and a rotary transformer. The peripheral circuit is used to generate an excitation reference signal according to a sinusoidal PWM signal sent by the main control chip and output it to the rotary transformer, and provide a sinusoidal or cosine mixing signal fed back by the rotary transformer to the main control signal for analyzing the rotor angle of the rotary transformer. The method includes:
[0007] The sampling result of the target mixing signal is compared with the preset reference signal value through the fast comparison device in the main control chip to generate a mixing PWM signal;
[0008] Capturing the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input device in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal;
[0009] Through the second channel of the timer input device in the main control chip, the edge timestamps of the sinusoidal PWM signal are captured to form a timestamp sequence;
[0010] Determine a second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal;
[0011] The time offset between the target mixing signal and the standard excitation sinusoidal signal is calculated according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and the phase offset value of the rotary transformer circuit system is calculated according to the time offset.
[0012] According to another aspect of an embodiment of the present invention, a phase shift detection device of a rotary transformer circuit system is further provided. The rotary transformer circuit system includes a main control chip, a peripheral circuit and a rotary transformer. The peripheral circuit is used to generate an excitation reference signal according to a sinusoidal PWM signal sent by the main control chip and output it to the rotary transformer, and provide a sinusoidal or cosine mixing signal fed back by the rotary transformer to the main control signal for analyzing the rotor angle of the rotary transformer. The device includes:
[0013] A mixed frequency PWM signal generation module is used to compare the sampling result of the target mixed frequency signal with a preset reference signal value through a fast comparison module in the main control chip to generate a mixed frequency PWM signal;
[0014] A first zero-crossing time point sequence forming module is used to capture the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input module in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal;
[0015] The timestamp sequence forming module is used to capture the edge timestamps of the sinusoidal PWM signal through the second channel of the timer input module in the main control chip to form a timestamp sequence;
[0016] A second zero-crossing time point sequence interval determination module, used to determine a second zero-crossing time point sequence of a standard excitation sinusoidal signal matching the sinusoidal PWM signal according to a timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal;
[0017] The phase offset value calculation module is used to calculate the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculate the phase offset value of the rotary transformer circuit system according to the time offset.
[0018] According to another aspect of an embodiment of the present invention, an electronic device is provided, the electronic device comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the phase shift detection method of the rotary transformer circuit system according to any embodiment of the present invention.
[0022] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the phase shift detection method of the rotary transformer circuit system described in any embodiment of the present invention when executed.
[0023] According to another aspect of an embodiment of the present invention, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, the steps of the method described in any embodiment of the present invention are implemented.
[0024] The technical solution of the embodiment of the present invention obtains the edge timestamp of the sinusoidal PWM signal used to generate the excitation reference signal and the edge timestamp of the mixed PWM signal matching the target mixed signal fed back by the rotary transformer by using the existing hardware acquisition of the rotary transformer circuit system. Based on the above two types of timestamps, the zero-crossing sequence of the standard excitation sinusoidal signal used to generate the sinusoidal PWM signal and the zero-crossing sequence of the target mixed signal are identified. Then, according to the above two types of zero-crossing sequences, the implementation method of the phase offset value of the rotary transformer circuit system is accurately determined. There is no need to introduce a carrier recovery device in the rotary transformer circuit system, which reduces the hardware complexity and chip cost of the rotary transformer circuit system. In addition, the phase offset value calculation scheme only needs to be calculated once after the hardware circuit of the rotary transformer circuit system is determined, and the calculation result can be directly used later. Such operation can effectively reduce the calculation complexity of the actual rotary transformer solution and effectively meet the real-time and high-precision position control requirements of the rotary transformer circuit system.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 Schematic diagram of the working principle of a rotary transformer applicable to an embodiment of the present invention;
[0028] Figure 2 is a structural schematic diagram of a rotary transformer circuit system applicable to an embodiment of the present invention;
[0029] Figure 3 is a flow chart of a phase shift detection method of a rotary transformer circuit system provided in an embodiment of the present invention;
[0030] Figure 4 It is a schematic diagram of input and output waveforms of a fast comparison module with a hysteresis band function applicable to an embodiment of the present invention;
[0031] Figure 5 is a flow chart of another phase shift detection method of a rotary transformer circuit system provided by an embodiment of the present invention;
[0032] Figure 6 is a specific structural diagram of a rotary transformer circuit system for phase shift detection applicable to an embodiment of the present invention;
[0033] Figure 7 is a waveform diagram of various types of signals in a phase shift detection process applicable to an embodiment of the present invention;
[0034] Figure 8 is a structural schematic diagram of a phase shift detection device of a rotary transformer circuit system provided in an embodiment of the present invention;
[0035] Fig. 9 It is a structural schematic diagram of an electronic device for implementing the phase shift detection method of the rotary transformer circuit system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] For the convenience of explanation below, the structure of the rotary transformer circuit system applicable to each embodiment of the present invention is first briefly described.
[0039] Specific, combined Figure 1 and Figure 2 As shown, the rotary transformer circuit system includes a main control chip, a peripheral circuit, and a rotary transformer (the internal structure of the main control chip Figure 2 (not shown). Among them, the main control chip includes a resolver to digital converter (RDC) device for outputting two excitation signals (that is, sinusoidal PWM signals) to the peripheral circuit, that is, SPWM_P and SPWM_N with the same frequency and opposite phase. The above two excitation signals are obtained after PWM using a standard sine signal and a sawtooth wave signal. The peripheral circuit converts SPWM_P and SPWM_N into two excitation reference signals EXE_P and EXE_N with the same frequency and opposite phase through the peripheral integral voltage, and outputs EXE_P and EXE_N to the rotary transformer. Based on the excitation reference signal, the rotary transformer will immediately output two sinusoidal mixing signals SIN_P and SIN_N with the same frequency and opposite phase, and two cosine mixing signals COS_P and COS_N with the same frequency and opposite phase to the peripheral circuit, which are fed back to the main control chip by the peripheral circuit. The main control chip finally solves the rotor angle of the rotary transformer based on the received sine or cosine mixing signal.
[0040] Theoretically, the excitation reference signal can be expressed as V r =A0*sin(ωt), the sinusoidal mixing signal fed back by the resolver can be expressed as V Q (t) = K*A0*sin(ωt)*sin(θ), the cosine mixing signal can be expressed as V I (t)=K*A0*sin(ωt)*cos(θ).
[0041] Where A0 is the amplitude, ω is the angular velocity of the driving carrier, that is, the angular velocity of the standard excitation sinusoidal signal generated by the sinusoidal PWM signal, K is the ratio of the resolver, and θ is the rotor angle.
[0042] In fact, V r =A0*sin(ωt) is the form of the standard excitation sinusoidal signal under ideal conditions obtained by integrating the SPWM signal. Due to the generation error of the excitation reference signal and the influence of line transmission error, there will be a certain difference between the excitation reference signal actually input to the rotary transformer and the standard excitation sinusoidal signal. After accumulating various mechanical errors and various line transmission delays, the mixing signal obtained by the main control chip will have a certain phase delay compared with the standard excitation sinusoidal signal.
[0043] That is, the sinusoidal mixing signal actually obtained by the main control chip is The cosine mixing signal is
[0044] In the prior art, it is necessary to add a carrier recovery device to the RDC of the main control chip, and then after the main control chip collects and obtains the sine or cosine mixing signal each time, the carrier recovery device is combined to perform auxiliary calculations to finally obtain the required rotor angle.
[0045] In various embodiments of the present invention, the inventors consider that the phase delay (i.e., phase shift) is an inherent error in the rotary transformer circuit system. When the hardware circuits in the rotary transformer circuit system are determined, the phase shift is also uniquely determined. Therefore, it is only necessary to calculate the phase shift once, and there is no need to perform complex carrier recovery calculations each time the rotor angle is calculated. In addition, considering that the above-mentioned phase shift solution process can occur before the actual rotor angle measurement, the execution timing of the two does not conflict. Therefore, the rotary transformer circuit system can be directly used to solve the various necessary hardware required for the rotor angle to realize the calculation of the phase shift, without the need to use a carrier recovery device. Furthermore, the design scheme of the embodiment of the present invention removes the carrier recovery device inside the RDC, reduces the complexity and chip cost of the RDC, and does not affect the normal use of the RDC function. Accordingly, the present invention is suitable for various fields requiring high-precision position control, such as aviation, industrial control or automation.
[0046] Furthermore, the goal of each embodiment of the present invention is to obtain the phase shift between the standard excitation sinusoidal signal and the sine or cosine mixing signal. Therefore, it is necessary to obtain the various zero-crossing time points of the standard excitation sinusoidal signal and the mixing signal respectively. After aligning the above-mentioned zero-crossing time points in each signal period, the time offset between the two signals can be obtained. Finally, based on the above-mentioned time offset and the signal period of the mixing signal, the above-mentioned phase offset can be calculated.
[0047] Correspondingly, such as Figure 2 As shown, in each embodiment of the present invention, it is necessary to collect the sinusoidal PWM signal output by the RDC to the peripheral circuit, and the sinusoidal mixing signal or cosine mixing signal fed back by the peripheral circuit as algorithm input items, use the edge detection function of the TIM (Timer Input Module) inside the GTM (Generic Timer Module) in the main control chip, the threshold value comparison function of the FC (Fast Compare) device in the main control chip and the multi-channel analog signal sampling function of the ADC (Analog-to-Digital Converter) device, adopt a preset phase shift detection algorithm, and finally calculate the phase offset of the rotary transformer circuit system.
[0048] In order to ensure the correct calculation results, the two algorithm input items need to be phase matched. That is, if the SPWM_P signal is selected as an input item, the COS_P signal or SIN_P signal needs to be selected as another input item; if the SPWM_N signal is selected as an input item, the COS_N signal or SIN_N signal needs to be selected as another input item.
[0049] That is, the rotating transformer circuit system required for phase shift resolution in each embodiment of the present invention includes a main control chip, a peripheral circuit and a rotating transformer. The peripheral circuit is used to generate an excitation reference signal according to the sinusoidal PWM signal sent by the main control chip and output it to the rotating transformer, and provide the sinusoidal or cosine mixing signal fed back by the rotating transformer to the main control signal for analyzing the rotor angle of the rotating transformer.
[0050] Figure 3 A flow chart of a phase shift detection method for a rotary transformer circuit system provided in an embodiment of the present invention. This embodiment can be applied to predetermining the inherent phase shift of a specific rotary transformer circuit system before the actual rotary transformer solution is performed in the specific rotary transformer circuit system. The method can be performed by a phase shift detection device for the rotary transformer circuit system, which can be implemented in the form of hardware and / or software and can generally be configured in an electronic device with data processing function.
[0051] Correspondingly, such as Figure 3 As shown, the method includes:
[0052] S310 , using a fast comparison device in the main control chip, compare the sampling result of the target mixing signal with a preset reference signal value to generate a mixing PWM signal.
[0053] As mentioned above, in order to realize the phase shift calculation of the resolver circuit system, it is necessary to obtain the sine mixing signal or cosine mixing signal fed back by the resolver as an input item, that is, the target mixing signal. Figure 2 As shown, the SIN_P signal can be determined as the target mixing signal, and a path is led out from the SIN_P signal output end in the peripheral circuit to provide to the FC device in the main control chip for signal sampling, and the FC device generates a mixing PWM signal matching the target mixing signal.
[0054] The specific function of the FC device is: to sample the input signal at a set sampling rate, and if the sampled value is greater than the preset reference signal value, the FC device compares and outputs 1; if the sampled value is less than or equal to the preset reference signal value, the FC device compares and outputs 0. Alternatively, if the sampled value is greater than the preset reference signal value, the FC device compares and outputs 0; if the sampled value is less than or equal to the preset reference signal value, the FC device compares and outputs 1. In the above two different settings, the FC device can output two opposite-phase square waves.
[0055] It is understandable that if the median of the target mixing signal is accurately obtained and used as the preset reference signal value, the target mixing signal can be converted into a square wave signal (i.e., a mixed PWM signal), and then through TIM, each zero-crossing time point of the target mixing signal can be accurately obtained.
[0056] In this embodiment, any signal of the sine mixing signal or the cosine mixing signal can be selected as the target mixing signal. Alternatively, in order to further improve the comparison accuracy of the FC device, the signal with the largest amplitude can be selected from the sine mixing signal or the cosine mixing signal as the target mixing signal.
[0057] Accordingly, in an optional implementation of this embodiment, before comparing the sampling result of the target mixing signal with the preset reference signal value through the fast comparison device in the main control chip to generate the mixing PWM signal, the following may also be included:
[0058] The sine mixing signal and the cosine mixing signal are sampled respectively in at least one sine cycle through an analog-to-digital conversion device in the main control chip;
[0059] The amplitudes of the sine mixing signal and the cosine mixing signal in a single sine cycle are respectively obtained according to the sampling results through the analog-to-digital conversion device in the main control chip;
[0060] A mixing signal with the largest amplitude is determined as a target mixing signal, and a signal median value of the target mixing signal is set as a reference signal value of a fast comparison device.
[0061] Theoretically, the signal periods of the target mixing signal, the excitation reference signal, the standard excitation sinusoidal signal and the standard sinusoidal signal should be the same, which is 2π / ω, where ω is the angular velocity of the aforementioned driving carrier. In this embodiment, the above 2π / ω can be determined as the sinusoidal period.
[0062] It is understandable that in order to accurately obtain the amplitude of the sine mixing signal and the cosine mixing signal, an ADC device can be used to collect at least one cycle of the sine mixing signal and the cosine mixing signal. After obtaining the collection results, the maximum and minimum values of the sine mixing signal in each sine cycle, and the maximum and minimum values of the cosine mixing signal in each sine cycle can be obtained.
[0063] If the ADC device collects signals from multiple sinusoidal cycles, the maximum values of the sine or cosine mixing signals in multiple sinusoidal cycles can be averaged to obtain the maximum average extreme value, and the minimum values of the sine or cosine mixing signals in multiple sinusoidal cycles can be averaged to obtain the minimum average extreme value. Finally, the amplitudes of the sine mixing signal and the cosine mixing signal in a single sinusoidal cycle can be calculated by subtracting the minimum average from the maximum average. After that, the signal with the largest amplitude can be selected as the target mixing signal, and 1 / 2 of the amplitude, that is, the signal median of the target mixing signal, can be set as the reference signal value of the fast comparison device.
[0064] S320 , capturing the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input device in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal.
[0065] As mentioned above, since it is necessary to obtain the zero-crossing time points of the target mixing signal and the standard excitation sinusoidal signal respectively, it is necessary to use two channels of the timer input device in the main control chip to detect the upper and lower edges (rising edge and falling edge) of the input signal in parallel.
[0066] Correspondingly, each edge time stamp of the mixed frequency PWM signal is captured through the first channel of the timer input device in the main control chip. It can be understood that each edge time stamp of the mixed frequency PWM signal captured by the first channel of the timer input device is the zero-crossing time point of the target mixed frequency signal. By arranging the above edge time stamps in time order, a zero-crossing point sequence corresponding to the target mixed frequency signal can be obtained, that is, the first zero-crossing time point sequence.
[0067] S330 , capturing the edge timestamps of the sinusoidal PWM signal through the second channel of the timer input device in the main control chip to form a timestamp sequence.
[0068] In this embodiment, considering that the standard excitation sinusoidal signal is obtained based on the integration of the sinusoidal PWM signal, it is considered that the zero-crossing time point sequence corresponding to the standard excitation sinusoidal signal, that is, the second zero-crossing time point sequence, can be accurately obtained directly based on the sinusoidal PWM signal. Figure 2 As shown, the SPWM_P signal can be determined as the sinusoidal PWM signal, and a channel is led out from the output end of the SPWM_P signal of the main control signal to provide a second channel of the timer input device in the main control chip for upper and lower edge timestamp detection.
[0069] S340 , determining a second zero-crossing time point sequence of a standard excitation sinusoidal signal that matches the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal.
[0070] In an optional implementation of this embodiment, after acquiring the timestamp sequence of the sinusoidal PWM signal, the rising edge timestamp can be first identified in the above timestamp sequence, and then the width of the adjacent timestamp can be calculated in combination with the rising edge timestamp, and then the maximum timestamp of the standard excitation sinusoidal signal can be determined, and then, in combination with the maximum timestamp and the number of PWM signal cycles contained in the sinusoidal period of the standard excitation sinusoidal signal, the second zero-crossing time point sequence of the standard excitation sinusoidal signal can be finally determined. It can be understood that the sinusoidal period of the standard excitation sinusoidal signal and the standard sinusoidal signal generating the sinusoidal PWM signal should be consistent in theory, and the waveforms of the two should also be approximately the same.
[0071] Specifically, the PWM signal period can be understood as a signal period of a sawtooth wave that is modulated together with a standard sinusoidal signal to obtain a sinusoidal PWM signal.
[0072] S350, calculating the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculating the phase offset value of the rotary transformer circuit system according to the time offset.
[0073] As mentioned above, after obtaining the first zero-crossing time point sequence and the second zero-crossing time point sequence, and aligning the time points of the above two sequences according to the sine cycle, the time offset of the standard excitation sinusoidal signal ahead of the target mixing signal in each sine cycle can be obtained. After averaging the time offsets under multiple different sine cycles, the time offset between the target mixing signal and the standard excitation sinusoidal signal can be obtained. After obtaining the time offset, combined with the actual signal cycle of the target mixing signal, the phase offset value of the rotary transformer circuit system can be accurately determined.
[0074] Of course, the time offset calculated under any sinusoidal period can also be used directly as the time offset between the target mixing signal and the standard excitation sinusoidal signal.
[0075] The technical solution of the embodiment of the present invention uses the existing hardware of the rotary transformer circuit system to obtain the edge timestamp of the sinusoidal PWM signal used to generate the excitation reference signal, and the edge timestamp of the mixed PWM signal that matches the target mixed signal fed back by the rotary transformer. Based on the above two types of timestamps, the zero-crossing sequence of the standard excitation sinusoidal signal used to generate the sinusoidal PWM signal and the zero-crossing sequence of the target mixed signal are identified. Then, according to the above two types of zero-crossing sequences, the implementation method of the phase offset value of the rotary transformer circuit system is accurately determined. There is no need to introduce a carrier recovery device in the rotary transformer circuit system, which reduces the hardware complexity and chip cost of the rotary transformer circuit system. In addition, the phase offset value calculation scheme only needs to be calculated once after the hardware circuit of the rotary transformer circuit system is determined, and the calculation result can be used directly later. Such operation can effectively reduce the calculation complexity of the actual rotary transformer solution and effectively meet the real-time high-precision position control requirements of the rotary transformer circuit system.
[0076] Based on the above embodiments, before the sampling result of the target mixing signal is compared with the preset reference signal value by the fast comparison device in the main control chip to generate the mixing PWM signal, the following may also be included:
[0077] The data stream is collected by the analog-to-digital converter in the main control chip, and the noise index of the rotary transformer circuit system is analyzed according to the data stream collection result; according to the noise index, the hysteresis band corresponding to the fast comparison device is set.
[0078] In this optional implementation, in order to reduce the influence of random noise of the loop signal, the FC device can support a hysteresis comparison function. That is, when the input signal is in the hysteresis band, the output signal will not flip. By setting the hysteresis band, the interference of signal noise can be reduced, but the error of the edge time of the target mixing signal will also increase. Furthermore, the noise can be analyzed based on the sampling data stream of the analog-to-digital converter device, and the hysteresis band width of the FC device can be reasonably set.
[0079] Specifically, in Figure 4 FIG. 2 is a schematic diagram showing input and output waveforms of a fast comparison module with a hysteresis band function applicable to an embodiment of the present invention. Figure 4 As shown, the set hysteresis band width includes the hysteresis band upper boundary and the hysteresis band lower boundary. Figure 4 The upper part is the compared signal input to the FC device. Figure 4 The two sub-figures in the lower part are two inverted square waves output by the FC device after comparison.
[0080] Among them, the first sub-diagram in the lower half is a schematic diagram of the square wave output by the FC device when the compared signal input to the FC device is greater than the preset reference signal value in the FC device, the FC device comparison output is 1, and the FC device input signal is less than or equal to the preset reference signal value in the FC device, and the FC device comparison output is 0.
[0081] The second sub-figure in the lower half is a schematic diagram of the square wave output by the FC device when the compared signal input to the FC device is greater than the preset reference signal value in the FC device and the FC device compares and outputs 0, and when the FC device input signal is less than or equal to the preset reference signal value in the FC device and the FC device compares and outputs 1.
[0082] Based on the above embodiments, before capturing the edge timestamps of the sinusoidal PWM signal to form a timestamp sequence through the first channel of the timer input device in the main control chip, the method may further include: controlling the rotary transformer to be in a stationary state.
[0083] The rotary transformer being in a stationary state can be understood as the rotary transformer maintaining a fixed rotor angle and being stationary. Through the above setting, the influence of the rotary transformer in a rotating state on the calculation accuracy of the phase offset value can be avoided, so as to further improve the calculation accuracy.
[0084] On the basis of the above embodiments, after calculating the phase offset value of the rotary transformer hardware circuit system, the following steps may also be included:
[0085] The phase offset value is stored in the storage device of the main control chip, so that the resolver circuit system can use the phase offset value to correct the calculation result in the subsequent process of calculating the rotor angle of the resolver.
[0086] After completing the calculation of the phase offset value, the embodiment of the present invention can store the phase offset value as a system parameter in the adapted rotary transformer circuit system, and the above operation can be understood as the factory setting process of the rotary transformer circuit system. After completing the above factory setting, the rotary transformer circuit system can be configured in an actual application scenario to measure the actual rotor angle. In each actual measurement process, the calculation result can be corrected based on the pre-stored phase offset value to achieve accurate rotor angle measurement results without introducing a carrier recovery device.
[0087] Figure 5A flow chart of another phase shift detection method for a rotating transformer circuit system provided in an embodiment of the present invention. This embodiment is refined based on the above embodiments. In this embodiment, the operation of "determining the second zero-crossing time point sequence of the standard excitation sinusoidal signal that matches the sinusoidal PWM signal based on the timestamp sequence and the number of PWM signal periods contained in the sinusoidal period of the standard excitation sinusoidal signal" is concretized.
[0088] Correspondingly, such as Figure 5 As shown, the method includes:
[0089] S510 , using a fast comparison device in the main control chip, compare the sampling result of the target mixing signal with a preset reference signal value to generate a mixing PWM signal.
[0090] S520 , capturing edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input device in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal.
[0091] S530 , capturing the edge timestamps of the sinusoidal PWM signal through the second channel of the timer input device in the main control chip to form a timestamp sequence.
[0092] Similarly, another channel of the TIM can capture the timestamps of the rising edge and the falling edge of the sinusoidal PWM signal in parallel, and arrange the captured edge timestamps in chronological order to obtain a timestamp sequence corresponding to the sinusoidal PWM signal.
[0093] S540: Take a timestamp as an interval, take the first timestamp in the timestamp sequence as a starting point, calculate the interval time between two interval timestamps in the timestamp sequence, and determine the first rising edge timestamp in the timestamp sequence according to each interval time.
[0094] Among them, when modulating to obtain the sinusoidal PWM signal, the period of the sawtooth wave used is fixed, and further, the time span between two adjacent rising edge timestamps in the timestamp sequence is equal to the time span between two falling edge timestamps respectively located after the above two rising edge timestamps, and the time spans between two adjacent rising edge timestamps are the same, which are equal to the period of the sawtooth wave.
[0095] Based on the above rules, a timestamp can be used as an interval, and the first timestamp in the timestamp sequence can be used as the starting point to calculate the interval time between each interval timestamp in the timestamp sequence (that is, the aforementioned time span), and based on the judgment result of whether the interval times are the same, the position of the first rising edge timestamp in the timestamp sequence can be determined.
[0096] Specifically, if the interval times are all equal, it means that the calculation is started from the rising edge timestamp, and the first timestamp in the timestamp sequence can be determined as the first rising edge timestamp; if the interval times are not completely equal, it means that the calculation is started from the falling edge timestamp, and the second timestamp in the timestamp sequence can be determined as the first rising edge timestamp.
[0097] S550, taking the first rising edge timestamp as the starting point, calculating the time widths between two adjacent timestamps in the timestamp sequence, and determining each target timestamp corresponding to the maximum value point of the standard excitation sinusoidal signal in the timestamp sequence according to each time width.
[0098] Among them, taking the first rising edge timestamp as the starting point, adjacent timestamps are subtracted to obtain the width of each high and low level, or it can also be called the high and low level duration.
[0099] It can be understood that when the standard excitation sinusoidal signal is generated based on the sinusoidal PWM signal, the signal amplitude of the standard excitation sinusoidal signal is positively correlated with the high and low level duration, gradually increasing to a maximum value, and then gradually decreasing to a minimum value, and so on. Based on the change trend between the high and low level duration and the signal amplitude of the standard excitation sinusoidal signal, each time stamp corresponding to each maximum value point of the standard excitation sinusoidal signal can be obtained, that is, the target time stamp.
[0100] In an optional implementation of this embodiment, determining each target time stamp corresponding to the maximum value point of the standard excitation sinusoidal signal in the time stamp sequence according to each time width may include:
[0101] Identify the high-level time widths in each time width respectively, and identify the maximum high-level time width in each high-level time width that is gradually increasing;
[0102] The next rising edge timestamp corresponding to each identified maximum high-level time width is determined as each target timestamp.
[0103] S560: Determine a second zero-crossing time point sequence of the standard excitation sinusoidal signal that matches the sinusoidal PWM signal according to each target time stamp and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal.
[0104] It is understandable that the sinusoidal PWM signal is obtained based on sawtooth wave modulation, and thus the signal period of the sinusoidal PWM signal is consistent with the signal period of the sawtooth wave, both of which are PWM signal periods. The standard excitation sinusoidal signal is also generally consistent with the sinusoidal period of the standard sinusoidal signal.
[0105] Furthermore, based on the number of PWM signal cycles contained in the sine cycle of the standard excitation sinusoidal signal, for example, 2N, it can be determined that the number of edge time points of the sine PWM signal contained between the zero-crossing time points of the standard excitation sinusoidal signal is N (corresponding to half a cycle of the standard excitation sinusoidal signal). Accordingly, after determining the target timestamp where the maximum value point of the standard excitation sinusoidal signal is located, the position point with an interval of N / 2 edge timestamps before and after the target timestamp can be determined as the zero-crossing timestamp of the standard excitation sinusoidal signal.
[0106] Accordingly, in an optional implementation of this embodiment, determining the second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal according to each target timestamp and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal may include:
[0107] According to the number of PWM signal cycles contained in the sine cycle of the standard excitation sine signal, respectively identifying the previous zero-crossing time stamp and the next zero-crossing time stamp corresponding to each target time stamp in the time stamp sequence;
[0108] The identified zero-crossing time stamps are arranged in chronological order to obtain a second zero-crossing time point sequence.
[0109] S570: Calculate the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculate the phase offset value of the rotary transformer circuit system according to the time offset.
[0110] It is understandable that the standard excitation sinusoidal signal generated based on the sinusoidal PWM signal should be ahead of the target mixing signal, and then, the first zero-crossing time point in the first zero-crossing time point sequence and the first zero-crossing time point in the second zero-crossing time point sequence can be compared first, and the zero-crossing time points in the first zero-crossing time point sequence that are ahead of the first zero-crossing time point in the second zero-crossing time point sequence are filtered out in chronological order. Experiments show that the first zero-crossing time point sequence generally only has an advance error of one zero-crossing point. Therefore, only the first zero-crossing time point in the first zero-crossing time point sequence and the first zero-crossing time point in the second zero-crossing time point sequence are compared.
[0111] In an optional implementation of this embodiment, calculating the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculating the phase offset value of the rotary transformer circuit system according to the time offset may include:
[0112] If the first zero-crossing time point in the first zero-crossing time point sequence is earlier than the first zero-crossing time point in the second zero-crossing time point sequence, the first zero-crossing time point in the first zero-crossing time point sequence is discarded;
[0113] Subtract the zero-crossing time points in the second zero-crossing time point sequence from the zero-crossing time points at the corresponding sequence positions in the first zero-crossing time point sequence to obtain a plurality of time difference values, and determine the average value of the time difference values as the time offset;
[0114] Taking a zero-crossing time point as an interval, taking the first zero-crossing time point in the first zero-crossing time point sequence as a starting point, calculating the interval time between two zero-crossing time points in the first zero-crossing time point sequence, and determining the average value of each interval time as the signal period of the target mixing signal;
[0115] The phase offset value of the resolver circuit system is calculated based on the time offset and the signal period.
[0116] The technical solution of the embodiment of the present invention does not need to introduce a carrier recovery device in the rotary transformer circuit system, thereby reducing the hardware complexity and chip cost of the rotary transformer circuit system. In addition, the phase offset value calculation scheme only needs to be calculated once after the hardware circuit of the rotary transformer circuit system is determined, and the calculation result can be used directly subsequently. Such operation can effectively reduce the calculation complexity during the actual rotary transformer solution, and effectively meet the real-time high-precision position control requirements of the rotary transformer circuit system.
[0117] In addition, it needs to be emphasized again that, in each embodiment of the present invention, a phase shift detection device can be set inside the main control chip of the rotary transformer circuit system, and the phase shift detection component can realize the phase shift detection of the rotary transformer circuit system. Alternatively, an external computing device can be set separately, and the external computing device can realize the phase shift detection of the rotary transformer circuit system. Accordingly, one or more storage devices inside the main control chip can be further used to realize the file storage of the first zero-crossing time point sequence corresponding to the target mixing signal and the timestamp sequence corresponding to the sinusoidal PWM signal captured by the timer input device. Furthermore, the phase shift detection device or the external computing device can directly obtain the file content from the storage device and perform the corresponding phase shift detection.
[0118] Specific application scenarios
[0119] In order to further illustrate the embodiments of the present invention, the technical solutions of the embodiments of the present invention are now described in detail in a specific application scenario. Figure 6 A specific structural diagram of a rotary transformer circuit system for phase shift detection applicable to an embodiment of the present invention is shown in FIG. Figure 7FIG. 2 is a schematic diagram showing waveforms of various types of signals in a phase shift detection process applicable to an embodiment of the present invention. Figure 7 In sub-figures (a), (b), (c) and (d), the horizontal axis is the time coordinate and the vertical axis is the amplitude coordinate.
[0120] like Figure 6 As shown, when the rotary transformer circuit system performs phase shift detection, the main control chip sends a sinusoidal PWM signal to the peripheral circuit, and the peripheral circuit generates an excitation reference signal based on the sinusoidal PWM signal and outputs it to the rotary transformer. The rotary transformer feeds back a sinusoidal or cosine mixing signal based on the excitation reference signal to the peripheral circuit, which is then transmitted back to the main control chip by the peripheral circuit.
[0121] In the above signal flow process, firstly, the target mixing signal that needs to be calculated is determined according to the sine or cosine mixing signal collected by the ADC device, and the data median of the target mixing signal is simultaneously determined as the reference signal value of the FC device.
[0122] After that, perform the following operations in parallel:
[0123] 1. Collect the sinusoidal PWM (i.e., Excitation SPWM, Sinusoidal Pulse Width Modulation) signal and transmit it to channel A (CHA in TIMx) in TIMx (the xth timer input device) inside GTM in the main control chip. After channel A captures the edge timestamp (Edge TimeStamp) of the sinusoidal PWM signal, each edge timestamp is sequentially transmitted to channel A (CHA in DMAx) of DMAx (the xth direct memory access device), and channel A of DMAx stores each edge timestamp in RAM (Random Access Memory).
[0124] 2. Provide the target mixing signal to the FC device, which generates a mixing PWM (i.e., Mixing PWM) signal and transmits the mixing PWM signal to channel B (CHB in TIMx) in TIMx (the xth timer input device) inside the GTM. After the edge timestamp of the mixing PWM signal is captured by channel B, each edge timestamp is sequentially transmitted to channel B (CHB in DMAx) of DMAx (the xth direct memory access device), and each edge timestamp is stored in RAM by channel B of DMAx.
[0125] Furthermore, the phase offset value in the resolver circuit system can be calculated by using a phase offset algorithm in combination with the storage content in the RAM.
[0126] Specifically, the program includes the following steps:
[0127] 1. Let the rotor of the rotary transformer be stationary, use the ADC device to collect the mixing signals output by the rotary transformer, calculate the maximum and minimum values of the mixing signals, and find the mixing signal with a larger amplitude as the input signal of the FC device, that is, the target mixing signal.
[0128] 2. Use the FC device to sample and compare the mixed signals output by the rotary transformer, and average the extreme values to obtain the center value as the reference value of the FC device. Turn on the comparison function of the FC device and output the comparison result (0 or 1) as a high or low level through the chip pin.
[0129] 3. Use the two channels CHA and CHB of the TIM module in GTM to capture the excitation signal Excitation SPWM output by the RDC and the Mixing PWM signal output by the FC device, turn on the TBU (Time Base Unit) counting, and obtain the TBU count value (that is, TimeStamp) every time an edge jump occurs. Use DMA's CHA or CHB to transfer the edge time value to RAM for storage, and store the count values of multiple Mixing PWM cycles.
[0130] 4. Calculate and analyze the matching Tei and Tmi, and calculate DTi. Average the results after multiple calculations to obtain the final phase offset value.
[0131] Among them, Tei (i = 0, 1, ..., n) is the time when the sinusoidal signal generated by the Excitation SPWM signal (that is, the standard excitation sinusoidal signal) is at kπ; Tmi (i = 0, 1, ..., n) is the time when the sinusoidal signal corresponding to the Mixing PWM signal (that is, the target mixing signal) is at kπ; DTi is the time difference between Tei and Tmi, that is, the phase offset value to be calculated.
[0132] Among them, this calculation scheme needs to control the rotary transformer rotor to be in a stationary state, and the rotating state will reduce the phase shift calculation accuracy.
[0133] 1.FC signal selection
[0134] RDC outputs two excitation signals (SPWM_P / N, same frequency and opposite phase, corresponding Figure 7 The waveform in the (b) sub-diagram in the figure) is sent to the peripheral circuit, and the excitation signal (EXE_P / N, theoretically corresponding to the same frequency and opposite phase) is output through the peripheral integral voltage. Figure 7 The orange curve in sub-graph (c) in the figure) is sent to the resolver, which will immediately output the mixed signals COS_P / N and SIN_P / N.
[0135] To ensure correct calculation results, the signal phases must match. That is, if SPWM_P is selected as the input to TIM, COS_P or SIN_P must be selected as the input to TIM. If SPWM_N is selected as the input to TIM, COS_N or SIN_N must be selected as the input to TIM.
[0136] Figure 6 In the example, the input is SPWM_P and the feedback signal is COS_P or SIN_P. It is necessary to collect COS_P and SIN_P signals and further select the appropriate signal to input to the FC device.
[0137] The ADC device collects two signals (COS_P and SIN_P, or COS_N and SIN_N), continuously samples, converts and stores the output results for multiple excitation signal cycles (at least more than 1 complete excitation signal cycle), analyzes and calculates the maximum and minimum values of the two signals in each cycle, and averages them to obtain the average extreme values of the two signals in the entire sampling cycle, that is:
[0138] The extreme values of COS_P are: COS_P_MIN and COS_P_MAX; the extreme values of SIN_P are: SIN_P_MIN and SIN_P_MAX.
[0139] Alternatively, the extreme values of COS_N: COS_N_MIN and COS_N_MAX; the extreme values of SIN_N: SIN_N_MIN and SIN_N_MAX.
[0140] Select a signal with a large amplitude as the input signal of the FC device. Take the P signal as an example:
[0141] If |COS_P_MIN-COS_P_MAX|>|SIN_P_MIN-SIN_P_MAX|, select COS_P, otherwise, select SIN_P. Figure 6 In the figure, SIN_P is taken as an example as the input signal of the FC device.
[0142] After the input signal of the FC device is determined, the median of the input signal is calculated according to the extreme value, that is, (SIN_P_MIN+SIN_P_MAX|) / 2 is used as the reference signal value of the FC device.
[0143] 2. FC device sampling comparison output Mixing PWM
[0144] The SPWM signal output by the RDC pin theoretically corresponds to the excitation signal A*sin(ωt). In fact, due to the influence of the circuit delay on the peripheral circuit and the resolver, the loop signal is (correspond Figure 7(c) The blue curve in the subgraph) or (Not shown in the figure), when the rotary transformer rotor is fixed, sin(θ) or cos(θ) is a fixed value, and then, according to the ADC sampling value, a group of signals with large loop signal amplitude are selected as the input signal of the FC device.
[0145] The FC device samples the loop signal (target mixing signal) at a maximum sampling rate of 5MSPS (Million Samples per Second) and selects the median of the loop signal as a comparison point (corresponding to Figure 7 (c) The gray horizontal line in the sub-diagram. When the setting exceeds the median value, the FC device compares and outputs 1, otherwise it outputs 0, and outputs the corresponding high and low levels through the chip pins. Figure 7 The blue square wave in the sub-diagram (d) is the mixed PWM signal. Figure 7 As can be seen from sub-figures (c) and (d) in the figure, the waveform of the loop sinusoidal signal (ie, the target mixing signal) is converted into a square wave, and the edge of the square wave corresponds to the moment when the loop sinusoidal signal is at kπ.
[0146] In order to reduce the impact of random noise on the loop signal, the FC device supports the hysteresis comparison function. Setting the hysteresis band can reduce signal noise interference, but it also increases the error of the edge timing of the Mixing PWM signal. Therefore, the noise can be analyzed according to the ADC device sampling data stream and the hysteresis band width can be set reasonably.
[0147] 3. TIM captures Excitation SPWM signal and Mixing PWM signal
[0148] The TIM in the GTM can capture the rising and falling edges of the square wave, and when the edge is captured, it generates the edge timestamp based on the TBU. The two channels in the TIM can be used to capture the edge timestamps of the Excitation SPWM signal and the Mixing PWM signal respectively.
[0149] Excitation SPWM is generated by RDC hardware, and this scheme uses an asymmetric method (corresponding to Figure 7 Take the SPWM generated by the sawtooth wave in the subgraph (a), the gray solid line, as an example, there are 20 points in total, that is, one sine cycle contains 20 PWM cycles (corresponding to 20 sawtooth waves), and the duty cycle in each PWM cycle is changing, corresponding to Figure 7 (b) Sub-graph in . Figure 7 It can be seen from sub-figure (a) that the standard excitation sinusoidal signal (orange solid line) generated in an asymmetric manner is almost identical to the standard sinusoidal signal (gray dotted line) with very little error.
[0150] Use TIM CHA to capture Excitation SPWM signals, and TIM CHB to capture Mixing PWM signals. Get the edge time of the PWM signal from TBU, trigger the two channels of DMA synchronously, and move the timestamps to RAM respectively. The entire sampling and capture time length must include multiple Mixing PWM signal cycles.
[0151] 4. Phase offset algorithm calculates the offset value
[0152] 1) Calculate the edge time of the Mixing PWM signal
[0153] Through step 3, the edge timestamp of the Mixing PWM signal has been stored in the RAM area (corresponding to Figure 7 The blue dots in subgraph (c) are Tmi(i=0,1,…,n) respectively.
[0154] 2) Calculate the zero edge time of the Excitation SPWM signal
[0155] The standard excitation sinusoidal signal generated by the Excitation SPWM signal also needs to identify and calculate the corresponding zero point time ( Figure 7 (orange dots in sub-figure (c)).
[0156] In step 3, TIM obtains the edge timestamp of the Excitation SPWM signal and calculates the timestamp corresponding to the zero point as follows:
[0157] a) Identify the rising edge timestamp of the Excitation SPWM signal based on the timestamp
[0158] Assume that the edge timestamps of the Excitation SPWM signal acquired by TIM are: te0, te1, ..., tei, ..., tem, a total of (m+1) timestamps. The sawtooth wave period corresponding to the Excitation SPWM signal is fixed, that is, the sum of the adjacent high and low level times of the Excitation SPWM signal is a constant value and equal to the sawtooth wave signal period. The relationship between the sawtooth wave signal period and the Mixing PWM signal is:
[0159] Mixing PWM signal period = sawtooth wave signal period × PWM points (the embodiments of the present invention take 20 points as an example)
[0160] Therefore, the Mixing PWM signal cycle is multiples of the adjacent high and low level time of the Excitation SPWM signal and the number of PWM points. Therefore, according to the rule that "the sum of the adjacent high and low level time of the Excitation SPWM signal is a constant", the timestamp of the rising edge of the Excitation SPWM signal can be identified:
[0161] Calculate the interval time of the interval timestamp: {(te2-te0), (te3-te1), (te4-te2), ...}. If the time intervals are equal, te0 is the first rising edge timestamp of the Excitation SPWM signal. Otherwise, te1 is the first rising edge timestamp of the Excitation SPWM signal.
[0162] b) Calculate the width of adjacent timestamps of the Excitation SPWM signal
[0163] Taking the first rising edge timestamp as the reference, calculate the width of the adjacent timestamps of the Excitation SPWM signal, subtract the adjacent timestamps, calculate the high and low level widths, and count them in sequence (assuming te0 is the first rising edge timestamp of Excitation SPWM): dt1 = te1-te0, dt2 = te2–te1, dti = tei–tei-1, … Correspondingly, dt1 corresponds to the first high level time of the Excitation SPWM signal, dt2 corresponds to the first low level time of the Excitation SPWM signal, and (dt1+dt2) is the Excitation SPWM signal period (also the sawtooth signal period), which is a fixed value.
[0164] c) Identify the extreme value timestamps of the standard excitation sinusoidal signal generated by the Excitation SPWM signal.
[0165] refer to Figure 7 In the (a) and (b) sub-figures, the standard excitation sinusoidal signal generated by the Excitation SPWM signal is positively correlated with the high-level width change of the Excitation SPWM signal, which gradually increases and then gradually decreases, and so on. Therefore, based on the result of step b), the high-level width time series is extracted (assuming that te0 is the first rising edge timestamp of the Excitation SPWM signal): dt1, dt3, dt5, ..., dtj, ....
[0166] The standard excitation sinusoidal signal generated by the Excitation SPWM signal is periodic, so the longest high level duration in the high level width time series is identified (such as Figure 7The red max point in the subgraph (a) corresponds to the position of the maximum value of the standard excitation sinusoidal signal generated by the ExcitationSPWM signal. Assuming that dtj is the first maximum high-level time, the timestamp corresponding to the max point is the next rising edge timestamp after dtj is high, which is te(j+1).
[0167] d) Extract the zero edge timestamp of the Excitation SPWM signal
[0168] The number of Excitation SPWM signals contained in a Mixing PWM signal cycle is fixed. Assuming that the number is represented by N (20 in the schematic diagram), the number of edges in a Mixing PWM signal cycle is 2N, the number of timestamps is also 2N, and the number of edges between the zero points of the Excitation SPWM signal is N (corresponding to half a cycle). Taking the timestamp te(j+1) corresponding to the first max point of the Excitation SPWM signal as the benchmark, it can be seen that the timestamps of N / 2 points before and after the first max point are the zero-point edge timestamps of the Excitation SPWM signal, so all zero-point timestamps can be calculated.
[0169] Correspondingly, the zero-point timestamp before the timestamp te(j+1) is expressed as: te(j+1-N / 2-rN); the zero-point timestamp between the timestamp te(j+1) is expressed as: te(j+1+N / 2+rN), r=0,1,2,….
[0170] By arranging the above zero time stamps in chronological order, Tei (i=0, 1, ..., n) is obtained.
[0171] 3) Calculate the phase offset
[0172] a) Signal starting point matching
[0173] like Figure 7 As shown in the neutron diagram (c), the standard excitation sinusoidal signal corresponding to the Excitation SPWM signal is ahead of the sinusoidal signal corresponding to the Mixing PWM signal, that is, the Te0 timestamp is ahead of Tm0. If Tm0 is less than Te0, Tm0 should be discarded and Tm1 should be used in the calculation.
[0174] b) Time deviation calculation
[0175] If the Te0 timestamp is ahead of Tm0 (corresponding to Figure 7 Neutron Figure (c)), the time offset DT0 = Tm0-Te0, ..., DTi = Tmi-Tei, ..., and all time offsets are averaged to obtain the final time offset DT.
[0176] c) Phase offset calculation
[0177] The period of the sinusoidal signal corresponding to the Mixing PWM signal is {(Tm2-Tm0), (Tm3-Tm2), ...}, and the average is Tsin, so the phase offset value can be expressed as:
[0178]
[0179] Finally, the above The RDC algorithm is introduced for compensation to improve the solution accuracy.
[0180] Optimization effect:
[0181] Compared with the existing solutions, the resolver phase shift algorithm proposed in each embodiment of the present invention has the following advantages:
[0182] 1. Reduce the complexity of the RDC module and the chip cost: The original RDC solution designed a carrier recovery module to calculate the phase offset. The RDC IC is complex, the implementation is complex, and it occupies a large chip area. In addition, the phase offset is an inherent error introduced by the hardware circuit. Once the hardware circuit is determined, the phase shift value only needs to be calculated once, without the need to calculate it every time. Therefore, the current design can remove the carrier recovery module inside the RDC, reduce the complexity of the RDC and the chip cost, and does not affect the normal use of the RDC function.
[0183] 2. Less hardware resources are occupied: The phase offset calculation scheme only needs to be calculated once after the hardware circuit is determined, and the result of the first calculation can be directly used later. Therefore, the hardware resources mentioned in this scheme will not be occupied during subsequent use.
[0184] Accordingly, the embodiments of the present invention are applicable to various fields requiring high-precision position control, such as aviation, industrial control, automation, etc.
[0185] Figure 8 The present invention provides a schematic diagram of the structure of a phase shift detection device of a rotary transformer circuit system. The rotary transformer circuit system includes a main control chip, a peripheral circuit and a rotary transformer. The peripheral circuit is used to generate an excitation reference signal according to the sine pulse width modulation PWM signal sent by the main control chip and output it to the rotary transformer, and provide the sine or cosine mixing signal fed back by the rotary transformer to the main control signal for analyzing the rotor angle of the rotary transformer. Figure 8 As shown, the device includes: a mixed frequency PWM signal generating module 810, a first zero-crossing time point sequence forming module 820, a timestamp sequence forming module 830, a second zero-crossing time point sequence determining module 840 and a phase offset value calculating module 850, wherein:
[0186] The mixed frequency PWM signal generating module 810 is used to compare the sampling result of the target mixed frequency signal with the preset reference signal value through the fast comparison module in the main control chip to generate a mixed frequency PWM signal;
[0187] A first zero-crossing time point sequence forming module 820 is used to capture the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input module in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal;
[0188] The timestamp sequence forming module 830 is used to capture the edge timestamps of the sinusoidal PWM signal through the second channel of the timer input module in the main control chip to form a timestamp sequence;
[0189] A second zero-crossing time point sequence determining module 840 is used to determine a second zero-crossing time point sequence of a standard excitation sinusoidal signal matching the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal;
[0190] The phase offset value calculation module 850 is used to calculate the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculate the phase offset value of the rotary transformer circuit system according to the time offset.
[0191] The technical solution of the embodiment of the present invention uses the existing hardware of the rotary transformer circuit system to obtain the edge timestamp of the sinusoidal PWM signal used to generate the excitation reference signal, and the edge timestamp of the mixed PWM signal that matches the target mixed signal fed back by the rotary transformer. Based on the above two types of timestamps, the zero-crossing sequence of the standard excitation sinusoidal signal used to generate the sinusoidal PWM signal and the zero-crossing sequence of the target mixed signal are identified. Then, according to the above two types of zero-crossing sequences, the implementation method of the phase offset value of the rotary transformer circuit system is accurately determined. There is no need to introduce a carrier recovery device in the rotary transformer circuit system, which reduces the hardware complexity and chip cost of the rotary transformer circuit system. In addition, the phase offset value calculation scheme only needs to be calculated once after the hardware circuit of the rotary transformer circuit system is determined, and the calculation result can be used directly later. Such operation can effectively reduce the calculation complexity of the actual rotary transformer solution and effectively meet the real-time high-precision position control requirements of the rotary transformer circuit system.
[0192] Based on the above embodiments, a reference signal value setting module may be further included, which is used to:
[0193] Before comparing the sampling result of the target mixing signal with the preset reference signal value through the fast comparison device in the main control chip and generating the mixing PWM signal, the sine mixing signal and the cosine mixing signal are sampled respectively in at least one sine cycle through the analog-to-digital conversion device in the main control chip;
[0194] The amplitudes of the sine mixing signal and the cosine mixing signal in a single sine cycle are respectively obtained according to the sampling results through the analog-to-digital conversion device in the main control chip;
[0195] A mixing signal with the largest amplitude is determined as a target mixing signal, and a signal median value of the target mixing signal is set as a reference signal value of a fast comparison device.
[0196] On the basis of the above embodiments, the second zero-crossing time point sequence interval determination module 840 may specifically include:
[0197] A rising edge timestamp determination unit is used to take a timestamp as an interval, take the first timestamp in the timestamp sequence as a starting point, calculate the interval time between two interval timestamps in the timestamp sequence, and determine the first rising edge timestamp in the timestamp sequence according to each interval time;
[0198] A target timestamp determination unit is used to calculate the time width between two adjacent timestamps in the timestamp sequence with the first rising edge timestamp as the starting point, and determine each target timestamp corresponding to the maximum value point of the standard excitation sinusoidal signal in the timestamp sequence according to each time width;
[0199] The sequence determination unit is used to determine the second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal according to each target time stamp and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal.
[0200] Based on the above embodiments, the rising edge timestamp determination unit may be specifically used for:
[0201] If the interval times are all equal, the first timestamp in the timestamp sequence is determined as the first rising edge timestamp;
[0202] If the interval times are not exactly equal, the second timestamp in the timestamp sequence is determined to be the first rising edge timestamp.
[0203] Based on the above embodiments, the target timestamp determination unit may be specifically used for:
[0204] Identify the high-level time widths in each time width respectively, and identify the maximum high-level time width in each high-level time width that is gradually increasing;
[0205] The next rising edge timestamp corresponding to each identified maximum high-level time width is determined as each target timestamp.
[0206] Based on the above embodiments, the sequence determination unit may be specifically used for:
[0207] According to the number of PWM signal cycles contained in the sine cycle of the standard excitation sine signal, respectively identifying the previous zero-crossing time stamp and the next zero-crossing time stamp corresponding to each target time stamp in the time stamp sequence;
[0208] The identified zero-crossing time stamps are arranged in chronological order to obtain a second zero-crossing time point sequence.
[0209] Based on the above embodiments, the phase offset value calculation module 850 can be specifically used for:
[0210] If the first zero-crossing time point in the first zero-crossing time point sequence is earlier than the first zero-crossing time point in the second zero-crossing time point sequence, the first zero-crossing time point in the first zero-crossing time point sequence is discarded;
[0211] Subtract the zero-crossing time points in the second zero-crossing time point sequence from the zero-crossing time points at the corresponding sequence positions in the first zero-crossing time point sequence to obtain a plurality of time difference values, and determine the average value of the time difference values as the time offset;
[0212] Taking a zero-crossing time point as an interval, taking the first zero-crossing time point in the first zero-crossing time point sequence as a starting point, calculating the interval time between two zero-crossing time points in the first zero-crossing time point sequence, and determining the average value of each interval time as the signal period of the target mixing signal;
[0213] The phase offset value of the resolver circuit system is calculated based on the time offset and the signal period.
[0214] On the basis of the above embodiments, a hysteresis band setting module may also be included, which is used to:
[0215] Before the sampling result of the target mixing signal is compared with the preset reference signal value by the fast comparison device in the main control chip and the mixing PWM signal is generated, the data stream is collected by the analog-to-digital conversion device in the main control chip, and the noise index of the rotary transformer circuit system is analyzed according to the data stream collection result;
[0216] According to the noise index, set the hysteresis band corresponding to the fast comparison device.
[0217] On the basis of the above embodiments, a rotary transformer control module may also be included, which is used to:
[0218] Before capturing the edge timestamps of the sinusoidal PWM signal through the first channel of the timer input device in the main control chip to form a timestamp sequence, the rotary transformer is controlled to be in a stationary state.
[0219] Based on the above embodiments, a phase offset value storage module may be further included, which is used to:
[0220] After calculating the phase offset value of the resolver hardware circuit system, the phase offset value is stored in the storage device of the main control chip, so that the resolver circuit system can use the phase offset value to correct the calculation result in the subsequent calculation of the rotor angle of the resolver.
[0221] The phase shift detection device of the rotary transformer circuit system provided in the embodiment of the present invention can execute the phase shift detection method of the rotary transformer circuit system provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0222] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0223] Fig. 9 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0224] like Fig. 9As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0225] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0226] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, for example, executing the phase shift detection method of the rotary transformer circuit system as described in any one of the embodiments of the present invention.
[0227] That is, the sampling result of the target mixing signal is compared with the preset reference signal value through the fast comparison device in the main control chip to generate a mixing PWM signal;
[0228] Capturing the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input device in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal;
[0229] Through the second channel of the timer input device in the main control chip, the edge timestamps of the sinusoidal PWM signal are captured to form a timestamp sequence;
[0230] Determine a second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal;
[0231] The time offset between the target mixing signal and the standard excitation sinusoidal signal is calculated according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and the phase offset value of the rotary transformer circuit system is calculated according to the time offset.
[0232] In some embodiments, the phase shift detection method of the rotary transformer circuit system as described in any one of the embodiments of the present invention may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the phase shift detection method of the rotary transformer circuit system as described in any one of the embodiments of the present invention described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the phase shift detection method of the rotary transformer circuit system as described in any one of the embodiments of the present invention by any other appropriate means (for example, by means of firmware).
[0233] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0234] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0235] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0236] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0237] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0238] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0239] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0240] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A phase shift detection method for a rotary transformer circuit system, wherein the rotary transformer circuit system comprises a main control chip, a peripheral circuit and a rotary transformer, wherein the peripheral circuit is used to generate an excitation reference signal according to a sinusoidal pulse width modulation (PWM) signal sent by the main control chip and output it to the rotary transformer, and to provide a sinusoidal or cosine mixing signal fed back by the rotary transformer to the main control signal for analyzing the rotor angle of the rotary transformer, characterized in that: The method comprises: The sampling result of the target mixing signal is compared with the preset reference signal value through the fast comparison device in the main control chip to generate a mixing PWM signal; Capturing the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input device in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal; Through the second channel of the timer input device in the main control chip, the edge timestamps of the sinusoidal PWM signal are captured to form a timestamp sequence; Determine a second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal; The time offset between the target mixing signal and the standard excitation sinusoidal signal is calculated according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and the phase offset value of the rotary transformer circuit system is calculated according to the time offset.
2. The method according to claim 1, characterized in that Before comparing the sampling result of the target mixing signal with the preset reference signal value through the fast comparison device in the main control chip to generate the mixing PWM signal, the method further includes: The sine mixing signal and the cosine mixing signal are sampled respectively in at least one sine cycle through an analog-to-digital conversion device in the main control chip; The amplitudes of the sine mixing signal and the cosine mixing signal in a single sine cycle are respectively obtained according to the sampling results through the analog-to-digital conversion device in the main control chip; A mixing signal with the largest amplitude is determined as a target mixing signal, and a signal median value of the target mixing signal is set as a reference signal value of a fast comparison device.
3. The method according to claim 1, characterized in that Determining a second zero-crossing time point sequence of a standard excitation sinusoidal signal matching the sinusoidal PWM signal according to the timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal includes: Take a timestamp as an interval, take the first timestamp in the timestamp sequence as the starting point, calculate the interval time between the interval timestamps in the timestamp sequence, and determine the first rising edge timestamp in the timestamp sequence according to each interval time; Taking the first rising edge timestamp as the starting point, the time width between two adjacent timestamps in the timestamp sequence is calculated, and according to each time width, each target timestamp corresponding to the maximum value point of the standard excitation sinusoidal signal is determined in the timestamp sequence; According to each target time stamp and the number of PWM signal cycles contained in the sine cycle of the standard excitation sinusoidal signal, a second zero-crossing time point sequence of the standard excitation sinusoidal signal matching the sinusoidal PWM signal is determined.
4. The method according to claim 3, characterized in that Based on each interval time, determine the first rising edge timestamp in the timestamp sequence, including: If the interval times are all equal, the first timestamp in the timestamp sequence is determined as the first rising edge timestamp; If the interval times are not exactly equal, the second timestamp in the timestamp sequence is determined to be the first rising edge timestamp.
5. The method according to claim 3, characterized in that: According to each time width, each target time stamp corresponding to the maximum value point of the standard excitation sinusoidal signal is determined in the time stamp sequence, including: Identify the high-level time widths in each time width respectively, and identify the maximum high-level time width in each high-level time width that is gradually increasing; The next rising edge timestamp corresponding to each identified maximum high-level time width is determined as each target timestamp.
6. The method according to claim 3, characterized in that According to each target time stamp and the number of PWM signal cycles contained in the sine cycle of the standard excitation sine signal, a second zero-crossing time point sequence of the standard excitation sine signal matching the sine PWM signal is determined, including: According to the number of PWM signal cycles contained in the sine cycle of the standard excitation sine signal, respectively identifying the previous zero-crossing time stamp and the next zero-crossing time stamp corresponding to each target time stamp in the time stamp sequence; The identified zero-crossing time stamps are arranged in chronological order to obtain a second zero-crossing time point sequence.
7. The method according to claim 1, characterized in that According to the first zero-crossing time point sequence and the second zero-crossing time point sequence, the time offset between the target mixing signal and the standard excitation sinusoidal signal is calculated, and according to the time offset, the phase offset value of the rotary transformer circuit system is calculated, including: If the first zero-crossing time point in the first zero-crossing time point sequence is earlier than the first zero-crossing time point in the second zero-crossing time point sequence, the first zero-crossing time point in the first zero-crossing time point sequence is discarded; Subtract the zero-crossing time points in the second zero-crossing time point sequence from the zero-crossing time points at the corresponding sequence positions in the first zero-crossing time point sequence to obtain a plurality of time difference values, and determine the average value of the time difference values as the time offset; Taking a zero-crossing time point as an interval, taking the first zero-crossing time point in the first zero-crossing time point sequence as a starting point, calculating the interval time between two zero-crossing time points in the first zero-crossing time point sequence, and determining the average value of each interval time as the signal period of the target mixing signal; The phase offset value of the resolver circuit system is calculated based on the time offset and the signal period.
8. The method according to claim 1, characterized in that Before comparing the sampling result of the target mixing signal with the preset reference signal value through the fast comparison device in the main control chip to generate the mixing PWM signal, the method further includes: The data stream is collected by the analog-to-digital converter in the main control chip, and the noise index of the rotary transformer circuit system is analyzed according to the data stream collection result; According to the noise index, set the hysteresis band corresponding to the fast comparison device.
9. The method according to any one of claims 1 to 8, characterized in that: Before capturing the edge timestamps of the sinusoidal PWM signal through the first channel of the timer input device in the main control chip to form a timestamp sequence, the method further includes: Controlling the rotary transformer to be in a stationary state; and / or After calculating the phase offset value of the resolver hardware circuit system, it also includes: The phase offset value is stored in the storage device of the main control chip, so that the resolver circuit system can use the phase offset value to correct the calculation result in the subsequent process of calculating the rotor angle of the resolver.
10. A phase shift detection device for a rotary transformer circuit system, the rotary transformer circuit system comprising a main control chip, a peripheral circuit and a rotary transformer, the peripheral circuit is used to generate an excitation reference signal according to a sinusoidal pulse width modulation (PWM) signal sent by the main control chip, output it to the rotary transformer, and provide a sinusoidal or cosine mixing signal fed back by the rotary transformer to the main control signal for analyzing the rotor angle of the rotary transformer, characterized in that: The device comprises: A mixed frequency PWM signal generation module is used to compare the sampling result of the target mixed frequency signal with a preset reference signal value through a fast comparison module in the main control chip to generate a mixed frequency PWM signal; A first zero-crossing time point sequence forming module is used to capture the edge timestamps of the mixed-frequency PWM signal through the first channel of the timer input module in the main control chip to form a first zero-crossing time point sequence corresponding to the target mixed-frequency signal; The timestamp sequence forming module is used to capture the edge timestamps of the sinusoidal PWM signal through the second channel of the timer input module in the main control chip to form a timestamp sequence; A second zero-crossing time point sequence determination module is used to determine a second zero-crossing time point sequence of a standard excitation sinusoidal signal that matches the sinusoidal PWM signal according to a timestamp sequence and the number of PWM signal cycles contained in the sinusoidal cycle of the standard excitation sinusoidal signal; The phase offset value calculation module is used to calculate the time offset between the target mixing signal and the standard excitation sinusoidal signal according to the first zero-crossing time point sequence and the second zero-crossing time point sequence, and calculate the phase offset value of the rotary transformer circuit system according to the time offset.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the phase shift detection method of the resolver circuit system according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the phase shift detection method of the resolver circuit system according to any one of claims 1 to 9 when the processor executes the computer instructions.