Introduction
Design a 1kVA online double-conversion UPS with SPWM inverter, battery charger, and bypass relay. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Design a 1kVA online double-conversion UPS with SPWM inverter, battery charger, and bypass relay.
Design a 1kVA online double-conversion UPS with SPWM inverter, battery charger, and bypass relay. This comprehensive guide covers everything from design through implementation, testing, and deployment.
An online double-conversion UPS converts AC to DC (rectifier stage) then DC back to AC (inverter stage). Mains power always flows through this conversion chain — the battery is always connected in parallel and charges when mains is present. On mains failure, the battery instantly supplies the inverter with no transfer time. The output is always clean, regulated sine wave regardless of input quality.
10 components required for this project.
| # | Component | Purpose | Qty |
|---|---|---|---|
| 1 | IGBT Module (600V/30A, H-Bridge) | Full-bridge inverter switching | x1 |
| 2 | IR2110 Gate Driver ICs | High-side and low-side IGBT driving | x4 |
| 3 | DSP Controller (TMS320F28027) | SPWM generation and control | x1 |
| 4 | 12V 100Ah VRLA Battery | 48V battery bank (4S) | x4 |
| 5 | PFC Rectifier Module (1kW) | AC to DC conversion with power factor correction | x1 |
| 6 | LC Output Filter (1mH, 10µF) | Filtering SPWM to clean sine wave | x1 |
| 7 | Current/Voltage Sensors (LEM HAL) | Closed-loop control feedback | x4 |
| 8 | Toroidal Transformer (48V:230V isolation) | Output galvanic isolation (offline mode) | x1 |
| 9 | Static Bypass Relay (40A SPST) | Fast bypass on inverter fault | x1 |
| 10 | Cooling System (240mm PWM Fan + Heatsink) | IGBT thermal management | x1 |
Follow these 8 steps carefully.
An online double-conversion UPS converts AC to DC (rectifier stage) then DC back to AC (inverter stage). Mains power always flows through this conversion chain — the battery is always connected in parallel and charges when mains is present. On mains failure, the battery instantly supplies the inverter with no transfer time. The output is always clean, regulated sine wave regardless of input quality.
SPWM generates a pure sine wave by rapidly switching IGBTs at a carrier frequency (typically 20kHz) with a duty cycle modulated by a reference sine wave at 50Hz. The modulation index M = V_peak_reference / V_peak_carrier determines output voltage amplitude. The LC filter removes the high-frequency switching components, leaving a pure 50Hz sine wave. DSP-based SPWM achieves THD < 3% — suitable for sensitive electronics.
Implement a 3-stage charger: Bulk (constant current at 0.1C rate, e.g., 10A for 100Ah battery until 56.8V for 48V LiFePO4 bank), Absorption (constant voltage at 54.4V until current drops below 0.05C), Float (53.6V constant voltage for maintenance). Monitor individual cell voltages using a BMS chip (BQ76940) for cell balancing and protection.
Implement a PI (Proportional-Integral) controller in the DSP for output voltage regulation. Sample output voltage at 40kHz. Error = V_reference - V_measured. Controller output modifies SPWM modulation index. Tune P and I gains using the Ziegler-Nichols method for step response. Target: output voltage regulation within ±1% for load changes from 0% to 100% rated load.
On inverter fault (IGBT overcurrent, overtemperature, DSP watchdog), the static bypass relay switches the load directly to mains within 5ms. Synchronize the inverter output to mains before transferring to allow synchronized bypass switching, preventing voltage glitch. Monitor inverter output quality continuously — trip to bypass if output THD > 8% or voltage deviation > ±5% for more than 200ms.
Implement battery SOC estimation using voltage, current integration (Coulomb counting), and temperature correction. SOC = SOC_0 + integral(I × dt) / Capacity_Ah. Calibrate SOC to 100% when charger current drops below 0.5A (full charge). Calculate runtime estimate: Runtime_min = (SOC/100 × Capacity_Ah × 48V) / Load_Watts × 60. Display on front panel LCD.
Mount IGBTs on a 0.5°C/W heatsink with thermal paste (Arctic Silver 5). IGBT junction temperature limit is typically 150°C. For 1kW output at 95% efficiency, losses = 50W — mostly in IGBTs. Control cooling fan via PWM based on IGBT case temperature (NTC thermistor). If temperature exceeds 80°C, trigger overtemperature alarm and reduce load capacity. If >90°C, trip to bypass and alert.
Test SPWM waveform with oscilloscope before connecting to load — verify 230V RMS, 50Hz ±0.5Hz, THD < 3%. Connect resistive load (1000W heater): measure regulation and efficiency. Test battery runtime with 500W load (should give >30 minutes on 48V/100Ah bank). Simulate mains failure: verify zero transfer time to battery, load is uninterrupted. Test bypass relay with forced inverter fault.
Core code for spwm_controller.cpp:
// DSP SPWM Generation (TMS320F28027 style pseudocode) #include <DueTimer.h> #define CARRIER_FREQ 20000 #define SINE_STEPS 400 const uint8_t sineTable[SINE_STEPS] = { }; volatile int sineIndex = 0; float modulationIndex = 0.9; float targetVoltage = 230.0; float measuredVoltage = 0; float integralError = 0; void ISR_20kHz() { measuredVoltage = analogRead(A0) * (330.0 / 1023.0); float error = targetVoltage - measuredVoltage; integralError += error * 0.00005; integralError = constrain(integralError, -0.3, 0.3); modulationIndex = constrain(0.9 + (error * 0.002) + integralError, 0.0, 1.0); uint8_t sineVal = sineTable[sineIndex]; uint8_t duty = (uint8_t)(sineVal * modulationIndex); analogWrite(6, duty); analogWrite(7, 255 - duty); analogWrite(8, 255 - duty); analogWrite(9, duty); sineIndex = (sineIndex + 1) % SINE_STEPS; } void setup() { Timer1.attachInterrupt(ISR_20kHz).setFrequency(20000).start(); } void loop() { delay(1000); }
Test Online UPS System Design by verifying each subsystem individually before full integration.
Verify power voltages, check ground connections, use serial monitor for debug.
An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.