![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Oct 2020
Location: Leicester, England
Posts: 500
|
GX developer: I don't understand this pump starting logic...
On line 20, I don't understand this logic.
Y2D5 (pump) is switched ON when water level D353 > 80cm AND D353>24cm Why is the AND needed? |
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
Looks like a latched output. Pump starts at 80cm level and is unlatched when less than 24cm.
|
![]() |
![]() |
#3 |
Lifetime Supporting Member
|
glenncovington is correct. It is a latching circuit. When the level is above 80 cm, it will obviously be over 24 cm, energizing the output. Since the output is energized, the contact in parallel with >80 cm is also energized, giving a path around. Once the level drops below 24 cm, the rung will be false, the pump will de-energize, and the pump will not energize again until the level rises above 80 cm once again.
Basically, once the level is above 80 cm AND above 24 cm, turn on the pump. Also, while the pump is energized AND the level is above 24 cm, keep the pump on.
__________________
C:\Dos C:\Dos Run Run Dos Run |
![]() |
![]() |
#4 |
Lifetime Supporting Member
|
@glencovington and @MikeyN got there first, but I will try to state it in a different way.
I supect you are reading that logic as Start pump if ... AND (level is above 24cm)but another way of reading that is Run pump if ... AND (level is NOT at or below 24cm)Note the use of Run instead of Start: every scan of the ladder logic is a fresh start at looking at input and internal values and responding by assigning values to internal and output values. By De Morgan's theorem, "Run if ... AND NOT ..." can be rewritten as Do NOT run pump if ... OR (level is at or below 24cm)TL;DR But please Do Read! That is a canonical Start/Stop pattern. Cf. here: https://www.contactandcoil.com/patterns-of-ladder-logic-programming/startstop-circuit/ I am amazed that anyone does not recognize and understand it as such; it is the canonical first or second example for teaching the reading and understanding of ladder logic; your teachers, not you, should be embarrassed; if you are self-taught, then it is understandable, but it needs to be rectified ASAP! Seriously mate, the Start/Stop pattern occurs over and over and over and over and over in many different forms; any of its Start, Stop, Seal-in or Run sub-systems may be composites of multiple conditions and not just solitary NC/NO/Outputs, but the overall logic is always the same. The [D353 > 240] is the Stop condition, or, perhaps more accurately, expresses the Stop condition, and could perhaps be more clearly understood as [NOT (D353 <= 240)] i.e. "allow the pump to run if and only if the level is not at or below the low level," which is the same as "do not run the when the level is at or below the low level." The [D353 > 800] is the Start condition. The pump starts when the level is above 80cm. The second condition, [D353 > 240] must also be true of course, but since 800 > 240 if the former is true then the latter will be true. The [NO Y2D5] is the Seal-in condition. It cannot cause the pump to start on its own, but once the Start condition (above) does that, the Seal-in will keep the pump running even after the Start condition is no longer true. It expresses "Pump is running" or "Pump was running at the end of the last scan" or "Pump was previously started and has not yet stopped." So the entire rung could be read as Run the pump if (EITHER the level is above 80cm OR the pump is already running) AND (the level is not at or below 24cm).I strongly suggest watching Ron Beaufort's Level 0 intro series to ladder logic; it takes less than 2h but will set one on the right track forever more: https://www.youtube.com/watch?v=T3tn...ACAF773A15BFB1
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; October 26th, 2021 at 09:13 AM. |
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: Oct 2020
Location: Leicester, England
Posts: 500
|
Really appreciate the answers! It makes sense now that it's been explained (and yes, I did read all of your post @drbitboy, many thanks).
For the record I am completely self-taught and have had no formal training whatsoever. Hence, all the questions I keep posting on this forum. Cheers Last edited by Mas01; October 26th, 2021 at 09:36 AM. |
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Mar 2012
Location: Michigan
Posts: 93
|
|
![]() |
![]() |
#7 |
Member
|
This is a common way to do a latch (RS) as many people seem to think that the SET/RESET is bad, there are a few things to consider that in some PLC's using a SET/RESET may stay latched if powered down even though the SET enable is not true this is just some people who believe that a SET/RESET cause problems that is not true, it's the original programmer has used them in a way that makes it difficult.
The US seem to call them SEAL in circuit but it is essentially a SET/RESET so you set the bit by making it true & ORING that bit round the bit that makes it true so in effect you latch it. The reset is effectively a NOT that drops it out. this is the same as in logic using relays, you can get SET/RESET relays that use magnets to hold the relay in then there are two coils that either SET or RESET the relay, if powered down then they maintain their state, the other is obviously the standard relay where you energise the relay & then use a spare contact to "LATCH" it in. The are some caveats, some S/R relays in PLC's are edge triggered some are SET before Reset or RESET before SET. The equivelent of the logic you have is > Dxx K820 SET Yxx < DXX K250 RST Yxx. As in Mitsubishi outputs are non retentive and only updated at end of scan (unless forced to do immediate update) then providing Dxx is less than K820 it will not latch even if it is above K250. |
![]() |
![]() |
#8 | |
Member
![]() ![]() Join Date: Oct 2020
Location: Leicester, England
Posts: 500
|
Quote:
|
|
![]() |
![]() |
#9 |
Member
![]() ![]() Join Date: Jun 2007
Location: Barcelona
Posts: 692
|
The pump starts when D353 value exceeds 800, then continues to run until D353 value falls below 241
|
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Oct 2020
Location: Leicester, England
Posts: 500
|
Hi again.
I'm returning to this thread because the operator has asked me to implement a change. I understand the code in the original post and the pump is behaving exactly as expected, ie the pump turns ON at 800mm water level , and stays on until the level drops to 240mm. Now the operator wants to have a manual override, so that they can switch the pump on/off at will, but only when the level is between 240 and 800mm. IE below 240mm or above 800mm , the operator is locked out & cannot manually operate the pump. To start the pump manually involves two inputs: a click on a screen to select the pump (a bit value let's call it M1) followed by a physical START pushbutton (a digital input let's call it X1). Both of these need to be TRUE/1. To stop the pump, M1 must be true and The STOP button must be pressed (let's call it X2). I was thinking along the lines of this (M3 is a bit representing a request to start/stop the pump) ---|M1|---|X1|---[SET M3]-------| ---|M1|---|X2|---[RST M3]-------| Then do a check to make sure water level is within range 240 to 800mm (let's call that M4). Then somehow feed M3 (the manual start/stop request) and M4 into the pump control logic as shown in post #1. But I'm not sure what that should look like. Sorry for the poor formatting, all this is written from my phone. Thanks in advance. Last edited by Mas01; May 14th, 2022 at 07:39 AM. |
![]() |
![]() |
#11 |
Lifetime Supporting Member
|
See below.
That covers the [Level>800] and [Level<=240] cases; the only case left is the middle case i.e. when [240<Level<=800].start_stop.png In that middle case, the upper branch [Is Level>800?] will evaluate to False, but low level test [Is Level>240?] will evaluate to True, so the output state of Y2D5 after the entire rung is evaluated is dependent on the input state of Y2D5 before the entire rung is evaluated. So while we may normally read that Start/Stop Circuit pattern as
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; May 14th, 2022 at 09:20 AM. |
![]() |
![]() |
#12 |
Lifetime Supporting Member
|
Based on the previous post, the branch added under the [Is Y2D5=1?] seal-in branch adds the operator's manual override to start the pump when the level is between 240 and 800 in the image below:
Note that the start event is effectively one-shot, set to 1 from the HMI and immediately cleared to 0 by the PLC after it is tested:start_stop_start_override.png
start_stop_start_override_00.pngBecause the "Start" logic, though now a composition of multiple instructions instead of a single Normally Opened/Closed instruction, is grouped into its canonical location in the Start/Stop Circuit pattern. It is worthwhile re-reading this Start/Stop Circuit pattern page, and paying particular attention to the "trigger dominant" vs. "stop dominant" aspects of the discussion. -
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#13 |
Member
|
As you are not that experienced, I have created a simple manual control ignore the bit & I/O numbers just used any you will need to allocate your own, basically the original control stays but to make it simple I have just created a separate rung for manual interlocking it, before DR starts to rip it apart & make it one rung I did this as it would be easier for you to comment & understand & test the manual without actually putting it fully in place.
The idea is to have an HMI button called Auto/Man if off it will be in auto, so the system runs as is, make this button a toggle i.e. one press it turns it on & another press it turns it off, also change it's colour & text based on if it's on or off. The bottom logic (although duplicating some of the auto logic) is basically the same but gives the operator manual control. Note: my M3 is the manual on/off latch. |
![]() |
![]() |
#14 |
Lifetime Supporting Member
|
The final step is where we add the operator's manual stop override, which is only to be effective when the measured level is between the low (240) and high (800) level limits. Furthermore, we can also assume the stop override is only effective when the motor is running: if the motor is already stopped, then we do not care if the operator wants it to stop.
For those conditions, the logic will look like this image where the green-highlighted paths indicate True conditions; every other path is False*. Note that the output rung of the [Is Level>800?] instruction is False, as are those of the [select this pump] and [start selected pump] instructions, while both input and output rungs of the [Is Level>240] instruction are True; all of that together tells us that the level is beween the trigger limits, and the seal-in [Is Y2D5=1?] instruction branch is what is keeping the pump running.start_stop_start_override_01.png Looking at that, it should be obvious that the place where the operator's manual stop override stop event can most easily stop the pump is to change seal-in branch to False. Also, because it is a seal-in branch, once Y2D5 is assigned a 0 on the output for even just one scan, the seal-in will be disabled for subsequent scans, and the pump will not re-start until one of the Start conditions becomes True again. Simply put, that seal-in branch need to change from
Again, the HMI interaction is based on "Set and Forget," where the stop override bit will only become a 1 if the HMI writes a 1, and the PLC will always clear that bit to 0.start_stop_start_stop_override.png De Morgan and other formalisms aside, it should be clear that, when the pump is being maintained by the seal-in only, i.e. [Is Y2D5=1] is True and [Is Level>800] is False, then as long as
* I specifically do not say "the logic flows ..." because, as @Ron Beaufort points out in his boot camp video, those semantics lead to problems.
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; May 14th, 2022 at 02:39 PM. |
![]() |
![]() |
#15 |
Lifetime Supporting Member
|
To make it easier to read*, here is a simple expansion of the one rung to several, ending with the denouement i.e. Start/Stop Circuit which everyone should know "in their bones."
* But not much easier to understand, because one must go through all the logic e.g. this is a low-level (stop) dominant circuit, and the start condition itself is high-level dominant. Simplified a bit more e.g. the set-and-forget bits can be unconditionally Reset (Unlatched), and the seal-in can be broken unconditionally by an operator's manual stop override, as during high level it will be immediately re-set to 1, although if the I/O scan is asynchronous with the program scan, then the pump could be turned off for a few ms (one I/O scan).start_stop_start_stop_override_00.png start_stop_start_stop_override_01.png
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mitsubishi GX Developer "strange behavior" | shaulapto | LIVE PLC Questions And Answers | 2 | April 27th, 2006 08:13 AM |
Again and again. How to start? | Alex Pel | LIVE PLC Questions And Answers | 33 | December 31st, 2004 12:10 PM |
Please a tiny push on this............. | hidroela | LIVE PLC Questions And Answers | 11 | November 1st, 2004 06:52 PM |
GX developer ... | taknevs | LIVE PLC Questions And Answers | 1 | April 14th, 2003 05:33 PM |
Logic of Standby pump | Shabbir | LIVE PLC Questions And Answers | 5 | August 10th, 2002 12:00 AM |