Share this

Research on DSP in Online UPS Uninterruptible Power Supply Control System

2026-04-06 05:59:45 · · #1

introduction


With the widespread use of computers and information processing technologies, uninterruptible power supplies (UPS) play a crucial 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 power conditions. Texas Instruments (TI)'s TMS320F28335 DSP offers an enhanced, cost-effective solution for online UPS design, capable of executing various control algorithms at high speeds, thus enabling high sampling rates.
This paper presents the design of an uninterruptible power supply (UPS) control system based on the TMS320F28335. This system enables the implementation of multiple control loops in an online UPS within a single chip, thereby improving integration and reducing system cost. Digital control also offers advantages such as programmability for each controller, noise immunity, and avoidance of redundant voltage and current sensors. DSP programmability means that enhanced algorithms can be used to update the system to improve reliability.


System Introduction


UPS systems are mainly classified according to their operating mode, into three main categories: standby, line-interactive, and online. Online UPS systems typically output a sine wave with stable voltage and frequency, making them suitable for applications requiring high power quality. The UPS power supply system described in this article is an online type, primarily composed of an input filter, charger, DC/DC converter, microcontroller, inverter circuit, input power factor regulation circuit, RS232 communication interface, and alarm circuit.
The UPS system controller utilizes TI's industry-first floating-point TMS320F28335 DSP, featuring a 150MHz high-speed processing capability, a 32-bit floating-point processing unit, and 32-bit accumulation operation per instruction cycle. This meets the performance requirements of floating-point processors used in faster code development and the integration of advanced controllers. Compared to its predecessors, the latest F2833x floating-point controller not only offers an average performance improvement of 50%, but also boasts higher precision, simplified software development, and compatibility with fixed-point C28xTM controller software. The overall system block diagram is shown in Figure 1.


Figure 1 System Overall Block Diagram


When the mains power is normal, the online UPS receives a 220V AC input voltage, which, after EMI/RFI filtering, is sent to relay RY2. When the mains power voltage is normal, relay RY1 is in the closed state. Under these conditions, the mains power supply will control the operation of the downstream circuits through the following channels:
(I) The AC power is directly supplied to the normally closed contact relay RY2 via the AC bypass, and then supplies power to the load. This situation continues until the UPS performs the startup "self-diagnosis" test, and the microprocessor controls the UPS to switch from AC power supply to inverter power supply.
(II) Charge the UPS’s built-in battery pack via the charger.
(III) The mains power supply passes through a fuse and then through a rectifier filter with input power factor regulation to become two DC power supplies. This DC high-voltage power supply is amplified by sinusoidal pulse width modulation and filtered at high frequency in the inverter, and then becomes a high-quality pure sinusoidal power supply with stable amplitude, frequency and phase that synchronously track the frequency and phase of the mains power grid. Finally, it is sent to the load through an 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 by the DC/DC converter, and then converted into an AC sine wave by the inverter to supply the load.


System hardware design


This solution utilizes the TMS320F28335 microcontroller to design the circuitry of a UPS control board. The system comprises a bus voltage detection circuit module, an amplitude detection circuit module, a current peak protection circuit module, an auxiliary power supply monitoring circuit module, a power-on/power-off circuit module, a voltage detection circuit module, a PWM generation circuit module, a relay control circuit module, an external memory module, and a buzzer generation circuit module.


Bus voltage detection module


The bus voltage detection circuit module is shown in Figure 2. The divided BUS voltage is filtered by an RC filter and then sent to the DSP's AD conversion pin ADCINA2. The divided -BUS voltage is inverted, then filtered by an RC filter and sent to the DSP's AD conversion pin ADCINA3.


Amplitude detection circuit module


The amplitude detection circuit, shown in Figure 3, is used to detect the amplitude of the inverter output voltage, mains input voltage, and load current. This circuit employs 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 detector's output always maintains a strict linear relationship with the amplitude of the sinusoidal signal input to the detector, thereby eliminating the nonlinear distortion that may occur with a typical diode detector under small signal input conditions.


Figure 2 Bus voltage detection circuit module


Figure 3 Amplitude detection circuit module


Peak current protection circuit module

 


The peak current protection circuit is shown in Figure 4. The UPS output power on the power board, after passing through a current transformer, generates a voltage-to-current signal which is then amplified and split into three paths. One path passes through an amplitude detection circuit and is sent to the DSP's ADCINA0 pin; another path passes through a zero-crossing current detection circuit and is sent to the DSP's GPIO75 pin; the third path passes through an overload and short-circuit protection circuit. When the load is overloaded or short-circuited, PWM_OFF becomes a low-level signal, immediately shutting off the two PWM wave outputs required by the inverter. Simultaneously, the DSP switches the system to bypass mode, providing rapid protection.


Figure 4 Current Peak Protection Module


Auxiliary power 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 by the pull-up resistor. If the 12V power supply is lower than 10V for some reason or the 5V power supply is higher than 5V for some reason, the output of the op-amp will become low level. Then, due to the effect of diode D, PWM_OFF will be pulled low level, which will turn off the PWM output and play a protective role.


