Industrial Modbus Power Meter(Acuvim L) readed in Arduino UNO


i reading on internet how create acceptable power meter during searching found circuits doesn't have parameters have use proyect, , error of circuits unpredictable. parameters looking are:

voltage, current, thd, individual harmonic analisis, ractive power , power factor. values 3 phase system.

the best idea of power metering using simple electronic elements , 1 arduino used process signals openenergymonitor.org, (emon). never capable calibrate error in power factor terrible small currents.
 
my next idea using industrial meter but, how comunicate arduino?. used modbus protocol library called simple-modbus-master , simple-modbus-slave , usefull used communicate arduinos.  

looking around internet found interesting power meter, acuvim-l , bought 1 acuvim-dl vercion, there many version diference parameters reads, of has modbus protocol.

in beginning of tests of communicate arduino, having troubles power meter has icon indicate comminication ok , online. didnt have response in arduino, problem timing between byte sending. used low baundrate.
 
here code used in arduino, in case master modbus point.

quote
#include <simplemodbusmaster.h>
#include <softwareserial.h>
#include <simpletimer.h>

softwareserial myserial(10, 11); // rx, tx
simpletimer timer;

//////////////////// port information ///////////////////
#define baud 9600
#define timeout 1000
#define polling 200 // scan rate

// if packets internal retry register matches
// set retry count communication stopped
// on packet. re-enable packet must
// set "connection" variable true.
#define retry_count 10

// used toggle receive/transmit pin on driver
#define txenablepin 2

#define led 9

// easiest way create new packets
// add many want. total_no_of_packets
// automatically updated.
enum
{
 packet1,
 packet2,
 packet3,
 packet4,
 packet5,
 packet6,
 packet7,
 total_no_of_packets // leave last entry
};

// create array of packets configured
packet packets[total_no_of_packets];
packetpointer packet1 = &packets[packet1];
packetpointer packet2 = &packets[packet2];
packetpointer packet3 = &packets[packet3];
packetpointer packet4 = &packets[packet4];
packetpointer packet5 = &packets[packet5];
packetpointer packet6 = &packets[packet6];
packetpointer packet7 = &packets[packet7];
// data read arduino slave stored in array
// if array initialized packet.
unsigned int cont=0;
unsigned int control=2050;
unsigned int readregs[2];
unsigned int readregs1[1];
unsigned int readregs2[6];
unsigned int av1[5];
unsigned int av2[5];
unsigned int av3[5];
unsigned int vfloat[2];

void setup()
{
   myserial.begin(9600);
   
   timer.setinterval(2000, repeattask);
 modbus_construct(packet1, 17, read_holding_registers, 0x130, 2, readregs);
 
 modbus_construct(packet2, 17, read_holding_registers, 0x400, 1, readregs1);
 
 modbus_construct(packet3, 17, read_holding_registers, 0x184, 6, readregs2);
 
 modbus_construct(packet4, 17, read_holding_registers, 0x406, 5, av1);
 modbus_construct(packet5, 17, read_holding_registers, 0x40b, 5, av2);
 modbus_construct(packet6, 17, read_holding_registers, 0x410, 5, av3);
 
 modbus_configure(&serial, baud, serial_8n2, timeout, polling, retry_count, txenablepin, packets, total_no_of_packets);
 
 pinmode(led, output);
}

void loop()
{
 modbus_update();
 timer.run();    
}

void repeattask() {
//fecha
  myserial.print(int(readregs2[0]));myserial.print("/"); //año
  myserial.print(int(readregs2[1]));myserial.print("/"); //mes
  myserial.print(int(readregs2[2]));myserial.print("  "); //dia
  myserial.print(int(readregs2[3]));myserial.print(":"); //hora
  myserial.print(int(readregs2[4]));myserial.print(":"); //minuto
  myserial.println(int(readregs2[5]));
  //myserial.println(int(readregs2[6])); //semana
  myserial.print("f=");
  myserial.print(float(readregs[0])/100);
  myserial.print("   ");
  myserial.print("v1=");
  myserial.println(float(readregs[1])/10);
  myserial.print("thd1=");
  myserial.print(float(readregs1[0])/100);
  myserial.println("   ");
  myserial.println("contenido armonico voltage");  
  myserial.print("% v2=");myserial.print(float(av1[0])/100);
  myserial.print(" % v3=");myserial.print(float(av1[1])/100);
  myserial.print(" % v4=");myserial.print(float(av1[2])/100);
  myserial.print(" % v5=");myserial.print(float(av1[3])/100);
  myserial.print(" % v6=");myserial.println(float(av1[4])/100);
  myserial.print("% v7=");myserial.print(float(av2[0])/100);
  myserial.print(" % v8=");myserial.print(float(av2[1])/100);
  myserial.print(" % v9=");myserial.print(float(av2[2])/100);
  myserial.print(" % v10=");myserial.print(float(av2[3])/100);
  myserial.print(" % v11=");myserial.println(float(av2[4])/100);
  myserial.print("% v12=");myserial.print(float(av3[0])/100);
  myserial.print(" % v13=");myserial.print(float(av3[1])/100);
  myserial.print(" % v14=");myserial.print(float(av3[2])/100);
  myserial.print(" % v15=");myserial.print(float(av3[3])/100);
  myserial.print(" % v16=");myserial.println(float(av3[4])/100);
}


this code print values power meter, used 1 softwareserial port show results because hardware serial used modbus rs485 adapter simple max485.

the schematic this:



the difference between schematic , project used 1 max485 module http://yourduino.com/sunshop2/index.php?l=product_detail&p=323 thing have plug same pins of max485. schematic of module, add 120 resistor in output , other resistors , power protection have 1 indicator led.



the last think have plug , b communication terminal strips located in acuvim-l module. there 1 s pin in power meter, didn't plug anywhere. thing s pin noise effects works in large distance.

the  simpletimer library easy find in arduino library repository, used because writing "delay" in loop() function caused wrong in communication seems slow, library great because doesnt in loop function waits pass of time , opens repeat task function.

thats can say, if interested in more details works can share more information, power meter has accuracy table

here results of comunication.

quote
the error in power factor terrible small currents.


you realize power factor irrelevant small currents. no commercial company or power utilitity company ever talks power factor feeders small current. pointless. reason ever talk power factor when current not small, because transmission cost utility company or power cost customer is
significant. if current small, nobody cares , don't talk power factor. if know effects power factor
you know this.
that being said, think post useful people interested in power monitors, , if don't mind me saying so, if posting contribute knowledge base, post missing important document, the
schematic. know how connect max485s people don't , think while post constitutes contribution, may problematic without schematic.


Arduino Forum > Community > Exhibition / Gallery > Industrial Modbus Power Meter(Acuvim L) readed in Arduino UNO


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support