Signal processing circuit and system and envelope signal extraction method

By using a timing comparator, interrupt controller, and microcontroller in the signal processing circuit to perform edge event detection and peak sampling, the problem of envelope signal accuracy caused by phase deviation between the carrier and the Sin and Cos electrical signals is solved, thus improving the accuracy of rotor angle calculation.

CN121595944APending Publication Date: 2026-03-03SHANGHAI AUTOMOBILE GEAR WORKS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411138121.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In new energy vehicles, the phase deviation between the carrier wave and the Sin and Cos electrical signals reduces the accuracy of envelope signal extraction, which in turn affects the accuracy of rotor angle calculation.

Method used

The signal processing circuit, including a timing comparator, an interrupt controller, an AD converter, and a microcontroller, is used to perform counting reset and signal comparison by detecting edge events, outputting periodic event signals and sampling trigger signals. The interrupt controller outputs an interrupt trigger signal, and the AD converter samples sine and cosine electrical signals. The microcontroller performs peak sampling to extract the envelope signal.

Benefits of technology

This improves the accuracy of envelope signal extraction, thereby increasing the accuracy of rotor angle calculation, overcoming the influence of phase deviation, and reducing the number of sampling points and CPU load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121595944A_ABST
    Figure CN121595944A_ABST
Patent Text Reader

Abstract

The invention discloses a signal processing circuit and system and an envelope signal extraction method, and relates to the technical field of signal processing, and the signal processing circuit comprises a timing comparator which is used for carrying out counting reset and signal comparison according to an edge event obtained by detecting a zero crossing point of an excitation signal, and outputting a periodic event signal and a sampling trigger signal; the interrupt controller is connected with the timing comparator and is used for outputting an interrupt trigger signal according to the periodic event signal; the AD converter is respectively connected with the timing comparator and the rotary transformer and is used for carrying out sine and cosine electric signal sampling on the rotary transformer according to the sampling trigger signal to obtain a sampling signal; and the microcontroller is respectively connected with the interrupt controller and the AD converter, and is used for carrying out peak value sampling according to the excitation signal and the sampling signal when receiving the interrupt trigger signal so as to extract and obtain an envelope signal. According to the method and the device, the effect of improving the accuracy of envelope signal extraction and the accuracy of subsequent rotor angle calculation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of signal processing technology, and in particular to a signal processing circuit, system, and envelope signal extraction method. Background Technology

[0002] In new energy vehicles, microcontrollers are commonly used to calculate rotor angles. This requires extracting the sin and cos envelope signals from the acquired sin and cos electrical signals. Currently, when using peak sampling for envelope signal extraction, it is easily affected by the phase deviation between the carrier wave and the sin and cos electrical signals. The sampling points deviate from the peak value, resulting in reduced accuracy of envelope signal extraction and consequently, decreased accuracy in rotor angle calculation. Summary of the Invention

[0003] The main objective of this application is to provide a signal processing circuit, system, and envelope signal extraction method, aiming to solve the technical problem in related technologies where phase deviation exists between the carrier and Sin and Cos electrical signals, resulting in reduced accuracy of envelope signal extraction.

[0004] To achieve the above objectives, this application proposes a signal processing circuit connected to a rotary transformer. The signal processing circuit includes:

[0005] A timing comparator is used to perform count reset and signal comparison based on detected edge events, and outputs a periodic event signal and a sampling trigger signal; wherein, the edge event is obtained by detecting the zero crossing point of the excitation signal;

[0006] The interrupt controller, connected to the timer comparator, is used to output an interrupt trigger signal based on the periodic event signal;

[0007] The AD converter is connected to the timing comparator and the rotary transformer respectively. It is used to sample the sine and cosine electrical signals of the rotary transformer according to the sampling trigger signal to obtain the sampled signal.

[0008] The microcontroller, connected to both the interrupt controller and the AD converter, is used to perform peak sampling based on the excitation signal and the sampling signal when an interrupt trigger signal is received, in order to extract the envelope signal.

[0009] In one embodiment, the timing comparator includes:

[0010] The counter, connected to the interrupt controller, is used to reset the count based on the detected edge event, and to generate and output periodic event signals.

[0011] The comparator, connected to the counter, microcontroller, and AD converter respectively, is used to compare the periodic event signal with the comparison signal provided by the microcontroller, and generate and output the sampling trigger signal.

[0012] In one embodiment, the signal processing circuit further includes:

[0013] The signal generator is connected to the rotary transformer in sequence through a signal filtering circuit and a signal amplification circuit to generate an excitation signal. The excitation signal is then output to the excitation winding of the rotary transformer in sequence through the signal filtering circuit and the signal amplification circuit, so that the sine winding and cosine winding of the rotary transformer can convert the rotor position of the motor into a sine electrical signal and a cosine electrical signal respectively according to the excitation signal.

[0014] In one embodiment, the signal processing circuit further includes:

[0015] An edge catcher, connected to a zero-crossing detection circuit, is used to detect the rising or falling edge of the zero-crossing square wave signal output by the zero-crossing detection circuit and output an edge event signal; wherein, the zero-crossing square wave signal is obtained by the zero-crossing detection circuit detecting the zero-crossing point of the excitation signal;

[0016] A timing comparator, connected to an edge catcher, is used for counter reset and signal comparison based on edge event signals.

[0017] In one embodiment, the signal processing circuit further includes:

[0018] The timestamp capture unit, connected to the timing comparator, is used to acquire the sampling time of the AD converter based on the sampling trigger signal and output a timestamp signal.

[0019] The microcontroller is also connected to a timestamp capture unit to perform peak sampling based on the excitation signal and the sampling signal when an interrupt trigger signal and a timestamp signal are received.

[0020] In one embodiment, the AD converter includes:

[0021] The first channel has its control terminal connected to a timing comparator and its input terminal connected to the sinusoidal winding of a rotary transformer via a first conditioning circuit. The first channel is used to sample and convert the sinusoidal modulation signal output by the first conditioning circuit according to the sampling trigger signal to obtain the first sampled signal.

[0022] The second channel has its control terminal connected to a timing comparator and its input terminal connected to the cosine winding of a rotary transformer via a second conditioning circuit. The second channel is used to sample and convert the cosine modulation signal output by the second conditioning circuit according to the sampling trigger signal to obtain the second sampled signal.

[0023] The microcontroller is connected to the output terminals of the first channel and the second channel, respectively, and is also used to perform peak sampling based on the polarity of the excitation signal and the first sampling signal / second sampling signal.

[0024] Furthermore, to achieve the above objectives, this application also proposes a signal processing system, comprising:

[0025] The signal processing circuit described above;

[0026] The rotary transformer is connected to the signal processing circuit in sequence through a signal amplification circuit and a signal filtering circuit. It is used to convert the rotor position of the motor into sine and cosine electrical signals according to the received excitation signal so that the signal processing circuit can sample them.

[0027] The zero-crossing detection circuit, connected to the signal amplification circuit, is used to detect the zero-crossing point of the excitation signal and output a zero-crossing square wave signal to the signal processing circuit so that the signal processing circuit can detect edge events.

[0028] Furthermore, to achieve the above objectives, this application also proposes an envelope signal extraction method, applied to the signal processing circuit described above. The envelope signal extraction method includes:

[0029] The timing comparator performs counting reset and signal comparison based on the detected edge events, and outputs a periodic event signal and a sampling trigger signal; the edge events are obtained by detecting the zero crossing point of the excitation signal.

[0030] The interrupt controller outputs an interrupt trigger signal based on the periodic event signal.

[0031] The rotary transformer is sampled using an AD converter based on a sampling trigger signal to obtain a sampled signal;

[0032] When the microcontroller receives an interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal.

[0033] In one embodiment, a timing comparator performs count reset and signal comparison based on detected edge events, outputting a periodic event signal and a sampling trigger signal, including:

