Advertisement
Advanced Time: 6–8 weeks Electrical Engineering

Three-Phase Motor Controller (VFD)

Design a variable frequency drive (VFD) to control three-phase induction motor speed using SPWM inverter technology.

VFDThree-PhaseIGBTPWMMotor ControlV/Hz Control
DifficultyAdvanced
Duration6–8 weeks
Components10 items
Steps7 steps

Introduction

Design a variable frequency drive (VFD) to control three-phase induction motor speed using SPWM inverter technology. This comprehensive guide covers everything from design through implementation, testing, and deployment.

Theory & Background

Three-phase SPWM generates three sinusoidal PWM waveforms displaced 120° from each other. Each phase uses complementary top and bottom IGBT switches. The DSP generates six PWM signals: S1–S6, where S1,S3,S5 are top-side and S2,S4,S6 are bottom-side (inverted) for legs A, B, C respectively. A deadtime of 2–4µs prevents shoot-through when complementary switches transition simultaneously.

Advertisement

Components & Requirements

10 components required for this project.

#ComponentPurposeQty
1Three-Phase IGBT Module (1200V/50A)Six-switch inverter bridgex1
2DSP Controller (STM32F303)3-phase SPWM generationx1
3Gate Driver IC (IRAMS10UP60B)IGBT gate driving with protectionx1
4Three-Phase Rectifier Bridge (50A)AC to DC conversionx1
5DC Bus Capacitor (1000µF/450V)DC bus energy storage and filteringx2
63-Phase 2.2kW Induction MotorTest loadx1
7Hall Effect Current Sensors (50A)Phase current feedbackx3
8Braking Resistor (10Ω/500W)Regenerative energy dissipation during decelerationx1
9EMC Input Filter (3-phase)Reducing conducted EMI back to mainsx1
10LCD and Rotary EncoderSpeed setpoint and parameter programmingx1

Step-by-Step Implementation

Follow these 7 steps carefully.

1
Three-Phase SPWM Principles

Three-phase SPWM generates three sinusoidal PWM waveforms displaced 120° from each other. Each phase uses complementary top and bottom IGBT switches. The DSP generates six PWM signals: S1–S6, where S1,S3,S5 are top-side and S2,S4,S6 are bottom-side (inverted) for legs A, B, C respectively. A deadtime of 2–4µs prevents shoot-through when complementary switches transition simultaneously.

2
V/Hz (Volts per Hertz) Control

The simplest motor control strategy maintains a constant ratio of output voltage to frequency. At 50Hz nominal, voltage is 415V (line-to-line). At 25Hz (half speed), voltage is 207V — maintaining constant air-gap flux and therefore constant torque capability. Below 5Hz, boost voltage to overcome stator resistance voltage drop. Implement a linear V/Hz profile with adjustable boost using a lookup table in the DSP.

3
Acceleration and Deceleration Ramping

Abrupt speed changes cause mechanical shock and electrical stress. Implement configurable linear ramp: acceleration time (time from 0 to 50Hz, typical 5–30 seconds) and deceleration time. During deceleration, the motor regenerates energy back to the DC bus, raising bus voltage. The braking resistor dissipates this energy when DC bus voltage exceeds 750V, preventing overvoltage trip.

4
Protection Systems

Implement: overcurrent protection (trip if any phase current > 150% rated for >5 cycles), overvoltage (DC bus > 800V), undervoltage (DC bus < 400V — mains brownout), overtemperature (IGBT module > 90°C via NTC), ground fault detection (sum of three phase currents ≠ 0 indicates ground fault), and output short circuit (instantaneous current > 300% rated — sub-microsecond response via hardware comparator).

5
Motor Parameter Setup

Program motor nameplate data: rated voltage, current, frequency, power, speed. The VFD uses these to set overcurrent thresholds and V/Hz profile breakpoints. Perform autotune: the VFD applies a series of DC pulses to the stopped motor to measure stator resistance (for IR compensation boost), then at low speed to measure leakage inductance. These parameters improve V/Hz control accuracy especially at low speeds.

6
Speed Feedback and Closed-Loop Control

For precise speed regulation, add a digital tachometer or encoder to the motor shaft. Compare actual speed with setpoint speed. A PI controller adjusts the output frequency to maintain setpoint despite load variations. This closed-loop speed control improves steady-state accuracy from ±3% (open-loop V/Hz) to ±0.01% (closed-loop with encoder). Implement anti-windup in the PI integrator for step load changes.

7
Communication Interfaces

Add RS485 Modbus RTU for industrial network integration. Map registers: setpoint frequency, actual frequency, motor current, motor voltage, DC bus voltage, fault code, run/stop command, direction (forward/reverse). This allows PLC or SCADA systems to control the VFD remotely, monitor its status, and command fault resets without operator intervention at the drive panel.

