Method for automatically allocating addresses of slave control units by battery management system

文档序号:1941410 发布日期:2021-12-07 浏览:14次 中文

阅读说明:本技术 电池管理系统自动分配从控单元的地址的方法 (Method for automatically allocating addresses of slave control units by battery management system ) 是由 何荣伟 汪盼 樊小虎 毛建良 于 2021-07-26 设计创作,主要内容包括:本发明公开了电池管理系统自动分配从控单元的地址的方法,其中,所述电池管理系统包括:主控单元和从控单元,从控单元设置有多个;多个从控单元之间首尾通过CAN通讯线连接;所述主控单元和多个首尾相连的从控单元中的第一个从控单元通过CAN通讯线连接。无需人工设置从控单元的地址,使之每个从控单元都是标准品,无差异可互换;减少额外的成本;完全自动分配,高度智能化,无需人工参与,高准确率。(The invention discloses a method for automatically distributing addresses of slave control units by a battery management system, wherein the battery management system comprises the following steps: the system comprises a main control unit and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in the plurality of slave control units which are connected end to end through a CAN communication line. The addresses of the slave control units are not required to be manually set, so that each slave control unit is a standard product and can be interchanged without difference; additional cost reduction; the method has the advantages of full automatic distribution, high intelligence, no need of manual participation and high accuracy.)

1. A method for a battery management system to automatically assign addresses of slave control units, wherein the battery management system comprises: the system comprises a main control unit and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in a plurality of slave control units which are connected end to end through a CAN communication line; it is characterized by comprising:

the first step is as follows: generating a random number from the control unit;

the second step is that: the master control unit sends a broadcast frame request to the serial number of the slave control unit and the battery voltage of the slave control unit;

the third step: the slave control unit counts the number of times of receiving the broadcast frame of the master control unit, and when the number of times of receiving the broadcast frame of the master control unit is equal to the random number, the slave control unit replies a frame message of the master control unit, wherein the message comprises the serial number of the slave control unit;

the fourth step: the master control unit receives the message replied by the slave control unit, compares the received serial number with the existing content in the serial number array, if the serial number is different from the existing content, the serial number array is stored, otherwise, the same times are counted; obtaining the number of slave control units according to the same occurrence times;

the fifth step: the main control unit arranges the received serial number arrays in a descending order, and then broadcasts a frame to send a frame of message, wherein the message comprises serial numbers and serial numbers, the message is sent once every preset period, and the subscript of the serial number array is added with 1 every time the message is sent until the subscript of the serial number array is more than or equal to the number of the slave control units;

and a sixth step: the slave control unit receives the message of the master control unit and compares the received serial number with the local serial number; if the serial numbers are equal, the serial number received this time is set as the local address, and a frame of message is replied at the same time, wherein the message identifier comprises the address of the slave control unit;

the seventh step: the master control unit counts the number of the addresses of the different slave control units according to the message replied by the slave control units, if the counted number is equal to the number calculated by the master control unit, the automatic distribution is successful, otherwise, the process is switched to the second step to repeat the above process.

2. The method for automatically assigning addresses of slave units according to claim 1, wherein in a first step the slave units generate random numbers; "preparation steps are carried out before: and connecting CAN communication lines between the master control unit and all the slave control units, and electrifying the master control unit and all the slave control units.

3. The method of claim 1, wherein in the first step, the slave unit generates the random number using a serial number of the slave unit as a seed.

4. The method of claim 1, wherein in the third step, when the number of times of the received master unit broadcast frame is not equal to the random number, the slave unit continues to receive the broadcast frame message until the number of times of the received master unit broadcast frame is equal to the random number.

5. The method for automatically assigning addresses of slave units by a battery management system according to claim 1, wherein in the third step, the message includes the battery voltage of the slave unit in addition to the serial number of the slave unit.

6. The method for automatically assigning addresses of slave units by a battery management system according to claim 1, wherein in the fourth step, "the number of slave units is derived based on the same number of occurrences; the method specifically comprises the following steps: and when the same times exceed the preset times, the master control adds the received battery voltages of all the slave control units to obtain an average voltage, and divides the average voltage by the battery voltage acquired by the master control to obtain the number of the slave control units.

7. The method for automatically assigning addresses of slave control units according to claim 6, wherein in the fifth step, the serial number takes the contents of the serial number array and the serial number takes the serial number array subscript.

