Info page · no simulation · Arduino and electronics
3-Phase Motor Speed Control with a VFD and Arduino
How a variable frequency drive changes the speed of a 3-phase induction motor, and how an Arduino can give it a speed signal and a run command safely.
This topic cannot be run safely or meaningfully in the simulator, so this page explains it with diagrams, calculations and sample code instead. Everything here is original.
What you will learn
- Why changing the frequency changes the motor speed
- What a rectifier, DC bus and inverter do inside a VFD
- How to send a 0 to 10 V speed signal and a run command
In short
A VFD turns incoming AC into DC and then builds a new 3-phase AC supply with the frequency you ask for. A 4-pole motor runs at about 120 x frequency / 4 rpm, so 25 Hz gives about 750 rpm and 50 Hz about 1500 rpm (less the slip). The Arduino only sends a speed reference and a run signal. It never touches the motor power wires.
Try this next
- Fit a real 10 k potentiometer to the VFD analog input first.
- Add a stop button and an emergency stop to the run circuit.
- Read the VFD current with an ACS712 on the control side and show it on an LCD.
Danger: 3-phase mains (415 V AC) and stored DC energy. The DC bus capacitors of a VFD stay charged at more than 500 V for several minutes after switch-off. This page is for learning. The power wiring of a VFD must be done by a qualified electrician, with the correct MCCB, earth, motor cable and the drive manual open in front of you. Never connect an Arduino pin to the motor terminals or to the mains side.
What is inside a VFD
The rectifier changes the AC to a steady DC. The capacitors smooth it. The inverter switches the DC on and off thousands of times a second with IGBTs. By changing the switching pattern it produces a 3-phase supply of the frequency you want. The drive also changes the voltage in step with the frequency (V/f control), so the motor does not saturate at low speed.
Speed, frequency and poles
Synchronous speed in rpm = 120 x frequency / number of poles. The real motor speed is a little lower because of slip (about 2 to 5 percent under load).
| Case | Speed |
|---|---|
| 2-pole motor, 50 Hz | 3000 rpm (about 2880 real) |
| 4-pole motor, 50 Hz | 1500 rpm (about 1440 real) |
| 4-pole motor, 25 Hz | 750 rpm (about 720 real) |
| 4-pole motor, 5 Hz | 150 rpm, but the cooling fan is weak: do not run long |
Our site has a separate AC induction motor selector if you need to choose the motor first.
How the Arduino talks to the VFD
- Run / stop: a relay contact (or an optocoupler) closes between the VFD terminals DI (FWD) and the VFD +24 V. The Arduino drives the relay coil only.
- Speed: most drives take 0 to 10 V on the AI1 terminal and have their own +10 V and GND for a potentiometer. An Arduino pin gives only 0 to 5 V as PWM, so you filter the PWM with an RC filter (10 k and 10 uF) and amplify by 2 with an op-amp (LM358 on a 12 V supply, two 10 k resistors, gain = 1 + 10k/10k = 2).
- Better: use an isolated PWM-to-0-10 V converter module. It keeps the Arduino ground separate from the drive ground and avoids noise.
- Digital way: many drives accept Modbus RTU over RS-485. An RS-485 module and a Modbus library let the Arduino set the speed with no analog parts.
const int SPEED_PWM = 9; // PWM pin to the RC filter and 0-10 V amplifier
const int RUN_RELAY = 7; // relay module: contact wired to the VFD run input
const int POT = A0; // speed knob
const int BTN = 2; // run / stop button (to GND)
bool running = false;
void setup() {
pinMode(SPEED_PWM, OUTPUT);
pinMode(RUN_RELAY, OUTPUT);
pinMode(BTN, INPUT_PULLUP);
}
void loop() {
if (digitalRead(BTN) == LOW) { // button pressed
running = !running;
digitalWrite(RUN_RELAY, running);
delay(300); // simple debounce
}
int speed = map(analogRead(POT), 0, 1023, 0, 255);
analogWrite(SPEED_PWM, running ? speed : 0);
}Parts list
| Part | What to look for |
|---|---|
| 3-phase induction motor 0.37 kW, 4 pole | Nameplate: 415 V star or 230 V delta, current, rpm |
| VFD (for example 0.75 kW, 3-phase input or 1-phase input) | Rating at least equal to the motor current |
| Relay module (5 V coil) | Contact rated for the VFD 24 V control, 1 A |
| Op-amp LM358 + 10 k resistors + 10 uF capacitor | For the 0 to 10 V signal |
| Shielded control cable | Keep it away from the motor cable |
| MCCB / MCB and earth | Sized from the drive manual |
Do and do not
- Do set the motor nameplate values in the drive first (voltage, current, frequency, rpm).
- Do keep control wires and motor wires in separate trunking.
- Do wait until the drive screen is dark and the charge lamp is off before touching anything.
- Do not switch the motor contactor while the drive is running.
- Do not fit a power factor capacitor between the drive and the motor.
- Do not run a standard motor at very low speed for long: its fan cools less.