[0034] The target sampling signal corresponding to the target channel is acquired by a microcontroller. Iterative optimization is performed using gradient descent or Newton's downhill method to obtain the time delay between the edge event of the current period and the peak point of the target sampling signal. A comparison signal is generated based on the time delay and the operating frequency of the timing comparator and output to the timing comparator. The target channel is the channel corresponding to a sine or cosine electrical signal far from zero. The optimization objective of the iterative optimization is that the sampling time of the target sampling signal corresponds to the peak value of the signal corresponding to the target channel.

[0035] The timing comparator performs a count reset based on edge events, generating a periodic event signal. The periodic event signal is compared with the comparison signal to generate a sampling trigger signal, and the periodic event signal and the sampling trigger signal are output respectively.

[0036] In one embodiment, when the microcontroller receives an interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal, including:

[0037] The edge type of the current cycle edge event is determined by the microcontroller, and the polarity flag value of the excitation signal is obtained. The peak value is calculated based on the product of the sampled value of the target sampled signal and the polarity flag value, and the envelope signal corresponding to the target sampled signal is obtained.

[0038] One or more technical solutions proposed in this application have at least the following technical effects:

[0039] A signal processing circuit is proposed. A timing comparator performs counting, reset, and signal comparison based on detected edge events, outputting a periodic event signal and a sampling trigger signal. An interrupt controller outputs an interrupt trigger signal based on the periodic event signal. An AD converter samples the sine and cosine electrical signals of the rotary transformer based on the sampling trigger signal to obtain a sampled signal. Furthermore, when the microcontroller receives the interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampled signal to extract the envelope signal, thus solving the phase deviation problem between the excitation signal and the sine and cosine electrical signals. By detecting zero-crossing points of the excitation signal to obtain edge events, and using these edge events to trigger interrupts and AD sampling, the circuit achieves a correspondence between interrupt triggering and detected edge events within a cycle. It also ensures that the sampling time of the AD converter is delayed after the interrupt trigger and corresponds to the peak value of the excitation signal. This allows the microcontroller to extract the envelope signal using the peak sampling method after receiving the interrupt trigger signal and sampled signal without being affected by the phase deviation, improving the accuracy of envelope signal extraction and subsequent rotor angle calculation. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0041] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0042] Figure 1 This is a schematic diagram of the structure of an embodiment of the signal processing circuit provided in this application;

[0043] Figure 2 for Figure 1 A schematic diagram of the timing comparator;

[0044] Figure 3 This is a schematic diagram of the signal processing system involved in the embodiments of this application;

[0045] Figure 4 This is a schematic diagram showing the waveform relationship of each signal in the embodiments of this application;

[0046] Figure 5 This is a schematic flowchart of the envelope signal extraction method according to an embodiment of this application;

[0047] Figure 6 This is a schematic diagram of the microcontroller's workflow provided in the embodiments of this application;

[0048] Figure 7 for Figure 6 A flowchart corresponding to the software process in Phase 1;

[0049] Figure 8 for Figure 7 A flowchart illustrating the optimization process performed in the process;

[0050] Figure 9 A schematic diagram of a queue buffer within a microcontroller provided in an embodiment of this application;

[0051] Figure 10 A schematic diagram showing the waveform relationship of each signal in an application example provided in this application.

[0052] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0054] It should be noted that if the embodiments of this application involve directional indications (such as up, down, left, right, front, back, etc.), these directional indications are only used to explain the relative positional relationships and movement of the components in a specific posture. If the specific posture changes, the directional indications will also change accordingly. Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" can explicitly or implicitly include at least one of those features. Additionally, if "and / or" or "and / or" appears throughout the text, its meaning includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or a solution where A and B are simultaneously satisfied. Furthermore, the technical solutions of the various embodiments can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0055] In new energy vehicles, motor controllers typically employ FOC (Field-Oriented Control, also known as vector frequency conversion) to achieve torque control. The calculation of the rotor angle directly impacts the accuracy of torque control. The rotor angle is usually obtained by acquiring the Sin and Cos electrical signals from the motor using a resolver, followed by calculation by a microcontroller or dedicated chip. Due to the high cost of dedicated chips, microcontrollers are currently the most common method for calculating the rotor angle. When calculating the rotor angle, the microcontroller first extracts the Sin and Cos envelope signals from the acquired Sin and Cos electrical signals, and then performs an arctangent calculation on these envelope signals to obtain the rotor angle.

[0056] Currently, there are two main methods for extracting envelope signals: integration and peak sampling. Integration requires high-frequency sampling and a large number of sampling points, resulting in a high computational load and increasing the CPU (Central Processing Unit) load. Peak sampling, while requiring only peak sampling points and thus requiring less computation, is susceptible to phase deviations between the carrier wave and the Sin and Cos electrical signals. This causes the sampling points to deviate from the peak value, reducing the accuracy of envelope signal extraction and consequently decreasing the accuracy of rotor angle calculation.

[0057] To address the aforementioned problems, this application provides a signal processing circuit, system, and envelope signal extraction method. The application and its embodiments will be described in detail below with reference to the accompanying drawings.

[0058] This application proposes a signal processing circuit.

[0059] In one embodiment of this application, reference is made to Figure 1 , Figure 1 This is a schematic diagram of a signal processing circuit according to an embodiment. The signal processing circuit 106 includes a timing comparator 203, an interrupt controller 204, an AD converter 202, and a microcontroller.

[0060] The timing comparator 203 is used to perform count reset and signal comparison based on the detected edge event, and outputs a periodic event signal and a sampling trigger signal; wherein, the edge event is obtained by detecting the zero crossing point of the excitation signal;

[0061] Interrupt controller 204 is connected to timer comparator 203, and interrupt controller 204 is used to output interrupt trigger signal according to periodic event signal;

[0062] The AD converter 202 is connected to the timing comparator 203 and the rotary transformer respectively. The AD converter 202 is used to sample the sine and cosine electrical signals of the rotary transformer according to the sampling trigger signal to obtain the sampled signal.

[0063] The microcontroller is connected to the interrupt controller 204 and the AD converter 202 respectively. When the interrupt trigger signal is received, the microcontroller performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal.

[0064] It should be noted that the signal processing circuit 106 can be implemented by a microcontroller, MCU (Microcontroller Unit), or other programmable control devices and their peripheral devices, including the aforementioned timing comparator 203, interrupt controller 204, AD converter 202, and microcontroller (…). Figure 1 Devices such as those not shown in the diagram can serve as hardware modules within the programmable controller. The software portion of the programmable controller can be implemented using a microcontroller, for example, by executing existing envelope signal extraction methods (such as peak sampling) or the envelope signal extraction method proposed later. In some examples, the microcontroller performs peak sampling based on the excitation signal and the sampling signal. After implementing envelope signal extraction based on the peak sampling method, it can further perform arctangent calculations on the extracted envelope signal to obtain the rotor angle of the motor.

[0065] It should also be noted that the excitation signal, also known as the carrier signal, is generated by the signal processing circuit 106 and output to the resolver. The resolver is connected to the signal processing circuit 106 and also to the motor rotor. It can convert the motor rotor position signal into a sine (Sin) or cosine (Cos) electrical signal based on the received excitation signal. The signal processing circuit 106 can perform zero-crossing self-detection on the output excitation signal to detect edge events, including rising or falling edges. The timing comparator 203 uses the edge events to perform a count reset, generating a periodic event signal. This periodic event signal can then be compared with a preset reference signal or a comparison signal provided by the microcontroller to generate a sampling trigger signal. The interrupt controller 204 is connected to the timing comparator 203 and can periodically generate an interrupt trigger signal based on the periodic event signal and output it to the microcontroller. This allows the microcontroller to interrupt the extraction of the envelope signal, meaning the signal processing circuit 106 can execute an interrupt service routine for accurate data processing, such as envelope signal extraction and rotor angle calculation.

