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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The command configurations in the manual are all expressed in hexadecimal. How should they be used in the code?
- Gizwits Timer Switch
- Getting Started Manual for Oscilloscopes Written by Tektronix
- Learn “how to arrange” and “how to connect”, PCB design specifications are so easy!
- Here are some questions about the ground insulation detection circuit
- About the panel of splicing screen
- Today at 10:00 AM, live broadcast with prizes: [Nichicon's new power storage device to open up the IoT society]
- [Serial] [Starlight Lightning STM32F407 Development Board] Chapter 12 RTC Experiment
- Develop smart lights based on Gizwits Cloud platform and ESP8266
- Wheeled robots can tackle new challenges and capabilities