Photovoltaic charge and discharge data measurement method and photovoltaic charge and discharge controller
By designing the metering module and sampling circuit in the photovoltaic charge and discharge controller, the problem of the inability to count the load power consumption in the existing technology is solved, and the accurate evaluation of the photovoltaic system and the effective measurement of electrical energy are achieved, with data support for carbon emissions and carbon trading.
Patent Information
- Application Number
- CN202510804507.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-17
AI Technical Summary
Existing technologies are unable to effectively count the amount of electricity consumed by loads in photovoltaic systems, resulting in an inability to accurately evaluate photovoltaic systems.
A photovoltaic charge and discharge controller is designed, which includes a discharge control module, a first sampling circuit, a metering module and a main control module. By determining the minimum unit electric energy value and update threshold value of the metering module, periodically reading and accumulating the metering value, the load electric energy consumption can be measured.
It achieves accurate measurement of the electric energy consumed by the load and can collect data to determine the amount of electric energy saved by photovoltaic panels on the national power grid, which has important significance for carbon emissions and carbon trading.
Smart Images

Figure CN120314644B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of photovoltaic power generation technology, and in particular to a photovoltaic charge and discharge data measurement method and a photovoltaic charge and discharge controller. Background Art
[0002] Photovoltaic panels can convert solar energy into directly usable electricity. They are safe and clean to use, and their prices are becoming increasingly cheaper, making them widely used in various fields.
[0003] Photovoltaic systems typically include a photovoltaic charge and discharge controller. Its primary functions include charging batteries based on sunlight intensity and battery characteristics, starting and stopping loads, and measuring and recording operating parameters. However, existing solutions lack the ability to measure load power consumption, hindering evaluation of photovoltaic systems. Summary of the Invention
[0004] The embodiment of the present invention provides a photovoltaic charge and discharge data measurement method and a photovoltaic charge and discharge controller to achieve measurement of load power consumption.
[0005] According to one aspect of the present invention, a method for measuring photovoltaic charge and discharge data is provided, which is performed by a photovoltaic charge and discharge controller. The photovoltaic charge and discharge controller is used to control the photovoltaic panel to charge a battery and control the battery to discharge a load. The photovoltaic charge and discharge controller includes: a discharge control module, a first sampling circuit, a metering module, and a main control module. The input end of the discharge control module is connected to the battery, the output end of the discharge control module is connected to the load via the first sampling circuit, the output end of the first sampling circuit is connected to the first sampling end group of the metering module, and the main control module is connected to the metering module.
[0006] The photovoltaic charge and discharge data measurement method includes:
[0007] Determining, based on the minimum power of the battery at the rated voltage, a minimum unit of electric energy value output by the metering module at a preset update time and an update threshold value measured by the metering module;
[0008] controlling the metering module to measure the data received by the first sampling end group thereof according to the update threshold value to obtain a first measurement value;
[0009] The first measurement value is periodically read and accumulated, and the accumulated value of the first measurement value is stored in a continuous address of the main control module at each first preset time interval, and the electric energy consumed by the load is determined based on the first measurement value and the electric energy value of the minimum unit.
[0010] Optionally, the determining, based on the minimum power of the battery at the rated voltage, a minimum unit of electric energy value output by the metering module at a preset update time and an update threshold value measured by the metering module includes:
[0011] Based on the minimum power, determining the pin voltage of the first sampling terminal group of the metering module and the pulse constant of the metering module at the preset update time; wherein the pin voltage of the first sampling terminal group of the metering module includes a first pin voltage corresponding to the current of the load and a second pin voltage corresponding to the voltage of the load;
[0012] Determining the minimum unit of electric energy value output by the metering module at the preset update time according to the pulse constant;
[0013] The update threshold value of the metering module is determined according to the pin voltage of the first sampling terminal group of the metering module, the pulse constant, the minimum power, and the amplification factor of the first pin voltage by the metering module.
[0014] Optionally, the pulse constant satisfies: ;
[0015] Wherein, IMP is the pulse constant, Pmin is the minimum power, and Tmin is the preset update time;
[0016] The update threshold value satisfies:
[0017] ;
[0018] Wherein, HFConst is the update threshold value, V1f is the first pin voltage, V2f is the second pin voltage, PGA is the amplification factor of the first pin voltage by the metering module, and IMP and HFConst are both integers.
[0019] Optionally, the second pin voltage is equal to the ratio of the maximum input value of the metering module to a preset multiple;
[0020] The preset multiple of the rated voltage of the battery is the input full scale of the analog-to-digital converter in the metering module.
[0021] Optionally, the amplification factor of the first pin voltage is determined as follows:
[0022] Determine a first voltage value corresponding to a code value of an analog-to-digital converter within the metering module, and a second voltage value corresponding to a metering accuracy error of the metering module;
[0023] determining an amplification factor of the first pin voltage according to a ratio of the second voltage value to the first voltage value;
[0024] The amplification factor of the first pin voltage satisfies:
[0025] , N1 is the number of bits of the coding noise of the analog-to-digital converter, N2 is the number of bits affected by the circuit noise on the coding value, Verr is the second voltage value, V1sb is the first voltage value, and PGA is an integer.
[0026] Optionally, before obtaining the first measurement value, the photovoltaic charge and discharge data measurement method further includes:
[0027] configuring sampling parameters of the first sampling circuit according to the second pin voltage;
[0028] The step of controlling the metering module to meter the data received by the first sampling end group according to the updated threshold value to obtain a first metering value includes:
[0029] Controlling the metering module to collect power consumption data of the load output by the first sampling circuit in real time; wherein the power consumption data includes current data and first voltage data;
[0030] Controlling the metering module to process the power consumption data collected each time to obtain a power accumulation value;
[0031] When the power accumulation value is greater than the update threshold value of the metering module, the first metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current power accumulation value.
[0032] Optionally, determining the electric energy consumed by the load according to the first measurement value and the electric energy value of the minimum unit includes:
[0033] The electric energy consumed by the load is determined according to the product of the first measurement value and the electric energy value of the minimum unit.
[0034] Optionally, the photovoltaic charge and discharge controller further includes a charging control module and a second sampling circuit, wherein the input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, and the output end of the second sampling circuit is connected to the second sampling end group of the metering module;
[0035] The photovoltaic charge and discharge data measurement method further includes:
[0036] Controlling the metering module to measure the data received by the second sampling end group thereof according to the update threshold value to obtain a second measurement value;
[0037] The amount of light received by the photovoltaic panel is determined according to the second measurement value.
[0038] Before obtaining the second measurement value, the photovoltaic charge and discharge data measurement method further includes:
[0039] Determining a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of the first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to the reference voltage output by the metering module;
[0040] configuring sampling parameters of the second sampling circuit according to the third pin voltage and the fourth pin voltage;
[0041] Controlling the metering module to measure the data received by the second sampling end group thereof according to the updated threshold value to obtain the second metering value includes:
[0042] Controlling the metering module to collect the second voltage data output by the second sampling circuit in real time;
[0043] controlling the metering module to process the second voltage data collected each time to obtain a voltage accumulation value;
[0044] When the voltage accumulation value is greater than the update threshold value of the metering module, the second metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current voltage accumulation value.
[0045] Optionally, determining the amount of light received by the photovoltaic panel according to the second measurement value includes:
[0046] determining the amount of light received by the photovoltaic panel according to a ratio of the second measurement value to the voltage of the fourth pin;
[0047] The photovoltaic charge and discharge data measurement method further includes:
[0048] The main control module is controlled to periodically read the second measurement value, and accumulate the ratio of the second measurement value to the fourth pin voltage, and store the accumulated value of the ratio of the second measurement value to the fourth pin voltage in a continuous address every first preset time interval.
[0049] Optionally, before controlling the metering module to perform metering, the photovoltaic charge and discharge data measurement method further includes:
[0050] Calibrate the gains corresponding to the sampling end groups and the updated threshold values of the metering module based on a reference source;
[0051] Wherein, the reference source is connected to the photovoltaic charge and discharge controller.
[0052] Optionally, the method for calibrating the gain corresponding to the first sampling end group of the metering module includes:
[0053] Controlling the charging control module to turn off, controlling the discharging control module to turn on, and obtaining a first current value output by a reference source;
[0054] determining an ideal value of a first register in the metering module based on the first current value and the pin voltage of the first sampling terminal group of the metering module, and calculating an ideal value of a second register in the metering module based on the first current value and the minimum current value of the battery; wherein the first register is used to store output voltage data of the discharge control module, and the second register is used to store output current data of the discharge control module;
[0055] Obtaining actual values of the first register and the second register respectively according to preset rules;
[0056] Performing floating-point operations on the ideal value and actual value of the first register and the ideal value and actual value of the second register respectively to determine the gain corresponding to the first sampling end group of the metering module, and writing the obtained gain to the gain register corresponding to the first register and the gain register corresponding to the second register;
[0057] Based on the updated gains, respectively obtaining actual values of the first register and the second register, and respectively comparing differences between the actual value and the ideal value of the first register and between the actual value and the ideal value of the second register to determine whether they are less than a first preset value;
[0058] If yes, the last updated gain is written to the gain register corresponding to the first register and the gain register corresponding to the second register;
[0059] If not, continue to update the gain corresponding to the first sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is less than the first preset value;
[0060] The obtaining the actual values of the first register and the second register respectively according to a preset rule includes:
[0061] Obtaining the actual value of the first register and the actual value of the second register respectively N times continuously at a first preset time interval;
[0062] Remove n maximum values and n minimum values from the N actual values of the first registers, and calculate an average value of the N-2n actual values of the first registers; and remove n maximum values and n minimum values from the N actual values of the second registers, and calculate an average value of the N-2n actual values of the second registers;
[0063] The performing floating-point operations on the ideal value and actual value of the first register and the ideal value and actual value of the second register to determine the gain corresponding to the first sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the first register and the gain register corresponding to the second register includes:
[0064] Performing a floating-point operation on the average of the ideal value and the actual value of the first register, converting the operation result into a first 32-bit signed integer, and taking the lower two bytes of the hexadecimal value of the first integer and writing it into a gain register corresponding to the first register;
[0065] Performing a floating-point operation on the average of the ideal value and the actual value of the second register, converting the operation result into a second 32-bit signed integer, and taking the lower two bytes of the hexadecimal representation of the second integer and writing them into a gain register corresponding to the second register;
[0066] The first preset value is ±0.2%, N is an integer greater than or equal to 10, and n is a positive integer less than or equal to 2.
[0067] Optionally, the method for calibrating the gain corresponding to the second sampling end group of the metering module includes:
[0068] Controlling the discharge control module to be turned off and controlling the charge control module to be turned on, and determining the ideal value of a third register and an ideal value of a fourth register within the metering module according to the pin voltage of the second sampling terminal group of the metering module; wherein the third register is used to store the output voltage data of the photovoltaic panel, and the fourth register is used to store the reference voltage data output by the metering module;
[0069] Obtaining actual values of the third register and the fourth register respectively according to preset rules;
[0070] performing floating-point operations on the ideal value and the actual value of the third register and the ideal value and the actual value of the fourth register, respectively, to determine the gain corresponding to the second sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the third register and the gain register corresponding to the fourth register;
[0071] Based on the updated gains, respectively obtaining actual values of the third register and the fourth register, and respectively comparing differences between the actual value and the ideal value of the third register and the actual value and the ideal value of the fourth register to determine whether they are less than a second preset value;
[0072] If yes, the gain updated last time is written into the gain register corresponding to the third register and the gain register corresponding to the fourth register;
[0073] If not, continue to update the gain corresponding to the second sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is less than the second preset value;
[0074] The obtaining of the actual values of the third register and the fourth register according to a preset rule includes:
[0075] Obtaining the actual value of the third register and the actual value of the fourth register respectively N times continuously at intervals of a second preset time;
[0076] removing n maximum values and n minimum values from the N actual values of the third registers, and calculating an average value of the N-2n actual values of the third registers; and removing n maximum values and n minimum values from the N actual values of the fourth registers, and calculating an average value of the N-2n actual values of the fourth registers;
[0077] The performing floating-point operations on the ideal value and the actual value of the third register and the ideal value and the actual value of the fourth register to determine the gain corresponding to the second sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the third register and the gain register corresponding to the fourth register includes:
[0078] Performing a floating-point operation on the average of the ideal value and the actual value of the third register, converting the operation result into a 32-bit signed third integer, and taking the lower two bytes of the hexadecimal system of the third integer and writing them into a gain register corresponding to the third register;
[0079] performing a floating-point operation on an average of an ideal value and an actual value of the fourth register, converting the operation result into a 32-bit signed fourth integer, and taking the lower two bytes of the hexadecimal representation of the second integer and writing them into a gain register corresponding to the fourth register;
[0080] The second preset value is ±0.2%, N is an integer greater than or equal to 10, and n is a positive integer less than or equal to 2.
[0081] Optionally, the method for calibrating the gain corresponding to the update threshold value includes:
[0082] Perform floating-point operation on the theoretical value and the usage value of the update threshold value, convert the operation result into a 32-bit signed third integer, and take the 16-bit value of the third integer and write it into the gain register corresponding to the update threshold value.
[0083] According to another aspect of the present invention, a method for measuring photovoltaic charge and discharge data is provided, which is performed by a photovoltaic charge and discharge controller, the photovoltaic charge and discharge controller being configured to control a photovoltaic panel to charge a battery and to control the battery to discharge a load. The photovoltaic charge and discharge controller comprises a charging control module, a second sampling circuit, a metering module, and a main control module. The input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, the output end of the second sampling circuit is connected to a second sampling end group of the metering module, and the main control module is connected to the metering module.
[0084] The photovoltaic charge and discharge data measurement method includes:
[0085] determining, based on the minimum power of the battery at the rated voltage, an update threshold value for measurement by the measurement module;
[0086] Controlling the metering module to measure the data received by the second sampling end group thereof according to the update threshold value to obtain a second measurement value;
[0087] The amount of light received by the photovoltaic panel is determined according to the second measurement value.
[0088] Optionally, the photovoltaic charge and discharge controller further includes a discharge control module and a first sampling circuit, wherein the input end of the discharge control module is connected to the battery, the output end of the discharge control module is connected to the load, the input end of the first sampling circuit is connected to the output end of the discharge control module, and the output end of the first sampling circuit is connected to the first sampling end group of the metering module;
[0089] Before obtaining the second measurement value, the photovoltaic charge and discharge data measurement method further includes:
[0090] Determining a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of the first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to the reference voltage output by the metering module;
[0091] The sampling parameters of the second sampling circuit are configured according to the third pin voltage and the fourth pin voltage.
[0092] Optionally, controlling the metering module to meter data received by its own second sampling end group according to the updated threshold value to obtain a second metering value includes:
[0093] Controlling the metering module to collect the second voltage data output by the second sampling circuit in real time;
[0094] controlling the metering module to process the second voltage data collected each time to obtain a voltage accumulation value;
[0095] When the voltage accumulation value is greater than the update threshold value of the metering module, the second metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current voltage accumulation value.
[0096] According to another aspect of the present invention, a photovoltaic charge and discharge controller is provided, which is used to execute the photovoltaic charge and discharge data measurement method provided in any embodiment of the present invention;
[0097] The photovoltaic charge and discharge controller includes a charging control module, a discharging control module, a first sampling circuit, a second sampling circuit, a metering module and a main control module. The input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the discharging control module is connected to the battery, the output end of the discharging control module is connected to the load, the input end of the first sampling circuit is connected to the output end of the discharging control module, the output end of the first sampling circuit is connected to the first sampling end group of the metering module, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, the output end of the second sampling circuit is connected to the second sampling end group of the metering module, and the main control module is connected to the metering module;
[0098] The main control module is used to determine the minimum unit of electric energy value output by the metering module at a preset update time and the update threshold value measured by the metering module based on the minimum power of the battery at the rated voltage, and use the minimum unit of electric energy value as a reference value. According to the update threshold value, the main control module is used to control the metering module to measure the data received by its first sampling end group to obtain a first measurement value, and determine the electric energy consumed by the load based on the first measurement value and the minimum unit of electric energy value.
[0099] Optionally, the first sampling circuit includes a first sampling resistor, a first voltage-dividing resistor, and a second voltage-dividing resistor, wherein the first end of the first sampling resistor is connected to the output end of the discharge control module, the second end of the first sampling resistor is connected to the first end of the load, the second end of the load is grounded, the first end of the first voltage-dividing resistor is connected to the first end of the load, the second end of the first voltage-dividing resistor is connected to the first end of the second voltage-dividing resistor, and the second end of the second voltage-dividing resistor is connected to the second end of the load;
[0100] The first sampling terminal group of the metering module includes a first terminal, a second terminal, a third terminal, and a fourth terminal. The first sampling circuit also includes a first matching resistor, a second matching resistor, a third matching resistor, and a fourth matching resistor. The first terminal of the first sampling resistor is connected to the first terminal of the first sampling terminal group via the first matching resistor, the second terminal of the first sampling resistor is connected to the second terminal of the first sampling terminal group via the second matching resistor, the second terminal of the first voltage-dividing resistor is connected to the third terminal of the first sampling terminal group via the third matching resistor, and the second terminal of the second voltage-dividing resistor is connected to the fourth terminal of the first sampling terminal group via the fourth matching resistor.
[0101] The second sampling circuit includes a third voltage-dividing resistor, a fourth voltage-dividing resistor, a fifth voltage-dividing resistor, and a sixth voltage-dividing resistor, wherein a first end of the third voltage-dividing resistor is connected to the output end of the photovoltaic panel, a second end of the third voltage-dividing resistor is connected to the first end of the fourth voltage-dividing resistor, a second end of the fourth voltage-dividing resistor is connected to the second end of the photovoltaic panel, a second end of the photovoltaic panel is grounded, a first end of the fifth voltage-dividing resistor is connected to the metering module, a second end of the fifth voltage-dividing resistor is connected to the first end of the sixth voltage-dividing resistor, and a second end of the sixth voltage-dividing resistor is grounded;
[0102] The second sampling end group of the metering module includes a first end, a second end, a third end, and a fourth end. The second sampling circuit also includes a fifth matching resistor, a sixth matching resistor, a seventh matching resistor, and an eighth matching resistor. The second end of the third voltage-dividing resistor is connected to the first end of the second sampling end group via the fifth matching resistor, the second end of the fourth voltage-dividing resistor is connected to the second end of the second sampling end group via the sixth matching resistor, the second end of the fifth voltage-dividing resistor is connected to the third end of the second sampling end group via the seventh matching resistor, and the second end of the sixth voltage-dividing resistor is connected to the fourth end of the second sampling end group via the eighth matching resistor.
[0103] Optionally, there are multiple loads and multiple first sampling circuits, and each first sampling circuit is connected to a corresponding load.
[0104] The technical solution provided by the embodiment of the present invention determines the minimum unit of electric energy value output by the metering module at a preset update time and the update threshold value measured by the metering module based on the minimum power of the battery at the rated voltage. The minimum unit of electric energy value is used as a reference value. The metering module is controlled to measure the data received by its own first sampling end group according to the update threshold value to obtain a first measurement value. The first measurement value is periodically read and accumulated. The accumulated value of the first measurement value is stored in a continuous address of the main control module at each first preset time interval. The electric energy consumed by the load is determined based on the first measurement value and the minimum unit of electric energy value. By collecting data from each photovoltaic charge and discharge controller, it can be determined how much electric energy can be saved for the national power grid by using photovoltaic panels to power each region or park. These data are of great significance to carbon emissions and carbon trading.
[0105] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0106] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0107] Figure 1 A schematic diagram of the structure of a photovoltaic charge and discharge controller provided by an embodiment of the present invention;
[0108] Figure 2 A photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0109] Figure 3 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0110] Figure 4 A schematic structural diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention;
[0111] Figure 5 A flowchart of a method for determining an amplification factor of a first pin voltage provided by an embodiment of the present invention;
[0112] Figure 6 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0113] Figure 7A schematic structural diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention;
[0114] Figure 8 A schematic structural diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention;
[0115] Figure 9 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0116] Figure 10 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0117] Figure 11 A schematic structural diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention;
[0118] Figure 12 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0119] Figure 13 A flow chart of a gain calibration method provided by an embodiment of the present invention;
[0120] Figure 14 A flow chart of another gain calibration method provided by an embodiment of the present invention;
[0121] Figure 15 A flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention;
[0122] Figure 16 This is a flow chart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0123] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0124] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0125] Figure 1 A schematic diagram of a photovoltaic charge and discharge controller according to an embodiment of the present invention is provided. Figure 1 The photovoltaic charge and discharge controller 10 is used to control the photovoltaic panel 20 to charge the battery 30 and to control the battery 30 to discharge the load 40. The battery 30 can be a storage battery. The photovoltaic charge and discharge controller 10 includes a discharge control module 102, a first sampling circuit 103, a metering module 104, and a main control module 105. The input end of the discharge control module 102 is connected to the battery 30, the output end of the discharge control module 102 is connected to the load 40 via the first sampling circuit 103, the output end of the first sampling circuit 103 is connected to the first sampling terminal group of the metering module 104, and the main control module 105 is connected to the metering module 104.
[0126] The photovoltaic charge and discharge controller 10 further includes a charging control module 101, which is used to control the photovoltaic panel 20 to charge the battery 30. A main control module 105 is connected to the metering module 104, the charging control module 101, and the discharging control module 102, respectively, and can be used to collect measurement data, store measurement data, etc.
[0127] Figure 2 A photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 2 , the method comprising:
[0128] S110 : Based on the minimum power of the battery at the rated voltage, determine the minimum unit of electric energy value output by the metering module at a preset update time and the update threshold value measured by the metering module.
[0129] Specifically, the minimum power refers to the minimum power output of the battery 30 under rated voltage conditions. The minimum unit of electric energy value refers to the minimum value of electric energy measured by the metering module 104 within a preset update time. The update threshold value is used by the metering module 104 to determine whether the electric energy measurement value needs to be updated. When the change in electric energy detected by the metering module 104 reaches the update threshold value, the electric energy measurement value is updated.
[0130] S120 : Control the metering module to measure the data received by the first sampling end group thereof according to the updated threshold value to obtain a first measurement value.
[0131] Specifically, the first sampling circuit 103 samples the power of the load 40 and, based on a preset update time, obtains the amount of electrical energy consumed by the load 40, as collected by the metering module 104 during the preset update time. When the change in the amount of electrical energy detected by the metering module 104 reaches the update threshold, the metering module 104 updates the measured value of the electrical energy, i.e., updates the first measured value.
[0132] S130, periodically reading the first measurement value and accumulating the first measurement value, storing the accumulated value of the first measurement value in a continuous address of the main control module at each first preset time interval, and determining the electric energy consumed by the load based on the first measurement value and the minimum unit of electric energy value.
[0133] Specifically, the main control module 105 periodically reads the first measurement value of the metering module 104 and accumulates the first measurement value into its internal register. Based on its own clock calendar, the accumulated value of the first measurement value is stored in consecutive addresses at first preset time intervals, thereby obtaining the accumulated value of the first measurement value for each day. The electric energy consumed by the load 40 within each first preset time interval can be obtained by multiplying the first measurement value by the minimum unit of electric energy value. For example, if the accumulated value of the first measurement value is stored hourly, the sequence of stored values can be used to analyze which dates and time periods of the year the load 40 consumes the most electric energy, i.e., which saves the most energy. Optionally, the first preset time interval can be 1 hour, in which case 24 accumulated values of the first measurement value can be stored per day.
[0134] The technical solution provided by the embodiment of the present invention determines the minimum unit of electric energy value output by the metering module at a preset update time and the update threshold value measured by the metering module based on the minimum power of the battery at the rated voltage. The minimum unit of electric energy value is used as a reference value. The metering module is controlled to measure the data received by its own first sampling end group according to the update threshold value to obtain a first measurement value. The first measurement value is periodically read and accumulated. The accumulated value of the first measurement value is stored in a continuous address of the main control module at each first preset time interval. The electric energy consumed by the load is determined based on the first measurement value and the minimum unit of electric energy value. By collecting data from each photovoltaic charge and discharge controller, it can be determined how much electric energy can be saved for the national power grid by using photovoltaic panels to power each region or park. These data are of great significance to carbon emissions and carbon trading.
[0135] Figure 3 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 3 Based on the above embodiment, optionally, step S110 specifically includes:
[0136] S1101. Determine, based on the minimum power, a pin voltage of a first sampling terminal group of a metering module and a pulse constant of the metering module at a preset update time; wherein the pin voltage of the first sampling terminal group of the metering module includes a first pin voltage corresponding to a load current and a second pin voltage corresponding to a load voltage.
[0137] Specifically, Figure 4 This is a schematic diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention, referring to Figure 4 The first sampling circuit 103 includes a first sampling resistor R1, a first voltage-dividing resistor R2P1, and a second voltage-dividing resistor R2P2. The first end of the first sampling resistor R1 is connected to the output end of the discharge control module 102, the second end of the first sampling resistor R1 is connected to the first end of the load 40, the second end of the load 40 is grounded, the first end of the first voltage-dividing resistor R2P1 is connected to the first end of the load 40, the second end of the first voltage-dividing resistor R2P1 is connected to the first end of the second voltage-dividing resistor R2P2, and the second end of the second voltage-dividing resistor R2P2 is connected to the second end of the load 40.
[0138] The first sampling terminal group of the metering module 104 includes a first terminal V1P, a second terminal V1N, a third terminal V2P, and a fourth terminal V2N. The first sampling circuit 103 also includes a first matching resistor R1P, a second matching resistor R1N, a third matching resistor R2P, and a fourth matching resistor R2N. The first end of the first sampling resistor R1 is connected to the first terminal V1P of the first sampling terminal group via the first matching resistor R1P, the second end of the first sampling resistor R1 is connected to the second terminal V1N of the first sampling terminal group via the second matching resistor R1N, the second end of the first voltage divider resistor R2P1 is connected to the third terminal V2P of the first sampling terminal group via the third matching resistor R2P, and the second end of the second voltage divider resistor R2P2 is connected to the fourth terminal V2N of the first sampling terminal group via the fourth matching resistor R2N.
[0139] The first sampling resistor R1 is used to sample the current of the load 40. The first sampling resistor R1 is a precision resistor with a resistance of 4 mΩ. The voltage V1 across the first sampling resistor R1 is input to the first terminal V1P and the second terminal V1N of the first sampling terminal group of the metering module 104 via the first matching resistor R1P and the second matching resistor R1N. The magnitude of V1 is linearly proportional to the current flowing through the load 40. The voltage at the first terminal of the load 40 is divided by the first voltage-dividing resistor R2P1 and the second voltage-dividing resistor R2P2, and then input to the third terminal V2P and the fourth terminal V2N of the first sampling terminal group of the metering module 104 via the third matching resistor R2P and the fourth matching resistor R2N. The first matching resistor R1P, the second matching resistor R1N, the third matching resistor R2P, and the fourth matching resistor R2N function to couple signals and protect the metering module 104.
[0140] The pin voltage of the first sampling terminal group of the metering module 104 is the voltage and current of the load corresponding to the minimum power of the battery 30 at the rated voltage, that is, the corresponding values of V1 and V2. At this time, V1 is recorded as V1f and V2 is recorded as V2f. Taking the rated voltage of the battery as 12V and the operating current between 0.1A and 10A as an example, under the action of the minimum current at the rated voltage, the voltage V1 across the first sampling resistor R1 is , that is, the first pin voltage V1f is 0.4mV.
[0141] The second pin voltage V2f is equal to the ratio of the maximum input value of the metering module 104 to a preset multiple. In this embodiment, the second pin voltage V2f should be as close to the full scale of the analog-to-digital converter in the metering module 104 as possible and converted to the rated voltage of the battery 30 at a preset multiple (greater than 1) to avoid surge voltage causing the pin voltage of the metering module 104 to be too high and damage the device. For example, the maximum input value of the metering module 104 is 1.04V, and the preset multiple is 3 times. That is, 3 times the rated battery voltage corresponds to the full scale input of the analog-to-digital converter in the metering module 104. Therefore, .
[0142] The pulse constant IMP represents the number of pulses output by metering module 104 for every kWh of electricity consumed by load 40. The time interval between pulses is linearly inversely proportional to the power. Higher power levels increase the speed of the pulse output, while higher pulse speeds also reflect higher power consumption. A pulse is the smallest unit of electrical energy.
[0143] In this embodiment, the pulse constant IMP may satisfy:
[0144] Where Pmin is the minimum power, and Tmin is the preset update time. For example, if the minimum current of battery 30 is 0.1A, Pmin = 12V × 0.1A = 1.2W, and the preset update time is 36s, then IMP = 83333.33, rounded to 83333. This means that each pulse output by metering module 104 represents 1 / 83333 kWh of energy consumed by load 40. This gives the minimum unit of energy output by metering module 104 during the preset update time.
[0145] Optionally, the preset update time can be set differently according to actual needs. In this embodiment, the preset update time is greater than 1s to visually observe the change in electric energy.
[0146] S1102: Determine the minimum unit of electric energy value output by the metering module at a preset update time according to the pulse constant.
[0147] S1103 : Determine an update threshold value of the metering module according to the pin voltage, pulse constant, minimum power of the first sampling terminal group of the metering module, and the amplification factor of the first pin voltage by the metering module.
[0148] Among them, the update threshold value HFConst satisfies:
[0149] ; Wherein, V1f is the first pin voltage, V2f is the second pin voltage, PGA is the amplification factor of the metering module on the first pin voltage, and IMP and HFConst are both integers.
[0150] In this embodiment, since the resistance of the first sampling resistor R1 is relatively small, the voltage V1 across the first sampling resistor R1 is relatively small, that is, the first pin voltage V1f is relatively small. Therefore, the first pin voltage V1f needs to be amplified to meet the linearity input range of the analog-to-digital converter in the metering module 104 to ensure the normal operation of the metering module 104.
[0151] Optionally, Figure 5 A flowchart of a method for determining the amplification factor of the first pin voltage provided by an embodiment of the present invention, referring to Figure 5Based on the above embodiments, the amplification factor PGA of the first pin voltage V1f is determined as follows:
[0152] S210: Determine a first voltage value corresponding to a code value of an analog-to-digital converter within a metering module, and a second voltage value corresponding to a metering accuracy error of the metering module;
[0153] S220 , determining an amplification factor of the first pin voltage according to a ratio of the second voltage value to the first voltage value.
[0154] Specifically, when the minimum value of the load current is 0.1A, the voltage across the first sampling resistor R1 is 0.4mV, that is, the first pin voltage , the second voltage value corresponding to the 0.5% accuracy error of the metering module 104 The maximum input value of the metering module 104 is 1.04V, and its corresponding coding value is , then the first voltage value corresponding to 1 code value ,therefore, According to the calculation formula of the amplification factor PGA of the first pin voltage V1f: , the amplification factor PGA of the first pin voltage V1f can be obtained and rounded to an integer. Wherein, N1 is the number of bits of the coding noise of the analog-to-digital converter, and N2 is the number of bits of the influence of the circuit noise on the coding value. In this embodiment, the maximum coding noise of the analog-to-digital converter inside the metering module 104 has 2 coding bits and 2 coding bits of circuit noise. In order to ensure that the voltage value corresponding to 0.5% can be correctly encoded, it should be Greater than Therefore, it is necessary to amplify the second voltage value Verr corresponding to the 0.5% accuracy error of the metering module 104 by 4 times, that is, amplify the first pin voltage V1f by 4 times. The final input of the analog-to-digital converter is When the load current is rated at 10A, the input of the analog-to-digital converter is 160mV, which is within the pin input range and meets the requirements.
[0155] After obtaining the amplification factor PGA of the first pin voltage V1f, the updated threshold value HFConst can be obtained by substituting it into the calculation formula of the updated threshold value HFConst.
[0156] Figure 6 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 6 Based on the above embodiments, optionally, before step S120, the method further includes:
[0157] S310 : Configure sampling parameters of the first sampling circuit according to the second pin voltage.
[0158] Among them, combined Figure 4 The sampling parameters of the first sampling circuit 103 are the resistance values of the resistors inside the first sampling circuit 103 .
[0159] In this embodiment, the second voltage-dividing resistor R2P2 is one thousandth of the input impedance of the metering module 104. According to Ohm's law, the resistance value of the first voltage-dividing resistor R2P1 can be obtained as follows: , where 12 is the rated voltage of battery 30, i.e., 12V. The first sampling resistor R1 is used for current sampling and has a relatively low resistance, such as 4mV, to prevent burnout due to high power consumption. The first matching resistor R1P, the second matching resistor R1N, the third matching resistor R2P, and the fourth matching resistor R2N can have the same resistance, for example, all 1KΩ.
[0160] After the first sampling circuit 103 is configured, the power consumption of the load 40 can be measured by the metering module 104. Step S120 specifically includes:
[0161] S1201. Control a metering module to collect power consumption data of a load output by a first sampling circuit in real time; wherein the power consumption data includes current data and first voltage data.
[0162] The first sampling circuit 103 collects power consumption data of the load 40. For example, the first sampling resistor R1 collects current data of the load 40. The metering module 104 obtains the corresponding current data by sampling the voltage V1 across the first sampling resistor R1. The first voltage data of the load 40 is collected via the first voltage-divider resistor R2P1 and the second voltage-divider resistor R2P2. The metering module 104 obtains the voltage at the input of the load 40 by sampling the voltage V2.
[0163] S1202: The control metering module processes the power consumption data collected each time to obtain a power accumulation value.
[0164] Specifically, the metering module 104 stores each sampled value in the corresponding register, such as the V1 voltage in the second register SPL_Ia and the V2 voltage in the first register SPL_Ua. The collected current data and the first voltage data are multiplied to obtain the instantaneous power of the load 40. The instantaneous power obtained each time is then accumulated in the power accumulation register Hreg_a to obtain the accumulated power value.
[0165] S1203: When the power accumulation value is greater than the update threshold value of the metering module, control the metering module to increase the first metering value output by 1, and subtract the update threshold value from the current power accumulation value, and perform metering in a loop.
[0166] Specifically, when the value in the power accumulation register Hreg_a is greater than the update threshold value HFConst, the value of the electric energy register EnergyPos_Pa in the metering module 104 is increased by 1, that is, the first metering value output by the metering module 104 is increased by 1, and the value in the current power accumulation register is subtracted from the update threshold value HFConst, and metering is continued, and this cycle is repeated.
[0167] Optionally, in this embodiment, the first measurement value is measured using the minimum unit of electric energy value as a reference value, so that the electric energy register can be updated at appropriate time intervals to timely display the electric energy consumed by the load 40.
[0168] Figure 7 This is a schematic diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention, referring to Figure 7 Based on the above embodiments, optionally, there may be multiple loads 40, each corresponding to a first sampling circuit 103. For example, there are two loads 40, namely a first load 401 and a second load 402, and two first sampling circuits 103, namely a first first sampling circuit 1031 and a second first sampling circuit 1032. The connection relationship between the first first sampling circuit 1031 and the first load 401 is as described in the above embodiments. The second first sampling circuit 1032 includes a second sampling resistor R3, a seventh voltage-dividing resistor R4P1, and an eighth voltage-dividing resistor R4P2. The first end of the second sampling resistor R3 is connected to the output end of the discharge control module 102, the second end of the second sampling resistor R3 is connected to the first end of the second load 402, and the second end of the second load 402 is grounded. The first end of the seventh voltage-dividing resistor R4P1 is connected to the first end of the second load 402, the second end of the seventh voltage-dividing resistor R4P1 is connected to the first end of the eighth voltage-dividing resistor R4P2, and the second end of the second voltage-dividing resistor R2P2 is connected to the second end of the second load 402.
[0169] The third sampling terminal group of the metering module 104 includes a first terminal V3P, a second terminal V3N, a third terminal V4P, and a fourth terminal V4N. The second first sampling circuit 1032 also includes a ninth matching resistor R3P, a tenth matching resistor R3N, an eleventh matching resistor R4P, and a twelfth matching resistor R4N. The first end of the second sampling resistor R3 is connected to the first terminal V3P of the third sampling terminal group via the ninth matching resistor R3P, the second end of the second sampling resistor R2 is connected to the second terminal V3N of the third sampling terminal group via the tenth matching resistor R3N, the second end of the seventh voltage-dividing resistor R4P1 is connected to the third terminal V4P of the third sampling terminal group via the eleventh matching resistor R4P, and the second end of the eighth voltage-dividing resistor R4P2 is connected to the fourth terminal V4N of the third sampling terminal group via the twelfth matching resistor R4N.
[0170] The methods for measuring the electric energy consumed by each load 40 may be the same as those described in the above embodiments, and will not be described in detail.
[0171] Figure 8 This is a schematic diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention, referring to Figure 8 Based on the above embodiments, optionally, the photovoltaic charge and discharge controller 10 further includes a charging control module 101 and a second sampling circuit 106, wherein the input end of the charging control module 101 is connected to the output end of the photovoltaic panel 20, the output end of the charging control module 101 is connected to the battery 30, the input end of the second sampling circuit 106 is connected to the output end of the photovoltaic panel 20, and the output end of the second sampling circuit 106 is connected to the second sampling end group of the metering module 104.
[0172] Figure 9 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 9 Based on the above embodiments, optionally, the photovoltaic charge and discharge data measurement method provided in this embodiment further includes:
[0173] S410 : Control the metering module to measure data received by its own second sampling end group according to the updated threshold value to obtain a second measurement value.
[0174] S420: Determine the amount of light received by the photovoltaic panel according to the second measurement value.
[0175] Specifically, the second sampling circuit 106 is used to sample the output voltage of the photovoltaic panel 20. The amplitude of the output voltage of the photovoltaic panel 20 reflects the amount of solar energy received by the photovoltaic panel 20. The second sampling terminal group of the metering module 104 is connected to the second sampling circuit 106. The second sampling terminal group of the metering module 104 receives the data collected by the second sampling circuit 106 and obtains a second metering value. When the change in the data detected by the second sampling terminal group reaches an update threshold, the second metering value is updated. Based on a preset update time, the second metering value can be used to obtain the amount of nanolight from the photovoltaic panel 20 collected by the metering module 104 during the preset update time.
[0176] It should be noted that the amount of nanolight is a cumulative value, representing the integral of the output voltage of the photovoltaic panel 20 over time. The amount of light received by the photovoltaic panel 20 is affected by factors such as installation angle, installation method, installation environment, climate conditions, usage, and product model. By measuring the amount of nanolight received by the photovoltaic panel 20, we can accurately assess the impact of these factors on the panel's light reception. This allows us to adjust these factors to increase the amount of nanolight received and improve solar energy utilization.
[0177] Figure 10 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 10 Based on the above embodiments, optionally, before step S410, the method further includes:
[0178] S510. Determine a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of a first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to a reference voltage output by the metering module.
[0179] S520 : Configure sampling parameters of the second sampling circuit according to the third pin voltage and the fourth pin voltage.
[0180] Specifically, Figure 11 This is a schematic diagram of another photovoltaic charge and discharge controller provided by an embodiment of the present invention, referring to Figure 11 The second sampling circuit 106 includes a third voltage-dividing resistor R5P1, a fourth voltage-dividing resistor R5P2, a fifth voltage-dividing resistor RE1, and a sixth voltage-dividing resistor RE2. A first end of the third voltage-dividing resistor R5P1 is connected to the output end of the photovoltaic panel 20, a second end of the third voltage-dividing resistor R5P1 is connected to the first end of the fourth voltage-dividing resistor R5P2, a second end of the fourth voltage-dividing resistor R5P2 is connected to the second end of the photovoltaic panel 20, and the second end of the photovoltaic panel 20 is grounded. A first end of the fifth voltage-dividing resistor RE1 is connected to the metering module 104, a second end of the fifth voltage-dividing resistor RE1 is connected to the first end of the sixth voltage-dividing resistor RE2, and a second end of the sixth voltage-dividing resistor RE2 is grounded.
[0181] The second sampling end group of the metering module 104 includes a first end V5P, a second end V5N, a third end V6P, and a fourth end V6N. The second sampling circuit 106 also includes a fifth matching resistor R5P, a sixth matching resistor R5N, a seventh matching resistor R6P, and an eighth matching resistor R6N. The second end of the third voltage-dividing resistor R5P1 is connected to the first end V5P of the second sampling end group via the fifth matching resistor R5P, the second end of the fourth voltage-dividing resistor R5P2 is connected to the second end V5N of the second sampling end group via the sixth matching resistor R5N, the second end of the fifth voltage-dividing resistor RE1 is connected to the third end V6P of the second sampling end group via the seventh matching resistor R6P, and the second end of the sixth voltage-dividing resistor RE2 is connected to the fourth end V6N of the second sampling end group via the eighth matching resistor R6N.
[0182] In this embodiment, the range of the third pin voltage is the same as the rated value of V1. The output voltage of the photovoltaic panel 20 used with the 12V battery 30 is not greater than 24V. The pin voltage of the second sampling terminal group of the metering module 104 is the pin voltage when the photovoltaic panel 20 outputs 2 times the rated voltage of the battery, that is, the corresponding value of V5, and V5 at this time is recorded as the third pin voltage V5f. That is, when the photovoltaic panel 20 outputs a voltage of 24V, the third pin voltage .
[0183] V6 is obtained from the reference voltage Vref output by the metering module 104 and is a fixed value. Therefore, the corresponding fourth pin voltage V6f may be the same as the second pin voltage V2f.
[0184] After obtaining the third pin voltage V5f and the fourth pin voltage V6f, the voltage divider resistors in the second sampling circuit 106 can be configured according to the third pin voltage V5f and the fourth pin voltage V6f. The resistance of the fourth voltage divider resistor R5P2 is one thousandth of the input impedance of the metering module 104. According to Ohm's law, the resistance of the third voltage divider resistor R5P1 can be calculated. Here, The resistance of the sixth voltage-dividing resistor RE2 is also one thousandth of the input impedance of the metering module 104. According to Ohm's law, the resistance of the fifth voltage-dividing resistor RE1 can be calculated. Here, .
[0185] Optionally, the main control module 105 configures the register of the metering module 104 receiving the third pin voltage V5f to amplify by 1 times.
[0186] Optionally, continue to refer to Figure 10 , step S410 specifically includes:
[0187] S4101. Control the metering module to collect second voltage data output by the second sampling circuit in real time.
[0188] S4102: Control the metering module to process the second voltage data collected each time to obtain a voltage accumulation value.
[0189] S4103: When the voltage accumulated value is greater than the update threshold value of the metering module, the second metering value output by the metering module is controlled to increase by 1, and the update threshold value is subtracted from the current voltage accumulated value, and the metering is cyclically performed.
[0190] Specifically, the second voltage data includes the output voltage of the photovoltaic panel 20 and the reference voltage Vref output by the metering module 104. For example, the output voltage of the photovoltaic panel 20 is collected through the third voltage-dividing resistor R5P1 and the fourth voltage-dividing resistor R5P2, and the reference voltage Vref is collected through the fifth voltage-dividing resistor RE1 and the sixth voltage-dividing resistor RE2. The metering module 104 can obtain the output voltage of the photovoltaic panel 20 and the reference voltage output by the metering module 104 by collecting the voltages V5 and V6.
[0191] Metering module 104 stores each sampled value in the corresponding register. For example, the voltage V5 is stored in register SPL_Ic, and the voltage V6 is stored in register SPL_Uc. The collected sampled values are processed (e.g., multiplied by V5 and V6) to obtain the corresponding instantaneous voltage accumulation value. Each accumulated instantaneous voltage value is then added to the corresponding register. When this accumulated voltage value exceeds the update threshold value of metering module 104, the value of energy register EnergyPos_Pc within metering module 104 is incremented by 1. This means that the second measurement value output by the metering module is incremented by 1. Metering continues after the update threshold value is subtracted from the current accumulated voltage value. This cycle repeats.
[0192] It should be noted that, since V6 is a fixed value, the value of the energy register EnergyPos_Pc used to accumulate the voltage accumulated value is only linearly proportional to the voltage of V5, that is, proportional to the amount of solar energy received by the photovoltaic panel 20.
[0193] Step S420 specifically includes:
[0194] S4201: Determine the amount of light received by the photovoltaic panel according to the ratio of the second measurement value to the voltage of the fourth pin.
[0195] Specifically, since the V5 voltage reflects the amount of solar energy received by the photovoltaic panel 20, the amount of light received by the photovoltaic panel 20 can be determined by the ratio of the second measurement value to the fourth pin voltage V6f, that is, the integral of the V5 voltage over time is obtained, and its unit is Vh.
[0196] After step S420, the method further includes:
[0197] S530: Control the main control module to periodically read the second measurement value, accumulate the ratio of the second measurement value to the voltage of the fourth pin, and store the accumulated value of the ratio of the second measurement value to the voltage of the fourth pin at a continuous address every first preset time interval.
[0198] Specifically, the main control module 105 periodically reads the second measurement value output by the measurement module 104 and accumulates the second measurement value into its internal register. Based on its own clock calendar, the main control module 105 stores the accumulated ratio of the second measurement value to the voltage V6f on the fourth pin at first predetermined intervals in consecutive addresses, thereby obtaining the amount of nanolight at different times of the day. For example, the accumulated ratio of the second measurement value to the voltage V6f on the fourth pin is stored every hour, with 24 values stored per day, or 400 × 24 values stored per year, and this cycle continues.
[0199] In this embodiment, the amount of light received is a cumulative value and does not reflect the amount of light energy converted within a specific time period. For 400 × 24 fixed values, the value at midnight of each day is subtracted from the value at midnight of the previous day to obtain the total amount of light received within the previous day. Repeating this process yields 399 daily light received values. The date corresponding to the maximum value among these 399 values is the day with the highest amount of light received. In this way, if the values at midnight on each day of each month are used, the month with the highest amount of light received can be calculated. If the interval is set to a few hours, the time period of a given day with the highest amount of light received can be determined.
[0200] Figure 12 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 12 Based on the above embodiments, optionally, before controlling the metering module 104 to perform metering, the photovoltaic charge and discharge data measurement method further includes:
[0201] S610: Calibrate gains corresponding to sampling end groups and updated threshold values of a metering module based on a reference source.
[0202] The reference source is connected to the photovoltaic charge and discharge controller.
[0203] Specifically, according to the descriptions in the aforementioned embodiments, the update threshold corresponds to one energy pulse and depends on the battery's rated voltage, minimum current, first pin voltage V1f, and second pin voltage V2f. Due to the discrete nature of the resistor, the voltage input to the pin of metering module 104 is not a theoretical value. Consequently, the digital code output by the analog-to-digital converter is also not an ideal value. A larger digital code lengthens the pulse interval, while a smaller digital code shortens it. Furthermore, when calculating the update threshold HFConst, decimal places are discarded, so errors caused by these decimal places need to be corrected.
[0204] Each channel's sampling value of the analog-to-digital converter within the metering module 104 is equipped with a gain register, which allows the sampling value to be linearly increased or decreased to obtain the ideal sampling value. The default gain is 1 and remains unchanged. Therefore, before measuring the charge and discharge data, a reference source is required to calibrate the gain of each channel to reduce deviations.
[0205] Optionally, during gain calibration, the photovoltaic charge and discharge controller is connected only to the reference source. The positive terminal of the first power source of the reference source is connected to the input of the charging control module 101, and the negative terminal of the first power source is grounded. The positive terminal of the second power source is connected to the output of the charging control module 101 and the input of the discharge control module 102, and the negative terminal of the second power source is grounded. A precision resistor is connected to the output of the first sampling circuit 103. Both the first and second power sources are configured to output 12V, and the metering module 104 is configured to amplify the voltage V1f at the first pin by 4 times.
[0206] Figure 13 A flow chart of a gain calibration method provided by an embodiment of the present invention, referring to Figure 13 Based on the above embodiments, optionally, a method for calibrating the gain corresponding to the first sampling end group of the metering module 104 includes:
[0207] S6101: Control the charging control module to turn off, control the discharging control module to turn on, and obtain a first current value output by a reference source.
[0208] The charging control module 101 is turned off, the discharging control module 102 is turned on, and the reference source supplies power to the load 40 via the discharging control module 102. A first current value I1 output by the second power supply of the reference source is obtained.
[0209] S6102: Determine an ideal value of a first register within the metering module based on the first current value and the pin voltage of the first sampling terminal group of the metering module, and calculate an ideal value of a second register within the metering module based on the first current value and the minimum current value of the battery; wherein the first register is used to store output voltage data of the discharge control module, and the second register is used to store output current data of the discharge control module.
[0210] Among them, the ideal value of the first register SPL_Ua , the ideal value of the second register SPL_Ia .
[0211] S6103: Obtain actual values of the first register and the second register respectively according to preset rules.
[0212] The actual value SPL_Ua2 of the first register SPL_Ua and the actual value SPL_Ia2 of the second register SPL_Ia can be read by the main control module 105 .
[0213] Optionally, the preset rule may be:
[0214] The actual value SPL_Ua2 of the first register SPL_Ua and the actual value SPL_Ia2 of the second register SPL_Ia are obtained N times in a row at intervals of a first preset time. The n maximum values and n minimum values are removed from the N actual values SPL_Ua2 of the first register SPL_Ua, and the average value of the N-2n actual values SPL_Ua2 of the first register SPL_Ua is calculated. Furthermore, the n maximum values and n minimum values are removed from the N actual values SPL_Ia2 of the second register SPL_Ia, and the average value of the N-2n actual values SPL_Ia of the second register SPL_Ia is calculated. The average value of the N-2n actual values is used as the final actual value. Wherein, N is an integer greater than or equal to 10, and n is a positive integer less than or equal to 2. For example, if the first preset time is 1 second, N=20, and n=2.
[0215] S6104. Perform floating-point operations on the ideal value and actual value of the first register and the ideal value and actual value of the second register to determine the gain corresponding to the first sampling end group of the metering module, and write the obtained gain into the gain register corresponding to the first register and the gain register corresponding to the second register.
[0216] Specifically, a floating point operation is performed on the average of the ideal value SPL_Ua1 and the actual value SPL_Ua2 of the first register SPL_Ua. , convert the operation result into a 32-bit signed first integer, and take the lower 2 bytes of the hexadecimal system of the first integer and write them into the gain register Gain_Va corresponding to the first register SPL_Ua.
[0217] Perform floating-point calculation on the average of the ideal value SPL_Ia1 and the actual value SPL_Ia2 of the second register SPL_Ia , convert the operation result into a 32-bit signed second integer, and take the lower 2 bytes of the hexadecimal system of the second integer and write them into the gain register Gain_Ia corresponding to the second register SPL_Ia.
[0218] S6105. Based on the updated gain, obtain the actual values of the first register and the second register respectively, and compare the difference between the actual value and the ideal value of the first register and the difference between the actual value and the ideal value of the second register to see whether they are less than the first preset value.
[0219] Specifically, the actual value SPL_Ua2 of the first register SPL_Ua and the actual value SPL_Ia2 of the second register SPL_Ia are read again, and the actual value SPL_Ua2 of the first register SPL_Ua and the ideal value SPL_Ua1 are compared to see whether the difference is less than a first preset value, and the actual value SPL_Ia2 of the second register SPL_Ia and the ideal value SPL_Ia1 is less than a first preset value, where the first preset value is ±0.2%.
[0220] S6106: If yes, write the gain updated last time into the gain register corresponding to the first register and the gain register corresponding to the second register.
[0221] S6107: If not, continue updating the gain corresponding to the first sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is smaller than the first preset value.
[0222] Figure 14 A flowchart of another gain calibration method provided by an embodiment of the present invention is provided. Figure 14 Based on the above embodiments, optionally, a method for calibrating the gain corresponding to the second sampling end group of the metering module 104 includes:
[0223] S6111. Control the discharge control module to be turned off, control the charge control module to be turned on, and determine the ideal value of the third register and the ideal value of the fourth register in the metering module based on the pin voltage of the second sampling terminal group of the metering module; wherein the third register is used to store the output voltage data of the photovoltaic panel, and the fourth register is used to store the reference voltage data output by the metering module.
[0224] Among them, the ideal value of the third register SPL_Ic , the ideal value of the fourth register SPL_Uc .
[0225] S6112. Obtain actual values of the third register and the fourth register respectively according to preset rules.
[0226] S6113. Perform floating-point operations on the ideal value and actual value of the third register and the ideal value and actual value of the fourth register to determine the gain corresponding to the second sampling end group of the metering module, and write the obtained gain into the gain register corresponding to the third register and the gain register corresponding to the fourth register.
[0227] S6114. Based on the updated gain, obtain the actual values of the third register and the fourth register respectively, and compare the difference between the actual value and the ideal value of the third register and the difference between the actual value and the ideal value of the fourth register to see whether they are less than the second preset value.
[0228] S6115: If yes, write the gain updated last time into the gain register corresponding to the third register and the gain register corresponding to the fourth register.
[0229] S6116: If not, continue updating the gain corresponding to the second sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is smaller than the second preset value.
[0230] Here, the specific working process of steps S6112-S6116 can refer to steps S6103-S6107 in the above embodiment, and will not be repeated here.
[0231] Optionally, the method for calibrating the gain corresponding to the update threshold value HFConst includes: performing floating-point operations on the theoretical value and the usage value of the update threshold value, converting the operation result into a 32-bit signed third integer, and taking the 16-bit value of the third integer and writing it into the gain register corresponding to the update threshold value.
[0232] The used value of the updated threshold value HFConst is an integer of the theoretical value.
[0233] It should be noted that the first sampling terminal group and the second sampling terminal group of the metering module 104 share the same update threshold value HFConst, so the values of the gain registers corresponding to the two are also the same.
[0234] The technical solution provided in this embodiment can achieve a data measurement accuracy of less than 0.3% during production and processing and a data measurement accuracy of less than 0.5% during actual on-site operation by correcting errors before measurement, thereby greatly improving measurement accuracy.
[0235] Figure 15 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 15 , the photovoltaic charge and discharge data measurement method includes:
[0236] S710: Determine an update threshold value for measurement by a measurement module based on a minimum power of the battery at a rated voltage.
[0237] S720: Control the metering module to measure the data received by the second sampling end group according to the updated threshold value to obtain a second measurement value.
[0238] S730: Determine the amount of light received by the photovoltaic panel according to the second measurement value.
[0239] The technical solution provided by the embodiment of the present invention can accurately evaluate the degree of influence of these influencing factors on the light received by the photovoltaic panel 20 by measuring the amount of light received by the photovoltaic panel 20, and thereby adjust the relevant factors to increase the amount of light received and improve the utilization rate of solar energy.
[0240] Figure 16 This is a flowchart of another photovoltaic charge and discharge data measurement method provided by an embodiment of the present invention, referring to Figure 16 Based on the above embodiment, optionally, the photovoltaic charge and discharge data measurement method includes:
[0241] S710: Determine an update threshold value for measurement by a measurement module based on a minimum power of the battery at a rated voltage.
[0242] S810. Determine a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of a first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to a reference voltage output by the metering module.
[0243] S820: Configure sampling parameters of the second sampling circuit according to the third pin voltage and the fourth pin voltage.
[0244] S7201. Control the metering module to collect second voltage data output by the second sampling circuit in real time.
[0245] S7202: Control the metering module to process the second voltage data collected each time to obtain a voltage accumulation value.
[0246] S7203: When the voltage accumulated value is greater than the update threshold value of the metering module, control the metering module to output a second metering value plus 1, and subtract the update threshold value from the current voltage accumulated value, and then perform metering in a loop.
[0247] S730: Determine the amount of light received by the photovoltaic panel according to the second measurement value.
[0248] Specifically, Figure 16 The specific working process of the method shown can refer to the relevant descriptions in the above embodiments, and has the same beneficial effects, so it will not be repeated here.
[0249] Optionally, the embodiment of the present invention further provides a photovoltaic charge and discharge controller, the specific structure of which can be referred to Figure 4 、 Figure 7 and Figure 11 The structure shown has the same working process and beneficial effects, which will not be described here in detail.
[0250] Optionally, continue to refer to Figure 11The photovoltaic charge and discharge controller provided in this embodiment also includes a display screen 111, a switch unit 112 and a clock unit 113, wherein the display screen 111 is used to display measurement data and operating parameters, the switch unit 112 is used to set operating parameters and switch displays, and the clock unit 113 is used to provide real-time calendar time for the main control module 105.
[0251] Optionally, the charging control module 101 can charge the battery 30 according to a certain control mode, such as a fast charging mode, a floating charging mode, etc. The battery 30 can be a storage battery. The discharge control module 102 can provide current to the load 40 according to a certain control mode, such as an overload protection mode, a short circuit protection mode, an overheating protection mode, etc.
[0252] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0253] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A photovoltaic charge and discharge data measurement method, performed by a photovoltaic charge and discharge controller, wherein the photovoltaic charge and discharge controller is used to control the photovoltaic panel to charge the battery and control the battery to discharge the load; characterized in that: The photovoltaic charge and discharge controller includes: a discharge control module, a first sampling circuit, a metering module and a main control module, wherein the input end of the discharge control module is connected to the battery, the output end of the discharge control module is connected to the load via the first sampling circuit, the output end of the first sampling circuit is connected to the first sampling end group of the metering module, and the main control module is connected to the metering module; The photovoltaic charge and discharge data measurement method includes: Determining, based on the minimum power of the battery at the rated voltage, a minimum unit of electric energy value output by the metering module at a preset update time and an update threshold value measured by the metering module; controlling the metering module to measure the data received by the first sampling end group thereof according to the update threshold value to obtain a first measurement value; Periodically reading the first measurement value and accumulating the first measurement value, storing the accumulated value of the first measurement value in consecutive addresses of the main control module at intervals of a first preset time, and determining the electric energy consumed by the load based on the first measurement value and the electric energy value of the minimum unit; The photovoltaic charge and discharge controller further includes a charging control module and a second sampling circuit, wherein the input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, and the output end of the second sampling circuit is connected to the second sampling end group of the metering module; The photovoltaic charge and discharge data measurement method further includes: Controlling the metering module to measure the data received by the second sampling end group thereof according to the update threshold value to obtain a second measurement value; The amount of light received by the photovoltaic panel is determined according to the second measurement value.
2. The photovoltaic charge and discharge data measurement method according to claim 1, characterized in that: The step of determining the minimum unit of electric energy output by the metering module at a preset update time and the update threshold value measured by the metering module based on the minimum power of the battery at the rated voltage includes: Based on the minimum power, determining the pin voltage of the first sampling terminal group of the metering module and the pulse constant of the metering module at the preset update time; wherein the pin voltage of the first sampling terminal group of the metering module includes a first pin voltage corresponding to the current of the load and a second pin voltage corresponding to the voltage of the load; Determining the minimum unit of electric energy value output by the metering module at the preset update time according to the pulse constant; The update threshold value of the metering module is determined according to the pin voltage of the first sampling terminal group of the metering module, the pulse constant, the minimum power, and the amplification factor of the first pin voltage by the metering module.
3. The photovoltaic charge and discharge data measurement method according to claim 2, characterized in that: The pulse constant satisfies: ; Wherein, IMP is the pulse constant, Pmin is the minimum power, and Tmin is the preset update time; The update threshold value satisfies: ; Wherein, HFConst is the update threshold value, V1f is the first pin voltage, V2f is the second pin voltage, PGA is the amplification factor of the first pin voltage by the metering module, and IMP and HFConst are both integers.
4. The photovoltaic charge and discharge data measurement method according to claim 2, characterized in that: The voltage of the second pin is equal to the ratio of the maximum input value of the metering module to a preset multiple; The preset multiple of the rated voltage of the battery is the input full scale of the analog-to-digital converter in the metering module.
5. The photovoltaic charge and discharge data measurement method according to claim 2, characterized in that: The amplification factor of the first pin voltage is determined as follows: Determine a first voltage value corresponding to a code value of an analog-to-digital converter within the metering module, and a second voltage value corresponding to a metering accuracy error of the metering module; determining an amplification factor of the first pin voltage according to a ratio of the second voltage value to the first voltage value; The amplification factor of the first pin voltage satisfies: , N1 is the number of bits of the coding noise of the analog-to-digital converter, N2 is the number of bits affected by the circuit noise on the coding value, Verr is the second voltage value, V1sb is the first voltage value, and PGA is an integer.
6. The photovoltaic charge and discharge data measurement method according to claim 2, characterized in that: Before obtaining the first measurement value, the photovoltaic charge and discharge data measurement method further includes: configuring sampling parameters of the first sampling circuit according to the second pin voltage; The step of controlling the metering module to meter the data received by the first sampling end group according to the updated threshold value to obtain a first metering value includes: Controlling the metering module to collect power consumption data of the load output by the first sampling circuit in real time; wherein the power consumption data includes current data and first voltage data; Controlling the metering module to process the power consumption data collected each time to obtain a power accumulation value; When the power accumulation value is greater than the update threshold value of the metering module, the first metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current power accumulation value.
7. The photovoltaic charge and discharge data measurement method according to claim 6, characterized in that: The determining, according to the first measurement value and the minimum unit electric energy value, the electric energy consumed by the load includes: The electric energy consumed by the load is determined according to the product of the first measurement value and the electric energy value of the minimum unit.
8. The photovoltaic charge and discharge data measurement method according to claim 1, characterized in that: Before obtaining the second measurement value, the photovoltaic charge and discharge data measurement method further includes: Determining a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of the first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to the reference voltage output by the metering module; configuring sampling parameters of the second sampling circuit according to the third pin voltage and the fourth pin voltage; Controlling the metering module to measure the data received by the second sampling end group thereof according to the updated threshold value to obtain the second metering value includes: Controlling the metering module to collect the second voltage data output by the second sampling circuit in real time; controlling the metering module to process the second voltage data collected each time to obtain a voltage accumulation value; When the voltage accumulation value is greater than the update threshold value of the metering module, the second metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current voltage accumulation value.
9. The photovoltaic charge and discharge data measurement method according to claim 8, characterized in that: Determining the amount of light received by the photovoltaic panel according to the second measurement value includes: determining the amount of light received by the photovoltaic panel according to a ratio of the second measurement value to the voltage of the fourth pin; The photovoltaic charge and discharge data measurement method further includes: The main control module is controlled to periodically read the second measurement value, and accumulate the ratio of the second measurement value to the fourth pin voltage, and store the accumulated value of the ratio of the second measurement value to the fourth pin voltage in a continuous address every first preset time interval.
10. The photovoltaic charge and discharge data measurement method according to claim 8, characterized in that: Before controlling the metering module to perform metering, the photovoltaic charge and discharge data measurement method further includes: Calibrate the gains corresponding to the sampling end groups and the updated threshold values of the metering module based on a reference source; Wherein, the reference source is connected to the photovoltaic charge and discharge controller.
11. The photovoltaic charge and discharge data measurement method according to claim 10, characterized in that: The method for calibrating the gain corresponding to the first sampling end group of the metering module includes: Controlling the charging control module to turn off, controlling the discharging control module to turn on, and obtaining a first current value output by a reference source; determining an ideal value of a first register in the metering module based on the first current value and the pin voltage of the first sampling terminal group of the metering module, and calculating an ideal value of a second register in the metering module based on the first current value and the minimum current value of the battery; wherein the first register is used to store output voltage data of the discharge control module, and the second register is used to store output current data of the discharge control module; Obtaining actual values of the first register and the second register respectively according to preset rules; Performing floating-point operations on the ideal value and actual value of the first register and the ideal value and actual value of the second register respectively to determine the gain corresponding to the first sampling end group of the metering module, and writing the obtained gain to the gain register corresponding to the first register and the gain register corresponding to the second register; Based on the updated gains, respectively obtaining actual values of the first register and the second register, and respectively comparing differences between the actual value and the ideal value of the first register and between the actual value and the ideal value of the second register to determine whether they are less than a first preset value; If yes, the last updated gain is written to the gain register corresponding to the first register and the gain register corresponding to the second register; If not, continue to update the gain corresponding to the first sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is less than the first preset value; The obtaining the actual values of the first register and the second register respectively according to a preset rule includes: Obtaining the actual value of the first register and the actual value of the second register respectively N times continuously at a first preset time interval; Remove n maximum values and n minimum values from the N actual values of the first registers, and calculate an average value of the N-2n actual values of the first registers; and remove n maximum values and n minimum values from the N actual values of the second registers, and calculate an average value of the N-2n actual values of the second registers; The performing floating-point operations on the ideal value and actual value of the first register and the ideal value and actual value of the second register to determine the gain corresponding to the first sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the first register and the gain register corresponding to the second register includes: Performing a floating-point operation on the average of the ideal value and the actual value of the first register, converting the operation result into a first 32-bit signed integer, and taking the lower two bytes of the hexadecimal value of the first integer and writing it into a gain register corresponding to the first register; Performing a floating-point operation on the average of the ideal value and the actual value of the second register, converting the operation result into a second 32-bit signed integer, and taking the lower two bytes of the hexadecimal representation of the second integer and writing them into a gain register corresponding to the second register; The first preset value is ±0.2%, N is an integer greater than or equal to 10, and n is a positive integer less than or equal to 2.
12. The photovoltaic charge and discharge data measurement method according to claim 11, characterized in that: The method for calibrating the gain corresponding to the second sampling end group of the metering module includes: Controlling the discharge control module to be turned off and controlling the charge control module to be turned on, and determining the ideal value of a third register and an ideal value of a fourth register within the metering module according to the pin voltage of the second sampling terminal group of the metering module; wherein the third register is used to store the output voltage data of the photovoltaic panel, and the fourth register is used to store the reference voltage data output by the metering module; Obtaining actual values of the third register and the fourth register respectively according to preset rules; performing floating-point operations on the ideal value and the actual value of the third register and the ideal value and the actual value of the fourth register, respectively, to determine the gain corresponding to the second sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the third register and the gain register corresponding to the fourth register; Based on the updated gains, respectively obtaining actual values of the third register and the fourth register, and respectively comparing differences between the actual value and the ideal value of the third register and the actual value and the ideal value of the fourth register to determine whether they are less than a second preset value; If yes, the gain updated last time is written into the gain register corresponding to the third register and the gain register corresponding to the fourth register; If not, continue to update the gain corresponding to the second sampling end group of the metering module until the difference between the corresponding actual value and the ideal value is less than the second preset value; The obtaining of the actual values of the third register and the fourth register according to a preset rule includes: Obtaining the actual value of the third register and the actual value of the fourth register respectively N times continuously at intervals of a second preset time; removing n maximum values and n minimum values from the N actual values of the third registers, and calculating an average value of the N-2n actual values of the third registers; and removing n maximum values and n minimum values from the N actual values of the fourth registers, and calculating an average value of the N-2n actual values of the fourth registers; The performing floating-point operations on the ideal value and the actual value of the third register and the ideal value and the actual value of the fourth register to determine the gain corresponding to the second sampling end group of the metering module, and writing the obtained gain into the gain register corresponding to the third register and the gain register corresponding to the fourth register includes: Performing a floating-point operation on the average of the ideal value and the actual value of the third register, converting the operation result into a 32-bit signed third integer, and taking the lower two bytes of the hexadecimal system of the third integer and writing them into a gain register corresponding to the third register; performing a floating-point operation on an average of an ideal value and an actual value of the fourth register, converting the operation result into a 32-bit signed fourth integer, and taking the lower two bytes of the hexadecimal representation of the second integer and writing them into a gain register corresponding to the fourth register; The second preset value is ±0.2%, N is an integer greater than or equal to 10, and n is a positive integer less than or equal to 2.
13. The photovoltaic charge and discharge data measurement method according to claim 11, characterized in that: The method for calibrating the gain corresponding to the update threshold value includes: Perform floating-point operation on the theoretical value and the usage value of the update threshold value, convert the operation result into a 32-bit signed third integer, and take the 16-bit value of the third integer and write it into the gain register corresponding to the update threshold value.
14. A photovoltaic charge and discharge data measurement method, characterized in that: Executed by a photovoltaic charge and discharge controller, the photovoltaic charge and discharge controller is used to control the photovoltaic panel to charge the battery, and control the battery to discharge the load; characterized in that the photovoltaic charge and discharge controller includes: a charging control module, a second sampling circuit, a metering module and a main control module, the input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, the output end of the second sampling circuit is connected to the second sampling end group of the metering module, and the main control module is connected to the metering module; The photovoltaic charge and discharge data measurement method includes: determining, based on the minimum power of the battery at the rated voltage, an update threshold value for measurement by the measurement module; Controlling the metering module to measure the data received by the second sampling end group thereof according to the update threshold value to obtain a second measurement value; The amount of light received by the photovoltaic panel is determined according to the second measurement value.
15. The photovoltaic charge and discharge data measurement method according to claim 14, characterized in that: The photovoltaic charge and discharge controller further includes a discharge control module and a first sampling circuit, wherein the input end of the discharge control module is connected to the battery, the output end of the discharge control module is connected to the load, the input end of the first sampling circuit is connected to the output end of the discharge control module, and the output end of the first sampling circuit is connected to the first sampling end group of the metering module; Before obtaining the second measurement value, the photovoltaic charge and discharge data measurement method further includes: Determining a pin voltage of a second sampling terminal group of the metering module based on the rated voltage and rated current of the battery and in combination with a pin voltage of the first sampling terminal group of the metering module; wherein the pin voltage of the second sampling terminal group of the metering module includes a third pin voltage corresponding to the output voltage of the photovoltaic panel and a fourth pin voltage corresponding to the reference voltage output by the metering module; The sampling parameters of the second sampling circuit are configured according to the third pin voltage and the fourth pin voltage.
16. The photovoltaic charge and discharge data measurement method according to claim 15, characterized in that: Controlling the metering module to measure the data received by the second sampling end group thereof according to the updated threshold value to obtain the second metering value includes: Controlling the metering module to collect the second voltage data output by the second sampling circuit in real time; controlling the metering module to process the second voltage data collected each time to obtain a voltage accumulation value; When the voltage accumulation value is greater than the update threshold value of the metering module, the second metering value output by the metering module is controlled to increase by 1, and the metering is cyclically performed after the update threshold value is subtracted from the current voltage accumulation value.
17. A photovoltaic charge and discharge controller, characterized in that: Used to perform the photovoltaic charge and discharge data measurement method according to any one of claims 1 to 16; The photovoltaic charge and discharge controller includes a charging control module, a discharging control module, a first sampling circuit, a second sampling circuit, a metering module and a main control module. The input end of the charging control module is connected to the output end of the photovoltaic panel, the output end of the charging control module is connected to the battery, the input end of the discharging control module is connected to the battery, the output end of the discharging control module is connected to the load, the input end of the first sampling circuit is connected to the output end of the discharging control module, the output end of the first sampling circuit is connected to the first sampling end group of the metering module, the input end of the second sampling circuit is connected to the output end of the photovoltaic panel, the output end of the second sampling circuit is connected to the second sampling end group of the metering module, and the main control module is connected to the metering module; The main control module is used to determine the minimum unit of electric energy value output by the metering module at a preset update time and the update threshold value measured by the metering module based on the minimum power of the battery at the rated voltage, and use the minimum unit of electric energy value as a reference value. According to the update threshold value, the main control module is used to control the metering module to measure the data received by its first sampling end group to obtain a first measurement value, and to determine the electric energy consumed by the load according to the first measurement value and the minimum unit of electric energy value; the main control module is also used to control the metering module to measure the data received by its second sampling end group to obtain a second measurement value according to the update threshold value, and to determine the amount of light received by the photovoltaic panel according to the second measurement value.
18. The photovoltaic charge and discharge controller according to claim 17, characterized in that: The first sampling circuit includes a first sampling resistor, a first voltage-dividing resistor, and a second voltage-dividing resistor, wherein a first end of the first sampling resistor is connected to the output end of the discharge control module, a second end of the first sampling resistor is connected to the first end of the load, and a second end of the load is grounded; a first end of the first voltage-dividing resistor is connected to the first end of the load, a second end of the first voltage-dividing resistor is connected to the first end of the second voltage-dividing resistor, and a second end of the second voltage-dividing resistor is connected to the second end of the load; The first sampling terminal group of the metering module includes a first terminal, a second terminal, a third terminal, and a fourth terminal. The first sampling circuit also includes a first matching resistor, a second matching resistor, a third matching resistor, and a fourth matching resistor. The first terminal of the first sampling resistor is connected to the first terminal of the first sampling terminal group via the first matching resistor, the second terminal of the first sampling resistor is connected to the second terminal of the first sampling terminal group via the second matching resistor, the second terminal of the first voltage-dividing resistor is connected to the third terminal of the first sampling terminal group via the third matching resistor, and the second terminal of the second voltage-dividing resistor is connected to the fourth terminal of the first sampling terminal group via the fourth matching resistor. The second sampling circuit includes a third voltage-dividing resistor, a fourth voltage-dividing resistor, a fifth voltage-dividing resistor, and a sixth voltage-dividing resistor, wherein a first end of the third voltage-dividing resistor is connected to the output end of the photovoltaic panel, a second end of the third voltage-dividing resistor is connected to the first end of the fourth voltage-dividing resistor, a second end of the fourth voltage-dividing resistor is connected to the second end of the photovoltaic panel, a second end of the photovoltaic panel is grounded, a first end of the fifth voltage-dividing resistor is connected to the metering module, a second end of the fifth voltage-dividing resistor is connected to the first end of the sixth voltage-dividing resistor, and a second end of the sixth voltage-dividing resistor is grounded; The second sampling end group of the metering module includes a first end, a second end, a third end, and a fourth end. The second sampling circuit also includes a fifth matching resistor, a sixth matching resistor, a seventh matching resistor, and an eighth matching resistor. The second end of the third voltage-dividing resistor is connected to the first end of the second sampling end group via the fifth matching resistor, the second end of the fourth voltage-dividing resistor is connected to the second end of the second sampling end group via the sixth matching resistor, the second end of the fifth voltage-dividing resistor is connected to the third end of the second sampling end group via the seventh matching resistor, and the second end of the sixth voltage-dividing resistor is connected to the fourth end of the second sampling end group via the eighth matching resistor.
19. The photovoltaic charge and discharge controller according to claim 17, characterized in that: There are multiple loads and multiple first sampling circuits, and each first sampling circuit is connected to a corresponding load.
Citation Information
Patent Citations
Detection method and device, equipment and storage medium
CN117148261A
Photovoltaic energy storage management system
CN117559587A