A kind of battery management system and battery management method
The present invention relates to a kind of battery management system (BMS), particularly the configurable battery management system of a kind of node address and concrete management method thereof.
Battery management system (BATTERY MANAGEMENT SYSTEM, referred to as BMS) is the tie between battery and user, and main object is secondary cell.There are some shortcomings below in secondary cell, as few in stored energy, the life-span is short, connection in series-parallel uses problem, safety in utilization, battery electric quantity estimation difficulty etc.The performance of battery is that very complicated, dissimilar battery behavior also differs greatly.Battery management system (BMS) major function comprises: the accurately state-of-charge (State of Charge, i.e. SOC) of estimation power battery pack; In battery charge and discharge process, the terminal voltage of the every block battery in Real-time Collection accumulator of electric car group and temperature, charging and discharging currents and power brick total voltage, prevent battery generation overcharge or overdischarge phenomenon; For cell equalizing charge, each battery in battery pack is made all to reach balanced consistent state.These measures are all intended to the utilance, the extending battery life that improve battery.
The storage battery of electric automobile is normally connected, because the characteristic of dispatching from the factory of cell is inconsistent, so above-mentioned battery management system plays an important role for the performance of electric automobile.
Fig. 1 is the BMS system construction drawing of the electric automobile of a typical prior art, and as figure, system is individual from control board (also claiming monitoring means) and display module etc. primarily of a master board, n.From the measurement of control board primary responsibility to the information such as voltage, electric current, working temperature of the single battery that it is monitored, and by the data that collect by the CAN (abbreviation of controller local area network Controller Area Network, it is one of most widely used fieldbus in the world, in the world in a big way in, CAN agreement has become the STD bus of Computer Controlled System for Vehicle and built-in industrial control area net（CAN）) be transferred to master board; Master board is responsible for processing the battery status information collected from control board, and the result of process is transferred to the equipment such as display module, charger and entire car controller by outside CAN.
This battery management system, owing to relating to master controller and multiple communication from controller, so bring the problem of communication contention aware.The mode that the battery management system of current solution communication contention aware adopts mainly contains two large classes: a class applies different software codes to each from controller, the bus ID (bus ID) that static configuration is different; Another kind of is for elder brother is from controller dynamic assignment bus ID by the mode of hardware or software.First kind method needs exploitation to have the software code of different I D, and the complexity of software is higher.Equations of The Second Kind method efficiency and cost lower.
Relevant previously described Equations of The Second Kind method, open in Chinese patent 200910249544.0 " distributed battery management system and mark distributing method thereof ", master controller is electrically connected with a slave computer by system, be electrically connected in series successively with other slave computers by this slave computer, master controller is by activating the mode of the slave computer be in series successively successively to each slave computer allocation identification again.
In this technical scheme, multiple slave computer (being equivalent to from controller) needs to connect successively, and construction complexity is high, cost is high; And from controller only upper the starting working from being just activated after controller distributes address of adjacent electrical connection with it, and the address from controller be activated is by obtaining to master controller application, the same time only has one to be operated in address configuration process from controller, not only the efficiency of whole system is lower, and in some series circuits, have the situation of disconnection, follow-up one or morely cannot normally to work from controller will be caused.Meanwhile, this battery management system all must carry out the process of primary address configuration when each system electrification, extend the initialization time of whole system undoubtedly.
Separately there is Chinese patent 200810021154.3 " distributed battery management system and management method thereof ", this invention by acquisition module (being also equivalent to from controller) external wire jumper circuit, utilizes wire jumper circuit state to be the corresponding CAN address of imparting of each acquisition module.This prior art introduces multiple wire jumper as hardware separator, although efficiently solve the problem of system communication conflict, but be not difficult to find, increase along with acquisition module quantity increases by the quantity of the wire jumper circuit of this invention, add the hardware complexity of system, allow hard wires become complicated, the quantity of the general input/output port (GPIO) of the microprocessor (MCU) shared by it also will increase.And it is different to need to rely on all hardware jumper states in the whole course of work, the setting of wire jumper can only rely on manpower to complete, and error rate is high.Wire jumper more likely also may change because of the reason such as vibration in the course of the work and causes whole system to be made mistakes.
Summary of the invention
The object of the invention is for the deficiencies in the prior art described in background technology, a kind of that can solve communication contention aware problem between master-slave controller, that structure is simple, with low cost battery management system and method are provided.
For this reason, technical scheme of the present invention is such:
A kind of battery management system, comprise master controller, from controller, master controller is multiple from controller by inner CAN control connection, eachly control a battery pack from controller, master controller also connects external equipment by outside CAN, it is characterized in that: also comprise a wire jumper circuit module and nonvolatile storage, wire jumper circuit module control connection is from controller, determine the mode of operation from controller, nonvolatile storage is connected with from controller, memory be assigned to from controller address.
According to the structure of above-mentioned battery management system, the present invention also provides a kind of address configuration method of battery management system:
Whole method includes directly chooses the operational mode that work is carried out in the address distributed, described operational mode is carried out after being arranged in the pre-configured address of initialization, it is characterized in that, after the step of initialization pre-configured address, first a model select program is arranged, after model select program, arrange the allocation model that parallel with operational mode, operational mode and allocation model are select a selection according to wire jumper state to start by model select program simultaneously; Operational mode comprises the step reading the address distributed from nonvolatile storage, and allocation model comprises address stored in the step in nonvolatile storage.
Concrete, the step of operational mode is:
1, from nonvolatile storage (EEPROM), read the bus address from controller of the correspondence configured when dispatching from the factory, this address is participated in the address of bus communication as this from controller;
2, gather the battery pack information of its control connection, carry out the computing of related data, and judge whether to there is fault;
3, resolve the Frame that CAN receives, in bus, respond corresponding frame data according to different frames;
As responded the remote frame of master controller request information of voltage;
4, judge whether bus has and receive " address claim frame " identical with Self address, as received, then in bus, send the frame data of " this address is just used ", if do not had, then continue the execution of next step;
5, perform other tasks from controller, the battery pack as measured from controller this carries out Balance route etc.;
6, step 1 is repeated to step 6.
The step of preferred configuration mode is:
1, send to other in CAN from controller with bus address pre-configured before " the address claim frame " of this address of statement;
2, receive CAN frame data, and resolve the frame data received;
3, the frame data receiving this occupied from the address that controller is stated in step 2 " this address is just used " are judged whether.If address is occupied, then from address pool, the next available address of selective sequential, as this pre-configured bus address from controller, and by this address write nonvolatile storage (as EEPROM), forwards mode of operation option program to afterwards; If address is unoccupied, by this address write nonvolatile storage, and forward mode of operation option program to.
The present invention program compared to the prior art, possess obvious advantage: first, proposition be a kind of non real-time address allocation plan, by address assignment and normal work separately, so just without the need to starting all allocation address at every turn, start rapidly, program is simple, cost is low.
Secondly, do not require emphasis multiple series connection successively from controller, each relatively independent from controller, and respectively do not have dependence and absolute succession from the job order of controller, more freely, reliable operation degree is high.
3rd, only need a wire jumper circuit to distinguish mode of operation, and do not need the state of wire jumper circuit directly as the address distinguishing identifier from controller, wire jumper quantitative requirement obviously reduces, and sets the probability of makeing mistakes and also significantly reduces.
4th, as long as one time jumper settings (as the correction when dispatching from the factory or after long-term work, maintenance etc.) completes address assignment, this kind of physical areas of jumper cap separating device no longer can be needed completely in normal operation, avoiding jumper cap because of reasons such as vibrations loses the logic error caused, and improves stability and the reliability of whole system.
Accompanying drawing explanation
Fig. 1, the structure chart of typical battery management system;
Fig. 2, structure chart of the present invention;
Fig. 3, the flow chart of the embodiment of battery management method of the present invention.
As Fig. 2, battery management system of the present invention, comprise master controller 1, multiple from controller 2, master controller 1 is electrically connected from controller with multiple by inner CAN, each control battery pack 3 from controller 2 correspondence.Master controller 1 connects external equipment by outside CAN, external equipment comprises display module 4, charger 5, entire car controller 6, also particularly including wire jumper circuit module 7 and nonvolatile storage 8, wire jumper circuit module control connection is from controller, wire jumper circuit module 7 provides 0 and 1 two kind of logic, determine to be in address allocation pattern from the mode of operation of controller or to be in normal operation mode, as, plug jumper cap to show to be in address configuration pattern, jumper cap disconnects and shows normal mode of operation, and vice versa.Nonvolatile storage 8 is connected with from controller 2, the work address from controller that memory allocation arrives.
The address assignment of native system and the specific works flow process of normal operation mode are as Fig. 3.
Step 1, using from the initial bus address initialization of first address as this from controller in controller available address pond, this initial bus address is also referred to as pre-configured bus address.
Step 2, reading wire jumper information, determine to enter which kind of mode of operation from controller, and e.g., jumper cap enters the execution of address configuration pattern for the state of plugging then jumps to step 3, and the jumper cap state that is off then forwards step 4 to and enters normal mode of operation execution.
Step 3, address configuration mode of operation, comprise following several step:
A, to send " the address claim frame " of this address of statement to other in CAN from controller with bus address pre-configured before.
B, reception CAN frame data, and resolve the frame data received.
C, judge whether to receive this from controller in step 2(A) the frame data of address occupied " this address is just used " of statement.If address is occupied, then from address pool, the next available address of selective sequential, as this pre-configured bus address from controller, and by this address write nonvolatile storage (as EEPROM), forwards step 2 to afterwards.If address is unoccupied, by this address write nonvolatile storage, and forward step 2 continuation operation to.
Step 4, normal mode of operation, comprise the steps:
A, from nonvolatile storage (EEPROM), read the basis that configured when dispatching from the factory from controller bus address, this address is participated in the address of bus communication as this from controller.
B, information such as collection voltage, temperature etc., carry out the computing of related data, and judge whether to there is fault.
The Frame that C, parsing CAN receive, responds corresponding frame data according to different frames in bus, as the remote frame of response master controller request information of voltage.
D, judge whether bus has and receive " address claim frame " identical with Self address, as received, then in bus, send the frame data of " this address is just used ", if do not had, then continue the execution of next step.
E, perform other tasks from controller, the battery module as measured from controller this carries out Balance route etc.
F, repetition step 4(B) to step 4(E).
In address configuration process, first the wire jumper circuit from controller is in and plugs jumper cap state, and need linking same CAN from control board and getting on of configuration address by all, successively jumper cap is extracted from from controller at set intervals, just complete address configuration process successively from controller and enter and normally run mode of operation, then according to the system configuration of Fig. 1, be connected being connected with all inside CAN from controller with master controller, whole battery management system just can normally work.And after system cut-off, when again starting shooting Deng next time, owing to being written to nonvolatile storage from the bus address of controller configuration before, these only need to take out their respective bus address from memory from controller just can ensuring escapement from confliction participation bus communication.
To give one example explanation:
In battery management system, one has three pieces and needs configuration address from controller.So, first these three pieces are linked together from the CAN of controller, and the jumper cap of the wire jumper circuit of three board is all plugged (being plugged and pulling up is two kinds of different logics).After finishing preparation, three board to be powered on and according to the flow performing program shown in Fig. 2, suppose from controller address pond total " 10 ", " 11 ", " 12 " three addresses can for distributing, now three board is all in address configuration pattern, and all at the bus address stating that in bus address " 10 " is oneself, because now do not use this bus address work in the normal operating mode from controller, so frame data bus not having address " 10 " " just by use frame " produce, these just can at set intervals to bus statement one " address claim frame " from controller.
By wherein one piece pull out from the jumper cap of the wire jumper circuit of controller, it will use address " 10 " to enter normal mode of operation work, and " the address claim frame " of the address " 10 " that other two pieces send from controller is responded to the frame data of " this address is just used ", just address " 11 " can be selected again to state respective address in bus from controller for two pieces that receive these frame data, equally due to now do not use this bus address work in the normal mode of operation from control board, continuation uses address " 11 " to state address in bus from controller by these two pieces, and under being operated in address configuration pattern.
Again by wherein one piece be operated in pulling out from the jumper cap of controller under address configuration pattern, he will use address " 11 " to enter normal operation mode and run, and " the address claim frame " of the address " 11 " sent from controller the 3rd piece is responded the frame data of " this address is just used ", so, the 3rd piece from controller receiving address " 11 " just by after the frame data that use, it will select address " 12 " in bus, again state its address.
When last 3rd piece is pulled out from the jumper cap of controller after, three pieces are just completed the process of address configuration from controller, because these bus addresss have been written in nonvolatile memory, when starting shooting next time, just directly can read respective bus address from memory.