Recording amps in Micrologix 1200

bh307

Member
Join Date
Mar 2008
Location
HOUSTON
Posts
57
I am doing a project at work for our lumpometer I will be using a Micrologix 1200 and getting the info froma GV3000 vfd.I will need to get a amp reading once every 10 sec. and if the amps is > 2.9 amps then I will want to store the last 120 amp signals(20mins) calculate baseline (20 min moving avg). How can i do this.
Thanks for any info
 
1. Create a 10-second timer.
2. Establish a memory storage area with 120 locations, probably in "F8" floating-point type memory, F8:1 to F8:120.
3. Create logic to shift the array every 10 seconds, #120 disappears, #119 moves to 120, #118 moves to #119...and so on until #1 moves to #2. Now put the latest new reading into #1.
4. Now, every 10 seconds, add all 120 memory storage locations together and divide by the Sample Count (normally 120). There is a short-cut: you can just subtract #120 from a Total Value, and add in the new value, save to Total Value. Then divide the new Total Value by the Sample Count to get the moving average.
5. Store the new moving-average in F8:0.

You will probably need some logic to wait until you have the first 120 samples, before you establish the average. Depending on the process, you may be able to calculate and use the moving average on the way up to 120 samples. Make sure that your Total Value will not ever exceed the maximum allowed value of the memory registers (3.40282347e+38 for the F8 Floating Point locations).
 
Last edited:
Lancie1 said:
3. Create logic to shift the array every 10 seonds, #120 disappears, #119 moves to 120, #118 moves to #119...and so on until #1 moves to #2. Now put the new reading into #1.

There was a post floating around here somewhere (I think) that dealt with this sort of situation. Instead of shifting all the values in the array one spot each time, it used pointers to indicate which value should be replaced. It saved on scan time.

Brian
 
Brian, good idea.

I think you are talking about a method posted by Alaric. It uses FFL and FFU in about 4 rungs to compute the running average.

You may also use indirect addressing to create a loop to do the shifting with only 4 or 5 rungs.

The key is to use logic appropriate for the job. If your program will need to be understood by electricians or technicians, then consider which method will be easier for them to understand. Also consider what will be easier for you to figure out 5 years from now.
 
Last edited:
Here is a sample program that shows two methods of doing a running average. The first uses a FIFO. The second uses the circular queue with a pointer that was mentioned. The second has the advantage of not moving any data around and it doesn't have the size limitation of the FIFO.

Both methods use a running sum instead of summing the queue everytime.
 
Thanks everyone for your help .Alaric your sample program was a big help understanding what I need to do. I am also the electrician out here so anything I get to work I will be able to understand.One more question what would be the best way to get the amp reading inputed in to the program The drive is a GV3000 SE
 
Last edited:
bh307 said:
Thanks everyone for your help .Alaric your sample program was a big help understanding what I need to do. I am also the electrician out here so anything I get to work I will be able to understand.One more question what would be the best way to get the amp reading inputed in to the program The drive is a GV3000 SE

I don't know anything about that particular drive, but I can make some assumptions.

1) ML1200 means you are probably not communicating with the drive. If you are then its most likely DH-485. Without more information I can't be more specific.

2) Assuming the drive has an analog output that you can configure to output a signal proportonal to drive current then you can add an analog inpupt card to the ML1200 and read the value at the analog input using the SCP instruction to scale the analog input to match the actual drive amps.
 
Troy, I wanted to update you on the Averaging logic you shared with me. It had to do with a phosphate reading and alum that took 24 hr to get thru the plant and to the sampler. Using the FIFO averaging you provided for me, I did 3 samples per hour then used that 1 hr sample to create a 24 hr (72 samples total) composite sample. I then compared the operator phosphate setpoint to the 24 hr sample, if the sample is inside or outside .10 mg/l it makes an adjustment to increase or decrease amount of alum fed into the system. All math and adjustments done at 7:00 am. The time each morning they would take a grab sample in the plant. It works really well, alum usage is going down and the plant is able to run closer to permit without having to manually watch it all the time, auto mode working. Thanks Again, Deb
 
Here is a sample program that shows two methods of doing a running average. The first uses a FIFO. The second uses the circular queue with a pointer that was mentioned. The second has the advantage of not moving any data around and it doesn't have the size limitation of the FIFO.

Both methods use a running sum instead of summing the queue everytime.
TConnolly,
I like to see your sample of a running sum with a circular queue and a pointer. Do you still have it?
 
TConnolly,
I like to see your sample of a running sum with a circular queue and a pointer. Do you still have it?
Search for "circular" in this forum (or "circular buffer" or "circular array") and I am fairly certain you will find some examples.
 

Similar Topics

I have to rollout a common CLX PLC program to a dozen or more installations, but each installation uses a different HMI front end. Some WW, some...
Replies
8
Views
881
Dear all I need help for delta plc programming . I can use DVP-12SE PLC and HMI DOP-B10E615 as they both support ethernet. I am planning to make...
Replies
0
Views
1,514
Good Afternoon, Many times I will quickly brainstorm an idea on FactoryTalk View , and would like to email it a coworkers , instead of...
Replies
14
Views
3,485
There has been a request for me to setup one of our machine HMI's to record a change in a setpoint. It needs to show what the last setpoint was...
Replies
4
Views
1,738
Hello, I am looking for advice on the best way to log production. The equipment is Allen Bradley SLC 5/04 and C More Ea7 touch panel. The managers...
Replies
11
Views
2,564
Back
Top Bottom