[0066] It should also be noted that after sampling the Sin or Cos electrical signal, the AD converter 202 can obtain the corresponding sampled signal. The microcontroller can perform peak sampling on the sampled signal corresponding to the Sin electrical signal when the output excitation signal is a sine (Sin) signal, or perform peak sampling on the sampled signal corresponding to the Cos electrical signal when the output excitation signal is a cosine (Cos) signal, thereby realizing the extraction of the envelope signal. After receiving the interrupt trigger signal and the sampled signal, the microcontroller can extract the envelope signal based on the sampling result interrupt.

[0067] This embodiment provides a signal processing circuit that uses a timing comparator to perform counting, reset, and signal comparison based on detected edge events, outputting a periodic event signal and a sampling trigger signal. An interrupt controller outputs an interrupt trigger signal based on the periodic event signal. An AD converter samples the sine and cosine electrical signals of the rotary transformer based on the sampling trigger signal to obtain a sampled signal. Furthermore, when the microcontroller receives the interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampled signal to extract the envelope signal, thus solving the problem of phase deviation between the excitation signal and the sine and cosine electrical signals. By detecting zero-crossing points of the excitation signal to obtain edge events, and using these edge events to trigger interrupts and AD sampling, the interrupt trigger within a cycle corresponds to the detected edge event. The sampling time of the AD converter is delayed after the interrupt trigger and corresponds to the peak value of the excitation signal. This ensures that the microcontroller, after receiving the interrupt trigger signal and the sampled signal, is no longer affected by phase deviation when using peak sampling to extract the envelope signal, improving the accuracy of envelope signal extraction and subsequent rotor angle calculations.

[0068] In one feasible implementation, such as Figure 1 As shown, the AD converter 202 may include a first channel 2021 and a second channel 2022;

[0069] The control terminal of the first channel 2021 is connected to the timing comparator 203, and the input terminal of the first channel 2021 is connected to the sinusoidal winding of the rotary transformer. The first channel 2021 is used to sample the sinusoidal signal according to the sampling trigger signal to obtain the first sampled signal.

[0070] The control terminal of the second channel 2022 is connected to the timing comparator 203, and the input terminal of the second channel 2022 is connected to the cosine winding of the rotary transformer. The second channel 2022 is used to sample the cosine signal according to the sampling trigger signal to obtain the second sampled signal.

[0071] The microcontroller is connected to the output of the first channel 2021 and the output of the second channel 2022, respectively, and is also used to perform peak sampling based on the polarity of the excitation signal and the first sampling signal / second sampling signal.

[0072] It should be noted that the AD converter 202 has two channels, which are used to sample the Sin and Cos electrical signals of the resolver, respectively. The operation of the first channel 2021 and the second channel 2022 is controlled by the sampling trigger signal output by the timing comparator 203. The polarity of the excitation signal refers to whether the current period of the excitation signal is in the positive or negative half-cycle, and a polarity flag can be set accordingly, for example, 1 indicates that it is in the positive half-cycle, and -1 indicates that it is in the negative half-cycle. During peak sampling, the peak value can be calculated by multiplying the AD value of the corresponding first / second sampled signal with the polarity flag, and the resulting peak value is used as the envelope signal of the Sin or Cos electrical signal.

[0073] In this embodiment, when the microcontroller receives an interrupt trigger signal, it performs peak sampling based on the polarity of the excitation signal and the first sampling signal / second sampling signal to extract the envelope signal. This method overcomes the adverse effects caused by the phase deviation between the excitation signal and the Sin and Cos signals. Furthermore, it has the advantages of fewer sampling points and lower CPU load rate when using the peak sampling method to extract the envelope signal.

[0074] In one feasible implementation, refer to Figure 2 , Figure 2 for Figure 1 A schematic diagram of the timing comparator 203 is shown. The timing comparator 203 may include a counter 2031 and a comparator 2032;

[0075] Counter 2031 is connected to interrupt controller 204. Counter 2031 is used to reset the count based on the detected edge event, and to generate and output periodic event signals.

[0076] Comparator 2032 is connected to counter 2031, microcontroller and AD converter 202 respectively. Comparator 2032 is used to compare the periodic event signal with the comparison signal provided by the microcontroller to generate and output the sampling trigger signal.

[0077] It should be noted that counter 2031 can be reset based on rising or falling edge events to generate periodic event signals. Interrupt controller 204 is connected to counter 2031 and can periodically generate and output interrupt trigger signals according to the corresponding periodic event signals. Comparator 2032 works with counter 2031 to compare the periodic event signals output by counter 2031 with the corresponding comparison values ​​(e.g., ...). Figure 2 The comparator 2032 compares CM0 and CM1 to generate a periodic pulse signal, which serves as the sampling trigger signal. The comparison values ​​CM0 and CM1 determine the rising and falling edges of the periodic pulse signal output by the comparator 2032, respectively.

[0078] It should also be noted that before comparator 2032 performs the comparison, the microcontroller can execute an optimization process based on periodic interrupts to determine a suitable comparison value. This provides a corresponding comparison signal to comparator 2032, ensuring that when comparator 2032 outputs a sampling trigger signal to AD converter 202, the sampling time of AD converter 202 corresponds to the peak value of the excitation signal. This optimization process can be implemented using gradient descent or Newton's downhill method, or through the optimization method described later.

[0079] In another embodiment of this application, the signal processing circuit 106 can be applied to a signal processing system. (See also...) Figure 3 , Figure 3 This is a schematic diagram of a signal processing system according to an embodiment. The signal processing system may include the signal processing circuit 106, signal filtering circuit 103, signal amplification circuit 104, rotary transformer 100, and zero-crossing detection circuit 105 as described above.

[0080] In one embodiment of this example, as Figure 1 and Figure 3 As shown, the signal processing circuit 106 may also include a signal generator 200;

[0081] The signal generator 200 is connected to the rotary transformer 100 in sequence through the signal filtering circuit 103 and the signal amplification circuit 104 to generate an excitation signal. The excitation signal is then output to the excitation winding of the rotary transformer 100 in sequence through the signal filtering circuit 103 and the signal amplification circuit 104, so that the sine winding and cosine winding of the rotary transformer 100 convert the rotor position of the motor into a sine electrical signal and a cosine electrical signal respectively according to the excitation signal.

[0082] It should be noted that the signal generator 200 can generate an excitation signal of a specific frequency. After the signal is processed by the signal filtering circuit 103 and the signal amplification circuit 104 in sequence, a sine wave or a triangular wave can be generated and sent to the excitation winding of the rotary transformer 100.

[0083] It should also be noted that in the signal processing system, the signal filtering circuit 103 is connected to the signal processing circuit 106, specifically to the signal generator 200. The signal filtering circuit 103 can filter out the high-frequency components in the excitation signal output by the signal processing circuit 106, and send the low-frequency components of the excitation signal to the signal amplification circuit 104. The signal amplification circuit 104 is connected to both the signal filtering circuit 103 and the rotary transformer 100. The signal amplification circuit 104 can amplify the power of the excitation signal output by the signal filtering circuit 103, and output the amplified excitation signal to the rotary transformer. The excitation signal is fed into the excitation winding of the rotary transformer 100. The rotary transformer 100 is connected to the motor rotor. The rotary transformer 100 can convert the rotor position of the motor into Sin and Cos electrical signals according to the received excitation signal, so that the signal processing circuit 106 can sample them. Specifically, when the motor rotates, the sine (Sin) winding and cosine (Cos) winding of the rotary transformer 100 can induce modulated Sin and Cos electrical signals according to the excitation signal frequency and rotor angle, so that the signal processing circuit 106 can extract the envelope signal from the Sin and Cos electrical signals.

