Digital high-precision sine and cosine function generator circuit
Through the combination of digital processing circuits, DAC conversion circuits and phase detection circuits, the complexity and scale of traditional digital/automatic angle converter circuits are solved, and a high-precision, low-power consumption is realized, which is suitable for lightweight and miniaturized designs of modern equipment.
Patent Information
- Application Number
- CN202411728089.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-05-06
AI Technical Summary
The more bits the traditional digital/automatic angle converter circuit is divided into quadrants, the more complex the circuit is, and cannot meet the lightweight and miniaturization requirements of modern equipment, which is not conducive to platform-based and general design.
Using digital processing circuit, DAC conversion circuit and phase identification circuit, the 16-bit parallel binary digital angle signal is converted into a digital cosine angle in the range of 0 to 90° through the digital processing circuit. The DAC conversion circuit converts the digital quantity into an analog signal. The phase identification circuit performs phase control and outputs a sine cosine signal in the range of 0 to 360°.
The design of high-precision cosine function generator circuit is realized, which reduces the circuit scale, is suitable for general platform design, and reduces power consumption and complexity.
Smart Images

Figure CN119945389A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of digital / axis-angle converters, and in particular to a digital high-precision sine-cosine function generator circuit. Background Art
[0002] The function of the high-precision sine-cosine function generator is to convert the input binary digital angle signal into two orthogonal sine-cosine analog angle signals. It is the core circuit of the digital / axis-angle converter.
[0003] The circuit principle of the traditional digital / synchro converter is based on quadrant division and linear approximation method within the sector. The number of bits of quadrant division determines the output accuracy of the converter. The more bits, the higher the output accuracy. However, the more bits of quadrant division, the more complex the circuit used to calculate the sector boundary voltage, and the larger the circuit scale, so that it cannot meet the requirements of lightweight and miniaturization of modern equipment, which is not conducive to the platformization and universal design of the shaft angle converter.
[0004] Therefore, in order to solve the above problems, it is urgent to realize a digital high-precision sine-cosine function generator circuit. Summary of the invention
[0005] The purpose of the present invention is to provide a digital high-precision sine-cosine function generator circuit, which is no longer based on the quadrant division principle, but utilizes the computational advantages of digital processing, which can not only reduce the circuit scale, but also is suitable for universal platform design.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A digital high-precision sine-cosine function generator circuit comprises a digital processing circuit, a DAC conversion circuit and a phase detection circuit.
[0008] The input signal of the digital processing circuit is a 16-bit parallel binary digital angle, and the digital processing circuit outputs a sine and cosine angle digital quantity within the range of 0 to 90 degrees through programming calculation.
[0009] The DA conversion circuit is used to perform digital-to-analog conversion on the sine and cosine angle digital quantities output by the digital processing circuit and then output an analog signal.
[0010] The phase detection circuit is used to perform phase control on the analog signal output by the DA conversion circuit and output sine and cosine signals within the range of 0 to 360 degrees.
[0011] Preferably according to the present invention, the digital processing circuit includes a digital processor U1, a power management circuit, a JATG interface circuit, a crystal oscillator circuit and a FLASH storage circuit; the digital processor U1 is used to receive a 16-bit parallel binary digital angle signal, and output a sine-cosine angle digital quantity in the range of 0° to 90° through programming operation; the power management circuit provides power for the digital processor U1; the JATG interface circuit provides an interface for program burning and debugging of the digital processor U1; the crystal oscillator circuit provides a clock frequency of more than 20MHz for the digital processor U1; the FLASH storage circuit is used to store the program code and data of the digital processor U1, and the circuit adopts serial port communication, and its data storage time is at least 20 years, and the number of erase and write times is at least 100,000 times.
[0012] Preferably according to the present invention, the digital processor is any one of FPGA, single chip microcomputer, ARM and DSP.
[0013] Preferably, according to the present invention, the output signal of the digital processing circuit includes: SIN signal digital quantities SD1-SD16, COS signal digital quantities CD1-CD16 and phase control words D1, D2.
[0014] Preferably, according to the present invention, the digital processing circuit identifies the quadrant through the high 2 bits of the digital input signal and converts it into phase control words D1 and D2; the phase control words D1 and D2 are used to switch the analog switch MK1 and the analog switch MK2 in the phase detection circuit, and the phase of the SIN signal is controlled by the analog switch MK1, and the phase of the COS signal is controlled by the analog switch MK2.
[0015] Preferably according to the present invention, the DAC conversion circuit includes a sine digital-to-analog conversion circuit and a cosine digital-to-analog conversion circuit.
[0016] The sinusoidal digital-to-analog conversion circuit includes a DAC converter N5, an operational amplifier N1 and a resistor R4; the input end of the DAC converter N5 is connected to the SIN signal digital quantity output by the digital processing circuit; the output end of the DAC converter N5 is connected to the inverting input end of the operational amplifier N1; the non-inverting input end of the operational amplifier N1 is grounded via the resistor R4; the output end of the operational amplifier N1 is connected to the first input end of the phase detection circuit.
[0017] The cosine digital-to-analog conversion circuit includes a DAC converter N6, an operational amplifier N3 and a resistor R5; the input end of the DAC converter N6 is connected to the COS signal digital quantity output by the digital processing circuit; the output end of the DAC converter N6 is connected to the inverting input end of the operational amplifier N3; the non-inverting input end of the operational amplifier N3 is grounded via the resistor R5; the output end of the operational amplifier N3 is connected to the second input end of the phase detection circuit.
[0018] Preferably, according to the present invention, the DAC converter N5 and the DAC converter N6 both adopt multiplication type DAC devices; the operational amplifier N1 and the operational amplifier N3 both adopt precision operational amplifiers.
[0019] Preferably according to the present invention, the phase detection circuit includes a sine phase detection circuit and a cosine phase detection circuit.
[0020] The sinusoidal phase detection circuit includes an operational amplifier N2, an analog switch MK1, a resistor R1, a resistor R2 and a resistor R3; the inverting input terminal of the operational amplifier N2 is connected to the first end of the resistor R2, and the second end of the resistor R2 is connected to the output end of the operational amplifier N1; the non-inverting input terminal of the operational amplifier N2 is grounded through the resistor R3; the IO1 terminal of the analog switch MK1 is connected to the second end of the resistor R2, and the IO2 terminal of the analog switch MK1 is connected to the output end of the operational amplifier N2; the first end of the resistor R1 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R1 is connected to the output end of the operational amplifier N2.
[0021] The cosine phase detection circuit includes an operational amplifier N4, an analog switch MK2, a resistor R6, a resistor R7 and a resistor R8; the inverting input terminal of the operational amplifier N4 is connected to the first end of the resistor R7, and the second end of the resistor R7 is connected to the output end of the operational amplifier N3; the non-inverting input terminal of the operational amplifier N4 is grounded through the resistor R8; the IO1 terminal of the analog switch MK2 is connected to the second end of the resistor R7, and the IO2 terminal of the analog switch MK2 is connected to the output end of the operational amplifier N4; the first end of the resistor R6 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R6 is connected to the output end of the operational amplifier N4.
[0022] Preferably, according to the present invention, the operational amplifiers N1 to N4 are all operational amplifiers with low offset voltage; the resistors R1 to R8 are all high-precision thin-film resistors; and the analog switch MK1 and analog switch MK2 are all low on-resistance analog switches.
[0023] Preferably, according to the present invention, the operational amplifier N2 and the operational amplifier N4 invert the signal output by the DAC conversion circuit by 180°; the analog switch MK1 and the analog switch MK2 switch the sine and cosine outputs under the action of the phase control word.
[0024] Compared with the prior art, the advantages of the present invention are:
[0025] (1) Compared with conventional analog function generator circuits, the digital high-precision sine and cosine function generator circuit proposed in the present invention not only saves a large number of analog devices and precision resistors for calculating boundary voltages, thus greatly reducing the circuit scale; it is also extremely convenient in terms of resolution expansion by adopting digital processing methods, which is conducive to universal platform design. The digital processor used in the circuit can be FPGA, single-chip microcomputer, ARM, DSP, etc., with a wide range of optional types.
[0026] (2) The circuit topology structure of the digital high-precision sine and cosine function generator circuit proposed in the present invention and the phase-detection circuit therein are innovative. The conventional high-precision function generator topology is based on a complex analog circuit implementation, which has high performance requirements for the device. The digital circuit topology structure proposed in the present invention solves the problems of the difficulty in selecting traditional analog circuit devices and the high power consumption of the devices, and achieves a high-precision and high-reliability technical effect.
[0027] (3) Analog sine and cosine function generator circuits require a large number of high-precision operational amplifiers, D / A, thin-film precision resistors and other analog devices, and the circuits are complex. As the resolution increases, the number of operational amplifiers required and the circuit scale will become larger and larger, and the reliability is low, which is not conducive to platform-based and universal design. The digital sine and cosine function generator circuit described in the present invention greatly reduces the number of devices used and significantly reduces the circuit scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a principle block diagram of the digital high-precision sine-cosine function generator circuit in the present invention;
[0029] Figure 2 It is a circuit principle diagram of the digital high-precision sine-cosine function generator circuit of the present invention;
[0030] Figure 3 It is a waveform diagram of the sine-cosine function signal output by the digital high-precision sine-cosine function generator circuit of the present invention at 45°;
[0031] Figure 4 It is a waveform diagram of the sine-cosine function signal output by the digital high-precision sine-cosine function generator circuit of the present invention at 135°;
[0032] Figure 5 It is a waveform diagram of the sine-cosine function signal outputted under the condition of continuous input of 16-bit digital signal of the digital high-precision sine-cosine function generator circuit in the present invention.
[0033] in:
[0034] 1. Digital processing circuit, 2. DAC conversion circuit, 3. Phase detection circuit. DETAILED DESCRIPTION
[0035] The present invention will be further described below in conjunction with the accompanying drawings:
[0036] like Figure 1 A digital high-precision sine-cosine function generator circuit is shown, which includes: a digital processing circuit, a DAC conversion circuit and a phase detection circuit.
[0037] The input signal of the digital processing circuit 1 is a 16-bit parallel binary digital angle. The digital processing circuit 1 outputs the digital value of sinθ and cosθ in the range of 0 to 90° through programming operation. The digital processing circuit 1 only needs to output the digital value of the sine and cosine angle in the range of 0 to 90°. The digital processing circuit 1 can reduce the resource storage and power consumption of digital devices. The amplitude of the sine and cosine in the range of 0 to 360° only changes within 0 to 90°, but the phase is different. Therefore, the memory only stores the amplitude and phase bytes within 0 to 90°, which greatly saves resources and reduces power consumption.
[0038] Specifically, the input signal of the digital processing circuit 1 is a 16-bit binary number representing an angle value. This angle value can represent any angle from 0° to 360°. For example, if the maximum value of a 16-bit binary number is 65535 (i.e., 2^16-1), then the angle that can be represented by each unit is 360° / 65536≈0.005493°. The digital processing circuit 1 converts the input 16-bit binary angle signal into digital quantities of sine (sinθ) and cosine (cosθ) values in the range of 0° to 90° through programming operations. This is because the sine and cosine functions are monotonically increasing in the range of 0° to 90° and can be extended to the range of 0° to 360° through simple mathematical transformations. The upper 2 bits of the input 16-bit binary angle signal can be used to identify the quadrant in which the input angle is located (0° to 90°, 90° to 180°, 180° to 270°, 270° to 360°). By identifying the quadrant, the sign and phase transformation of the sine and cosine values can be determined. Since the sine and cosine functions are monotonically increasing in the range of 0° to 90°, it is only necessary to store the data in this range; through simple mathematical transformations, the data in the range of 0° to 90° can be expanded to the entire range of 0° to 360°. In this way, the digital processing circuit 1 can not only efficiently realize the generation of high-precision sine and cosine functions while maintaining a small circuit scale and low power consumption, but also reduce complex calculation steps and improve calculation efficiency.
[0039] The digital quantity is converted by the DA conversion circuit 2 and then outputs an analog signal. Within the range of 0 to 360°, the amplitude of the sine and cosine signals only changes within the range of 0 to 90°, and the phases are different. The digital quantity of the sine (sinθ) and cosine (cosθ) values output by the digital processing circuit 1 is converted by the DA conversion circuit 2 to output an analog signal, thereby realizing the conversion from the digital domain to the analog domain. The DA conversion circuit 2 converts the digital quantity into a corresponding analog voltage or current signal. Within the range of 0° to 360°, the amplitude of the sine and cosine signals only changes within the range of 0° to 90°. Within the range of 0° to 360°, the phases of the sine and cosine signals are different. Through the phase control words D1 and D2, the phases of the sine and cosine signals can be switched, thereby realizing the output of sine and cosine signals within the range of 0° to 360°.
[0040] The sine and cosine signals have a specific phase relationship in the range of 0° to 360°. For example, the sine signal and the cosine signal differ in phase by 90°. In order to ensure that the phase of the output signal is correct, the analog signal needs to be phase adjusted. To ensure the correct phase, the phase detection circuit 3 is used to phase control the analog signal, and finally outputs a sine and cosine signal in the range of 0 to 360°. The main function of the phase detection circuit 3 is to phase control the analog signal output by the DA conversion circuit 2 to ensure that the correct sine and cosine signals are output in the range of 0° to 360°. Through phase control, the phase of the sine and cosine signals can be adjusted to meet the required phase relationship, ensuring that the output sine and cosine signals maintain the correct phase relationship in each quadrant, thereby ensuring the quality and accuracy of the signal.
[0041] like Figure 2As shown, the digital processing circuit 1 includes a digital processor U1, a power management circuit, a JATG interface circuit, a crystal oscillator circuit and a FLASH storage circuit. The digital processor U1 is responsible for receiving a 16-bit parallel binary digital angle signal and outputting the digital values of the sine (sinθ) and cosine (cosθ) values within the range of 0° to 90° through programming operations. The power management circuit provides power to the digital processor U1 to ensure its normal operation. The JATG interface circuit provides an interface for the digital processor U1 to program and debug. The JATG interface is usually used for the development and debugging of embedded systems and supports online programming and debugging functions. The crystal oscillator circuit provides a clock frequency of more than 20MHz for the digital processor U1. The crystal oscillator circuit is an important component of the digital circuit and provides a stable clock signal to ensure that the digital processor U1 can operate according to the timing requirements. The FLASH storage circuit uses serial communication to store the program code and data of the digital processor U1. Its data storage time is at least 20 years and the number of erase and write times is at least 100,000 times, ensuring long-term and reliable storage of data. The digital processor used in the digital processing circuit 1 can be FPGA, single-chip microcomputer, ARM, DSP, and the device selection range is wide, and a suitable processor can be selected according to specific application requirements.
[0042] The output signal of the digital processing circuit 1 includes:
[0043] (1) SIN signal digital quantity SD1~SD16;
[0044] (2) COS signal digital quantity CD1~CD16;
[0045] (3) Phase control words D1 and D2. According to the quadrant where the input angle is located, the digital processing circuit 1 generates phase control words D1 and D2.
[0046] The digital processing circuit 1 identifies the quadrant through the high 2 bits of the digital input, and converts it into phase control words D1 and D2, which are used to switch the analog switch MK1 and the analog switch MK2 in the phase detection circuit, and the phase of the SIN signal is controlled by the analog switch MK1, and the phase of the COS signal is controlled by the analog switch MK2. Through the phase control words D1 and D2, the state of the analog switch can be flexibly controlled to adapt to the phase adjustment requirements of different quadrants. The quadrant where the input angle is located is identified by the high 2 bits of the input signal (0° to 90°, 90° to 180°, 180° to 270°, 270° to 360°). The sine and cosine signals in each quadrant have different signs and phase relationships, and the phase detection circuit 3 performs phase adjustment based on this information. According to the quadrant where the input angle is located, the phase detection circuit 3 adjusts the phase of the sine and cosine signals to meet the required phase relationship.
[0047] Therefore, the digital processing circuit 1 realizes the conversion from the 16-bit parallel binary digital angle signal to the digital quantity of the sine and cosine values in the range of 0° to 90° through the coordinated work of its various components. The circuit not only has flexible processor selection, stable power management, convenient development and debugging interface, stable clock signal, but also has long-term and reliable data storage capabilities, ensuring the efficient, stable and reliable operation of the system.
[0048] Preferably, the DA conversion circuit 2 adopts a multiplication type DA converter circuit. Compared with a conventional DA converter, the multiplication type DA converter circuit can output analog signals in four quadrants without a control signal.
[0049] Specifically, if Figure 2 As shown, the DAC conversion circuit 2 includes a sine digital-to-analog conversion circuit and a cosine digital-to-analog conversion circuit. The sine digital-to-analog conversion circuit includes a DAC converter N5, an operational amplifier N1 and a resistor R4; the input end of the DAC converter N5 is connected to the SIN signal digital quantity output by the digital processing circuit 1; the output end of the DAC converter N5 is connected to the inverting input end of the operational amplifier N1; the non-inverting input end of the operational amplifier N1 is grounded via a resistor R4. The output end of the operational amplifier N1 is connected to the first input end of the phase detection circuit 3. The cosine digital-to-analog conversion circuit includes a DAC converter N6, an operational amplifier N3 and a resistor R5; the input end of the DAC converter N6 is connected to the COS signal digital quantity output by the digital processing circuit 1; the output end of the DAC converter N6 is connected to the inverting input end of the operational amplifier N3; the non-inverting input end of the operational amplifier N3 is grounded via a resistor R5. The output end of the operational amplifier N3 is connected to the second input end of the phase detection circuit 3. Both the DAC converter N5 and the DAC converter N6 use multiplication type DAC devices. The operational amplifier N1 and the operational amplifier N3 are both precision operational amplifiers.
[0050] The function of the DAC conversion circuit 2 is to output the analog sine and cosine signals. Taking the SIN signal as an example, the working principle of the DAC conversion circuit 2 is described as follows:
[0051] The SIN signal digital quantities SD1-SD16 output by the digital processing circuit 1 and the external reference signal REF are input to the DAC converter N5 using a multiplication type DAC device, the output end of the DAC converter N5 is connected to the inverting input end of the operational amplifier N1, the non-inverting input end of the operational amplifier N1 is grounded through the resistor R4, and the output end of the operational amplifier N1 is connected to the resistor R2 in the phase detection circuit. The COS signal output in the DAC conversion circuit 2 is based on the same principle as the above-mentioned SIN signal output. In this way, the DA conversion circuit 2 can efficiently convert the digital quantity output by the digital processing circuit 1 into an analog signal, and realize the sine and cosine signal output in the range of 0° to 360° through phase control, while maintaining a small circuit scale and low power consumption.
[0052] like Figure 2 As shown, the phase detection circuit 3 includes a sine phase detection circuit and a cosine phase detection circuit. These two sub-circuits respectively control the phases of the sine and cosine signals to ensure that the output signal has a correct phase relationship within the range of 0° to 360°.
[0053] The sinusoidal phase detection circuit includes an operational amplifier N2, an analog switch MK1, a resistor R1, a resistor R2 and a resistor R3; the inverting input terminal of the operational amplifier N2 is connected to the first end of the resistor R2, and the second end of the resistor R2 is connected to the output end of the operational amplifier N1. The in-phase input terminal of the operational amplifier N2 is grounded through the resistor R3. The IO1 terminal of the analog switch MK1 is connected to the second end of the resistor R2, and the IO2 terminal of the analog switch MK1 is connected to the output end of the operational amplifier N2. The first end of the resistor R1 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R1 is connected to the output end of the operational amplifier N2. The sinusoidal signal after phase adjustment is output from the output end of the operational amplifier N2. The state of the analog switch MK1 is controlled by the phase control words D1 and D2. When D1 and D2 indicate different quadrants, the analog switch MK1 will switch between IO1 and IO2, thereby changing the feedback path of the operational amplifier N2, and then changing the phase of the output signal. Operational amplifier N2 inverts the input signal by 180° and performs gain control through the feedback network composed of resistors R1, R2, and R3. The sinusoidal phase detection circuit uses the high 2-bit digital quantity to identify whether the digital angle is in phase with the reference signal. If the phase is in phase, the operational amplifier outputs normally. If the phase is different, the operational amplifier is controlled to be inverted through the control word.
[0054] The cosine phase detection circuit includes an operational amplifier N4, an analog switch MK2, a resistor R6, a resistor R7 and a resistor R8; the inverting input terminal of the operational amplifier N4 is connected to the first end of the resistor R7, and the second end of the resistor R7 is connected to the output end of the operational amplifier N3. The in-phase input terminal of the operational amplifier N4 is grounded through the resistor R8. The IO1 terminal of the analog switch MK2 is connected to the second end of the resistor R7, and the IO2 terminal of the analog switch MK2 is connected to the output end of the operational amplifier N4. The first end of the resistor R6 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R6 is connected to the output end of the operational amplifier N4. The cosine signal after phase adjustment is output from the output end of the operational amplifier N4. The state of the analog switch MK2 is controlled by the phase control words D1 and D2. When D1 and D2 indicate different quadrants, the analog switch MK2 will switch between IO1 and IO2, thereby changing the feedback path of the operational amplifier N4, and then changing the phase of the output signal. Operational amplifier N4 inverts the input signal by 180° and performs gain control through the feedback network composed of resistors R6, R7, and R8. The combination of analog switches and operational amplifiers can accurately adjust the phase of the sine and cosine signals to ensure that the output signal has the correct phase relationship within the range of 0° to 360°.
[0055] Preferably, according to the present invention, the operational amplifiers N1 to N4 all adopt operational amplifiers with low offset voltage to ensure the stability and accuracy of the output signal.
[0056] Preferably according to the present invention, the resistors R1 to R8 are all high-precision thin-film resistors to ensure the stability and accuracy of the feedback network.
[0057] Preferably, the analog switch MK1 and the analog switch MK2 are low on-resistance analog switches, which can effectively reduce signal loss and noise and improve the signal-to-noise ratio and stability of the system.
[0058] In the phase detection circuit 3, operational amplifiers N2 and N4 invert the sine and cosine signals output by the DAC conversion circuit 2 by 180° respectively. Under the action of the phase control words D1 and D2, analog switches MK1 and MK2 adjust the phase of the signal by switching the feedback path. This design ensures that the output signal has the correct phase relationship in the range of 0° to 360°, thereby ensuring efficient, stable and reliable operation of the system. Operational amplifier N2 is configured as an inverting amplifier to invert the input sinusoidal signal by 180°. Specifically, the inverting input terminal of operational amplifier N2 is connected to the sinusoidal signal output terminal of the DAC conversion circuit 2 through resistor R2, and the non-inverting input terminal is grounded through resistor R3. The output terminal of operational amplifier N2 is fed back to the inverting input terminal through resistor R1 to form negative feedback, thereby inverting the input signal by 180°. Operational amplifier N4 is also configured as an inverting amplifier to invert the input cosine signal by 180°. Specifically, the inverting input terminal of the operational amplifier N4 is connected to the cosine signal output terminal of the DAC conversion circuit 2 through the resistor R7, and the non-inverting input terminal is grounded through the resistor R8. The output terminal of the operational amplifier N4 is fed back to the inverting input terminal through the resistor R6 to form negative feedback, thereby inverting the input signal by 180°.
[0059] Taking the SIN signal output as an example, the working principle of the phase detection circuit 3 is described in detail:
[0060] The output signal of the operational amplifier N1 is connected to the inverting input terminal of the operational amplifier N2 through the resistor R2 on the one hand, and to the IO1 terminal of the analog switch MK1 on the other hand. The non-inverting input terminal of the operational amplifier N2 is grounded through the resistor R3. The output terminal of the operational amplifier N2 is connected to the inverting input terminal of the operational amplifier N2 through the resistor R1 on the one hand, and to the IO2 terminal of the analog switch MK1 on the other hand. As the phase control word D1 is also connected to the analog switch MK1, the IO port of the analog switch MK1 is the final SIN signal output. When the phase control word indicates a specific quadrant, the analog switch MK1 will switch between IO1 and IO2, thereby changing the feedback path of the operational amplifier N2, and then changing the phase of the sine signal. The COS signal output in the phase detection circuit 3 is the same as the above-mentioned SIN signal output. When the phase control word indicates a specific quadrant, the analog switch MK2 will switch between IO1 and IO2, thereby changing the feedback path of the operational amplifier N4, and then changing the phase of the cosine signal.
[0061] The sine and cosine analog signals output by the DA conversion circuit 2 are phase-controlled by the sine phase detection circuit and the cosine phase detection circuit to ensure that the output signals have the correct phase relationship within the range of 0° to 360°. The phase of the signal can be accurately adjusted by the combination of the analog switch and the operational amplifier to ensure the efficient, stable and reliable operation of the system.
[0062] The actual output signal of the digital high-precision sine-cosine function generator circuit of the present invention is as follows: Figure 3-Figure 5 Among them, Figure 3 It is a waveform diagram of the sine-cosine function signal output by the digital high-precision sine-cosine function generator circuit of the present invention at 45 degrees, at which time the sine signal sin and the cosine signal cos are in phase. Figure 4 It is the sine-cosine function signal output by the digital high-precision sine-cosine function generator circuit of the present invention at 135°. At this time, the sine signal sin and the cosine signal cos are in opposite directions, with a phase difference of 180°. Figure 5 It is the sine-cosine function signal outputted by the digital high-precision sine-cosine function generator circuit of the present invention under the condition of continuous input of 16-bit digital signals. At this time, the sine-cosine function is an envelope signal.
[0063] exist Figure 3 , Figure 4 and Figure 5 In the figure, the horizontal axis represents time in us, and the vertical axis represents amplitude in V. Figure 3 , Figure 4 and Figure 5 It can be seen that the processing procedure and phase control method of the digital sine-cosine function generator described in the present invention are feasible and effective.
[0064] The above-described embodiments are merely descriptions of preferred implementations of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the scope of protection determined by the claims of the present invention.
Claims
1. A digital high-precision sine-cosine function generator circuit, characterized in that: The circuit comprises: a digital processing circuit (1), a DAC conversion circuit (2) and a phase detection circuit (3); The input signal of the digital processing circuit (1) is a 16-bit parallel binary digital angle, and the digital processing circuit (1) outputs a sine and cosine angle digital quantity within a range of 0 to 90 degrees through programming calculation; The DA conversion circuit (2) is used to perform digital-to-analog conversion on the sine and cosine angle digital quantities output by the digital processing circuit (1) and then output an analog signal; The phase detection circuit (3) is used to perform phase control on the analog signal output by the DA conversion circuit (2) and output a sine and cosine signal within the range of 0 to 360 degrees.
2. The digital high-precision sine-cosine function generator circuit according to claim 1, characterized in that: The digital processing circuit (1) comprises a digital processor U1, a power management circuit, a JATG interface circuit, a crystal oscillator circuit and a FLASH storage circuit; The digital processor U1 is used to receive a 16-bit parallel binary digital angle signal and output a sine-cosine angle digital quantity within a range of 0° to 90° through programming operation; The power management circuit provides power to the digital processor U1; The JATG interface circuit provides an interface for the digital processor U1 to perform program burning and debugging; The crystal oscillator circuit provides a clock frequency of more than 20 MHz for the digital processor U1; The FLASH storage circuit is used to store the program code and data of the digital processor U1. The circuit adopts serial communication, and its data storage time is at least 20 years and the number of erasures and writes is at least 100,000 times.
3. The digital high-precision sine-cosine function generator circuit according to claim 2, characterized in that: The digital processor is any one of FPGA, single chip microcomputer, ARM and DSP.
4. The digital high-precision sine-cosine function generator circuit according to claim 1, characterized in that: The output signal of the digital processing circuit (1) comprises: SIN signal digital quantities SD1-SD16, COS signal digital quantities CD1-CD16 and phase control words D1, D2.
5. The digital high-precision sine-cosine function generator circuit according to claim 4, characterized in that: The digital processing circuit (1) identifies the quadrant through the upper two bits of the digital input signal and converts it into phase control words D1 and D2; the phase control words D1 and D2 are used to switch the analog switch MK1 and the analog switch MK2 in the phase detection circuit, and the phase of the SIN signal is controlled through the analog switch MK1, and the phase of the COS signal is controlled through the analog switch MK2.
6. The digital high-precision sine-cosine function generator circuit according to claim 4, characterized in that: The DAC conversion circuit (2) comprises a sine digital-to-analog conversion circuit and a cosine digital-to-analog conversion circuit; The sinusoidal digital-to-analog conversion circuit comprises a DAC converter N5, an operational amplifier N1 and a resistor R4; the input end of the DAC converter N5 is connected to the SIN signal digital quantity output by the digital processing circuit (1); the output end of the DAC converter N5 is connected to the inverting input end of the operational amplifier N1; the non-inverting input end of the operational amplifier N1 is grounded via the resistor R4; the output end of the operational amplifier N1 is connected to the first input end of the phase detector circuit (3); The cosine digital-to-analog conversion circuit comprises a DAC converter N6, an operational amplifier N3 and a resistor R5; the input end of the DAC converter N6 is connected to the COS signal digital quantity output by the digital processing circuit (1); the output end of the DAC converter N6 is connected to the inverting input end of the operational amplifier N3; the non-inverting input end of the operational amplifier N3 is grounded via the resistor R5; and the output end of the operational amplifier N3 is connected to the second input end of the phase detector circuit (3).
7. The digital high-precision sine-cosine function generator circuit according to claim 6, characterized in that: The DAC converter N5 and the DAC converter N6 both use multiplication type DAC devices; the operational amplifier N1 and the operational amplifier N3 both use precision operational amplifiers.
8. The digital high-precision sine-cosine function generator circuit according to claim 6, characterized in that: The phase detection circuit (3) comprises a sine phase detection circuit and a cosine phase detection circuit; The sinusoidal phase detection circuit includes an operational amplifier N2, an analog switch MK1, a resistor R1, a resistor R2 and a resistor R3; the inverting input terminal of the operational amplifier N2 is connected to the first end of the resistor R2, and the second end of the resistor R2 is connected to the output end of the operational amplifier N1; the non-inverting input terminal of the operational amplifier N2 is grounded through the resistor R3; the IO1 terminal of the analog switch MK1 is connected to the second end of the resistor R2, and the IO2 terminal of the analog switch MK1 is connected to the output end of the operational amplifier N2; the first end of the resistor R1 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R1 is connected to the output end of the operational amplifier N2; The cosine phase detection circuit includes an operational amplifier N4, an analog switch MK2, a resistor R6, a resistor R7 and a resistor R8; the inverting input terminal of the operational amplifier N4 is connected to the first end of the resistor R7, and the second end of the resistor R7 is connected to the output end of the operational amplifier N3; the non-inverting input terminal of the operational amplifier N4 is grounded through the resistor R8; the IO1 terminal of the analog switch MK2 is connected to the second end of the resistor R7, and the IO2 terminal of the analog switch MK2 is connected to the output end of the operational amplifier N4; the first end of the resistor R6 is connected to the inverting input terminal of the operational amplifier N2, and the second end of the resistor R6 is connected to the output end of the operational amplifier N4.
9. The digital high-precision sine-cosine function generator circuit according to claim 8, characterized in that: The operational amplifiers N1 to N4 are all low offset voltage operational amplifiers; The resistors R1 to R8 are all high-precision thin film resistors; The analog switch MK1 and the analog switch MK2 are low on-resistance analog switches.
10. The digital high-precision sine-cosine function generator circuit according to claim 1, characterized in that: The operational amplifier N2 and the operational amplifier N4 invert the signal output by the DAC conversion circuit (2) by 180°; the analog switch MK1 and the analog switch MK2 switch the sine and cosine outputs under the action of the phase control word.