High-speed AVR realizes vibration/temperature signal acquisition and storage

Publisher:EnchantingEyesLatest update time:2015-05-08 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  The new intelligent charger system introduced in this article solves the technical key of dynamically tracking the acceptable charging current curve of the battery, forming a unique series of intelligent chargers, improving the charging quality and efficiency. Charging workers only perform auxiliary work, breaking a brand new path for charging technology and charging equipment.

  1 Hardware

  During the battery charging and discharging process, various control rules can be selected, such as constant current, constant voltage, trickle current, charging and discharging time, and termination voltage. The entire system is divided into two layers, the lower layer is the execution layer, and the upper layer is the control layer.

  1.1 Node Layer

  The three-phase bridge type fully controlled rectifier bridge technology is used to realize the charge and discharge conversion. The triggering of the thyristor is completed by MSP430. It is planned to use double narrow pulse triggering to reduce the output power of the triggering device. The core of the lower layer lies in the control of MSP430. MSP430F135 is a 16-bit single-chip microcomputer of the Flash series recently launched by TI. It has a built-in 12-bit A/D converter, a serial communication interface, an integrated JTAG interface, a built-in Flash memory, a watchdog timer, and two 16-bit timers. It can realize functions such as counting, timing generation, and PWM. And through the processing of the stack, it realizes unlimited interrupt and subroutine call levels, and has a nested interrupt structure, that is, the high-level interrupt program can be interrupted by the low-level interrupt request. When the interrupt request occurs at the same time, it is processed according to the priority level. The current and voltage values ​​are collected by its 12-bit A/D as the feedback variable of the closed-loop control. The processed feedback variable is compared with the set value, and the trigger angle is determined according to a certain control law. The trigger signal is directly given by the single-chip microcomputer to open the thyristor. The control accuracy can reach 2.5‰. The current and voltage acquisition adopts differential mode amplification technology. The circuit is simple, easy to implement, and has high feedback accuracy. The single-channel structure diagram is shown in Figure 1.

  

Single channel structure diagram

 

  1.2 Control Layer

  Realize the distributed control of the control system. The main task of the middle layer is to collect the data of multiple lower computers. The middle layer is based on the ATmega16 microcontroller, which is an 8-bit microcontroller compatible with the 51 series and easy to expand peripherals. The lower computer data is uploaded to the non-volatile large-capacity memory (Flash) DA28F640 of this layer through the communication interface. Add a human-machine interface LCD display and keyboard input to this layer, and the operator can directly control the lower computer at this layer. This system can also be networked and connected to a computer. The operator can monitor and manage the lower computer through a PC.

  2. Software

  This system is designed in assembly language and has a modular program structure. It consists of several modules, including the main program module, data acquisition module, data processing module, timing pulse sending module, and communication module. The program first determines the execution command, and then enters the condition setting subroutine. For example, for the constant current charging command, the program first assigns the command end conditions such as setting the current and end time to the judgment variables, and then sets the Boolean values ​​of these variables to true. In this way, various charging and discharging commands are simplified to direct condition judgment by the main loop. The overall program structure is compact, concise, easy to understand, and easy to design, debug, maintain and transplant.

  2.1 Data acquisition/processing

  The data acquisition of this system adopts a differential amplifier circuit to directly introduce voltage and current signals from both ends of the battery. The amplifier OP07 is selected. The analog-to-digital conversion part is completed by the built-in A/D converter of MSP430. The A/D conversion is started in the main loop. After the conversion is completed, the interrupt program stores the converted value in the specified register and leaves it for processing after all conversions are completed. Set the conversion end flag to prevent repeated startup. Due to the existence of various interferences on site, the data obtained has a certain error. In order to make the conversion result more accurate and taking into account the sensitivity of the system, each input signal can be sampled about 4 times, and digital filtering is used in processing, using the arithmetic mean method. The arithmetic mean method is suitable for filtering general signals with random interference, especially for the situation where the signal itself fluctuates around a value.

  In the application, multiple algorithms can be used in combination according to the actual situation of the measured parameters and the data rules to achieve more effective filtering effects. The processed value is first compared with the set value to obtain the difference, and then the relationship is:

  

 

  Where: Ud is the effective value of the transformer secondary phase voltage;

  U2L is the effective value of the transformer secondary line voltage.

  The experiment results in the adjustment relationship between the voltage and current difference and the degree, and then the degree and time are converted into time parameters. After the voltage and current difference is converted into the time difference, the time difference is added (charging) or subtracted (discharging) from the original set value, so as to dynamically adjust the angle, further dynamically adjust the voltage and current values, and maintain the voltage and current with a certain acceptable curve change. Since the system can continuously collect the current and voltage values ​​fed back, and dynamically adjust the control quantity according to the situation at any time, the system can keep up with the changes in current and voltage at any time and take corresponding measures, avoiding the possibility of excessive current during the charging/discharging process, and making the current curve change smoothly. [page]

2.2 Pulse triggering procedure

 

  The P1 port of MSP430 has an external interrupt working mode. Any two phases of the three-phase power are led out through the transformer and connected to the P1 port through the comparator. When the two phases are swapped, the P1 port will cause an interrupt, which can accurately determine the position of the switching point of the two phases. After determining the position of the switching point, the timer is turned on in the P1 port interrupt program, and the time value converted from the voltage is paid to the 16-bit register of the timer. The timer generates an interrupt after the trigger angle time, and the pin of the corresponding trigger pulse is turned on in the timer interrupt program. According to the rule, the pulse ends after 15°, and then after 45°, the next trigger pin is turned on. After one cycle (360°), the sampled voltage or current re-determines the trigger angle and resets the register of the timer.

  

 

  2.3 Upper-layer Programs

  The upper program mainly consists of two parts: the human-machine interface part and the communication part. The human-machine interface includes two parts: keyboard control and display. In the program, various control rules and control programs are compiled using the keyboard. The DA28F640 can be divided into several areas, with each node in the lower layer corresponding to one area, and the corresponding charging and discharging program and the field data transmitted from the lower layer are stored in the corresponding area. A small font library is established inside the microcontroller, and the characters to be displayed are stored to ensure that the LCD screen can dynamically display the current voltage, current, time and other values.

  3 Conclusion

  The system has a high degree of automation, which greatly improves production efficiency; the human-machine interface is friendly and easy to operate and manage. The operator only needs to compile the control program at the control layer, and the system is responsible for transmitting the program to each node, which is operated independently by each node without the need for supervision in the middle, realizing the full automation of the equipment. The changes in current and voltage during the working process are automatically adjusted by the system. In the case of power failure, the system will automatically save the on-site data, realizing the intelligence of the system.

Reference address:High-speed AVR realizes vibration/temperature signal acquisition and storage

Previous article:AVR microcontroller LED light cycle displacement assembly program
Next article:AVR microcontroller timer 0 overflow interrupt program

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号