Design of battery status detection and control software based on Qt/Embedded

Publisher:chinapxfLatest update time:2011-10-10 Source: 互联网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

The state parameter detection in the battery production process is the key to ensure the quality of the battery. However, at present, the state detection of domestic batteries mainly relies on instruments such as battery voltage patrol meter, battery conductivity tester and internal resistance capacity tester. These instruments can only realize a single detection of battery status, and the operation flexibility is limited. The storage, transmission and real-time analysis of data require the assistance of additional PCs to achieve, which can no longer meet the current many high-demand industrial field control applications. In order to make the battery performance parameter measurement on the battery production line more flexible, this paper proposes a portable battery state detection system based on QT/embedded, which realizes multi-channel data acquisition of batteries, the control software interface is friendly, and the detection instrument is light and convenient.

2 Overall design and implementation of the system

This detection system consists of several parts such as data acquisition part, A/D conversion, ARM microcontroller and data storage. The overall architecture design diagram is shown in Figure 1. Among them, the data acquisition part mainly completes the acquisition of battery performance parameters, the A/D conversion part mainly completes the analog/digital conversion of the collected signal, and the ARM microcontroller is the key part of the whole system. It is mainly responsible for connecting with the QT/embedded-based system, accepting the command information of third-party users and performing corresponding processing. The data storage part is mainly responsible for storing the processed data in the USB device to provide a basis for future data analysis.

3 Design of control software

3.1 Introduction to QT/embedded

QT/embedded is a complete self-contained GUI and Linux-based embedded platform tool, and is the version of QT on the embedded platform. It directly interacts with Linux I/O and framebuffer through QT API, has high operating efficiency, and adopts object-oriented programming as a whole, with a good system architecture and programming mode. Through QT/embedded, control software working on embedded devices can be directly built, providing a good human-computer interaction interface for portable devices, making the operation of the device more flexible.



Figure 1 Composition of the measurement system


3.2 Porting of qt/embedded

This article adopts the host-target board porting method. After debugging on the host, the debugged program is ported to the target board.

3.2.1 Porting on the host

qt/embedded directly writes to the frame buffer, and on the host, qvfb (vital frame buffer) is used to simulate the frame buffer. The tools and environment variables required for porting on the host are shown in Table 1. The setting of the environment variables can be directly declared using export. When configuring qt-embedded-3.3.2, /configure-qconfig-qvfb-depths4, 8, 16, 32 specifies the qt/embedded development package to generate the virtual buffer frame tool qvfb.



3.2.2 Transplantation on the target board

Apply the qt/embedded program to the arm development board and configure the linux-arm-g++ configuration option during configure[6]. Finally, burn the cross-compiled application to the /opt directory of the root file system of the development board.

3.3 Framework structure of the application

The battery status detection control software based on qt/embedded includes the following four main modules, as shown in Figure 2.



Figure 2 Software framework structure

3.3.1 User interface module The

user interface is shown in Figure 3, which mainly includes staff information (Figure 3 Part ①), battery information (Figure 3 Part ②), data to be displayed (Figure 3 Part ③) (ideal data, upper and lower limits of data, actual test data and current battery status) and data storage (Figure 3 Part ④). Before the test personnel start working, they need to manually input employee information and equipment information to facilitate data classification, and finally store these data together.



Figure 3 Human-machine interface operation diagram


3.3.2 Data processing module

The basic structure flow chart of the data acquisition processing module is shown in Figure 4. After the system is started, the ARM microprocessor chip is initialized first. After the initialization is completed, the system starts the QT host computer software, and then the entire program enters the monitoring state, constantly detecting whether there is a control command event trigger. Once triggered, A/D conversion is performed, and the information collected by the data acquisition module is converted into digital/analog. Finally, the processed data is sent to the display module for display.



Figure 4 Software Flowchart



In the design of the driver for the ad module, the interrupt acquisition method is used to complete data acquisition. The main code of the ad driver function is as follows:

(1) Device initialization, registration of the driver device. To prevent device number conflicts, the device registration here uses automatic allocation of device numbers.

devfs_handle=devfs_register(null,device_name,devfs_fl_auto_devnum,0,0,s_ifchr|s_irusr|s_iwusr,&s3c2410_fops,null).

(2) The open function is used to set the ad channel and initialize the scale factor.

init_waitqueue_head (&adcdev.wait);
//Wait queue, when data arrives, the process is awakened and returns the data to the caller.
adcdev.channel=0;
adcdev.prescale= 0xff;
//ad setting, indicating sampling of channel 0.

(3) The read function, one of the key functions, in this function, the control register of the ad device needs to be configured and the conversion started. Use the copy_to_user function to transfer data from the kernel to the user space. The main code of the function is as follows:

start_adc_ain(adcdev.channel, adcdev.prescale);
interruptible_sleep_on(&adcdev.wait);
copy_to_user (buffer, (char*)&ret, sizeof(ret)).

(4) Finally, write all the function functions into file_operations.



Table 1 Tools and environment variables required for transplantation on the host machine


4 Summary

In the research and design of various detection systems, data acquisition is an indispensable link. This system is based on the s3c2410a microcontroller and uses the graphical programming language qt to design a visual and friendly control interface, which can significantly improve the display effect of the human-machine interface. The system has high stability and reliability, and is particularly suitable for portable detection devices. Therefore, the system has broad market prospects.

Reference address:Design of battery status detection and control software based on Qt/Embedded

Previous article:Application of batteries in wind power generation
Next article:A streamlined and efficient battery charging design

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号