A microprocessor chip and its application method
By building DFT, ATAN, FFT, IIR controller and other modules into the microprocessor chip, reactive power compensation, unbalance adjustment and harmonic control are realized, which solves the complex design of multiple chip combinations and user-independent code development in the existing technology. solve the problem and achieve efficient comprehensive management of power quality.
Patent Information
- Application Number
- CN202010804791.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-12
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-08-12
AI Technical Summary
Existing reactive power compensation, imbalance regulation and power quality comprehensive management solutions usually require a combination of multiple TI chips and Altera or Xilinx FPGA/CPLD chips. The design is complex and users need to develop all codes independently, making the work difficult.
Design a microprocessor chip with built-in DFT, ATAN, and sine and cosine modules to achieve angle tracking and phase locking. It achieves spectrum separation through FFT and HCC modules. It combines the extended IIR controller and PWM module for compensation control and pulse width modulation. Through the GPIO interface Output PWM pulses to drive the power switch tube to achieve reactive power compensation, imbalance adjustment and harmonic control.
This chip can replace multiple chips to achieve the same function. It has a unique architecture and is simple to use. Users only need to configure registers to implement complex comprehensive power quality management functions, reducing the difficulty of work.
Smart Images

Figure CN111952994B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microelectronics technology, and in particular to a microprocessor chip suitable for extracting, displaying and controlling positive and negative sequence active power, reactive power and harmonics of electrical signals and a method for applying the chip. Background Art
[0002] The comprehensive power quality control device is a comprehensive power quality control device used on the low-voltage power distribution user side to control three-phase current imbalance, reactive power compensation and harmonic control.
[0003] At present, most of the reactive power compensation, unbalanced regulation and comprehensive power quality management solutions available on the market use a combination of TI chips + Altera or Xilinx FPGA / CPLD chips. The TI chip implements the control of the algorithm module, and the Altera or Xilinx FPGA / CPLD chip implements PWM modulation.
[0004] However, in order to realize complex functions, some occasions require multiple TI chips + Altera or Xilinx FPGA / CPLD architecture. Secondly, the design of the entire solution of TI chip + Altera or Xilinx FPGA / CPLD architecture requires users to develop all the codes independently, which is difficult. Summary of the invention
[0005] The main purpose of the present invention is to provide a microprocessor chip with small area, powerful functions and comprehensive power quality management that can achieve reactive power compensation, unbalanced regulation and harmonic control.
[0006] Another object of the present invention is to provide an application method of a microprocessor chip that can achieve comprehensive power quality management including reactive power compensation, unbalanced regulation and harmonic control.
[0007] In order to achieve the above-mentioned main purpose, the present invention provides a microprocessor chip, which includes a first processing unit and a second processing unit. The first processing unit performs analog-to-digital conversion on a first input signal and calculates the sine and cosine values of the first input signal. The second processing unit obtains the sine and cosine values output by the first processing unit, and performs analog-to-digital conversion and spectrum separation on the second input signal to obtain the expected value in the input signal.
[0008] In a further solution, the chip also includes a third processing unit, which uses the expected value output by the second processing unit as the input of feedback control, and compares the error with the actual value of the third input signal after analog-to-digital conversion to obtain a modulation signal. The modulation signal is modulated by PWM pulse width modulation to obtain a PWM pulse, which is output through the GPIO interface to control the power switch tube.
[0009] In a further solution, when the PWM pulse is output through the GPIO interface to drive the power switch tube outside the chip to operate, a new input signal is formed again to enter the GPIO interface of the chip and an error comparison is performed with the expected value output by the second processing unit, so that the actual value of the new input signal continues to approach the expected value.
[0010] In a further solution, the first processing unit includes a first analog-to-digital converter, a DFT module, an ATAN function module, and a sine-cosine module. The input end of the first analog-to-digital converter is connected to the first input signal, the output end of the first analog-to-digital converter is connected to the input end of the DFT module, the output end of the DFT module is connected to the input end of the ATAN function module, the output end of the ATAN function module is connected to the input end of the sine-cosine module, and the output end of the sine-cosine module outputs a sine signal and a cosine signal, respectively.
[0011] In a further solution, the second processing unit includes a second analog-to-digital converter, a first Matrix module, an FFT module, an HCC module, and a second Matrix module. The second analog-to-digital converter is connected to a second input signal, the output end of the second analog-to-digital converter is connected to the input end of the first Matrix module, the output end of the first Matrix module is connected to the input end of the FFT module, the output end of the FFT module is connected to the input end of the HCC module, the output end of the HCC module is connected to the input end of the second Matrix module, the first Matrix module and the second Matrix module receive the sine and cosine values, and the output end of the second Matrix module outputs the expected value.
[0012] In a further solution, the third processing unit includes a third analog-to-digital converter, a controller module, and a pulse width modulation module. The input end of the third analog-to-digital converter is connected to the third input signal, the output end of the third analog-to-digital converter is connected to the input end of the controller module, the input end of the controller module receives the error value between the actual value and the expected value of the third input signal after analog-to-digital conversion, the output end of the controller module is connected to the input end of the pulse width modulation module, and the output end of the pulse width modulation module is connected to the GPIO interface.
[0013] It can be seen that the present invention realizes angle tracking phase locking through the chip's built-in DFT, ATAN, and sine-cosine modules, and then realizes spectrum separation to obtain the expected value through the chip's built-in FFT and HCC. Finally, the chip's built-in extended IIR controller and PWM module realize compensation control and pulse width modulation, and the PWM pulse is output through the GPIO to drive the power switch tube outside the chip to operate, thereby forming an input signal to enter the GPIO again, and after ADC analog-to-digital conversion, iterative analysis, calculation, and control are repeated again, so that the actual value continues to approach the expected value.
[0014] Therefore, the processor chip of the present invention can replace multiple chips to achieve the same function. Using this chip as the only processor can realize the comprehensive power quality management functions of reactive power compensation, unbalanced regulation and harmonic control. It has a unique architecture and is easy to use. Many functions have fixed models, and users only need to configure registers to achieve their goals.
[0015] In order to achieve the above-mentioned other purpose, the present invention provides an application method of a microprocessor chip, wherein the microprocessor chip adopts the above-mentioned microprocessor chip, and the application method comprises: step S1, using the first processing unit built into the chip to perform angle tracking and phase locking on a first input signal, and calculate the sine and cosine values of the first input signal; step S2, according to the obtained sine and cosine values, using the second processing unit built into the chip to perform analog-to-digital conversion and spectrum separation on the second input signal to obtain the expected value in the input signal.
[0016] A further solution is that the method also includes step S3, in which the expected value output by the second processing unit is used as the input of feedback control, and after error comparison with the actual value of the third input signal after analog-to-digital conversion, the third processing unit built into the chip is used to perform compensation control and pulse width modulation to form a PWM pulse and output it through the GPIO interface to drive the power switch tube outside the chip to operate, thereby forming a new input signal again to enter the GPIO interface of the chip, and repeating this process continuously so that the actual value of the new input signal continues to approach the expected value.
[0017] A further solution is that step S1 specifically includes: obtaining analog signals of input voltages U1, U2, U3, performing analog-to-digital conversion on the input voltages U1, U2, U3 through a first analog-to-digital converter, converting the input voltages U1, U2, U3 into components A and B of two-phase coordinates using a DFT module, and calculating the sine and cosine values of any one phase of the input voltages U1, U2, U3 through an ATAN function module and a sine and cosine module to complete phase angle tracking and phase locking of the input voltages U1, U2, U3.
[0018] A further solution is that step S2 specifically includes: obtaining analog signals of input currents I1, I2, and I3, performing analog-to-digital conversion on the input currents I1, I2, and I3 through a second analog-to-digital converter, and outputting digital signals to a first Matrix module; the first Matrix module outputs matrix signals to an FFT module after matrix transformation based on the received sine and cosine values, and realizes spectrum separation through the FFT module and the HCC module to obtain the expected value.
[0019] It can be seen that the present invention realizes angle tracking phase locking through the chip's built-in DFT, ATAN, and sine-cosine modules, and then realizes spectrum separation to obtain the expected value through the chip's built-in FFT and HCC. Finally, the chip's built-in extended IIR controller and PWM module realize compensation control and pulse width modulation, and the PWM pulse is output through the GPIO to drive the power switch tube outside the chip to operate, thereby forming an input signal to enter the GPIO again, and after ADC analog-to-digital conversion, iterative analysis, calculation, and control are repeated again, so that the actual value continues to approach the expected value.
[0020] Therefore, the processor chip of the present invention can replace multiple chips to achieve the same function. Using this chip as the only processor can realize the comprehensive power quality management functions of reactive power compensation, unbalanced regulation and harmonic control. It has a unique architecture and is easy to use. Many functions have fixed models, and users only need to configure registers to achieve their goals. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of a microprocessor chip embodiment of the present invention.
[0022] Figure 2 It is a flowchart of an application method embodiment of a microprocessor chip of the present invention.
[0023] Figure 3 It is a schematic diagram of a first processing unit in an embodiment of an application method of a microprocessor chip of the present invention.
[0024] Figure 4 It is a schematic diagram of a second processing unit in an embodiment of an application method of a microprocessor chip of the present invention.
[0025] Figure 5 It is a schematic diagram of a third processing unit in an embodiment of an application method of a microprocessor chip of the present invention.
[0026] Figure 6 It is a schematic diagram of the data structure of each component of a signal separated by an FFT module in an embodiment of an application method of a microprocessor chip of the present invention.
[0027] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0028] A microprocessor chip embodiment:
[0029] See also Figure 1 The microprocessor chip of the present invention includes a first processing unit and a second processing unit. The first processing unit performs analog-to-digital conversion on a first input signal and calculates the sine and cosine values of the first input signal. The second processing unit obtains the sine and cosine values output by the first processing unit, and performs analog-to-digital conversion and spectrum separation on the second input signal to obtain the expected value in the input signal.
[0030] In this embodiment, the chip also includes a third processing unit, which uses the expected value output by the second processing unit as the input of feedback control, and compares the error with the actual value of the third input signal after analog-to-digital conversion to obtain a modulation signal. The modulation signal is modulated by PWM pulse width modulation to obtain a PWM pulse, which is output through the GPIO interface to control the power switch tube.
[0031] Among them, when the PWM pulse is output through the GPIO interface to drive the power switch tube outside the chip to operate, a new input signal is formed again to enter the GPIO interface of the chip and compare the error with the expected value output by the second processing unit, so that the actual value of the new input signal continues to approach the expected value.
[0032] In this embodiment, the first processing unit includes a first analog-to-digital converter 11, a DFT module 12, an ATAN function module 13, and a sine-cosine module 14. The input end of the first analog-to-digital converter 11 is connected to the first input signal, the output end of the first analog-to-digital converter 11 is connected to the input end of the DFT module 12, the output end of the DFT module 12 is connected to the input end of the ATAN function module 13, the output end of the ATAN function module 13 is connected to the input end of the sine-cosine module 14, and the output end of the sine-cosine module 14 outputs a sine signal and a cosine signal, respectively.
[0033] In this embodiment, the second processing unit includes a second analog-to-digital converter 21, a first Matrix module 22, an FFT module 23, an HCC module 24, and a second Matrix module 25. The second analog-to-digital converter 21 is connected to the second input signal, the output end of the second analog-to-digital converter 21 is connected to the input end of the first Matrix module 22, the output end of the first Matrix module 22 is connected to the input end of the FFT module 23, the output end of the FFT module 23 is connected to the input end of the HCC module 24, the output end of the HCC module 24 is connected to the input end of the second Matrix module 25, the first Matrix module 22 and the second Matrix module 25 receive sine and cosine values, and the output end of the second Matrix module 25 outputs an expected value.
[0034] In this embodiment, the third processing unit includes a third analog-to-digital converter 31, a controller module 32, and a pulse width modulation module 33. The input end of the third analog-to-digital converter 31 is connected to the third input signal, the output end of the third analog-to-digital converter 31 is connected to the input end of the controller module 32, the input end of the controller module 32 receives the error value between the actual value and the expected value of the third input signal after analog-to-digital conversion, the output end of the controller module 32 is connected to the input end of the pulse width modulation module 33, and the output end of the pulse width modulation module 33 is connected to the GPIO interface. Among them, the controller module 32 is an IIR / PR / PID controller.
[0035] Specifically, the chip of the present invention includes modules such as an analog-to-digital converter, a Matrix custom matrix, a DFT, an ATAN, a SINCOS, a FFT, an IIR extension module, and a PWM integrated in the chip. Among them, the analog-to-digital converter is used to convert analog signals into digital signals for identification by the chip processor, and the algorithm module is mainly used to extract and convert components of the digital signal, and finally convert it into a pulse signal output through the PWM module. This implementation method has high integration, a wide range of adaptability, and high reliability, and is suitable for power equipment that needs to extract, display, and control positive and negative sequence active power, reactive power, and harmonics.
[0036] It can be seen that the present invention realizes angle tracking and phase locking of sin_ux and cos_ux through the chip's built-in DFT, ATAN, and sine-cosine modules 14, then realizes spectrum separation through the chip's built-in FFT and HCC to obtain the expected value, and finally realizes compensation control and pulse width modulation through the chip's built-in extended IIR controller and PWM module, and outputs the PWM pulse through the GPIO output chip to drive the power switch tube outside, thereby forming an input signal to enter the GPIO again, and undergoing ADC analog-to-digital conversion, iterative analysis, calculation, and control are repeated again, so that the actual value continues to approach the expected value.
[0037] Therefore, the processor chip of the present invention can replace multiple chips to achieve the same function. Using this chip as the only processor can realize the comprehensive power quality management functions of reactive power compensation, unbalanced regulation and harmonic control. It has a unique architecture and is easy to use. Many functions have fixed models, and users only need to configure registers to achieve their goals.
[0038] An application method embodiment of a microprocessor chip:
[0039] An application method of a microprocessor chip, applied to the above-mentioned microprocessor chip, see Figure 2 , the application method for reactive power compensation, unbalance regulation and comprehensive power quality management functions includes the following steps:
[0040] First, execute step S1, use the first processing unit built into the chip to perform angle tracking and phase locking on the first input signal, and calculate the sine and cosine values of the first input signal. Wherein, step S1 specifically includes: obtaining analog signals of input voltages U1, U2, and U3, performing analog-to-digital conversion on the input voltages U1, U2, and U3 through the first analog-to-digital converter 11, using the DFT module 12 to convert the input voltages U1, U2, and U3 to components A and B of two-phase coordinates, and calculating the sine and cosine values of any one phase of the input voltages U1, U2, and U3 through the ATAN function module 13 and the sine and cosine module 14, and completing the phase angle tracking and phase locking of the input voltages U1, U2, and U3.
[0041] Then, step S2 is executed, and according to the obtained sine and cosine values, the second input signal is converted into analog-to-digital and spectrum separation is performed by using the second processing unit built into the chip to obtain the expected value in the input signal. Wherein, step S2 specifically includes: obtaining the analog signals of the input currents I1, I2, and I3, performing analog-to-digital conversion on the input currents I1, I2, and I3 through the second analog-to-digital converter 21, and outputting the digital signals to the first Matrix module 22, the first Matrix module 22 outputs the matrix signal to the FFT module 23 after matrix transformation according to the received sine and cosine values, and performs spectrum separation through the FFT module 23 and the HCC module 24 to obtain the expected value.
[0042] Then, execute step S3, use the expected value output by the second processing unit as the input of feedback control, compare the error with the actual value of the third input signal after analog-to-digital conversion, and use the built-in third processing unit of the chip to perform compensation control and pulse width modulation to form a PWM pulse and output it through the GPIO interface to drive the power switch tube outside the chip to operate, thereby forming a new input signal again to enter the GPIO interface of the chip, and repeating this process continuously, so that the actual value of the new input signal continues to approach the expected value.
[0043] In addition, the power switch tube is driven by the driving circuit outside the GPIO interface output chip, and the calculated current is injected into the power grid after filtering by the filtering circuit, realizing the comprehensive power quality management functions of reactive power compensation, unbalanced regulation and harmonic control; thereby forming a new input signal to enter the GPIO interface of the chip again, and repeating it continuously, so that the actual value of the new input signal continues to approach the expected value.
[0044] In practical applications, with the chip as the core, the three-phase current and voltage of the distribution network are first detected in conjunction with the signal conditioning circuit to obtain their sampling values, wherein the first input signal is the three-phase voltage signal U1, U2, U3, the second input signal is the external CT current signal I1, I2, I3, and the third input signal is the three-phase current signal IF1, IF2, IF3.
[0045] The chip algorithms of this embodiment are mainly divided into three categories: (1) phase locking; (2) extraction of positive and negative sequence active, reactive, and harmonic components; and (3) feedback control and modulation.
[0046] Among them, Figure 3 As shown, (1) the main function of phase locking is to realize phase angle tracking and phase locking of input voltage signals U1, U2, U3. The DFT module 12 is used to convert U1, U2, U3 into two-phase coordinate components A and B. The sine and cosine values of any phase of the input voltage U1, U2, U3 can be calculated through the ATAN and sine-cosine module 14 (SINCOS) to realize the phase locking function.
[0047] like Figure 4 As shown, (2) the main function of extracting the positive and negative sequence active, reactive and harmonic components is to convert the input analog ADC signal (such as input current I1, I2, I3) into analog-to-digital and separate the signal to obtain the expected components in the input signal. Among them, the Matrix module is for preparing the signal separation, and the HCC module 24 is for correcting and compensating the separated components, so as to make the expected value closer to the real value.
[0048] like Figure 6 As shown in Figure 3, the main function of (3) feedback control and modulation is to control and modulate the error signal. The expected value of the previous two types of output will be used as the input of the feedback control, and the error will be compared with the actual value of the analog-to-digital conversion. The IIR / PR / PID controller will finally obtain the modulation signal, and the modulation signal will then be modulated by PWM pulse width modulation technology to obtain the modulation pulse, which will be output through GPIO to drive the power switch tube.
[0049] Of course, in scenarios where feedback control is not required, such as display, the (3) step is not necessary. Only the (1) and (2) steps are required to separate the positive and negative sequence active, reactive, harmonic and other components of the input ADC signal. The entire process is clear and concise. Users can save a lot of algorithm programming design by using this chip. They only need to configure the program to run according to the (1) and (2) steps.
[0050] If feedback control is required, it is necessary to connect the (1), (2), and (3) links in series to form a complete link. The user only needs to configure the corresponding registers, eliminating a lot of algorithm programming design, making the work simple and efficient.
[0051] Among them, the data structure of each component of the signal separated by FFT module 23 is as follows: Figure 6 As shown, take inputting 256 data as an example.
[0052] It can be seen that the present invention realizes angle tracking and phase locking through the chip's built-in DFT, ATAN, and sine-cosine modules 14, and then realizes spectrum separation to obtain the expected value through the chip's built-in FFT and HCC. Finally, the chip's built-in extended IIR controller and PWM module realize compensation control and pulse width modulation, and the PWM pulse is output through the GPIO to drive the power switch tube outside the chip to operate, thereby forming an input signal to enter the GPIO again, and after ADC analog-to-digital conversion, iterative analysis, calculation, and control are repeated again, so that the actual value continues to approach the expected value.
[0053] In addition, the built-in algorithm of the chip can fully realize the functions of the comprehensive power quality management solution of reactive power compensation, unbalanced regulation and harmonic control. Users do not need to write algorithm programs. The whole work only needs to configure Figure 1 The registers of the various functional modules shown can realize complex functions, and the difficulty of work is reduced exponentially.
[0054] Therefore, the processor chip of the present invention can replace multiple chips to achieve the same function. Using this chip as the only processor can realize the comprehensive power quality management functions of reactive power compensation, unbalanced regulation and harmonic control. It has a unique architecture and is easy to use. Many functions have fixed models, and users only need to configure registers to achieve their goals.
[0055] Users do not need to write algorithm programs. The entire work only requires configuring the registers of the modules in the relevant schematic diagram (as shown below) to achieve complex functions, and the difficulty of the work is reduced exponentially.
[0056] It should be noted that the above are only preferred embodiments of the present invention, but the design concept of the invention is not limited thereto, and any non-substantial modifications made to the present invention using this concept also fall within the protection scope of the present invention.
Claims
1. A microprocessor chip, It is characterized in that include: A first processing unit and a second processing unit, wherein the first processing unit performs analog-to-digital conversion on the first input signal and calculates the sine value and cosine value of the first input signal, and the second processing unit obtains the sine value and cosine value output by the first processing unit, and performs analog-to-digital conversion and spectrum separation on the second input signal to obtain an expected value in the input signal; The chip further includes a third processing unit, which uses the expected value output by the second processing unit as an input for feedback control, and compares the error with the actual value of the third input signal after analog-to-digital conversion to obtain a modulation signal. The modulation signal is modulated by PWM pulse width modulation to obtain a PWM pulse, which is output through the GPIO interface to control the power switch tube; Wherein, the first processing unit includes a first analog-to-digital converter, a DFT module, an ATAN function module, and a sine-cosine module, the input end of the first analog-to-digital converter is connected to the first input signal, the output end of the first analog-to-digital converter is connected to the input end of the DFT module, the output end of the DFT module is connected to the input end of the ATAN function module, the output end of the ATAN function module is connected to the input end of the sine-cosine module, and the output end of the sine-cosine module outputs a sine signal and a cosine signal respectively; The second processing unit includes a second analog-to-digital converter, a first Matrix module, an FFT module, an HCC module, and a second Matrix module. The second analog-to-digital converter is connected to a second input signal. The output end of the second analog-to-digital converter is connected to the input end of the first Matrix module. The output end of the first Matrix module is connected to the input end of the FFT module. The output end of the FFT module is connected to the input end of the HCC module. The output end of the HCC module is connected to the input end of the second Matrix module. The first Matrix module and the second Matrix module receive the sine value and the cosine value. The output end of the second Matrix module outputs an expected value. Among them, the third processing unit includes a third analog-to-digital converter, a controller module, and a pulse width modulation module. The input end of the third analog-to-digital converter is connected to the third input signal, the output end of the third analog-to-digital converter is connected to the input end of the controller module, the input end of the controller module receives the error value between the actual value and the expected value of the third input signal after analog-to-digital conversion, the output end of the controller module is connected to the input end of the pulse width modulation module, and the output end of the pulse width modulation module is connected to the GPIO interface.
2. The chip according to claim 1, Features: When the PWM pulse is output through the GPIO interface to drive the power switch tube outside the chip to operate, a new input signal is formed again to enter the GPIO interface of the chip and compare the error with the expected value output by the second processing unit, so that the actual value of the new input signal continues to approach the expected value.
3. An application method of a microprocessor chip, It is characterized in that The microprocessor chip is the microprocessor chip according to claim 1 or 2, and the method comprises: Step S1, using a first processing unit built into the chip to perform angle tracking and phase locking on a first input signal, and calculating a sine value and a cosine value of the first input signal; Step S2: According to the obtained sine value and cosine value, the second processing unit built into the chip is used to perform analog-to-digital conversion and spectrum separation on the second input signal to obtain the expected value in the input signal.
4. The method according to claim 3, It is characterized in that The method further includes: In step S3, the expected value output by the second processing unit is used as the input of feedback control. After error comparison with the actual value of the third input signal after analog-to-digital conversion, the third processing unit built into the chip is used to perform compensation control and pulse width modulation to form a PWM pulse and output it through the GPIO interface to drive the power switch tube outside the chip to operate, thereby forming a new input signal again to enter the GPIO interface of the chip, and repeating this process continuously so that the actual value of the new input signal continues to approach the expected value.
5. The method according to claim 3 or 4, Features: The step S1 specifically includes: obtaining analog signals of input voltages U1, U2, and U3, performing analog-to-digital conversion on the input voltages U1, U2, and U3 through a first analog-to-digital converter, converting the input voltages U1, U2, and U3 into components A and B of two-phase coordinates using a DFT module, and calculating the sine value and cosine value of any one phase of the input voltages U1, U2, and U3 through an ATAN function module and a sine-cosine module to complete phase angle tracking and phase locking of the input voltages U1, U2, and U3.
6. The method according to claim 3 or 4, Features: The step S2 specifically includes: obtaining analog signals of input currents I1, I2, and I3, performing analog-to-digital conversion on the input currents I1, I2, and I3 through a second analog-to-digital converter, and outputting digital signals to a first Matrix module; the first Matrix module outputs matrix signals to an FFT module after matrix transformation according to received sine values and cosine values, and performs spectrum separation through the FFT module and the HCC module to obtain expected values.