[0084] It is understandable that there is a phase deviation between the excitation signal output by the signal generator and the Sin and Cos electrical signals generated by the resolver. In related technologies, when extracting the envelope signal of the Sin and Cos electrical signals, the sampling points for sampling the Sin and Cos electrical signals deviate from the peak value of the excitation signal, resulting in poor accuracy of the envelope signal extraction and thus affecting the accuracy of subsequent rotor angle calculations. However, in the signal processing circuit of this embodiment, the influence of this phase deviation can be overcome, enabling the microcontroller to perform accurate envelope signal extraction.

[0085] In one embodiment of this example, as Figure 1-3 As shown, the signal processing circuit 106 may also include an edge catcher 201;

[0086] Edge catcher 201 is connected to zero-crossing detection circuit 105 and is used to detect the rising or falling edge of the zero-crossing square wave signal output by zero-crossing detection circuit 105 and output edge event signal; wherein, the zero-crossing square wave signal is obtained by zero-crossing detection circuit 105 detecting the zero-crossing point of excitation signal.

[0087] The timing comparator 203 is connected to the edge catcher 201 and is used to perform count reset and signal comparison based on the edge event signal.

[0088] It should be noted that the edge catcher 201 can capture the rising edge or falling edge of the zero-crossing square wave signal, i.e., the edge event, and generate a corresponding signal representing the rising edge or falling edge event, i.e., the edge event signal, and send the edge event signal to the timing comparator 203.

[0089] It should also be noted that in the signal processing system, the zero-crossing detection circuit 105 is connected to the signal amplification circuit 104. The zero-crossing detection circuit 105 can perform zero-crossing detection on the amplified excitation signal output by the signal amplification circuit 104. When the excitation signal is greater than 0, the zero-crossing detection circuit 105 outputs a high level, and when the excitation signal is less than 0, the zero-crossing detection circuit 105 outputs a low level, thereby outputting a zero-crossing square wave signal to the signal processing circuit 106 so that the signal processing circuit 106 can detect edge events. Specifically, the zero-crossing square wave signal is output to the edge catcher 201 so that it can detect the rising edge or falling edge and output the edge event signal.

[0090] In one embodiment of this example, as Figure 1 As shown, the signal processing circuit 106 may also include a timestamp capture unit 205;

[0091] The timestamp capture unit 205 is connected to the timing comparator 203 and is used to acquire the sampling time of the AD converter 202 according to the sampling trigger signal and output the timestamp signal.

[0092] The microcontroller is also connected to the timestamp capture 205 for peak sampling based on the excitation signal and the sampling signal upon receiving an interrupt trigger signal and a timestamp signal.

[0093] It should be noted that the timestamp capture unit 205 can be specifically connected to the output of comparator 2032 in the timing comparator 203, receive the sampling trigger signal to trigger the capture action, record the sampling time of the AD converter 202, and then output a timestamp signal to the microcontroller. In some embodiments, this timestamp signal can be used for rotor angle compensation. Therefore, this timestamp signal can not only be used as a parameter for related processes of the microcontroller, such as the optimization process, but also as a parameter for other processes after envelope signal extraction, such as the rotor angle calculation process.

[0094] In one specific embodiment, the signal processing system may further include a first conditioning circuit 101 and a second conditioning circuit 102. For example... Figure 1 and Figure 3 As shown, the AD converter 202 may include a first channel 2021 and a second channel 2022;

[0095] The control terminal of the first channel 2021 is connected to the timing comparator 203. The input terminal of the first channel 2021 is connected to the sinusoidal winding of the rotary transformer 100 through the first conditioning circuit 101. The first channel 2021 is used to sample and convert the sinusoidal modulation signal output by the first conditioning circuit 101 according to the sampling trigger signal to obtain the first sampling signal.

[0096] The control terminal of the second channel 2022 is connected to the timing comparator 203, and the input terminal of the second channel 2022 is connected to the cosine winding of the rotary transformer 100 through the second conditioning circuit 102. The second channel 2022 is used to sample and convert the cosine modulation signal output by the second conditioning circuit 102 according to the sampling trigger signal to obtain the second sampling signal.

[0097] The microcontroller is connected to the output of the first channel 2021 and the output of the second channel 2022, respectively, and is also used to perform peak sampling based on the polarity of the excitation signal and the first sampling signal / second sampling signal.

[0098] It should be noted that the input terminal of the first conditioning circuit 101 is connected to the rotary transformer 100, specifically to its sine winding, and the output terminal is connected to the signal processing circuit 106, specifically to the first channel 2021 of its internal AD converter 202. The first conditioning circuit 101 processes the Sin electrical signal converted by the rotary transformer 100 and sends it to the signal processing circuit 106, specifically filtering and proportionally amplifying the Sin electrical signal for sampling by the AD converter 202. The input terminal of the second conditioning circuit 102 is connected to the rotary transformer 100, specifically to its cosine winding, and the output terminal is connected to the signal processing circuit 106, specifically to the second channel 2022 of its internal AD converter 202. The second conditioning circuit 102 processes the Cos electrical signal converted by the rotary transformer 100 and sends it to the signal processing circuit 106, specifically filtering and proportionally amplifying the Cos electrical signal for sampling by the AD converter 202. Afterwards, the signal processing circuit 106 can perform subsequent calculations, including extracting the envelope signal and calculating the rotor angle.

[0099] It should also be noted that the control terminals of the first channel 2021 and the second channel 2022 are specifically connected to the output terminal of comparator 2032 in the timing comparator 203, receiving a sampling trigger signal to trigger the sampling action. The first channel 2021 samples the Sin modulated signal from the first conditioning circuit 101, performs analog-to-digital conversion, and obtains a digital first sampled signal for subsequent processing by the microcontroller; the second channel 2022 samples the Cos modulated signal from the second conditioning circuit 102, performs analog-to-digital conversion, and obtains a digital second sampled signal for subsequent processing by the microcontroller.

[0100] By way of example, in order to help understand the working principle and technical effects of the signal processing circuit 106 proposed in the embodiments of this application, the following refers to... Figure 4 , Figure 4 The waveform relationships of each signal are shown in the diagram, with a detailed explanation.

[0101] In Figure 4 In the diagram, the horizontal axis represents time, and the vertical axis represents the waveform of each signal. It should be noted that... Figure 4 In this circuit, the Sin modulated signal is the output of the first conditioning circuit 101, the Cos modulated signal is the output of the second conditioning circuit 102, the zero-crossing square wave signal is the output of the zero-crossing detection circuit 105, the edge event signal is the output of the edge catcher 201, the periodic event signal is the output of the counter 2031 in the timing comparator 203, and the sampling trigger signal is the output of the comparator 2032 in the timing comparator 203.

[0102] In this circuit, the positive and negative half-cycles of the Sin / Cos modulation signal correspond to the positive and negative half-cycles of the excitation signal output by the signal generator 200. The zero-crossing square wave signal corresponds to the excitation signal. When the excitation signal output by the signal amplifier circuit 104 is greater than 0, the zero-crossing square wave signal is at a high level; when the excitation signal output by the signal amplifier circuit 104 is less than 0, the zero-crossing square wave signal is at a low level. Therefore, the zero-crossing square wave signal corresponds to the positive and negative half-cycles of the Sin / Cos modulation signal, such as... Figure 4 As shown. However, due to the influence of many factors such as the connection harness of the rotary transformer 100 and external circuit filtering, there is a phase deviation Φ between the zero-crossing square wave signal and the Sin modulated signal / Cos modulated signal.

