Saturday, November 3, 2018

Read Energy Meter- EM1340(Rishabh Instruments) data in Raspberry Pi via Modbus communication







Overview of the Energy Meter:
RISH EM series measures important electrical parameters in 3 phase and single phase Network & replaces the multiple analog panel meters. It measures electrical parameters like Active / Reactive / Apparent energy , power as per models. It has inbuilt RS485 port available to transfer the data in realtime. The instrument has optional output as one pulse output for energy measurement.
Its Application:
Energy billing
Electrical load monitoring
Sub-metering
Genset, Test Benches and Laboratories


      EM1340 Manuals Click here


Configuration of the Energy Meter for enabling RS485 :

  • Set Slave Address(Between 1-247)
  • Set Baudrate(9600-115200)
  • Set Parity Bit(odd : odd parity with one stop bit , no 1 : no parity with one stop bit , no 2 : no parity with two stop bit,  E : even parity with one stop bit)
  • For Configuring CT:  Set-AP=100(Primary value), Set-AS=5(Secondary Value)[ If CT value= 100/5A]


Connecting the RS485 to USB Converter:

 Connect -      A(meter_side)  ---------A(converter_side)
                       B(meter_side)  ---------B(converter_side)



Getting data's on the PC Side:

   Modscan Software:
         Plug the USB converter into your PC and get the COM PORT no device manager section and  than do the necessary configuration settings .




  
Enter the  Slave Address of the meter in the Device ID and Select the Input Register from the drop down.
Here in the respective register address, you will be able to see the real time values.

Note: Select the device length maximum upto 30, else you will encounter an error.


Getting data's on the Raspberry Pi :


  •  Plug the USB to RS485 Converter into the USB port of the Raspberry Pi
  • Open Terminal and type the command- ls/dev. It will show that the converter is connected to ttyUSB0.
  • In the terminal, type - sudo pip install minimalmodbus   (We will be using minimal modbus library)
  • Open Python IDLE and run the following program

Python Code:


import minimalmodbus

import time

while True:
    try:
        powermeter1 = minimalmodbus.Instrument('/dev/ttyUSB0', 1) 
        # serial port name, slave address (in decimal)
        powermeter1.serial.baudrate = 19200
        powermeter1.serial.bytesize = 8
        # use only one of the 3 lines below to set the parity, and remark the other two lines 
        powermeter1.serial.parity   = minimalmodbus.serial.PARITY_NONE
        powermeter1.serial.stopbits = 1
        powermeter1.serial.timeout  = 1   # seconds
        powermeter1.address
        M1_volts1_address=0x00
        M1_volts2_address=0x02
        M1_volts3_address=0x04
        M1_frequency_address=0x46
        M1_volts1= powermeter1.read_float(M1_volts1_address, 4)
        print("Line 1 Voltage(R)   ")+ str(M1_volts1)
        M1_volts2= powermeter1.read_float(M1_volts2_address, 4)
        print("Line 2 Voltage(Y)  ")+ str(M1_volts2)
        M1_volts3= powermeter1.read_float(M1_volts3_address, 4)
        print("Line 3 Voltage(B)  ")+ str(M1_volts3)

        M1_frequency= powermeter1.read_float(M1_frequency_address, 4)
        print("Frequency  ")+ str(M1_frequency)
   
    except:
        print("Disconnected")



Watch The Video-












    

Raspberry Pi in Industrial Applications

Industrial operations require the combination of harsh operating environments, high I/O capacity, Robust and complex functionality requirements for which programmable logic controllers (PLCs) were mainly used but this increase the setup cost but however for many smaller operations, the Raspberry Pi 3 platform offers a low-cost solution with substantial performance capabilities. Fully capable of handling dedicated industrial applications tasks

Some of the Applications are described below:

1. Industrial Automation:




    Raspberry Pi can be used to automate various specific tasks such as:

  • Control of Three phase motors.
  • Controlling Inputs and Outputs.
  • Auto triggering of devices when sensor is being sensed.
  • Conveyor control.
  • Pick and Place of products.
  • Automatic sortation of products in a conveyor lines, and many more


2. Production and Machine Monitoring:




Production monitoring can be done in real time from by interfacing Raspberry Pi to any machine ranging from CNC,  VMC,  SPM or  having PLC . This helps the Supervisor  as well as the stake holders to track the production in real-time and henceforth it can help them to achieve their target better.

          Some Features are:
  • Live Monitoring of Production Count.
  • Hourly, Daily, Monthly analysis of production and its predictions based upon previous trends with advanced Machine Learning algorithm.
  • Downtime of your machine.
  • Machine Status(Run/Idle/On/Off).
  • Current Tool in Use.
  • Cycle time of Jobs.
  • Time difference between two Jobs(It can be used to track operator's efficiency).
  • Power ON time of machine.
  • Motion Time of Machine.
  • CNC/VMC Program currently running.
  • SMS and Mail Alerts.


3. Fault identification:




Raspberry Pi connected to any machine can track down the error codes and faults occurred in real-time of that machine and the operator & Supervisor can get the error information via alerts and it will helps them in quick diagnostics. Enhanced features such audio and visuals can also be given connecting Pi to large TV screens and monitors.

The status of these machines can also be monitored remotely by Company Owner sitting at home or any remote location.  


4. Barcode Recognition System: 




 By connecting a camera to Raspberry Pi and mounting it in fixed position by the side of running conveyor lines, we can capture the barcodes of each passing boxes/products and as well as their images in real time by using advanced computer vision and machine learning algorithms.

Camera based production counting ,Quality and separating  the damaged product can also be implemented.


5. Predictive Maintenance: 




Predictive Maintenance is to predict when equipment failure might occur, and  to prevent the occurrence of the failure by performing maintenance. Monitoring for future failure allows maintenance to be planned before the failure occurs. Ideally, predictive maintenance allows the maintenance frequency to be as low as possible to prevent unplanned reactive maintenance, without incurring costs associated with doing too much preventive maintenance. For Predictive Maintenance to happen, we have to capture lots of realtime data's from the machine for the Analytics. 

Raspberry Pi can be used here as a data-logger by interfacing it with the machine via communication interface. It will capture the real-time data, process it and henceforth send it over to Cloud platform or centralized server for the Analytics engine running advanced machine learning Algorithm.



6. Energy Monitoring System:





Energy monitoring system is management technique that uses energy information as a basis to eliminate waste, reduce and control current level of energy uses and improve the existing operating procedure.
Raspberry Pi can be interfaced with any Smart Energy Meters/ Energy Meter having communication interface. It can capture all the real-time energy parameters of the whole industrial plant and send it over to cloud platform for its live monitoring as well as for the  analytics.
If energy meter is connected directly to machine, than its live status can be monitored  such as Machine OFF, No Load, Full Load & Ideal running state from the current consumption parameter.

6. Monitoring of Variable Frequency Drives(VFD):


Variable Frequency Drives (VFD) are often used on critical applications in remote locations. Examples of remote and critical VFD applications would be Automation industries, Compressor station, oil and gas pipelines, water treatment and pumping, and oil production, etc.
Raspberry Pi can be used to capture the realtime operational status and parameters from these VFD via any communication interface and send it to cloud platform. With that we can  monitor the VFD's live parameters remotely  and get alerts if any fault occurs.

                                                                                                                Image Source: Google(For Reference)

These are some of the used cases of Raspberry Pi in Industrial environment. If someone have any other applications implemented than please mention in the comment section