8. The method for automatically assigning an address of a slave unit in a battery management system according to claim 1, wherein in the sixth step, when the serial number received by the slave unit is not equal to the local serial number, the slave unit receives the master unit message and compares the received serial number with the local serial number; if the serial number is equal to the local address, the received serial number is set as the local address, a frame of message is replied at the same time, and the message identifier comprises the address of the slave control unit.

9. The battery management system is characterized by comprising a master control unit and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in a plurality of slave control units which are connected end to end through a CAN communication line; wherein the plurality of slave control units allocate addresses by automatically allocating the addresses of the slave control units using the battery management system according to any one of claims 1 to 8.

10. An electric vehicle characterized by comprising the battery management system of claim 9.

Technical Field

The invention relates to the field of battery management, in particular to a method for automatically allocating addresses of slave control units by a battery management system.

Background

The BMS battery system is commonly called a battery caregiver or a battery manager, and is mainly used for intelligently managing and maintaining each battery unit, preventing overcharge and overdischarge of the battery, prolonging the service life of the battery, and monitoring the state of the battery. BMS battery management system unit includes BMS battery management system, control module group, display module group, wireless communication module group, electrical equipment, is used for the group battery of electrical equipment power supply and is used for gathering the collection module of the battery information of group battery, BMS battery management system passes through communication interface and is connected with wireless communication module group and display module group respectively, the output of gathering the module is connected with BMS battery management system's input, BMS battery management system's output is connected with the input of control module group, the control module group is connected with group battery and electrical equipment respectively, BMS battery management system passes through wireless communication module and is connected with the Server end

The traditional technology has the following technical problems:

the address needs to be manually assigned, thereby increasing the additional cost, and the main prior art has two schemes: firstly, a fixed address is set for each slave control unit through an upper computer and is stored in an EEPROM; secondly, the host sets addresses for the slave control units in sequence through the trigger signals to the slave control trigger signals through the IO port, for example, patent (CN 104486180A).

Disclosure of Invention

The invention aims to solve the technical problem of providing a method for automatically distributing addresses of slave control units by a battery management system, which does not need to manually set the addresses of the slave control units, so that each slave control unit is a standard product and can be interchanged without difference; additional cost reduction; the method has the advantages of full automatic distribution, high intelligence, no need of manual participation and high accuracy.

In order to solve the above technical problem, the present invention provides a method for automatically allocating addresses of slave control units by a battery management system, wherein the battery management system comprises: the system comprises a main control unit and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in a plurality of slave control units which are connected end to end through a CAN communication line; the method comprises the following steps:

the first step is as follows: generating a random number from the control unit;

the second step is that: the master control unit sends a broadcast frame request to the serial number of the slave control unit and the battery voltage of the slave control unit;

the third step: the slave control unit counts the number of times of receiving the broadcast frame of the master control unit, and when the number of times of receiving the broadcast frame of the master control unit is equal to the random number, the slave control unit replies a frame message of the master control unit, wherein the message comprises the serial number of the slave control unit;

the fourth step: the master control unit receives the message replied by the slave control unit, compares the received serial number with the existing content in the serial number array, if the serial number is different from the existing content, the serial number array is stored, otherwise, the same times are counted; obtaining the number of slave control units according to the same occurrence times;

the fifth step: the main control unit arranges the received serial number arrays in a descending order, and then broadcasts a frame to send a frame of message, wherein the message comprises serial numbers and serial numbers, the message is sent once every preset period, and the subscript of the serial number array is added with 1 every time the message is sent until the subscript of the serial number array is more than or equal to the number of the slave control units;

and a sixth step: the slave control unit receives the message of the master control unit and compares the received serial number with the local serial number; if the serial numbers are equal, the serial number received this time is set as the local address, and a frame of message is replied at the same time, wherein the message identifier comprises the address of the slave control unit;

the seventh step: the master control unit counts the number of the addresses of the different slave control units according to the message replied by the slave control units, if the counted number is equal to the number calculated by the master control unit, the automatic distribution is successful, otherwise, the process is switched to the second step to repeat the above process.

In one embodiment, in a first step the slave unit generates a random number; "preparation steps are carried out before: and connecting CAN communication lines between the master control unit and all the slave control units, and electrifying the master control unit and all the slave control units.

In one embodiment, in the first step, the slave unit generates the random number using the serial number of the slave unit as a seed.