[0103] like Figure 4As shown, the rising edge of the zero-crossing square wave signal can be captured by the edge catcher 201, generating a rising edge event. Similarly, a falling edge event can also be generated, and the corresponding edge event signal is output to the timing counter 2031. Based on the rising or falling edge event corresponding to the edge event signal, the counter 2031 in the timing comparator 203 can be reset, making it count from zero to achieve periodic interruption and generate a corresponding periodic event signal. In the timing comparator 203, the periodic event signal output by the counter 2031 is compared with the comparison value CM0 / CM1 in the comparator 2032 to generate a pulse signal, i.e., a sampling trigger signal. This sampling trigger signal can, on the one hand, trigger the first channel 2021 / second channel 2022 in the AD converter 202 to perform AD sampling and conversion, and on the other hand, trigger the timestamp capturer 205 to collect the sampling time of the AD converter 202. For the aforementioned periodic event signal, the interrupt controller 204 can periodically generate an interrupt trigger signal and output it to the microcontroller. Then, the microcontroller can perform peak sampling when it receives the interrupt trigger signal and the first sampling signal / second sampling signal output by the AD converter 202, thereby realizing envelope signal extraction.

[0104] In the aforementioned signal processing system, the signal filtering circuit 103, the signal amplification circuit 104, the zero-crossing detection circuit 105, the first conditioning circuit 101, and the second conditioning circuit 102 form the peripheral circuit of the signal processing circuit 106. When the signal processing circuit 106 is implemented by a microcontroller, accurate envelope signal extraction can be achieved through the microcontroller and its peripheral circuits.

[0105] Based on this, in another embodiment of this application, a method for extracting the envelope signal based on the above-mentioned signal processing circuit 106 and signal processing system is proposed, referring to... Figure 5 , Figure 5 This is a flowchart illustrating an envelope signal extraction method, which may include steps S10 to S40:

[0106] Step S10: The timing comparator 203 performs count reset and signal comparison based on the detected edge event, and outputs a periodic event signal and a sampling trigger signal; wherein, the edge event is obtained by detecting the zero crossing point of the excitation signal;

[0107] Step S20: The interrupt controller 204 outputs an interrupt trigger signal based on the periodic event signal;

[0108] Step S30: The AD converter 202 samples the sine and cosine electrical signals of the rotary transformer 100 according to the sampling trigger signal to obtain the sampled signal;

[0109] In step S40, when the microcontroller receives the interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal.

[0110] In one feasible implementation, step S10 may include steps S11 to S12:

[0111] Step S11: The target sampling signal corresponding to the target channel is acquired through the microcontroller. Iterative optimization is performed using the gradient descent method or Newton's downhill method to obtain the time delay between the edge event of the current period and the peak point of the target sampling signal. A comparison signal is generated based on the time delay and the operating frequency of the timing comparator 203 and output to the timing comparator 203. The target channel is the channel corresponding to the sine or cosine signal far from zero. The optimization target of the iterative optimization is that the sampling time of the target sampling signal corresponds to the peak value of the signal corresponding to the target channel.

[0112] In step S12, the timing comparator 203 performs a count reset based on the edge event, generating a periodic event signal. This periodic event signal is compared with the comparison signal to generate a sampling trigger signal, and both the periodic event signal and the sampling trigger signal are output. In this way, the microcontroller can execute this optimization process to determine the optimal comparison value corresponding to the comparison signal in comparator 2032, thereby ensuring that the sampling time of the subsequent AD converter 202 corresponds to the signal peak value of the target channel.

[0113] Optionally, before executing step S11, the microcontroller can first determine the target channel, that is, the microcontroller can first determine the target channel, then execute the optimization process, and then output a comparison signal to the timing comparator 203 so that the timing comparator 203 can execute the above step S11.

[0114] In another feasible implementation, after receiving the interrupt trigger signal, the microcontroller can interrupt based on the sampling result and extract the envelope signal using the peak sampling method. That is, step S40 may include step S41:

[0115] Step S41: Determine the edge type of the current period edge event through the microcontroller, obtain the polarity flag value of the excitation signal, calculate the peak value based on the product of the sampled value of the target sampled signal and the polarity flag value, and obtain the envelope signal corresponding to the target sampled signal.

[0116] For example, refer to Figure 6 , Figure 6 This is a schematic diagram of the microcontroller's workflow. To extract the envelope signal, the microcontroller can specifically execute the following processes S1 to S3:

[0117] S1: Initialization operation.

[0118] After the microcontroller starts up, it can perform operations such as clock parameter setting, signal generator 200 initialization, edge catcher 201 initialization, AD converter 202 initialization, timing comparator 203 initialization, interrupt controller 204 initialization, and other necessary initializations, thereby realizing the initialization operations of various peripherals and software modules in the signal processing circuit 106.

[0119] S2: Phase 1 software process.

[0120] Reference Figure 7 , Figure 7 This is a flowchart corresponding to the software process in Phase 1. The process may specifically include: determining the target channel and executing the optimization process.

[0121] When determining the target channel, the microcontroller can select the channel corresponding to the Sin or Cos electrical signal as the target channel, including the corresponding sampling channel in the conditioning circuit and the AD converter 202. Since the value of the Sin or Cos electrical signal is 0 or close to 0 when the angle of the motor rotor is exactly such that it will bring a large error to the subsequent operation, the principle that the values ​​of Sin or Cos cannot be 0 at the same time can be used to select the channel corresponding to the Sin or Cos electrical signal that is far from 0 as the target channel.

[0122] For example, such as Figure 7 As shown, it can specifically include:

[0123] Step S21: First, select the Sin electrical signal as the initial target;

[0124] Step S22: The cycle is interrupted in the first period, and the time delay τ = 0 is obtained;

[0125] Step S23: Interrupt in the second cycle to obtain the time delay τ = T s / 4, where T s The period of the excitation signal;

[0126] Step S24: Determine whether the sampled AD values ​​of the first two cycles are close to 0. If so, proceed to step S25; otherwise, proceed to step S26.

[0127] Step S25: Use the channel corresponding to the Cos electrical signal as the target channel;

[0128] Step S26: Use the channel corresponding to the Sin electrical signal as the target channel;

[0129] Step S27: Execute the optimization process.

[0130] When the microcontroller executes the optimization process, it can be performed on the target channel, iteratively optimizing the time delay τ between the rising (or falling) edge of the zero-crossing square wave signal and the peak point of the Sin or Cos modulated signal. k This iterative optimization can be performed during a microcontroller execution cycle interruption.

[0131] Specifically, the time delay τ between the rising edge (or falling edge) of the zero-crossing square wave signal and the AD sampling point corresponding to the sampling trigger signal of the AD converter 202 is calculated iteratively. k Finally, an optimal value τ was found. pk This ensures that the AD sampling points correspond to the peak points of the sin or cos modulation signals of the target channel; then the microcontroller uses this optimal value τ... pk A comparison signal is generated to set a comparison value for comparator 2032 in timing comparator 203. Then, when counter 2031 in timing comparator 203 generates a periodic event signal, comparator 2032 compares the count value corresponding to the periodic event signal with the aforementioned comparison value, so as to generate and output a sampling trigger signal when the comparison value is reached.

[0132] For example, refer to Figure 8 , Figure 8 To execute the flowchart corresponding to the optimization process, the microcontroller executes the optimization process, which may include the following steps:

[0133] Step A1: Interrupt in the k-th cycle and read the AD value (sampled value) f(τ). k-1 ).

[0134] Obtain the target sampling signal (Sin or Cos modulated signal) corresponding to the target channel, and read the AD value f(τ) of the target sampling signal. k-1 ), where τ k-1 This represents the time delay calculated by the microcontroller during the sampling result interruption in the previous cycle (the (k-1)th cycle). For example... Figure 4 As shown, the time delay τ determines the trigger sampling time corresponding to the sampling trigger signal output by comparator 2032. Therefore, the sampling AD value corresponding to the Sin or Cos modulated signal based on the target sampling signal can be considered to be the time delay τ. k-1 The function.

[0135] Step A2, calculate the derivative: f ′ (τ k-1 ).

