Announcement

Collapse
No announcement yet.

Time Integration - Productivity Series

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Time Integration - Productivity Series

    I'm looking for a programming snippet for time integration on a Productivity Series PLC--I have a working solution, but its not very optimal. Let me start by giving two examples where I would use this snippet.

    (1) A pump has a known flow rate of 7 L/min. Whenever the pump is on, the tag FLOW is 7 L/min, when the pump is off, FLOW is 0 L/min. How much liquid has been pumped since the last counter reset?

    (2) A conveyor motor runs at a speed set by the user. The linear speed of the conveyor is set by the tag SPEED. The user can change SPEED at any time. How far has the conveyor traveled since the last reset.

    Usually, I solve the first problem by having a TOTAL tag. I then use a MATH instruction (TOTAL = TOTAL+ (FLOW * 2.0)) that is enabled by a normally open edge contact (NOE) triggered by the 2 SECOND BIT.

    While this solution works, I don't like it. If the pump is turning on and off, or the flow rate changes within that two second window the TOTAL tag may not catch the flow. I was hoping I could run my MATH instruction every scan, and use one of the LAST SCAN INTERVAL tags to compute the change in time (dt). Unfortunately, the documentation on what these tags means if fairly vague.

    Does someone know more about what they would mean in my application? Is each unit of LAST SCAN INTERVAL 10 ns, or 100 us? Would LAST SCAN INTERVAL or LAST LOGIC SCAN TIME be more relevant?

    Thanks,

    Michael


  • #2
    (1) A pump has a known flow rate of 7 L/min. Whenever the pump is on, the tag FLOW is 7 L/min, when the pump is off, FLOW is 0 L/min. How much liquid has been pumped since the last counter reset?

    The following can be used to calculate volume down to the 1 second resolution. It will only calculate volume when the pump is running and it is not dependent on scan or system bits. No sure how often you wish to update, but this will update total every second. You can change the preset value to make it less often. ( 5,10,15 seconds etc...)


    Click image for larger version

Name:	LT_Min.JPG
Views:	12
Size:	102.8 KB
ID:	110812

    (2) A conveyor motor runs at a speed set by the user. The linear speed of the conveyor is set by the tag SPEED. The user can change SPEED at any time. How far has the conveyor traveled since the last reset.
    Same can be done for the conveyor speed:

    Click image for larger version

Name:	Conveyor.JPG
Views:	11
Size:	64.7 KB
ID:	110813

    Comment

    Working...
    X