Research on DSP-based online UPS uninterruptible power supply control system

Publisher:温暖微笑Latest update time:2013-11-30 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  introduction

  With the popularity of computers and the widespread application of information processing technology, uninterruptible power supplies (UPS) play an important role in connecting critical loads to the public power grid. They are designed to provide clean, continuous power to loads under any normal or abnormal utility power conditions. Texas Instruments (TI) TMS320F28335 DSP provides an enhanced, cost-effective solution for online UPS design, which can execute multiple control algorithms at high speed, making it possible to achieve high sampling rates.

  This paper implements the design of an uninterruptible power supply control system based on TMS320F28335, which can realize multiple control loops of online UPS in a single chip, thereby improving integration and reducing system cost. Digital control also brings advantages such as programmability, noise immunity and avoidance of redundant voltage and current sensors to each controller. DSP programmability means that the system can be updated with enhanced algorithms to improve reliability.

  System Introduction

  UPS is mainly classified by working mode, and it is divided into three categories: backup type, online interactive type, and online type. The output of online UPS is mostly sinusoidal wave, and the voltage and frequency are stable, so it is mostly used in places with high power supply quality requirements. The UPS power supply system introduced in this article is online, mainly composed of input filter, charger, DC/DC converter, microcontroller, inverter circuit, input power factor adjustment circuit, RS232 communication interface, alarm circuit and other parts.

  The controller of the UPS system uses the industry's first floating-point TMS320F28335 DSP launched by TI. It has a 150MHz high-speed processing capability, a 32-bit floating-point processing unit, and a single instruction cycle 32-bit accumulation operation, which can meet the floating-point processor performance requirements for faster code development and integrated advanced controllers. Compared with the previous generation of leading DSPs, the latest F2833x floating-point controller can not only improve performance by an average of 50%, but also has higher accuracy, simplified software development, and compatibility with fixed-point C28xTM controller software. The overall block diagram of the system is shown in Figure 1.

  Figure 1 System overall block diagram

  When the mains power is normal, the online UPS inputs 220V AC voltage, which is sent to relay RY2 after EMI/RFI filtering. When the mains power voltage is normal, the RY1 relay is in a closed state. Under this condition, the mains power will be divided into the following ways to control the operation of the subsequent circuits:

  (I) The AC power is directly sent to the normally closed contact relay RY2 through the AC bypass, and then supplies power to the load. This situation continues until the UPS performs the startup "self-diagnosis" detection operation, and the UPS is switched from the AC power supply state to the inverter power supply state through the control of the microprocessor.

  (II) The built-in battery pack of the UPS is charged via the charger.

  (III) The mains power supply passes through the fuse and then through the rectifier filter with input power factor adjustment function to become two DC power supplies. After the DC high-voltage power supply is amplified by sinusoidal pulse width modulation and high-frequency filtering in the inverter, it becomes a high-quality pure sinusoidal power supply with stable amplitude, frequency and phase synchronously tracking the frequency and phase of the mains power grid, and finally sent to the load through the output filter.

  (IV) When the mains power supply is abnormal, the battery voltage is converted into a DC high voltage power supply with an amplitude of up to ±390V through the DC/DC converter, and then converted into an AC sine wave through the inverter to supply the load.

  System hardware design

  This scheme uses the TMS320F28335 microcontroller to design the circuit of the UPS control board system. The system is composed of bus voltage detection circuit module, amplitude detection circuit module, current peak protection circuit module, auxiliary power monitoring circuit module, on/off circuit module, voltage detection circuit module, PWM generation circuit module, relay control circuit module, external expansion memory module and peak sound generation circuit module.

  Bus voltage detection module

  The bus voltage detection circuit module is shown in Figure 2. The divided +BUS voltage is sent to the DSP's AD conversion pin ADCINA2 after RC filtering. The divided -BUS voltage is sent to the DSP's AD conversion pin ADCINA3 after the inverter and the RC filter.

  Amplitude detection circuit module

  The amplitude detection circuit is shown in Figure 3, which is used for inverter output voltage, mains input voltage, and load current amplitude detection. The circuit is implemented using a positive unidirectional active precision detector. The purpose of using an active precision detector is to ensure that the amplitude of the unipolar signal obtained from the output of the detector always maintains a strict linear relationship with the amplitude of the sine wave signal input to the detector, so as to eliminate the nonlinear distortion that may be generated by a general diode detector when a small signal is input.

  Figure 2 Bus voltage detection circuit module [page]

  Figure 3 Amplitude detection circuit module

  Current peak protection circuit module

  The current peak protection circuit is shown in Figure 4. After the UPS output power on the power board passes through the current transformer, the signal representing the current size in the form of voltage passes through the signal amplifier and is divided into three paths. One path passes through the amplitude detection circuit and is sent to the ADCINA0 pin of the DSP; one path passes through the current zero-crossing detection circuit and is sent to the GPIO75 pin of the DSP; the other path passes through the overload and short-circuit protection circuit. When the load is overloaded or short-circuited, PWM_OFF becomes a low-level signal, which immediately shuts off the two PWM wave outputs required by the inverter, and at the same time, the DSP switches the system to the bypass working mode, which plays a rapid protection role.

  Figure 4 Current peak protection module

  Auxiliary power supply monitoring circuit module

  The auxiliary power supply monitoring circuit is shown in Figure 5. Under normal circumstances, the output of the op amp is clamped to 5V through the pull-up resistor. If the 12V power supply is lower than 10V or the 5V power supply is higher than 5V for some reason, the output of the op amp will become a low level. Then, due to the effect of diode D, PWM_OFF will be pulled to a low level, which will shut down the PWM output and play a protective role.

  On/off circuit module

  The system's power on and off circuit is shown in Figure 6. When the power button is pressed, the divided positive battery power is sent to the power circuit on the power board through the power button, current limiting resistor, and diode. The power board then generates 12V and 5V DC auxiliary power to power the control board. When the DSP is started, it scans the GPIO78 pin to see if it is actually turned on. If it is confirmed that the power button is pressed, then a "self-test" is performed. When the "power off" button is pressed, GPIO77 is at a high level. When the DSP scans the pin to be at a high level, it performs a shutdown operation.

  Voltage detection circuit module

  The battery voltage detection circuit module is shown in Figure 7. After the battery pack voltage is divided, it is sent to the AD conversion pin ADCINA4 of the DSP.

  Figure 5 Auxiliary power supply monitoring circuit module

  Figure 6 Power on and off circuit module

  Figure 7 Voltage detection circuit module

  PWM generation circuit module

  The input signal of the triangle wave generating circuit is from the EPWM1A pin of the DSP. This signal is a PWM signal. After integration, it becomes a triangle wave and is sent to the PWM generating circuit. The PWM signal EPWM2A from the TMS320F28335 is filtered by a second-order low-pass filter to generate a sine reference wave signal, which is inverted with the voltage feedback signal of the inverter output. The PWM signal output by the EPWM2A pin tracks the mains input, and the circuit has the function of regulating the output sine wave signal. As shown in Figure 8, this is the circuit for generating triangle waves and sine waves.

  The PWM generation circuit module is shown in Figure 9. It uses the sinusoidal pulse width modulation (SPWM) method to achieve the purpose of pulse width modulation. According to the modulation principle, a positive pulse with a pulse width equal to the time interval corresponding to the part of the triangle wave greater than the sine wave can be obtained at the output of the comparator. The PWM_OFF signal in the figure is used to control the output of PWM. When the signal is low, there is no PWM output.

  Figure 8 Triangular wave and sine wave generation circuit

  Figure 9 PWM generation circuit module

  Relay control circuit module

  The relay control circuit module uses NPN transistors to drive the relays, and its control signal comes from the GPIO64 pin of TMS32028335. When GPIO64 outputs a high level, relay RY1 is activated. Similarly, relay RY2 also uses this drive circuit.

  External memory module

  The external memory circuit is mainly used to record the working status of the system, such as the daily system load, mains voltage, working hours, etc. The recorded data is provided to the PC software for analysis through the RSR232 communication interface to achieve the multifunctionality of the human-machine interface. The external memory has 512K*8Bits FLASH and 4K*8bits SRAM storage space. The DSP and the external memory transmit data through the communication protocol.

  Peak sound generation circuit module

  The beeping circuit module generates a beeping sound when the GPIO63 pin from the TMS32028335 outputs a high level.

  System software design

  The whole system program flow is shown in Figure 10.

  Figure 10 System program flow chart [page]

  The timer period interrupt flow chart is shown in Figure 11.

  Figure 11 Timer period interrupt flow chart

  A/D sampling subroutine

  The main tasks are line current sampling and line voltage sampling. To ensure that there is no relative phase shift between the voltage and current signals, this part uses the synchronous sampling method of the ADC on the TMS320F28335 chip. To improve the sampling accuracy, the mean filter method is used in the A/D interrupt subroutine.

  interrupt void adc_isr(void)

  {

  if(counter==0)

  {

  receive_a0_data[i++] = AdcRegs.ADCRESULT0>>4; // right shift four bits

  receive_b0_data[j++] = AdcRegs.ADCRESULT1>>4; // right shift four bits

  }

  if(counter>=1)

  { // Average the results and smooth the filter

  receive_a0_data[i++] = (receive_a0_data[i0++]+(AdcRegs.ADCRESULT0>>4))/2;

  receive_b0_data[j++] = (receive_b0_data[j0++]+(AdcRegs.ADCRESULT1>>4))/2;

  }

  if(i==512) {i=0;i0=0;}

  if(j==512) {j=0;j0=0; counter++;}

  AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1; // Reset sequencer

  AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1; // Clear interrupt flag

  PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Enable interrupt response

  Experimental Results

  During the experiment, an oscilloscope was used to detect the waveform of the inverter output voltage tracking the AC grid voltage in a stable state. The results show that the inverter system can basically achieve zero-static tracking. When the grid suddenly loses power, the system switches to a protection waveform, and the switching time is <10ms, indicating that the UPS has a fast detection speed for grid power failure and a short switching time; when the AC grid is undervoltage <190V, the UPS output is converted from the grid to the waveform of the inverter supplying power to the load, and the voltage waveform fluctuates little during the switching process. The inverter output voltage has a small distortion, and the switching time is <10ms. When the UPS is suddenly loaded, the output voltage has a dynamic response waveform. It can be seen that the output voltage fluctuates little, the recovery time is <40ms, and the dynamic response speed is fast, meeting the requirements of stability and dynamic performance.

  Basic parameters of the system

  Conclusion

  The online UPS uninterruptible power supply control system uses TMS320F28335 as the main control chip. Compared with the traditional analog system, it has the advantages of compact structure, good reliability, high precision, convenient debugging, and low cost, which fully reflects the advantages of digital control. From the test results, it fully meets the system requirements. Finally, it can provide users with reliable, accurate and stable power supply voltage, realize the digitization, intelligence and networking of online UPS, and has a good market application prospect.

References:

[1]. RS232 datasheet http://www.dzsc.com/datasheet/RS232_585128.html.

Reference address:Research on DSP-based online UPS uninterruptible power supply control system

Previous article:An encryption algorithm suitable for RFID reader and its implementation
Next article:Design of Signal Analysis System for RF Reader/Writer Based on SPCE061A

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号