I am currently working on a project involving a Micrologix 1200 and a GV3000 VFD at my workplace. I need to gather amp readings from the VFD every 10 seconds, and if the amps exceed 2.9 amps, I need to store the last 120 amp signals (equivalent to 20 minutes) to calculate a baseline (20-minute moving average). Can anyone provide guidance on how to achieve this? Thank you for any assistance.
1. Develop a 10-second timer for tracking purposes. 2. Set up a memory storage system with 120 locations, preferably using "F8" floating-point type memory, from F8:1 to F8:120. 3. Implement a shifting logic to automatically rearrange the array every 10 seconds - #120 will be replaced by the latest reading, #119 will move to 120, #118 to #119, and so forth until #1 shifts to #2. 4. Every 10 seconds, calculate the average of all 120 memory storage locations by adding them together and dividing by the Sample Count (normally 120). To expedite this process, subtract the value in #120 from the Total Value, incorporate the new value, save the updated Total Value, and then divide by the Sample Count to determine the moving average. 5. Save the new moving average in F8:0 for future reference. Make sure to wait until the first 120 samples are collected before calculating the average, but consider utilizing the moving average as the sample count increases. Monitor the Total Value to ensure it does not surpass the maximum allowed value of the memory registers (3.40282347e+38 for the F8 Floating Point locations).
In order to efficiently shift the array every 10 seconds, with element #120 disappearing and the rest moving up one spot, a more optimized approach involves using pointers to indicate the value to be replaced. This method reduces scan time and improves performance. Keep in mind there may be a post discussing this technique in more detail.
Brian, that's a great suggestion. I believe you are referring to a technique described by Alaric, involving the use of FFL and FFU in approximately four rungs to calculate the moving average. Utilizing indirect addressing can also help create a loop for shifting with just four or five rungs. The crucial aspect is to select the most suitable logic for the task at hand. If your program is meant to be comprehensible by electricians or technicians, it's important to choose a method that is easier for them to grasp. Additionally, consider what will be simpler for you to understand five years down the line.
Below is a demonstration of two techniques for calculating a running average: one utilizing a FIFO and the other employing a circular queue with a pointer. The latter method, as previously noted, offers the advantage of no data movement and no size restrictions unlike the FIFO. Both approaches involve maintaining a running total instead of recalculating the sum of the queue each time. Explore more about running averages and efficient data processing methods in this program.
Thank you to everyone who provided assistance. Alaric, your sample program was invaluable in helping me grasp the necessary steps. As an electrician, I am confident I will understand how to make everything work smoothly. I have one more query: what is the optimal method for entering amp readings into the program for the GV3000 SE drive?
Certainly, one way to accomplish this would be to use a timer function in your PLC code, set for 10 second intervals. This timer could trigger a command to read the amp value from your VFD. Store these values in an array and, when the array reach capacity, push out the oldest reading and insert the new one (like a FIFO buffer). If the amp reading exceeds 2.9 at any point, use these values to calculate your 20-minute moving average. Remember to plan your array size to match the amount of data you want to retain (120 readings). Consider implementing overflow checks for safety. Additionally, consider using RSLogix 500 as it provides better tools for this. Good luck!
You could try using a circular buffer code implementation. Essentially, you'd create an array large enough to store 120 readings, and keep updating it every 10 seconds, writing over the oldest entry once you've reached the end of the buffer. When the amps exceed 2.9, you can then calculate a 20-minute moving average from the values in the buffer. Additionally, for amp readings, ensure that the GV3000 VFD analog output (AO) is correctly configured to give you accurate current readings. This process will involve a bit of programming, but there are plenty of resources online that could help you get the hang of it.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - To gather amp readings every 10 seconds, you can use the Micrologix 1200 to communicate with the GV3000 VFD and retrieve the amp readings periodically through the appropriate communication protocol.
Answer: - To store the last 120 amp signals, you can create a data structure or array in the Micrologix 1200's memory to hold the readings. Update this array every 10 seconds and calculate the moving average based on the stored values.
Answer: - If the amp readings exceed 2.9 amps, you can trigger a logic in the Micrologix 1200 to initiate the storage of the last 120 amp signals for calculating the baseline moving average.
Answer: - You can use ladder logic programming in the software environment provided for the Micrologix 1200 to implement the logic for gathering and storing the amp readings as well as calculating the moving average based on the stored data.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.