Looking for advice on kW pulse to rate conversion

DarrenG

Member
Join Date
Dec 2016
Location
London
Posts
74
Hi folks,

I'm getting pulses back from a recently installed meter and have found that when converting it to a rate it fluctuates quite a bit. I do realise that converting from a pulse to a rate is not going to be very accurate, I just expected it to be a little better than what it is. I've been monitoring the pulses themselves and it does look like the time between pulses varies slightly which explains why the rate is then fluctuating. This meter is monitoring our imported electricity usage and I know that the plant it is monitoring is running around 9.4MW. My readings are fluctuating from 9MW to 11.1MW which is a bit too inaccurate to do much with.

I've attached a sample of the code for one of the readings, it's quite simple at the moment but I may have to start filtering it. It is reading 9.3MW for the majority of the time which is great but it's the spikes up to 10.5MW or 11.1MW that are an issue.

I'm going to average the readings a bit and see if that makes much of a difference but I'm just wondering if there's another way of making this better that I'm not thinking of apart from averaging?

Also ... please don't rip me to shreds over not using UDT's in this example too... (n) I know, I prefer them too but every time I download to this controller it fails to go back into run mode so modifying UDT's is a pain in the *** at the mo :cry: That's a problem for future Darren :ROFLMAO:

Thanks,

Darren

Import Rate.PNG
 
Presuming this logic is running within the Continuous Task I'd put it into a Periodic type one first.

It looks like the pulses arrive via IP; precise math via timer implemented logic and comms produced data within a variable timing task is a bit of a 'stretch'.
 
Thanks for the suggestion, this is in a periodic task of 50ms as the pulse widths are 80ms.

I've just tried another method below which has much more accurate results but it only updated every minute... I don't think that is an issue really though now that I think about it. The highest it went to was 9600KW but was on 9300KW most of the time.

Import Rate V2.PNG
 
Not very familiar with this software, but are you using a pulse input? If not you may be missing pulses...


Depending on the speed of the pulses, you might want to calculate flow over more samples. So calculate for every 10 or 100 pulses.
 
What does one pulse represent? It looks like a pulse represents 1kW? is that correct?

What is a "normal" frequency of pulses when you are running at 9.3MW?
 
Darren,
I think your latest logic is best. You could implement it again with a time trigger 30 seconds away and write to same DINT. That way rate would be updated every 30 seconds. Or you could do it 6 times and have a 10 sec update.
 
Depending on what you want the power for, you should get good accuracy if you give up a bit on response.

In my experience, the pulses from a power relay are slow - on the order of a few pulses per second at most. They usually represent a fixed value of energy (kWh or Wh) per pulse. I used to track the time for 10 or 20 pulses and use that time and the count to get power.

Capture.JPG
 
When dealing with a slow pulse train, I prefer to measure the time between pulses, not the number of pulses over a span of time.

Describe the physical input from the meter; its it wired to a local Input module, or to a module connected over a network, or is it a cyclic connection to a networked non-IO device ?

Your very best accuracy will come from using an Event task triggered by an I/O device that is capable of triggering an Event.

When you have an unknown period between I/O events, you can determine the uncertainty using the cyclic update of the I/O device and the cyclic rate of the program execution. Unless your Main Task is very long, you will usually make your uncertainty worse by putting the logic into a periodic task, especially one whose rate is slower than 2x the actual signal rate.
 
boneless - This is Rockwell's Studio 5000. It is a pulse input yes, I just have the physical address mapped to 'Import_KW_PULSE_IP'.

ndzied1 - One pulse at the moment is 5kW, we might be able to change this though. When running at 9.3MW I think we were getting pulses roughly every 1-1.5 seconds. We are running at 2.7MW at the moment and it's pulsing every 6 seconds or so.

Ken M - This seems to be working best so far anyway yeah, out of habit I was looking for a quicker response but for this situation it doesn't need to be instantaneous, quite the opposite actually!

Tom - I am starting to realise that now! So far I've tried measuring the time between each pulse and calculating the flow based on that, and counting the amount of pulses in a minute. What you're suggesting sounds somewhere in between the two that I've tried so I could give that a try.

Ken R - I can see why you would do it that way and I'm starting to think I might need to implement this differently for the different meters. The one I've been referring to is going to have the most frequent pulses, it measures the electricity we're importing from the grid to the plant. We also have meters to measure what the auxiliary equipment is using and what we will be exporting back to the grid.

The meter is wired to a local I/O module. I had a quick look at setting up an Event task but I will have to do a bit more research on it. What's the difference between that and a periodic task? Is it that the calculation will be triggered by the pulse itself instead of every 50ms which is what the scan interval has been set to?

We've been told to use periodic tasks for everything as we're using Factorytalk View so the program processing the pulses has been assigned the highest priority and the most frequent scan interval. The execution time is only 0.87ms.
 
What kind of input module are you using? Some Logix input modules that are designed to count pulses will have an average input word.
 

Similar Topics

Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
Just joined the site and wanted to say hello. A lot of googling has sent me to this site multiple times in my quest to learn about PLCs and...
Replies
14
Views
2,868
Hi, currently have a 5 year old laptop running Windows 8.1 and RS Logix 500 Starter Edition V 9 and RSLinx Classic Lite V 3.81....I cannot...
Replies
22
Views
5,707
Hello everyone, I'm in a unique position and would really appreciate some career advice from people familiar with the automation industry. I...
Replies
29
Views
6,158
Hi, I'm a fresher with a degree in automation. I had applied for job at an MNC. Today, I got a response saying that a sales position is...
Replies
7
Views
2,985
Back
Top Bottom