Using a variable frequency drive with an industrial Arduino based PLC

How to work with a PLC controller Arduino
February 13, 2019 by
Using a variable frequency drive with an industrial Arduino based PLC
Bernat Garcia

Introduction

In this case, we are using a VFD (variable frequency drive or adjustable frequency drive, AFD). The software on your industrial PLC M-Duino 21+ is in charge to provide a simple user interface to the user and controlling the VFD. So, through your serial monitor in your PLC Arduino IDE, you will be able to control the three-phase motor. 

Using a 0-10 V Analog output, you will be able to control the speed of a three-phase motor. Apart from that, you will also be able to control the direction of rotation using two digital pins. 


Requirements

Wiring

(*Remember to wire the VCom and Com (-) to provide power supply to the digital outputs).

Electrical network

Software

////////////////////////////////////////////////////////////////////////////////////////////////////
void setup(){
Serial.begin(9600L);
delay(1000);
printMenu();
}

////////////////////////////////////////////////////////////////////////////////////////////////////
void loop(){
if (Serial.available()){
    int byteSerial = Serial.read(); 
if (byteSerial == '0'){
digitalWrite(Q0_0, LOW);
digitalWrite(Q0_1, LOW);
analogWrite(A0_7, 0);
Serial.println("Motor Stop");
printMenu();
}
else if (byteSerial == '1'){
digitalWrite(Q0_0, HIGH);
digitalWrite(Q0_1, LOW);
      digitalWrite(A0_7, 50);
Serial.println("Forward rotation mode");
      printMenu();
}
else if (byteSerial == '2'){
digitalWrite(Q0_0, LOW);
digitalWrite(Q0_1, HIGH);
analogWrite(A0_7, 50); 
Serial.println("Reverse rotation mode");
  printMenu();
}
else if (byteSerial == '3'){
analogWrite(A0_7, 50);
Serial.println("Speed nº1");
  printMenu();
}
else if (byteSerial == '4'){
analogWrite(A0_7, 127);
Serial.println("Speed nº2");
  printMenu();
}
else if (byteSerial == '5'){
analogWrite(A0_7, 255);
Serial.println("Speed nº3");
  printMenu();
}
}
}
void printMenu(){
  Serial.println("------------------------------------------");
  Serial.println("Command guide:");
  Serial.println("Press 0 for Stop");
  Serial.println("Press 1 for reverse rotation");
  Serial.println("Press 2 for forward rotation");
  Serial.println("Press 3 for Speed nº1");
  Serial.println("Press 4 for Speed nº2");
  Serial.println("Press 5 for Speed nº3");
  Serial.println("------------------------------------------");
}

 
 


Thinking about the industrial automation of your business?

 Contact our tech-sales team to solve your doubts about our Arduino automation industrial controllers.


​Search in our Blog

Using a variable frequency drive with an industrial Arduino based PLC
Bernat Garcia February 13, 2019

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>