In one embodiment, in the third step, when the number of times of the received master control unit broadcast frame is not equal to the random number, the slave control unit continues to receive the broadcast frame message until the number of times of the received master control unit broadcast frame is equal to the random number.

In one embodiment, in the third step, the message includes the battery voltage of the slave unit in addition to the serial number of the slave unit.

In one embodiment, in the fourth step, "according to the same number of occurrences, the number of slave control units is obtained; the method specifically comprises the following steps: and when the same times exceed the preset times, the master control adds the received battery voltages of all the slave control units to obtain an average voltage, and divides the average voltage by the battery voltage acquired by the master control to obtain the number of the slave control units.

In one embodiment, in the fifth step, the serial number is the content in the serial number array, and the serial number is the index of the serial number array.

In one embodiment, in the sixth step, when the serial number received by the slave control unit is not equal to the local serial number, the slave control unit receives the master control unit message, and compares the received serial number with the local serial number; if the serial number is equal to the local address, the received serial number is set as the local address, a frame of message is replied at the same time, and the message identifier comprises the address of the slave control unit.

Based on the same inventive concept, the invention also provides a battery management system, which comprises a plurality of main control units and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in a plurality of slave control units which are connected end to end through a CAN communication line; the plurality of slave control units allocate addresses by adopting any method for automatically allocating the addresses of the slave control units by the battery management system.

Based on the same inventive concept, the invention also provides an electric automobile comprising the battery management system.

The invention has the beneficial effects that:

the addresses of the slave control units are not required to be manually set, so that each slave control unit is a standard product and can be interchanged without difference; additional cost reduction; the method has the advantages of full automatic distribution, high intelligence, no need of manual participation and high accuracy.

Drawings

Fig. 1 is a schematic diagram of the structure of the battery management system of the present invention.

Fig. 2 is a flowchart illustrating a method for automatically allocating addresses of slave units in the battery management system according to the present invention.

Detailed Description

The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.

Referring to fig. 1 and 2, a method for automatically allocating an address of a slave unit by a battery management system, wherein the battery management system includes: the system comprises a main control unit and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in the plurality of slave control units which are connected end to end through a CAN communication line. The method comprises the following steps:

the first step is as follows: the slave control unit generates a random number. It will be appreciated that the generation of the random number requires the use of a seed, so in a first step the slave unit generates the random number using the serial number of the slave unit as the seed. The method for generating the random number by using the serial number of the slave control unit as the seed is simple and convenient.

Of course, in the first step "the slave unit generates a random number; "preparation steps before graduation: and connecting CAN communication lines between the master control unit and all the slave control units, and electrifying the master control unit and all the slave control units.

The second step is that: the master control unit transmits a broadcast frame requesting a serial number of the slave control unit and a battery voltage of the slave control unit.

The third step: and the slave control unit counts the number of times of receiving the broadcast frame of the master control unit, and when the number of times of receiving the broadcast frame of the master control unit is equal to the random number, the slave control unit replies a frame of message of the master control unit, wherein the message comprises the serial number of the slave control unit.

In the third step, when the number of times of receiving the main control unit broadcast frame is equal to the random number, and when the number of times of receiving the main control unit broadcast frame is not equal to the random number, the slave control unit continues to receive the broadcast frame message until the number of times of receiving the main control unit broadcast frame is equal to the random number. For the convenience of counting the number of slave units, in a third step, the message includes the battery voltage of the slave unit in addition to the serial number of the slave unit.

The fourth step: the master control unit receives the message replied by the slave control unit, compares the received serial number with the existing content in the serial number array, if the serial number is different from the existing content, the serial number array is stored, otherwise, the same times are counted; and obtaining the number of the slave control units according to the same occurrence times.

It is important to derive the number of slave units and is an important step in assigning slave unit addresses. Wherein, the number of slave control units is obtained according to the same occurrence times; the method specifically comprises the following steps: and when the same times exceed the preset times, the master control adds the received battery voltages of all the slave control units to obtain an average voltage, and divides the average voltage by the battery voltage acquired by the master control to obtain the number of the slave control units.

The fifth step: the main control unit arranges the received serial number arrays in a descending order, then broadcasts a frame to send a frame of message, the message comprises serial numbers and serial numbers, wherein, the message is sent once every preset period, and the subscript of the serial number array is added with 1 every time the message is sent until the subscript of the serial number array is more than or equal to the number of the slave control units.

