Controlling a battery module comprising a plurality of switched battery cell units
By controlling the switching circuit and random number generator with probabilistic properties, the connection of individual battery cells is dynamically adjusted, solving the internal loss and balance problems of electric vehicle battery packs and achieving efficient voltage regulation and automatic balancing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SCANIA CV AB
- Filing Date
- 2020-12-08
- Publication Date
- 2026-07-21
AI Technical Summary
In existing electric vehicle battery packs, the inverter's conversion of constant high voltage to variable voltage is inefficient, and the internal power loss and battery pack balance of large battery packs are difficult to optimize.
By controlling the probabilistic properties of the switching circuit, and utilizing a switch controller and a random number generator, the parallel and series connections of individual battery cells are dynamically adjusted, reducing communication overhead and automatically balancing the battery pack.
This reduces internal losses in the battery pack, decreases the need for balancing circuits, and improves the flexibility and efficiency of voltage regulation.
Smart Images

Figure CN114762238B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for controlling the output voltage of a battery module, the module comprising: a plurality of battery cell units, each battery cell unit including a battery cell having a first electrode and a second electrode and a switching circuit including a plurality of switches; and a switching controller, the switching controller being arranged to control the switches of the switching circuit to enter either a first state or a second state.
[0002] The present invention also relates to such battery modules. If all switching circuits are in a first state, the individual battery cells are connected in parallel to obtain a minimum output voltage from the battery module; and if all switching circuits of the battery module are in a second state, the individual battery cells are connected in series to obtain a maximum output voltage from the battery module. By controlling the switching circuits, the output voltage of the battery module can thus be controlled to a level between the minimum and maximum output voltage. Background Technology
[0003] In electric vehicles, energy is stored in battery packs consisting of one or more battery modules, each containing multiple individual cells. These cells typically have low voltages on the order of a few volts. The electric motor that drives the vehicle typically requires alternating current (AC) on the order of hundreds of volts. Therefore, the battery pack contains hundreds of cells connected in series to obtain the maximum voltage required by the motor. To convert this high, constant voltage into AC voltage with variable amplitude, a device called an inverter is used. The inverter converts the constant voltage into AC voltage with variable amplitude, typically sinusoidal.
[0004] Inverters convert constant high voltage to variable voltage, which involves inefficiencies. Therefore, one might propose a battery with internal switches that connect and disconnect individual cells to achieve AC voltage at the battery pack terminals. These switches must be controlled in some way by a main controller that determines the currently required voltage.
[0005] Because the number of individual cells in a battery pack is very large, on the order of hundreds, controlling a large number of switches is required to individually turn each cell on or off. These cells can be grouped together, with each group turning on or off together, but this reduces the granularity of the battery's possible output voltage. Furthermore, to know which switch is on or off, the main controller must have a detailed understanding of the battery pack layout, i.e., which battery is adjacent to which switch, etc.
[0006] Another problem with this technology is that the internal power loss of the battery is not minimized. A large battery pack using cells connected in series has a maximum output voltage of n*Ucell, where n is the number of cells and Ucell is the voltage of each cell. For example, if half of this maximum voltage is required in certain situations, the power loss due to the internal resistance of the cells is (I)^2*Rcell*n / 2, where I is the current drawn from the battery pack and Rcell is the internal resistance of the individual cells. However, if the battery pack is arranged into two equal groups of cells, with each group connected in series and the two groups connected in parallel, the loss due to internal resistance is reduced to 2*(I / 2)^2*Rcell*n / 2 = (I / 2)^2*Rcell*n = 1 / 4*(I)^2*Rcell*n. Therefore, by optimally configuring the battery pack for this specific output voltage, the internal loss is halved.
[0007] Another issue is battery pack balancing. If the individual cells of the battery pack are connected in series, additional circuitry is needed to transfer charge between the cells in order to balance the charge state of the entire battery pack. Summary of the Invention
[0008] One objective of this invention is to provide a battery module and a method for controlling the output voltage of the battery module, which reconfigures the battery module with minimal communication to minimize internal losses at any given time. Another objective of this invention is to provide a battery module and a method for controlling its output voltage, which reduces the need for a balancing circuit because individual cells are connected in parallel at certain points in time, thereby promoting automatic balancing.
[0009] The objective of this invention is achieved through a method for controlling the output voltage of a battery module. The battery module includes...
[0010] Multiple battery cells, each battery cell comprising:
[0011] - A battery cell, the battery cell having a first electrode and a second electrode, and
[0012] - A switching circuit, the switching circuit including
[0013] - First input, which is connected to the first output via a first switch.
[0014] - Second input, the second input is connected to the second output via a second switch, and
[0015] - A third switch, the second input is connected to the first output via the third switch, wherein the first pole of the battery cell is connected to the first input, and the second pole is connected to the second input.
[0016] The battery module further includes a switch controller, which is arranged to control the switch of the switch circuit to enter any one of the following
[0017] - A first state, in which the first input is connected to the first output, the second input is connected to the second output, and the second input is disconnected from the first output, and
[0018] - A second state, in which the first input is disconnected from the first output, the second input is disconnected from the second output and connected to the first output.
[0019] The method includes the following steps:
[0020] - Measuring the output voltage V of the battery module at one of the first output and the second output,
[0021] - Generating a difference value by measuring the difference between the measured output voltage V and a reference voltage Vref, the reference voltage Vref being within the range from the nominal minimum output voltage Vmin of the battery module to the nominal maximum output voltage Vmax of the battery module,
[0022] - Generating a probability value p based on the difference value, the probability value being proportional to the absolute value of the difference value and within an interval representing a probability of 0% to 100%,
[0023] - Generating a random number r within the interval by means of a random number generator,
[0024] - Comparing the probability value p with the random number r, and,
[0025] a) If the switch circuit is in the first state and V - Vref < 0 and p > r, then the state changes to the second state, or,
[0026] b) If the switch circuit is in the second state and V - Vref > 0 and p > r, then the state changes to the first state, or,
[0027] c) If p = 0, and the switch circuit is in the first state or in the second state, then the state remains unchanged.
[0028] If p = r or p < r, then the state remains unchanged.
[0029] This invention proposes a layout and control strategy for battery modules with switches. This strategy reconfigures the battery module with minimal communication to minimize internal losses at any given time. The invention also alleviates the need for a balancing circuit, as individual cells are connected in parallel at certain points in time, thus facilitating automatic balancing. The proposed control strategy consists of a main controller comprising a voltage regulator and a switch controller, which knows the necessary output voltage from the battery, i.e., the reference voltage, in every situation. The main controller is capable of broadcasting signals to all switches in the battery module. Note that the same signal is sent to all switches, thus requiring only a single communication channel.
[0030] The key feature of this invention is the probabilistic nature of controlling the switching circuit. Each switch controller receives a probability, or probability value, of changing its state. Each switch controller, in conjunction with a random number generator, has an internal "dice-rolling" mechanism to determine its action. This means that although each switch controller receives the same signal (probability value), the actions taken by the switches differ (depending on the number generated by the random number generator), making the goal more complex to achieve if fully deterministic switching logic were used.
[0031] The main controller measures the current output voltage and compares it with the desired value and a reference voltage. If the output voltage is higher than the reference voltage, the regulator outputs a difference greater than 0; if the output voltage is lower than the reference voltage, the regulator outputs a difference less than 0. The specific selection of these values can be accomplished in various ways, such as with a standard proportional-integral-derivative (PID) controller.
[0032] Switches located between battery cells receive control signals (to change or maintain their state) and update their state at a certain frequency, such as once every millisecond. All coordination is performed via control signals, which causes the battery cells to configure themselves as a parallel group of series-coupled cells.
[0033] Compared to a deterministic solution that assumes each battery cell has a predetermined voltage, the probabilistic method of this invention will allow the state of the switching circuit, and thus the output voltage, to automatically adapt to any unforeseen deviations in the voltage (or charge) contribution of any battery cell. Because the control scheme of the switch has a random element, the resulting parallel group is not constant but changes over time, thus allowing different cells to have equal charge with each other.
[0034] Because the individual units are constantly reconfigured into the optimal number of parallel groups, losses due to internal resistance are minimized.
[0035] The main controller does not need to know the internal configuration of the battery module; it only measures the output voltage and sends control signals accordingly. Therefore, the concept is highly modular, and individual battery cells with corresponding switching units can be added or removed, for example, while maintaining the original functionality.
[0036] Only a single unidirectional communication channel is needed from the main controller to the switches in each switching circuit.
[0037] The probabilistic nature of the control system is essential. If the responses of all switching circuits are deterministic, then a specific control signal that changes the state of one switching circuit will also change the state of every other switching circuit, resulting in an excessively large step in the output voltage. By using the stochasticity of the control scheme, the state of only one (or possibly a pair) of switching circuits can be changed at a time, thereby keeping potential overvoltages within reasonable limits.
[0038] According to one embodiment, the probability value p is proportional to the difference between the measured output voltage V and the reference voltage Vref. A limit is set for the difference between the nominal minimum and maximum output voltages. This difference is preferably multiplied by a factor that generates a suitable range for the probability value, for example, such that the probability value can be in the range of 0 to 100. A random number generator can be configured to generate integers from 0 to 100. The voltage of each battery cell and the number of battery cells can also be considered when determining which factor to use to generate the probability value based on the difference.
[0039] According to one embodiment,
[0040] - The nominal minimum voltage Vmin corresponds to the state in which all the battery cells of the battery module are connected in parallel with each other, and
[0041] - The nominal maximum voltage Vmax corresponds to the state in which all the battery cells of the battery module are connected in series with each other.
[0042] Therefore, the method includes the following steps:
[0043] - Measure the difference between the measured output voltage and one of the nominal minimum voltage and the nominal maximum voltage that is closer to the reference voltage compared to the measured output voltage.
[0044] - Generate a correction value proportional to the difference in the measurements, and
[0045] - The difference is corrected based on the correction value, wherein the probability value is generated based on the corrected difference.
[0046] Therefore, the probability value is adjusted to compensate for the many battery cells (switching circuits) in a particular state. If all battery cells are connected in parallel (first state) and a request is made to increase the output voltage, i.e., the reference voltage is higher than the nominal minimum output voltage, many switching circuits may switch to the second state. However, if all but one or more switching circuits are already in the second state and a request is made to increase the output voltage, only said one or more switching circuits can achieve this increase in voltage output. Therefore, the probability of these one or more switching circuits changing state should be increased so that the system responds quickly and reaches the requested output voltage, i.e., the reference voltage, quickly. The system will function without this compensation, but the closer the reference voltage is to the minimum and maximum nominal output voltage, the slower the system becomes.
[0047] According to one embodiment, correcting the difference includes the step of removing the difference with the corrected value.
[0048] According to one embodiment, the method includes the step of repeating the method at a predetermined frequency. The method is an iterative method to achieve a requested output voltage, i.e., a reference voltage. Choosing a suitable frequency is a matter of selection. For example, the steps of the method may be repeated once per microsecond.
[0049] The objective of this invention is also achieved by means of a battery module for a vehicle, the battery module comprising a plurality of battery cell units. Each battery cell unit includes:
[0050] - A battery cell, the battery cell having a first electrode and a second electrode, and
[0051] - A switching circuit, the switching circuit including
[0052] - First input, which is connected to the first output via a first switch.
[0053] - Second input, the second input is connected to the second output via a second switch, and
[0054] - A third switch, through which the second input is connected to the first output.
[0055] The first electrode of the battery cell is connected to the first input, and the second electrode is connected to the second input.
[0056] The battery module also includes a switch controller, which is arranged to control the switch circuit to enter any of the following states:
[0057] - First state, in which the first input is connected to the first output, the second input is connected to the second output, and the second input is disconnected from the first output, and
[0058] - Second state, in which the first input is disconnected from the first output, and the second input is disconnected from the second output and connected to the first output.
[0059] The switch controller includes an input for receiving a probability signal indicating the probability that the switch circuit enters the first state or the second state.
[0060] The battery module also includes
[0061] A voltage regulator configured to measure the output voltage at one of the first and second outputs to compare the measured output voltage with a reference voltage Vref, the reference voltage being within a range from the nominal minimum output voltage Vmin of the battery module to the nominal maximum output voltage Vmax of the battery module. The regulator is configured to generate a difference based on the comparison and a probability value based on the difference, the probability value being proportional to the absolute value of the difference and falling within an interval representing a probability from 0% to 100%. The regulator is also configured to transmit the probability value to the switching controller.
[0062] - A random number generator that generates a random number r within the interval.
[0063] The switch controller is configured to receive the random number, compare the probability value with the random number, and...
[0064] a) If the switching circuit is in the first state and V-Vref<0 and p>r, then change the state to the second state, or,
[0065] b) If the switching circuit is in the second state and V-Vref>0 and p>r, then change the state to the first state, or,
[0066] c) If p = 0, and the switching circuit is in the first state or the second state, then the state remains unchanged.
[0067] According to one embodiment, the probability value is proportional to the difference between the measured output voltage and the reference voltage.
[0068] According to one embodiment, the method includes
[0069] - The nominal minimum voltage Vmin corresponds to the state in which all the battery cells of the battery module are connected in parallel with each other, and
[0070] - The nominal maximum voltage Vmax corresponds to the state in which all the battery cells of the battery module are connected in series with each other, wherein the voltage regulator is configured to...
[0071] - Measure the difference between the measured output voltage and one of the nominal minimum voltage and the nominal maximum voltage that is closer to the reference voltage compared to the measured output voltage.
[0072] - Generate a correction value proportional to the difference in the measurements, and
[0073] - The difference is corrected based on the correction value, wherein the probability value is generated based on the corrected difference.
[0074] According to one embodiment, the voltage regulator includes
[0075] - A first differential amplifier circuit, configured to generate a difference signal proportional to the difference between the measured output voltage and the reference voltage, and
[0076] - A correction circuit, the correction circuit including
[0077] - Second differential amplifier circuit.
[0078] The second differential amplifier circuit is configured to measure
[0079] a) The difference between the nominal maximum output voltage of the battery module and the output voltage measured for the case where the reference voltage is higher than the measured output voltage, and
[0080] b) The difference between the nominal minimum output voltage of the battery module and the output voltage measured for the case where the reference voltage is lower than the nominal minimum output voltage, and
[0081] Configured to generate a correction value proportional to the difference measured, and
[0082] - A divider configured to generate the corrected difference by dividing the difference by the corrected value.
[0083] According to one embodiment, the battery module includes an electrode shifting device.
[0084] The present invention also relates to a vehicle comprising a battery module according to the present invention.
[0085] According to one embodiment, the energy used to propel the vehicle is electrical energy stored in one or more batteries carried by the vehicle, the vehicle including at least one battery module according to the invention, and wherein the engine of the vehicle for propelling the vehicle is an electric motor.
[0086] The present invention also relates to a computer program including computer program code, said computer program code being used to cause the computer to implement the method according to the present invention when the computer program is executed in the computer.
[0087] The present invention also relates to a computer program product comprising a non-transitory data storage medium readable by a computer, wherein the program code of the computer program disclosed above is on the non-transitory data storage medium.
[0088] The present invention also relates to an electronic control device for a motor vehicle, the electronic control device comprising an actuator and a data storage medium connected to the actuator, and computer program code of a computer program product according to the present invention stored on the data storage medium. Attached Figure Description
[0089] Figure 1 This is a schematic diagram of a portion of the battery module according to the present invention.
[0090] Figure 2 This is a detailed representation of an embodiment of the voltage regulator according to the present invention.
[0091] Figure 3 This indicates a battery module equipped with an electrode shifting device.
[0092] Figure 4 This is a schematic diagram of a vehicle according to the present invention.
[0093] Figure 5 This illustrates a process scheme for a first embodiment of the method of the present invention, and
[0094] Figure 6 This is a flowchart illustrating a second embodiment of the method of the present invention. Detailed Implementation
[0095] refer to Figure 1 The diagram illustrates a first embodiment of a battery module according to the invention. Only a portion of the module is shown, and it should be understood that the teachings of the invention and, for example, [details omitted]. Figure 4 As indicated in the document, the battery module may include multiple similar modules connected to each other. Figure 1 The battery cell shown is a single unit.
[0096] The battery module includes multiple battery cell units 1, each battery cell unit including: a battery cell 2 having a first electrode 3 and a second electrode 4, and a switching circuit 5. The switching circuit 5 includes a first input 6 connected to a first output 7 via a first switch 8, a second input 9 connected to a second output 10 via a second switch 11, and a third switch 12, the second input 9 being connected to the first output 7 via the third switch. The first electrode 3 of the battery cell 2 is connected to the first input 6, and the second electrode 4 is connected to the second input 9.
[0097] The battery module also includes a switch controller 14, which is arranged to control the switches 8, 11, and 12 of the switch circuit 5 to either a first state or a second state. In the first state, the first input 6 is connected to the first output 7, the second input 9 is connected to the second output 10, and the second input 9 is disconnected from the first output 7. In the second state, the first input 6 is disconnected from the first output 7, and the second input 9 is disconnected from the second output 10 and connected to the first output 7.
[0098] The switch controller 14 includes an input 15 for receiving a probability signal p indicating the probability that the switch circuit 5 will enter a first state or a second state.
[0099] The battery module also includes a voltage regulator 16 configured to measure the output voltage V at one of the first output 7 and the second output 10, and to compare the measured output voltage V with a reference voltage Vref. The reference voltage Vref is within the range of the battery module's nominal minimum output voltage Vmin to the battery module's nominal maximum output voltage Vmax. The voltage regulator 16 is configured to generate a difference d based on the comparison, and to generate a probability value p based on the difference d. The probability value p is proportional to the absolute value of the difference d and is within an interval representing a value from 0 to corresponding to a 100% probability. The voltage regulator 16 is configured to transmit the probability value p to the switch controller 14.
[0100] The battery module also includes a random number generator 17 that generates a random number r within the said interval. The switch controller 14 is configured to receive the random number r, compare the probability value p with the random number r, and...
[0101] a) If switch circuit 5 is in the first state and V-Vref<0 and p>r, change the state to the second state, or...
[0102] b) If switch circuit 5 is in the second state and V-Vref>0 and p>r, then change the state to the first state, or,
[0103] c) If p = 0, and the switching circuit 5 is in the first state or the second state, then the state is not changed.
[0104] The probability value p is proportional to the difference between the measured output voltage V and the reference voltage Vref.
[0105] Now for reference Figure 2 This illustrates a further development of the voltage regulator embodiment. The nominal minimum voltage Vmin corresponds to a state where all the battery cells 2 of the battery module are connected in parallel with each other. The nominal maximum voltage Vmax corresponds to a state where all the battery cells of the battery module are connected in series with each other. The voltage regulator 16 is configured to measure the difference between the measured output voltage V and one of the nominal minimum voltage Vmin and the nominal maximum voltage Vmax, which are closer to the reference voltage Vref than the measured output voltage V. The voltage generator 16 is also configured to generate a correction value m, which is proportional to the measured difference. The voltage regulator is thus configured to correct the difference d based on the correction value m, wherein a probability value p is generated based on the difference dmod thus corrected.
[0106] The voltage regulator 16 includes: a first differential amplifier circuit 18 configured to generate a difference d proportional to the difference between a measured output voltage V and a reference voltage Vref; and a correction circuit 19. The correction circuit includes a second differential amplifier circuit 20 configured to measure the difference between a nominal maximum output voltage Vmax of the battery module and an output voltage measured for a case where the reference voltage Vref is higher than the measured output voltage, and configured to generate a correction value m proportional to the measured difference. Figure 2 The situation shown in the figure.
[0107] The correction circuit 20 is also configured to measure the difference between the nominal minimum output voltage of the battery module and the output voltage measured for the case where the reference voltage is lower than the measured output voltage V, and is configured to generate a correction value m proportional to the measured difference.
[0108] The voltage regulator 16 also includes a divider 21 configured to generate the corrected difference dmod by dividing the difference d by the corrected value m.
[0109] exist Figure 2 In the diagram, reference numeral 32 indicates the component where the difference d is multiplied by a factor K, which is preferably selected with respect to the nominal maximum output voltage Vmax and the nominal minimum output voltage Vmin, such that the difference will have a value in the range of -1 to 1. Reference numeral 33 indicates the component where the modified difference dmod is multiplied by a factor k, which is selected in advance, for example, with respect to possible upper and lower limits of the product between the difference d and the modified value m, such that the absolute value of the modified difference dmod is generated within an appropriate range, for example, a probability value in the range of 0 to 100. The random number generator can then be suitably configured to generate integers in the range of 0-100.
[0110] The voltage regulator 16 does not necessarily have to include the correction circuit 20, but it should be understood that including the correction circuit enables the voltage regulator 16 to respond faster when the reference voltage Vref and the output voltage V are closer to the nominal minimum voltage Vmin or the nominal maximum voltage Vmax.
[0111] refer to Figure 3 According to this embodiment, the battery module may include an electrode shifting device. In the illustrated embodiment, the electrode shifting device includes an electrode shifting control module 22 and controllable switches 23, 24, 25, and 26, which are located at opposite ends of the battery module, and the battery module is connected to a load via the controllable switches. The battery module can deliver alternating current (AC) to an AC motor via the electrode shifting device. If the load connected to the battery module does not require AC power, the electrode shifting device may not be necessary.
[0112] refer to Figure 4 The present invention includes a vehicle 27 comprising a battery module 28 according to the invention as disclosed above. The energy for propelling the vehicle 27 is electrical energy stored in one or more batteries 29 carried by the vehicle 27 and comprising at least one battery module 28 according to an embodiment of the invention. The engine 30 of the vehicle 27 for propelling the vehicle 27 is an electric motor, typically an AC motor.
[0113] According to one embodiment of the present invention, a method for controlling the output voltage of a battery module is implemented using a battery module as disclosed above. Figure 5 As shown, the method therefore includes the following steps:
[0114] S1) Measure the output voltage V of the battery module at one of the first output 7 and the second output 10, and generate a difference value d by measuring the difference between the measured output voltage V and a reference voltage Vref, wherein the reference voltage Vref is within the range from the nominal minimum output voltage Vmin of the battery module to the nominal maximum output voltage Vmax of the battery module.
[0115] S2) Generate a probability value p based on the difference d, the probability value being proportional to the absolute value of the difference d, and falling within the range representing a probability of 0% to 100%.
[0116] S3) Using random number generator 17, a random number r is generated within the interval.
[0117] S4) Compare the probability value p with the random number r, and,
[0118] a) If switch circuit 5 is in the first state and V-Vref<0 and p>r, then the state changes to the second state, or,
[0119] b) If switch circuit 5 is in the second state and V-Vref>0 and p>r, then the state changes to the first state, or...
[0120] c) If p = 0, and the switching circuit 5 is in the first state or the second state, then the state does not change.
[0121] refer to Figure 6 If the correction circuit 20 is incorporated into the voltage regulator 16, then step S2 of the above method includes the following steps:
[0122] S2a) Measure the difference between the measured output voltage V and one of the nominal minimum voltage Vmin and the nominal maximum voltage Vmax, which are closer to the reference voltage than the measured output voltage.
[0123] S2b) Generate a correction value m proportional to the difference in the measurement, and
[0124] S2c) The difference d is corrected based on the correction value m, wherein a probability value is generated based on the corrected difference dmod.
[0125] The above method steps can be repeated at a predetermined frequency (e.g., per microsecond) according to embodiments of the invention to achieve an output voltage V equal to or as close as possible to the requested reference voltage Vref, which may vary due to load changes. The voltage regulator, switching controller, and random number generator are therefore configured to perform the steps at said frequency.
[0126] The present invention also relates to a computer program including computer program code, said computer program code being used to cause the computer to implement the method according to the present invention when the computer program is executed in the computer.
[0127] The present invention also relates to a computer program product comprising a non-transitory data storage medium readable by a computer, wherein the program code of the computer program disclosed above is on the non-transitory data storage medium.
[0128] like Figure 4 The vehicle 27 shown includes an electronic control unit 31, which includes an actuator and a data storage medium connected to the actuator, and computer program code of a computer program according to the present invention is stored on the data storage medium.
Claims
1. A method for controlling the output voltage of a battery module, the module comprising: Multiple battery cell units (1), each battery cell unit comprising: - Battery cell (2), the battery cell having a first electrode (3) and a second electrode (4), and - Switching circuit (5), the switching circuit includes - First input (6), which is connected to first output (7) via first switch (8). - Second input (9), the second input is connected to the second output (10) via the second switch (11), and - A third switch (12) is connected to the first output (7) via the third switch, wherein the first pole (3) of the battery cell (2) is connected to the first input (6) and the second pole (4) is connected to the second input (9). - Switch controller (14), which is arranged to control the switches (8, 11, 12) of the switch circuit (5) to enter any of the following: In the first state, the first switch (8) is closed, connecting the first input (6) to the first output (7), and the second switch (11) is closed, connecting the second input (9) to the second output (10), and the third switch (12) is open, disconnecting the second input (9) from the first output (7). In the second state, the first switch (8) is open, causing the first input (6) to be disconnected from the first output (7), and the second switch (11) is open, causing the second input (9) to be disconnected from the second output (10), and the third switch (12) is closed, causing the second input (9) to be connected to the first output (7). The method includes the following steps: Measure the output voltage V of the battery module at one of the first output and the second output (7, 10). - A difference value d is generated by measuring the difference between the measured output voltage V and a reference voltage Vref, wherein the reference voltage Vref is within the range of the nominal minimum output voltage Vmin of the battery module to the nominal maximum output voltage Vmax of the battery module. - Generate a probability value p based on the difference d, the probability value being proportional to the absolute value of the difference d, and falling within the range representing a probability of 0% to 100%. - Generate a random number r within the interval using a random number generator (17). - Compare the probability value p with the random number r, and, a) If the switching circuit (5) is in the first state and V-Vref<0 and p>r, then the state changes to the second state, or, b) If the switching circuit (5) is in the second state and V-Vref>0 and p>r, then the state changes to the first state, or, c) If p=0 and the switching circuit (5) is in the first state or in the second state, the state remains unchanged.
2. The method according to claim 1, characterized in that, The probability value p is proportional to the difference between the measured output voltage V and the reference voltage Vref.
3. The method according to claim 1 or 2, characterized in that, - The nominal minimum voltage Vmin corresponds to the state in which all the battery cells of the battery module are connected in parallel with each other, and - The nominal maximum voltage Vmax corresponds to the state in which all the battery cells of the battery module are connected in series with each other, and the method includes the following steps. - Measure the difference between the measured output voltage and one of the nominal minimum voltage and the nominal maximum voltage that is closer to the reference voltage compared to the measured output voltage. - Generate a correction value m proportional to the difference in the measurements, and - The difference d is corrected based on the correction value m, wherein the probability value is generated based on the corrected difference.
4. The method according to claim 3, characterized in that, Correcting the difference d includes the step of removing the difference d with the correction value m.
5. The method according to any one of claims 1-4, characterized in that, It includes the step of repeating the method at a predetermined frequency.
6. A battery module for a vehicle, the battery module comprising a plurality of battery cell units (1), each battery cell unit comprising: - Battery cell (2), the battery cell having a first electrode (3) and a second electrode (4), and - Switching circuit (5), the switching circuit includes - First input (6), which is connected to first output (7) via first switch (8). - Second input (9), the second input is connected to the second output (10) via the second switch (11), and - Third switch (12), the second input (9) is connected to the first output (7) via the third switch. - wherein the first electrode (3) of the battery cell (2) is connected to the first input (6), and the second electrode (4) is connected to the second input (9). - Switch controller (14), which is arranged to control the switches (8, 11, 12) of the switch circuit (5) to enter any of the following: - First state, in which the first switch (8) is closed, such that the first input (6) is connected to the first output (7), and the second switch (11) is closed, such that the second input (9) is connected to the second output (10), and the third switch (12) is open, such that the second input (9) is disconnected from the first output (7), and - Second state, in which the first switch (8) is open, causing the first input (6) to be disconnected from the first output (7), and the second switch (11) is open, causing the second input (9) to be disconnected from the second output (10), and the third switch (12) is closed, causing the second input (9) to be connected to the first output (7). -The switch controller (14) includes an input (15) for receiving a probability signal indicating the probability that the switch circuit (5) enters the first state or the second state. The battery module also includes - A voltage regulator (16) configured to measure the output voltage V at one of the first output and the second output (7, 10) to compare the measured output voltage with a reference voltage Vref, the reference voltage Vref being within the range of the nominal minimum output voltage Vmin of the battery module to the nominal maximum output voltage Vmax of the battery module, and the voltage regulator (16) configured to generate a difference d based on the comparison, and to generate a probability value p based on the difference d, the probability value being proportional to the absolute value of the difference d and within the range representing a value from 0% to a value corresponding to a 100% probability, and the voltage regulator being configured to transmit the probability value p to the switch controller (14), and - A random number generator (17), which is configured to generate random numbers r within the interval. - wherein the switch controller (14) is configured to receive the random number r, and compare the probability value p with the random number r, and, a) If the switching circuit (5) is in the first state and V-Vref<0 and p>r, then change the state to the second state, or, b) If the switching circuit (5) is in the second state and V-Vref>0 and p>r, then change the state to the first state, or, c) If p=0 and the switching circuit (5) is in the first state or in the second state, the state remains unchanged.
7. The battery module according to claim 6, characterized in that, The probability value p is proportional to the difference between the measured output voltage V and the reference voltage Vref.
8. The battery module according to claim 6 or 7, characterized in that... - The nominal minimum voltage Vmin corresponds to the state in which all the battery cells (2) of the battery module are connected in parallel with each other, and - The nominal maximum voltage Vmax corresponds to the state in which all the battery cells of the battery module are connected in series with each other, and the voltage regulator (16) is configured to - Measure the difference between the measured output voltage and one of the nominal minimum voltage Vmin and the nominal maximum voltage Vmax that are closer to the reference voltage Vref than the measured output voltage V. - Generate a correction value m that is proportional to the difference in the measurement, and - The difference d is corrected based on the correction value m, wherein the probability value p is generated based on the corrected difference dmod.
9. The battery module according to any one of claims 6-8, characterized in that, The voltage regulator (16) includes A first differential amplifier circuit (18) is configured to generate a difference d proportional to the difference between the measured output voltage V and the reference voltage Vref. Correction circuit (19), the correction circuit includes The second differential amplifier circuit (20), the second differential amplifier circuit being configured to measure a) The difference between the nominal maximum output voltage of the battery module and the output voltage measured for the case where the reference voltage is higher than the measured output voltage, and b) The difference between the nominal minimum output voltage of the battery module and the output voltage measured for the case where the reference voltage is lower than the measured output voltage, and Configured to generate a correction value m proportional to the difference measured, and A divider (21) is configured to generate the corrected difference dmod by dividing the difference d by the corrected value m.
10. The battery module according to any one of claims 6-9, characterized in that, It includes an electrode shifting device (22-26).
11. A vehicle (27), characterized in that, It includes the battery module (28) according to any one of claims 6-10.
12. The vehicle (27) according to claim 11, characterized in that, The energy used to propel the vehicle (27) is electrical energy stored in one or more batteries (29) carried by the vehicle (27) and including at least one battery module (28) according to any one of claims 6-10, and the engine (30) of the vehicle (27) used to propel the vehicle (27) is an electric motor.
13. A computer program comprising computer program code, the computer program code being configured to cause the computer to perform the method according to any one of claims 1-5 when the computer program is executed in a computer.
14. A computer program product comprising a non-transitory data storage medium, the non-transitory data storage medium being readable by a computer, and program code of the computer program according to claim 13 stored on the non-transitory data storage medium.
15. An electronic control device (31) for a motor vehicle (27), the electronic control device comprising an actuator and a data storage medium connected to the actuator, and computer program code of the computer program product according to claim 14 stored on the data storage medium.