Monday, February 13, 2012

Based on the the VB6.0 monolithic voltage inspection of the fuel cell system design


The fuel cell is a new driving force for the 21st century is expected to replace the internal combustion engine of the vehicle fuel system, it is a H2 and O2 of the chemical through the electrode reaction to be directly converted into electrical energy. A fuel cell stack, the multi-plate cells in series together to form the entire performance of the stack and single cell voltage has a great relationship. Therefore necessary to capture the voltage value of the single cell under different conditions, to find out the relationship between the H2 and O2 reaction environment and the single cell voltage by analyzing the development of fuel cell. This paper is to introduce fuel cell monolithic  Panasonic DMW-BCJ13PP Battery Charger voltage inspection test, analyze the system of units in progress 25kW fuel cell car project design. The system host computer software developed using VB6.0 programming language, the language is powerful, object-oriented and visual programming, friendly interface, particularly suitable for the graphical interface in the Windows environment and the user program preparation, data acquisition by more than 8-bit PIC microcontroller as the core data acquisition module to complete.


Composition and working principle of the 2 systems

The system consists of the host computer, the host microcontroller and a number of data acquisition module, shown in Figure 1. The host computer for an industrial control computer, its main function is to implement and host microcontroller through RS-232 serial communication receiver to collect data and send control commands; real-time display of the single cell voltage and draw the same time monolithic voltage changes trend curve; measurement data classification is saved to the database, and with a variety of mathematical analysis on the measurement results.

Master monolithic receiver control from the host computer command


Figure 1 System composition diagram

Control of each data module, and each module sent the data to be forwarded to the host computer via RS-232 serial port. The host microcontroller and data acquisition module with RS-485 bus to communicate, and set the main structure, the host microcontroller is set to host various data acquisition module from the machine. Host microcontroller in the detection of receipt of the host computer command, in accordance with the round robin way in turn to each data acquisition module hair collection command, issued an acquisition command after waiting to receive the collection module collecting data, if the waiting time received within the collection module sends back the collected data, the data package will be forwarded to the host computer; If you wait for the timeout still does not receive data directly down an acquisition module fat acquisition command, and so repeated the cycle continues.

Hardware and software constitute the data acquisition module is exactly the same, and communication through the RS-485 bus and the host microcontroller. Each data acquisition module in receipt of the test command from the host microcontroller 16 is responsible for testing the battery voltage value is sampled, and then sampling from the 16 battery voltage value package to send to the host microcontroller. Each data acquisition module can be taken in 16 single cell voltage, a corresponding increase or decrease the number of data acquisition module based on the total number of cells.

3 Data Acquisition Module

The acquisition of the single cell voltage in the inspection system is completed by each data module. The data acquisition module is based on PIC16F873 microcontroller as the core plus some external circuit shown in Figure 2. The PIC16F873 microcontroller is Microchip's production of a reduced instruction set (RISC), Harvard dual-bus and two-stage instruction pipeline structure cost-effective 8-bit embedded controllers, high integration, speed, low operating voltage, power consumption is low, the I / O directly drive the instruction simple and easy to use and features. Its built-in 8k x 14 Flash memory, a 10 four-input channel A / D converter, and a UART. Can-Circuit Serial Programming (ICSP), the development and use are required for peripheral expansion device. The data acquisition module, multi-channel analog signal input is selected through a 16-channel analog switch CD4067, microcontroller through the I / O port RC1 is ~ the RC4 to select specific input. The generally low single cell voltage 0.5V ~ 1.2V, the voltage within the permitted range of the CD4067, CD4067 input port and isolation circuit. 485 bus communication between the data acquisition module and the host microcontroller, the microcontroller serial input / output after a MAX485 level translator to receiving the 485 bus. Sampling rate by the host microcontroller control. Due to the limited space under the machine software design is not mentioned.

Figure 2 data acquisition module schematic


Host computer communication program design

Application VB6.0 embedded MSComm control will be able to send and receive serial data through a simple setup and programming. The MSComm control provides properties and methods of a series of packaged standard serial communication, and Nikon D5000 Battery Charger use it to build the application and the serial connection, complete the send and receive serial data. Its initialization properties set as follows:

The if MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
MSComm1.CommPort, = CommNum 'serial number
9600 baud, no parity, 8 data bits, one stop bit.
MSComm1.Settings = 9600, N, 8,1
MSComm1.InputLen = 0
MSComm1.RThreshold = 20 'to receive data threshold
MSComm1.SThreshold = 0 'Send able to fulfill the raw event
MSComm1.InputMode = comInputModeBinary

'Communications for the binary mode
MSComm1.PortOpen = True 'Open the serial port
MSComm1.InBufferCount = 0 'clear the receive buffer
MSComm1.OutBufferCount = 0 'clear the transmission buffer
Up bits of the next bit machine sends the data frame format shown in Figure 3:

Figure 3 receives the data frame type

Each frame of data consists of 20 bytes are: frame mark the beginning of a byte is FF; one byte of data group; 16 bytes of data; one byte checksum, the checksum and the group number and 16 bytes of data between the XOR result; last byte frame marks the end of the FD. 16 bytes of data, each byte represents a battery voltage value, an integer from 0 to 255 the number divided by 100 and get the actual voltage value, generally single cell voltage of 0.5V ~ 1.2V . By MSComm serial communication receive data can be used two ways to achieve a query, the other is the event trigger. In this system, select the event trigger mode, a receive events triggered whenever the number of data bytes in the receive buffer reaches 20. Receive communications procedures are as follows:

Private Sub MSComm1_OnComm ()
The dim InputData () As Byte
Dim strSum As Byte
Dim i As Integer
Dim Volvalue (0 To 18) As Single
With MSComm1
Select the Case. The CommEvent determine the communication event
comEvReceive: received 20 bytes of data
InputData = Input 'read the receive buffer
If InputData (0) = 253 And InputData (18) = 237 Then 'determine the received frame format correctly whether
For i = 1 To 17 Step 1
Volvalue (i) = InputData (i)
Next I
strSum = InputData (1)
For i = 2 To 17 'calculate the checksum
strSum = InputData (i) Xor strSum
Next I 'will accept the data validation and send checksum and XOR
If strSum = 0 Then 'If receive data is correct
Volvalue (N) = InputData (i) / 100
'Conversion to get the actual voltage value
............ Data Processing
Case Else
MSComm1.InBufferCount = 0 'clear the receive buffer
The MsgBox serial communication error
Exit Sub
End Sub

At this point is to pay attention to when reading data from the buffer the array InputData () must be defined as type Byte can not be Integer or JVC GZ-MG20U Battery Charger  Single, because the receive mode is set to binary. The host computer to send fewer instructions are very simple in this careful analysis.

5 Conclusion

A new, clean energy fuel cell more optimistic about the prospects for the 21st century, about the technology all help to promote further development to the practical stage. In this paper, made in the design of monolithic voltage detection and analysis system. For fuel cells, but can also learn from other similar multi-point detection and control system design.