Solar cell testing software design

Publisher:知者如渊Latest update time:2013-02-23 Source: 微型机与应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 System overall structure and function
    The solar cell performance test system consists of two parts: hardware structure and measurement and control software. The hardware structure mainly includes three parts: optical path system, sample chamber and measurement circuit, as shown in Figure 1. The software is mainly divided into two parts: upper computer software and lower computer program.

    Xenon lamp is selected as the sunlight simulation light source because it has a wide and continuous spectral range, covering ultraviolet light to infrared light, and is an ideal sunlight simulation light source. The light source is converted into an alternating complex light signal by a chopper, and then passes through a grating monochromator to provide an alternating monochromatic light signal for the test system. The existence of the bias light source enables the system to have the conditions for testing multi-cell solar cells. Xenon lamps and halogen tungsten lamps can be used as light sources. The solar cell sample to be tested and the calibrated standard detector are placed on the moving platform in the sample chamber and connected to the computer through a data acquisition card. The host computer software can configure the hardware system status and obtain the acquisition card data. After data processing, it generates the absolute spectral response curve of the standard detector, the absolute spectral response curve of the solar cell to be tested, and the quantum efficiency curve.
2 Overall design of the host computer and data processing
2.1 Overall design of the host computer

    As a medium for human-computer interaction, the host computer software should have the characteristics of simple interface, easy user understanding, and simple and fast operation. In view of the fact that C++ Builder, a high-performance visual integrated development environment, has a large number of reusable controls and powerful database processing capabilities [1-2], this software is selected as the development tool. The software interface is shown in Figure 2.

3.1 HID firmware program design
    The host computer detects the USB device by changing the level signal of the hub receiving end, which requires the device end D+ or D- to be connected to a pull-up resistor to a 3.3 V power supply. The STM32F103 microcontroller does not do internal pull-up in this link, so a soft pull-up circuit is built to simulate the connection and disconnection of the pull-up resistor by using the level change of the I/O port PE0. The USB hardware implementation is shown in Figure 5.

    The communication between the HID device and the host is completed through the USB control pipe (the default pipe is endpoint 0) and interrupt pipe 1. The descriptors of the HID device include device descriptors, configuration descriptors, interface descriptors, endpoint descriptors, string descriptors, HID descriptors, report descriptors, and entity descriptors. The first five descriptors belong to the USB device standard descriptors, while the last three are HID class device specific descriptors. The definition of HID device attributes is realized by configuring the descriptors, such as product ID: idProduct (PID), manufacturer ID: idVendor (VID), including the definition of the port and the definition of the message format. The
    initial data exchange process between the host and the USB device is completed through enumeration. The USB-HID class device parses the host's request and sends a descriptor to the host during enumeration to respond to the host's request. The system uses the solar cell short-circuit current data as a message. When the short-circuit current measurement is completed, the USB device sends the message to the host to complete the information transmission. The HID firmware program flow chart is shown in Figure 6.

3.1.1 USB device standard descriptor
    The device standard descriptor is mainly defined in the usb_desc.c file. The specific operations are as follows:
    (1) Edit the CustomHID_DeviceDes-criptor device descriptor, and define the experimental PID and VID of the device in little-endian mode as 0×123 4 and 0×567 8.
    (2) Edit the ConfigurationDescriptor
configuration descriptor, define the interface number as 0, define the endpoint, and define the interface protocol as a HID custom device.
    (3) Edit the Endpoint Descriptor endpoint descriptor, and define the maximum packet length of the input and output endpoints as 8 B.
    (4) Edit the CustomHID_ReportDescriptor message descriptor and set the 8 B message format.
    (5) Edit the StringLangID, String
Vendor, StringProduct, and StringSerial descriptors to set the device manufacturer ID, product ID, and product serial number.
3.1.2 USB endpoint settings
   Edit the usb_prop.c file and configure the endpoints. The specific operations are as follows:
    (1) Edit the CustomHID_Reset(void) function to initialize endpoint 0 and endpoint 1, and call the SetEPType() function to initialize endpoint 0 as a control endpoint type and endpoint 1 as an interrupt endpoint type.
    (2) Call SetEPRxAddr() and SetEPTxAddr() to set the address of the received and sent data.
    (3) Call SetEPTxCount() and SetEPRxCount() to set the length of the received and sent data to 8 B.