[0136] The calculation formula used is:

[0137]

[0138] Among them, f′ (τ k-1 f(τ) is the derivative of the AD value calculated for the current period k. k-1 ), f(τ) k-2 ) are the AD values ​​of the Sin or Cos modulated signal read within the current cycle k interrupt and the previous cycle (k-1) interrupt, respectively, and τ is the AD value of the signal. k-1 τ k-2 These are the time delays calculated within the previous cycle (k-1) interrupt and the cycle before that (k-2) interrupt, respectively.

[0139] Step A3, determine f ′ (τ k-1 If the threshold value is less than the preset threshold value ε, then proceed to step A8; otherwise, proceed to step A4.

[0140] The threshold value ε is a value close to 0 to indicate the time delay τ. k The corresponding sampling point is the peak point of the target sampling signal.

[0141] Step A4: Calculate the time delay τ for k iterations. k .

[0142] The calculation formula used is:

[0143] τ k =τ k-1 +α*f′(τ k-1 ),

[0144] Where α is the step size factor, which determines the time delay τ of the current period k. k It will be delayed by τ in the previous cycle (k-1). k-1 The variation range based on the specific application scenario, α, usually takes the value of 1, 10 or 20.

[0145] It should be noted that gradient descent is used here to calculate the time delay τ of the current period k. k .

[0146] Step A5, determine the time delay τ k If the value is less than 0, proceed to step A6; otherwise, proceed to step A7.

[0147] When τ k When the time delay is less than 0, it indicates that the sampling point will precede the rising (or falling) edge of the zero-crossing square wave signal corresponding to the excitation signal, but this is impossible. Therefore, if the obtained time delay τ is found to be... k If the value is less than 0, the time delay τ needs to be adjusted. k Perform corrections.

[0148] Step A6, use periodic folding to correct time delay τk .

[0149] The calculation formula used is:

[0150] τ k =τ k +T s ,

[0151] Here, taking advantage of the periodicity of the Sin and Cos modulated signals, this point is folded over by one excitation signal period T. s Thus, the corrected time delay τ is obtained. k This ensures that subsequent operations proceed normally.

[0152] Step A7: Set comparison values ​​CM0 and CM1.

[0153] Specifically, the time delay τ can be calculated based on the time delay τ obtained in step A4 above. k Or the time delay τ after correction in step A6 k Set the comparison values ​​CM0 and CM1 in comparator 2032. Assuming the rising edge of the pulse signal output by comparator 2032, i.e., the sampling trigger signal, is determined by CM1, and the falling edge of the sampling trigger signal is determined by CM0, then the formulas for calculating CM0 and CM1 are:

[0154] CM1 = F clk *τ k ,

[0155] CM0 = F clk *(τ k +n*T clk ),

[0156] Among them, F clk T clk These represent the operating frequency and operating period of the timer comparator 203, respectively, n*T clk This determines the pulse width of the sampling trigger signal.

[0157] It should be noted that steps A1-A7 constitute only one loop. After the wait counter 2031 generates a periodic interrupt based on a rising edge (or falling edge) event, it can return to step A1 and, within the new current period k, reread the AD value f(τ) of the target sampled signal (Sin or Cos modulated signal). k-1 ), calculate the derivative f of the AD value. ′ (τ k-1 The process continues, repeating the subsequent steps, and then looping until the derivative f of the AD value obtained at the time of the current cycle's interruption is reached. ′ (τ k-1 If the value is less than the preset threshold ε, then proceed to step A8.

[0158] Step A8, Exit.

[0159] When f ′ (τ k-1 If the time delay τ is less than the preset threshold ε, it indicates that the time delay τ is within the preset threshold ε. k The corresponding sampling point is the peak point of the target sampled signal. At this time, the corresponding time delay τ can be... k As the optimal value τ pk This completes the iterative optimization process.

[0160] In an optional implementation, unlike the method described above which uses gradient descent to obtain the optimal value τ, pk In addition, the method of Newton's descent can be used to delay time τ. k Iterative optimization to determine the optimal value τ pk Specifically, step A4 in the above process can be used to calculate the time delay τ. k The calculation formula is replaced with the following formula, while keeping other operations inconvenient. Here, the time delay τ k The formula for calculation is:

[0161]

[0162] Where λ is the step size factor, which depends on the specific application scenario and usually takes a value between 0 and 1.

[0163] In some implementations, such as Figure 6 As shown, the microcontroller can also set the comparison value of the timer comparator 203 after process S2, when the optimization target is reached, to enable the sampling result interruption and execute process S3.

[0164] Specifically, after obtaining the optimal value τ pk Then, the microcontroller can use this optimal value τ pk The comparison values ​​CM0 and CM1 of comparator 2032 are reset so that signal processing circuit 106 can overcome the adverse effects of the phase deviation Φ between the zero-crossing square wave signal and the Sin, Cos modulated signal. Assuming that the rising edge time of the sampling trigger signal output by comparator 2032 is determined by CM1, and the falling edge time is determined by CM0, then the formulas for calculating CM0 and CM1 are:

[0165]

[0166]

[0167] Here, % represents the modulo operation.

[0168] S3: Phase 2 software process.

[0169] Specifically, the process may include: performing rectification operations based on the edge type of the zero-crossing square wave signal; and calculating the peak values ​​of the Sin and Cos electrical signals.

[0170] When the microcontroller receives an interrupt trigger signal, it can interrupt based on the sampling result and extract the envelope signal using the peak sampling method. First, the edge type of the current period edge event is determined to obtain the polarity flag value of the excitation signal. Then, the peak value is calculated based on the product of the sampled value of the target sampled signal and the polarity flag value to obtain the envelope signal corresponding to the target sampled signal.

[0171] For example, after the AD converter 202 completes sampling and conversion according to the sampling trigger signal output by the timing comparator 203 and outputs the sampled signal, the microcontroller generates a sampling result interrupt according to the received interrupt trigger signal. At this time, envelope signal extraction can be performed, which may include the following steps:

[0172] First, obtain the edge type of the zero-crossing square wave signal corresponding to the excitation signal in the current cycle, determining whether it is a rising edge or a falling edge, to obtain the polarity flag value CgSgn of the excitation signal. If it is a rising edge, it indicates that the excitation signal is in the positive half-cycle, and CgSgn = 1; if it is a falling edge, it indicates that the excitation signal is in the negative half-cycle, and CgSgn = -1.

[0173] Then, after waiting for the AD converter 202 to complete sampling and conversion and obtain the target sampled signal corresponding to the Sin modulated signal or Cos modulated signal, the AD value (sampled value) of the target sampled signal is read to obtain the AD value of Sin or Cos; at the same time, the timestamp of the sampling time is obtained through the timestamp capturer 205.

[0174] Next, the peak value is calculated based on the product of the AD value and the polarity indicator value CgSgn. The specific calculation formula is as follows:

[0175] Peak value = AD value * CgSgn

[0176] This peak value is the envelope of the Sin or Cos modulated signal.

[0177] Using this method, the peak values ​​of the Sin and Cos electrical signals can be obtained, namely the Sin peak value and the Cos peak value, thus realizing the extraction of the envelope signal of the Sin or Cos modulated signal.

[0178] In some implementations, such as Figure 6 As shown, after the microcontroller obtains the Sin peak value and Cos peak value and extracts the envelope signal, it can write the Sin peak value, Cos peak value and timestamp into the queue buffer for subsequent calculation of the motor rotor angle.

[0179] It should be noted that when storing the Sin peak value, Cos peak value, and timestamp together in the queue buffer, the Sin peak value, Cos peak value, and timestamp stored in the queue buffer must be values ​​from the same moment to ensure data consistency. By introducing a queue buffer within the microcontroller, the problem of data consistency being affected by different data write and data read rates is solved.

[0180] For example, refer to Figure 9 , Figure 9 This is a schematic diagram of a queue buffer within a microcontroller. Data is buffered in an array structure and accessed using a first-in, first-out (FIFO) access rule. In the array structure, each data element consists of a sine peak value, a cosine peak value, and a timestamp. `ReadIdx` and `WriteIdx` are array indices used to represent reading and writing data elements, respectively. Specifically:

[0181] The data writing process is as follows: WriteIdx is used as the array index to perform the write operation. Specifically, the S sine peak value, Cosine peak value, and timestamp are written to the cell at the position WriteIdx. Then, WriteIdx is moved to the position of the next element. It is determined whether WriteIdx has reached the end of the queue. If WriteIdx has reached the end of the queue, WriteIdx needs to return to the head of the queue. This can be done by clearing WriteIdx to 0. Otherwise, the S sine peak value, Cosine peak value, and timestamp are written.

[0182] The data reading process is as follows: ReadIdx is used as the array index to perform the read operation. Specifically, it first checks if ReadIdx and WriteIdx are equal. If they are equal, the queue is empty, no reading is needed, and the process exits directly. If they are not equal, the queue is not empty, and there is data to be read. In this case, the Sin peak value, Cos peak value, and timestamp can be read from the position ReadIdx. Then, ReadIdx moves to the position of the next element and checks if ReadIdx has reached the end of the queue. If ReadIdx has reached the end of the queue, it needs to return to the head of the queue, which can be done by clearing ReadIdx to 0. Otherwise, it continues to read the Sin peak value, Cos peak value, and timestamp.

[0183] To aid in understanding the implementation process or workflow of the signal processing circuit, system, and envelope signal extraction method proposed in the embodiments of this application, an application example is provided. In this application example, the specific structure of the signal processing circuit and signal processing system is as follows: Figures 1-3 As shown.

[0184] The signal processing circuit is implemented using a microcontroller, specifically an Infineon Aurix TC3xx series microcontroller, to perform signal processing and envelope signal extraction. The microcontroller is the processor within this microcontroller. The signal generator 200 uses the excitation generator within the microcontroller's EDSADC module, the AD converter 202 uses the microcontroller's EVADC module, the edge catcher 201 uses the microcontroller's GTM_TIM0_CH0 module, the timestamp catcher 205 uses the microcontroller's GTM_TIM0_CH2 module, and the timing comparator 203 uses the microcontroller's GTM_TOM0 module. Channel GTM_TOM0_CH0 operates in counter mode, and channel GTM_TOM0_CH1 operates in comparator mode. Correspondingly, we can obtain... Figure 10 The diagram shown illustrates the waveform relationships of the signals in this application example.

[0185] like Figure 10 As shown, the zero-crossing square wave signal corresponds to the positive and negative half-cycles of the excitation signal, and there is a phase deviation Φ between the zero-crossing square wave signal and the Sin / Cos modulation signal. GTM_TIM0_CH0 captures the rising edge of the zero-crossing square wave signal, generating a rising edge event. This rising edge event resets the counter of channel GTM_TOM0_CH0, causing it to count from zero. The counter's output is compared with the comparison values ​​CM0 and CM1 of the comparator in channel GTM_TOM0_CH1, outputting a pulse signal, which is the sampling trigger signal. This sampling trigger signal can be used to trigger the AD sampling and conversion of the first and second channels in the EVADC module, and simultaneously trigger the GTM_TIM0_CH2 module to record the sampling time values ​​of the first and second channels in the EVADC module. The counter periodically generates a periodic event signal based on the input edge event signal, causing the interrupt controller to output an interrupt trigger signal.

[0186] Within this microcontroller, initialization operations are performed first, including: clock parameter setting, initialization of the excitation generator inside the EDSADC, initialization of the GTM_TIM0_CH0 module, initialization of the EVADC module, initialization of GTM_TOM0_CH0 and GTM_TOM0_CH1, initialization of the GTM_TIM0_CH2 module, initialization of the interrupt controller, and initialization of the OS (Operating System).

[0187] Then, the target channel is identified, and an optimization process is executed. Specifically, this can be combined with... Figure 7-8 And as described above, it will not be repeated here. Specifically, the step size factor α for gradient descent is set to 20, and the step size factor λ for Newton's downhill method is set to 0.5. Iterative optimization is then performed to obtain the optimal value τ. pkThen, the AD sampling points are aligned with the peak values ​​of the Sin or Cos signals of the target channel. Further assuming the rising edge of the output pulse of the timing comparator is determined by CM1 and the falling edge by CM0, the optimal value τ is then used to determine the timing. pk Reset the comparison values ​​CM0 and CM1 of GTM_TOM0_CH1.

[0188] Next, the EVADC module can complete sampling based on the sampling trigger signal GTM_TOM0_CH1, generating a sampling result interrupt and triggering the subsequent envelope signal extraction process, i.e., the execution of the aforementioned stage 2 software process. For details, please refer to the previous description; it will not be repeated here. Specifically, in the current cycle, the edge type of the zero-crossing square wave signal is determined based on the value of the ECNT register within the microcontroller. After waiting for the AD conversion to complete and obtaining the AD values ​​of Sin and Cos, as well as the timestamp of the sampling time, the peak values ​​of Sin and Cos are calculated based on the AD values ​​of Sin and Cos, thus obtaining the envelope of the Sin and Cos modulated signal. Finally, the peak values ​​of Sin, Cos, and the timestamp are stored in the queue buffer.

[0189] This application example fully utilizes the advantages of peak sampling method, such as fewer sampling points and lower CPU load, while overcoming the adverse effects caused by the phase deviation between the generated excitation signal and the Sin and Cos electrical signals.

[0190] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the subject matter of this application. Any simple modifications based on this technical concept are within the scope of protection of this application.

[0191] This application also proposes a signal processing system.

[0192] In one embodiment of the signal processing system of this application, reference is made to Figure 3 , Figure 3 This is a schematic diagram of a signal processing system, which includes a signal processing circuit 106, a rotary transformer 100, and a zero-crossing detection circuit 105.

[0193] The rotary transformer 100 is connected to the signal processing circuit 106 in sequence through the signal amplification circuit 104 and the signal filtering circuit 103. It is used to convert the rotor position of the motor into sine and cosine electrical signals according to the received excitation signal so that the signal processing circuit 106 can sample it.

[0194] The zero-crossing detection circuit 105 is connected to the signal amplification circuit 104 and is used to detect the zero-crossing point of the excitation signal and output the zero-crossing square wave signal to the signal processing circuit 106 so that the signal processing circuit 106 can detect edge events.

[0195] In another embodiment of the signal processing system of this application, the signal processing system further includes a first conditioning circuit 101 and a second conditioning circuit 102;

[0196] The first conditioning circuit 101 is connected to the rotary transformer 100 and the signal processing circuit 106 respectively, and is used to modulate the sinusoidal electrical signal generated by the rotary transformer 100 and output the sinusoidal modulated signal to the signal processing circuit 106.

[0197] The second conditioning circuit 102 is connected to the rotary transformer 100 and the signal processing circuit 106 respectively, and is used to modulate the cosine electrical signal generated by the rotary transformer 100 and output the cosine modulated signal to the signal processing circuit 106.

[0198] It should be noted that the specific structure of the signal processing circuit refers to the above embodiments, and more implementation methods of the signal processing system can refer to the specific description of the above embodiments. Since the signal processing system adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be repeated here.

[0199] This application also proposes a method for extracting envelope signals.

[0200] In one embodiment of the envelope signal extraction method of this application, referring to Figure 5 , Figure 5 This is a flowchart illustrating an envelope signal extraction method, which includes steps S10 to S40:

[0201] Step S10: The timing comparator performs count reset and signal comparison based on the detected edge events, and outputs a periodic event signal and a sampling trigger signal; wherein, the edge events are obtained by detecting the zero-crossing point of the excitation signal;

[0202] Step S20: The interrupt controller outputs an interrupt trigger signal based on the periodic event signal;

[0203] Step S30: The sine and cosine electrical signals of the rotary transformer are sampled by the AD converter according to the sampling trigger signal to obtain the sampled signal;

[0204] In step S40, when the microcontroller receives the interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal.

[0205] In another embodiment of the envelope signal extraction method of this application, step S10 includes steps S11 to S12:

[0206] Step S11: The target sampling signal corresponding to the target channel is acquired through the microcontroller. Iterative optimization is performed using the gradient descent method or Newton's downhill method to obtain the time delay between the edge event of the current period and the peak point of the target sampling signal. A comparison signal is generated based on the time delay and the operating frequency of the timing comparator and output to the timing comparator. The target channel is the channel corresponding to the sine or cosine signal far from zero. The optimization target of the iterative optimization is that the sampling time of the target sampling signal corresponds to the peak value of the signal corresponding to the target channel.

[0207] Step S12: The timer comparator performs a count reset based on the edge event to generate a periodic event signal. The periodic event signal is compared with the comparison signal to generate a sampling trigger signal. The periodic event signal and the sampling trigger signal are output respectively.

[0208] In another embodiment of the envelope signal extraction method of this application, step S40 includes step S41:

[0209] Step S41: Determine the edge type of the current period edge event through the microcontroller, obtain the polarity flag value of the excitation signal, calculate the peak value based on the product of the sampled value of the target sampled signal and the polarity flag value, and obtain the envelope signal corresponding to the target sampled signal.

[0210] It should be noted that the specific structure of the signal processing circuit refers to the above embodiments, and more implementation methods of the envelope signal extraction method can refer to the specific description of the above embodiments. Since the envelope signal extraction method can be applied to any technical solution of the above signal processing circuit embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, and will not be described in detail here.

[0211] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A signal processing circuit, characterized in that, The signal processing circuit, connected to the resolver, includes: A timing comparator is used to perform count reset and signal comparison based on detected edge events, and output a periodic event signal and a sampling trigger signal; wherein, the edge event is obtained by detecting the zero-crossing point of the excitation signal; An interrupt controller, connected to the timing comparator, is used to output an interrupt trigger signal based on the periodic event signal; The AD converter is connected to the timing comparator and the rotary transformer respectively, and is used to sample the sine and cosine electrical signals of the rotary transformer according to the sampling trigger signal to obtain the sampled signal; The microcontroller is connected to the interrupt controller and the AD converter respectively, and is used to perform peak sampling based on the excitation signal and the sampling signal to extract the envelope signal when the interrupt trigger signal is received.

2. The signal processing circuit as described in claim 1, characterized in that, The timing comparator includes: A counter, connected to the interrupt controller, is used to reset the count based on the detected edge event, and to generate and output the periodic event signal; The comparator, connected to the counter, the microcontroller, and the AD converter respectively, is used to compare the periodic event signal with the comparison signal provided by the microcontroller, and generate and output the sampling trigger signal.

3. The signal processing circuit as described in claim 1, characterized in that, The signal processing circuit further includes: A signal generator is connected to the rotary transformer in sequence through a signal filtering circuit and a signal amplification circuit to generate the excitation signal. The excitation signal is then output to the excitation winding of the rotary transformer in sequence through the signal filtering circuit and the signal amplification circuit, so that the sine winding and cosine winding of the rotary transformer can respectively convert the rotor position of the motor into a sine electrical signal and a cosine electrical signal according to the excitation signal.

4. The signal processing circuit as described in claim 1, characterized in that, The signal processing circuit further includes: An edge catcher, connected to a zero-crossing detection circuit, is used to detect the rising or falling edge of the zero-crossing square wave signal output by the zero-crossing detection circuit and output an edge event signal; wherein, the zero-crossing square wave signal is obtained by the zero-crossing detection circuit detecting the zero-crossing point of the excitation signal; The timing comparator is connected to the edge catcher and is used to perform count reset and signal comparison based on the edge event signal.

5. The signal processing circuit as described in claim 1, characterized in that, The signal processing circuit further includes: A timestamp capture unit, connected to the timing comparator, is used to acquire the sampling time of the AD converter according to the sampling trigger signal and output a timestamp signal; The microcontroller is also connected to the timestamp capturer and is used to perform peak sampling based on the excitation signal and the sampling signal when the interrupt trigger signal and the timestamp signal are received.

6. The signal processing circuit as described in claim 1, characterized in that, The AD converter includes: The first channel has its control terminal connected to the timing comparator and its input terminal connected to the sinusoidal winding of the rotary transformer via a first conditioning circuit. The first channel is used to sample and convert the sinusoidal modulation signal output by the first conditioning circuit according to the sampling trigger signal to obtain a first sampling signal. The second channel has its control terminal connected to the timing comparator and its input terminal connected to the cosine winding of the rotary transformer via a second conditioning circuit. The second channel is used to sample and convert the cosine modulation signal output by the second conditioning circuit according to the sampling trigger signal to obtain a second sampling signal. The microcontroller is connected to the output terminals of the first channel and the second channel, respectively, and is also used to perform peak sampling based on the polarity of the excitation signal and the first sampling signal / second sampling signal.

7. A signal processing system, characterized in that, include: The signal processing circuit as described in any one of claims 1 to 6; A rotary transformer is connected to the signal processing circuit in sequence through a signal amplification circuit and a signal filtering circuit. It is used to convert the rotor position of the motor into sine and cosine electrical signals according to the received excitation signal, so that the signal processing circuit can sample them. A zero-crossing detection circuit, connected to the signal amplification circuit, is used to detect the zero-crossing point of the excitation signal and output a zero-crossing square wave signal to the signal processing circuit so that the signal processing circuit can detect edge events.

8. A method for extracting envelope signals, characterized in that, The envelope signal extraction method, applied to the signal processing circuit as described in any one of claims 1 to 6, comprises: A timing comparator performs counting reset and signal comparison based on detected edge events, outputting a periodic event signal and a sampling trigger signal; wherein, the edge event is obtained by detecting the zero-crossing point of the excitation signal; The interrupt controller outputs an interrupt trigger signal based on the periodic event signal; The rotary transformer is sampled using an AD converter based on the sampling trigger signal to obtain a sampled signal; When the microcontroller receives the interrupt trigger signal, it performs peak sampling based on the excitation signal and the sampling signal to extract the envelope signal.

9. The envelope signal extraction method as described in claim 8, wherein the step of performing count reset and signal comparison based on the detected edge event using a timing comparator, and outputting a periodic event signal and a sampling trigger signal, includes: The target sampling signal corresponding to the target channel is acquired by the microcontroller, and iterative optimization is performed using gradient descent or Newton's downhill method to obtain the time delay between the edge event of the current period and the peak point of the target sampling signal. A comparison signal is generated based on the time delay and the operating frequency of the timing comparator and output to the timing comparator. The target channel is a channel corresponding to a sine or cosine electrical signal far from zero, and the optimization objective of the iterative optimization is that the sampling time of the target sampling signal corresponds to the peak value of the signal corresponding to the target channel. The timing comparator performs a count reset based on the edge event to generate the periodic event signal. The periodic event signal is compared with the comparison signal to generate the sampling trigger signal, and the periodic event signal and the sampling trigger signal are output respectively.

10. The envelope signal extraction method as described in claim 9, wherein the step of extracting the envelope signal by performing peak sampling based on the excitation signal and the sampling signal when the microcontroller receives the interrupt trigger signal includes: The microcontroller determines the edge type of the edge event in the current period, obtains the polarity flag value of the excitation signal, calculates the peak value based on the product of the sampled value of the target sampled signal and the polarity flag value, and obtains the envelope signal corresponding to the target sampled signal.