It can be understood that the specific numeric methods of the sequence number and the serial number are as follows: the serial number is the content in the serial number array, and the serial number is the subscript of the serial number array.

It is understood that the transmission is performed once at a preset period, for example, once at an interval of 100ms, and may be set according to actual needs.

And a sixth step: the slave control unit receives the message of the master control unit and compares the received serial number with the local serial number; if the serial number is equal to the local address, the received serial number is set as the local address, a frame of message is replied at the same time, and the message identifier comprises the address of the slave control unit.

In the sixth step, when the serial number received by the slave control unit is equal to the local serial number, the slave control unit receives the message of the master control unit and compares the received serial number with the local serial number; if the serial number is equal to the local address, the received serial number is set as the local address, a frame of message is replied at the same time, and the message identifier comprises the address of the slave control unit.

The seventh step: the master control unit counts the number of the addresses of the different slave control units according to the message replied by the slave control units, if the counted number is equal to the number calculated by the master control unit, the automatic distribution is successful, otherwise, the process is switched to the second step to repeat the above process.

Based on the same inventive concept, the invention also provides a battery management system, which comprises a plurality of main control units and a plurality of slave control units; the plurality of slave control units are connected end to end through CAN communication lines; the master control unit is connected with a first slave control unit in a plurality of slave control units which are connected end to end through a CAN communication line; the plurality of slave control units allocate addresses by adopting any method for automatically allocating the addresses of the slave control units by the battery management system.

Based on the same inventive concept, the invention also provides an electric automobile comprising the battery management system.

The addresses of the slave control units are not required to be manually set, so that each slave control unit is a standard product and can be interchanged without difference; additional cost reduction; the method has the advantages of full automatic distribution, high intelligence, no need of manual participation and high accuracy.

A specific application scenario of the present invention is described below:

a. connecting CAN communication lines between the master control unit and the slave control units, and electrifying the master control unit and all the slave control units;

b. the slave control unit takes the serial number S1 as a seed to generate a Random number Random;

c. the master control unit sends a broadcast frame to request the serial number S and the battery voltage V1 of the slave control unit;

d. the slave control unit counts the number of times Cnt of receiving the broadcast frame, when the number of times Cnt1 of receiving is equal to the Random number Random, the slave control unit replies a frame message of the master control unit, wherein the frame message comprises a serial number S1 of the slave control unit and a battery voltage V1, and if the number of times Cnt is not equal to the Random number Random, the slave control unit continues to receive the broadcast frame message;

e. the master control unit receives the message replied by the slave control unit, stores the message into the serial number array Buff by using the serial number S, compares the received serial number S1 with the existing content in the serial number array Buff, if the received serial number S1 is not the same as the existing content, and otherwise, counts the same number Cnt 2; when the same number Cnt2 exceeds the preset number, the master control adds all the received slave control battery voltages V1 to obtain an average voltage V2, and simultaneously divides the battery voltage V3 acquired by the master control by the average voltage V2 to obtain the number of the slave control units Num 1;

f. the main control unit arranges the received serial number arrays Buff in the descending order, and then the broadcast frame sends a frame message, wherein the message comprises a serial number S2 and a serial number No, the serial number S2 takes the content in the serial number array Buff, and the serial number No takes the Index of the serial number array Buff subscript; sending the sequence number array Buff subscript Index at intervals of a preset period, and adding 1 to the Buff subscript Index of the sequence number array every time the Buff subscript Index is sent; until the Index of the sequence number array Index is greater than or equal to the number Num1 of the slave control units;

g. the slave control unit receives the message of the master control unit and compares the received serial number S2 with the local serial number S1; if the serial number No is equal to the local address, the serial number No received this time is set as the local address, and a frame of message is replied at the same time, wherein the message identifier comprises the address of the slave control unit; otherwise, continuing to receive the message and the message of the main control unit, and comparing the received serial number with the local serial number; if the serial numbers are equal, the serial number received this time is set as the local address, and a frame of message is replied at the same time, wherein the message identifier comprises the address of the slave control unit;

h. and the master control unit counts the number Num2 of the received different slave control units according to the message replied by the slave control units, if the counted number Num2 of the address is equal to the number Num1 calculated by the master control, the automatic allocation is successful, and otherwise, c-g is repeated.

The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据传输方法、装置、设备、系统及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!