3.1.3 Main function framework
    Write the main.c file and complete the following content:
    (1) Include the key header files stm32f10x_lib.h, usb_lib.h, and hw_
config.h.
    (2) Call Set_System(), USB_Interrupts_ConFig(), Set_USBClock(), and USB_Init() functions to configure the system clock, USB interrupt, USB clock, and initialization.
    (3) Write the CustomHID_Send() data sending function, call UserToPMABufferCopy(), put the data into the output buffer, and call SetEPTxValid(ENDP1) to make endpoint 1 valid to send data.
    (4) Write the CustomHID_Receive() data receiving function, call the PMAToUserBufferCopy() function to obtain data, and call the SetEPRxValid(ENDP1) function to make endpoint 1 valid to receive data.
3.2 Design of the host computer communication module
    The C++ Builder integrated development environment calls the Windows API function to develop the USB-HID program module. By calling the Windows basic library function to obtain the globally unique identifier (GUID), device ID, device interface, buffer pointer and other information of the HID device, the message information is finally obtained, and the parsed data is handed over to the data processing module for further processing. The host computer HID program flow chart is shown in Figure 7.

 

 

    The functions that the host computer calls to implement communication with the USB-HID device are as follows:
    (1) Use the HidD_GetGuid function to obtain the 128-bit GUID.
    (2) Use the SetupDiGetClassDevs function to obtain the device information group.
    (3) Use the SetupDiEnumDeviceInterfaces function to identify the HID interface.
    (4) Use the SetupDiGetDeviceInterfaceDetail function to obtain the device path.
    (5) Use the CreateFile function to open the device and use the CloseHandle function to release resources.
    (6) Use the HidD_GetAttributes function to obtain the device ID.
    (7) Use the HidD_GetPreparsedData function and the HidD_Free
PreparsedData function to obtain the buffer pointer and release resources.
    (8) Use the WriteData function and the ReadFile function to send and read messages.
4 Software test results
    The software detects that the relevant equipment is in a connected state, places the standard solar cell and the solar cell to be tested on the sample chamber test table, and configures the relevant test parameters. Under the conditions of scanning range 300 nm~1 200 nm, wavelength interval 10 nm, chopper and lock-in amplifier reference frequency 2 Hz, single point test 10 times, and buffer time 10 s, the data uploaded by the USB-HID device is successfully obtained. The host computer software calls the TeeChart control to draw the spectral response curve of the battery to be tested, and the test results are shown in Figure 8.

    USB has gradually replaced the serial port and become the commonly used interface and communication method for test instruments at this stage, which greatly enhances the versatility and ease of use of the instrument. The system adopts USB communication method. At the same time, the host computer software has the ability to obtain stable and accurate data, and accurately and intuitively displays the test results in the form of images, which has certain practical value.
References
[1] Yuan Xue, Xu Chaoyang, Zhu Chunguang, et al. C++ Builder 6 Introduction and Improvement [M]. Changsha: National University of Defense Technology Press, 2002.
[2] Wu Yixian, Wu Mucheng. Wonderful C++ Builder 6 Programming [M]. Beijing: Science Press, 2003.
[3] GB 11009-1989 Solar Cell Spectral Response Test Method [S]. Approved by the Ministry of Machinery and Electronics Industry of the People's Republic of China on March 2, 1989: implemented in 1990.
[4] Liao Jilin. USB2.0 Application System Development Example [M]. Beijing: Publishing House of Electronics Industry, 2006.
[5] Xue Yuanyuan. USB Application Development Technology Encyclopedia [M]. Beijing: People's Posts and Telecommunications Press, 2006.

Reference address:Solar cell testing software design

Previous article:A high-efficiency DC-DC module power supply implementation solution
Next article:Understand the importance of power components in power systems

Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号