Code & Implementation

Core code for vfd_spwm.cpp:

vfd_spwm.cpp C/C++
// 3-Phase SPWM for STM32 (Arduino framework)   float freq_Hz = 10.0;   float freq_target = 50.0; float ramp_rate = 0.1;    const int SINE_SIZE = 360; float sine_table[SINE_SIZE];  void init_sine_table() {   for (int i = 0; i < SINE_SIZE; i++)     sine_table[i] = sin(2 * PI * i / SINE_SIZE); }  float vhz_ratio = 415.0 / 50.0;  float dutyCycleA, dutyCycleB, dutyCycleC;  void update_SPWM(float freq) {   static float angle = 0;   float V = constrain(freq * vhz_ratio, 0, 415.0) / 415.0;     int idx = (int)angle % SINE_SIZE;   dutyCycleA = 0.5 + 0.5 * V * sine_table[(idx)       % SINE_SIZE];   dutyCycleB = 0.5 + 0.5 * V * sine_table[(idx + 120) % SINE_SIZE];   dutyCycleC = 0.5 + 0.5 * V * sine_table[(idx + 240) % SINE_SIZE];           angle += (freq / 20000.0) * SINE_SIZE;    if (angle >= SINE_SIZE) angle -= SINE_SIZE; }  void apply_ramp() {   if (freq_Hz < freq_target) freq_Hz = min(freq_Hz + ramp_rate, freq_target);   if (freq_Hz > freq_target) freq_Hz = max(freq_Hz - ramp_rate, freq_target); }

Testing & Troubleshooting

Test Three-Phase Motor Controller (VFD) by verifying each subsystem individually before full integration.

!
Troubleshooting Tips

Verify power voltages, check ground connections, use serial monitor for debug.

Real-World Applications

*Centrifugal pump speed control
*HVAC fan speed regulation
*Conveyor belt variable speed
*Compressor capacity control
*Elevator motor drive
*CNC machine tool spindle drive
*Textile machinery speed control
*Water treatment plant control

Extensions & Next Steps

  • Implement Field-Oriented Control (FOC) for higher dynamic performance
  • Add regenerative braking with power fed back to grid
  • Implement PID process control (pressure, flow, level) with VFD as actuator
  • Add IoT connectivity for predictive maintenance analytics
  • Build a multi-drive synchronized system for coordinated motion

Interactive Playground

Coming Soon

An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.

Frequently Asked Questions

How does a VFD save energy in pump and fan applications?
Pump and fan loads follow the affinity laws: flow rate is proportional to speed, and power is proportional to the cube of speed. Running a pump at 80% of full speed delivers 80% of flow but uses only 51% of the power (0.8³). Throttling with valves wastes energy while maintaining full motor speed. VFDs reduce speed to match required flow, achieving 30–50% energy savings in HVAC and pumping systems.
What is the difference between a VFD and a soft starter?
A soft starter reduces motor voltage during starting to limit inrush current (6–8× rated) to 2–3× rated, preventing mechanical shock and electrical stress. Once at rated speed, the soft starter bypasses itself with a contactor — no speed control during running. A VFD provides full variable speed control from 0 to rated speed (and beyond in field-weakening) throughout the entire operation, enabling energy savings and process optimization.
Why do VFDs sometimes cause motor insulation failure?
VFD switching produces common-mode voltages and high dV/dt (voltage rise rate up to 10kV/µs). These cause: (1) bearing currents — high-frequency currents flow through shaft bearings, causing pitting and early bearing failure. Solution: use insulated bearings and shaft grounding brush. (2) Winding insulation stress from voltage spikes. Solution: use inverter-duty motors rated for VFD use and add dV/dt filter at VFD output.
Can I use a VFD with single-phase input for a three-phase motor?
Yes — a three-phase VFD with single-phase input will work, but you must derate the VFD output to 50% of rated capacity because single-phase input means only one phase charges the DC capacitor during each half-cycle (vs. six-pulse charging with three-phase input), resulting in higher capacitor stress and ripple current. Size the VFD at 2× the motor rating when using single-phase input.
What is the maximum cable length between VFD and motor?
Long cables between VFD and motor create capacitive current flow during each IGBT switching transition, causing: increased bearing currents, reflected wave overvoltage at motor terminals (voltage can reach 2× DC bus voltage with long cables), and conducted EMI. Recommended limit without mitigation: 10–30m depending on VFD. For longer cables (up to 300m), use: output reactors (dV/dt filter), motor-rated cables with symmetric shielding, and reduce carrier frequency to 2–4kHz.
Advertisement