Power on/off circuit module


The system's power-on and power-off circuits are shown in Figure 6. When the power button is pressed, the battery positive terminal power, after voltage division, is sent to the power-on circuit on the power board via the power button, current-limiting resistor, and diode. The power board then generates 12V and 5V DC auxiliary power to power the control board. After the DSP starts, it scans the GPIO78 pin to check if the system is actually powered on. If the power button is confirmed to be pressed, a self-test is performed. When the power button is pressed, GPIO77 is high. When the DSP detects this high level, it performs a power-off operation.


Voltage detection circuit module


The battery voltage detection circuit module is shown in Figure 7. After being divided, the battery voltage is sent to the DSP's AD conversion pin ADCINA4.


Figure 5 Auxiliary power supply monitoring circuit module


Figure 6 Power on/off circuit module


Figure 7 Voltage detection circuit module


PWM generation circuit module

 


The input signal to the triangular wave generation circuit comes from the EPWM1A pin of the DSP. This signal is a PWM signal, which, after integration, is converted into a triangular wave and sent to the PWM generation circuit. The PWM signal EPWM2A from the TMS320F28335, after second-order low-pass filtering, generates a sinusoidal reference wave signal, which is out of phase with the voltage feedback signal of the inverter output. The PWM signal output from the EPWM2A pin tracks the mains input, and this circuit has the function of regulating the output sinusoidal wave signal. Figure 8 shows the triangular wave and sine wave generation circuits.
The PWM generation circuit module is shown in Figure 9. It uses sinusoidal pulse width modulation (SPWM) to achieve pulse width modulation. According to the modulation principle, a positive pulse with a pulse width equal to the time interval corresponding to the larger portion of the triangular wave than the sine wave can be obtained at the output of the comparator. In the figure, the PWM_OFF signal is used to control the PWM output; when this signal is low, there is no PWM output.


Figure 8. Circuits for generating triangular and sine waves.


Figure 9 PWM generation circuit module


Relay control circuit module


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


External memory module


The external memory circuit is mainly used to record the system's operating status, such as daily system load, mains voltage, and operating time. The recorded data is supplied to the PC software for analysis via an RSR232 communication interface, enabling a multi-functional human-machine interface. The external memory has 512K*8Bits FLASH and 4K*8Bits SRAM storage space, and the DSP and the external memory transmit data via a communication protocol.


Peak generation circuit module


The humming generation circuit module generates a humming sound when the GPIO63 pin of the TMS32028335 outputs a high level.


System software design

The overall system program flow is shown in Figure 10.


Figure 10 System Program Flowchart


The flowchart for the timer period interrupt is shown in Figure 11.


Figure 11 Timer Period Interrupt Flowchart


A/D sampling subroutine


This section primarily performs line current and line voltage sampling. To ensure there is no relative phase shift between the voltage and current signals, this part utilizes the synchronous sampling method of the TMS320F28335 on-chip ADC. To improve sampling accuracy, mean filtering is employed in the A/D interrupt subroutine.
interrupt void adc_isr(void)
{
if(counter==0)
{
receive_a0_data[i++] = AdcRegs.ADCRESULT0>>4; // Shift right by four bits receive_b0_data[j++] = AdcRegs.ADCRESULT1>>4; // Shift right by 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 the sequencer AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1; // Clear the interrupt flag PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Enable interrupt acknowledge

Experimental results


During the experiment, an oscilloscope was used to detect the waveform of the inverter output voltage tracking the AC grid voltage under steady-state conditions. The results show that the inverter system can basically achieve zero steady-state error tracking. When the grid suddenly loses power, the system switches to the protection waveform with a switching time of <10ms, indicating that the UPS has a fast grid power failure detection speed and a short switching time. When the AC grid undervoltage is <190V, the UPS output switches from the grid waveform to the inverter's power supply waveform to the load, with small voltage waveform fluctuations during the switching process. The inverter output voltage distortion is small, and the switching time is <10ms. The dynamic response waveform of the output voltage when the UPS suddenly adds a load shows small output voltage fluctuations and a recovery time of <40ms, indicating a fast dynamic response speed, which meets the requirements for stability and dynamic performance.


System basic parameters

 


Conclusion

 
The online UPS uninterruptible power supply control system, using the TMS320F28335 as the main control chip, offers advantages over traditional analog systems, including compact structure, high reliability, high precision, convenient debugging, and low cost, fully demonstrating the advantages of digital control. Test results show that it fully meets system requirements. Ultimately, it can provide users with a reliable, accurate, and stable power supply voltage, realizing the digitalization, intelligence, and networking of online UPS systems, and has good market application prospects.

Read next

CATDOLL 123CM Chu TPE

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL 139CM Sasha Silicone Doll

CATDOLL 139CM Sasha Silicone Doll

Articles
2026-02-22
CATDOLL 136CM Miho

CATDOLL 136CM Miho

Articles
2026-02-22
CATDOLL 138CM Tami Silicone Doll

CATDOLL 138CM Tami Silicone Doll

Articles
2026-02-22