You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 10th, 2022, 06:04 PM   #1
aidan5192
Member
United Kingdom

aidan5192 is offline
 
Join Date: Jan 2022
Location: tamworth
Posts: 7
Logo! help on task

Hi i have recently been studying PLC for work and i have had a task now which i believe i am close to finishing but i cannot think how to correct my problem. Any help would be much appreciated.

I need to run the mixing tank for 10 seconds and then empty the tank after but i can only manage to get them both to come on at the same time but i need the empty tank to come on after the 10 seconds. I cant see where i am going wrong as i have tried several ways and i just end up braking the rest of the circuit.

this is what i have been given if anyone could see a solution to my problem or let me know if i am way off.

• When the Start ‘push to make’ (not toggle) switch (I1) is pressed/released and gets latched on (B1: RS latch), the start ‘fill’ pump (Q1) will be energized and the tank will start to fill.
• The pulses generated by flow meter 1 (B5: pulse generator) should be used to increment the counter (B6: Up/down). Tank level full is when the counter function on = 10 and tank low level is when counter off = 1. These values can be used as feedback to control the pumps (instead of the high/low level sensors shown above) and can be called the ‘tank high/low level count indicator’ (Q5 or use a flag M1)
• When the full liquid level in the tank is sensed by the tank high/low level count indicator (Q5), the fill pump will be shut-off and the FULL light (Q2) on the control panel is to be energized.
• When the tank is full, start the mixer (Q3) and run for 10 seconds (B8: off-delay timer).
• When the 10 seconds has expired, stop the mixer (Q3) and start ‘empty’ pump P3 (Q4).
• Pump 3 (Q4) will be required to run until the tank is empty. Tank empty can be detected using the low-level sensor (I3).
• The pulses generated by flow meter 3 (B15) should be used to decrement the counter (B6: Up/down). Tank empty can be detected by the high/low level count indicator (Q5 or use a flag M1) to switch off the pump
• When the stop button (I2) is operated, the process must stop immediately (Q1, Q3, Q4).


Thanks
Attached Images
File Type: png Task Logo.png (255.5 KB, 87 views)

Last edited by aidan5192; January 10th, 2022 at 06:34 PM.
  Reply With Quote
Old January 10th, 2022, 07:48 PM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
This could be done with ladder easily enough, but the principles should be the same.

Inputs
  • Start (momentary)
  • Stop (momentary?)
  • Flow pulses (not sure if they are needed, if there are independent high and low level switches, but whatever)
  • Levels?
    • High level? (not sure if this is an actual switch, or output Q2, or an "inflow pulses counted up and reached 10 or more" result)
    • Low level? (not sure if this is a switch or an "outflow pulses counted down and reached 1 or less" result)
Outputs
  • Q1 Filling pump
  • Q2 Tank full (seems to be conflated with Q5?)
  • Q3 Mixer
  • Q4 Emptying pump
  • Q5 Tank Hi/Low count? (Seems to be conflated with Q2?)

There are four states
  • Idle, which on Start=1 transitions to
  • Filling, which on TankFull=1 transitions to
  • Mixing, which on TimerOff expiring transtions to
  • Emptying, which on TankEmpty transitions back to Idle (above)
It could be argued that there are an additional four states, representing the states in between those four i.e. the transitions, e.g. State is Idle and Start=1 but we have not yet transitioned to Filling.

Also, when Stop=1, always transition to Idle.

We could maintain states either
  • by the logic of what is happening at any moment e.g. combining inputs and output 1s and 0s logically, so once mixer starts we can no longer be in Filling state
  • OR
  • in independent internal bits that get latched as the process moves from state to state.
    • E.g. B001 is Set (becomes 1) when Start is pushed.
With the latter, we can ISOLATE
  • the transition logic i.e.
    • which state, N, are we in now
    • AND
    • if we are in N, and Event E(N) happens, transition to state N+1.
FROM
  • the output logic i.e.
    • When we are in Mixing state, then turn on Mixer
The nice thing about that is that you can know if you are in a state N if state bit N is 1, AND state bit N+1 is 0.

So the state map looks like this:
  • Idle
    • All state bits are 0
  • Filling
    • Filling bit is 1
    • Mixing bit is 0
    • Emptying bit is 0
  • Mixing
    • Mixing bit is 1
    • Filling bit is 1 (still)
    • Emptying bit is 0
  • Emptying
    • Emptying bit is 1
    • Filling bit is 1 (still)
    • Mixing bit is 1 (still)
That is overkill: to identify if the process is in any one State N, wee need only to check if that (State bit N is 1) AND the next (State bit N+1 is 0). So, for example, when Mixing state bit is 1 and Emptying state bit is 0, turn on the Mixer and the emptying pump will not be on at the same time because the Emptying bit is 0.

I haven't seen this exact style of logic before, but it seems pretty straightforward.

Suggestion

You have probably figured it out by now, but I think the Off Parameter on the Up/Down Counter should be 2, not 1, so the Q bit will change to 0 when the count reaches 1, otherwise the Q bit will continue to be 1.

yyy.png

Although from what you wrote, your problem seems to be before that i.e. the mixer.
__________________
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
  Reply With Quote
Old January 11th, 2022, 02:00 AM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Possible solution, but there is a problem if the system is reset (e.g. I2 Stop pressed) while the counter output (Q) is 1, because the next time I1 Start is pressed, there can be no rising edge to Reset the Filling State. That can probably be fixed by removing the AND-edge of the counter output Q, but then the mixer will run when Start is pressed if that counter Q is 1.

xxx.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

Last edited by drbitboy; January 11th, 2022 at 02:29 AM.
  Reply With Quote
Old January 11th, 2022, 04:55 AM   #4
aidan5192
Member
United Kingdom

aidan5192 is offline
 
Join Date: Jan 2022
Location: tamworth
Posts: 7
Thanks for commenting , i will have another look at it now. Also everything that is on there
like the " (Q5) high/low tank indicator" and flow meters all been set up for the task ive had to fill in the rest haha, also never tried ladder actually thought that would of been harder (only been shown FBD).

All that said thank you for taking some time to answer me. much appreciated
  Reply With Quote
Old January 11th, 2022, 09:56 AM   #5
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
I just re-read the OP, I did not notice there an input, I3, that indicates a low level, presumably that is a level switch. I was wondering about that, because counting filling flowmeter pulses up and emptying flowmeter pulses down will eventually not represent the actual level. So my logic will not work.


Also, I realized the diagram in the OP uses Asynchronous Pulse Generators (see this link)as proxies, in B002 and B01, for the filling and emptying flowmeters' pulses.

There is also the question of what to do next after the [I2] Stop momentary is pressed somewhere in the middle of the sequence:
  • Should the tank be somehow drained, until [I3] is 1, without any (more?) mixing?
  • Or should there be an option to do some mixing first?
  • Or filling then mixing?
This process seems ill-defined; is this a homework assignment, or a contrived exercise to learn how to program LOGO?
__________________
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; January 11th, 2022 at 10:10 AM.
  Reply With Quote
Old January 11th, 2022, 10:21 AM   #6
aidan5192
Member
United Kingdom

aidan5192 is offline
 
Join Date: Jan 2022
Location: tamworth
Posts: 7
yeah its an assignment for work but they gave me this to work out. been told i have to get all 3 stages to work , print screen etc all individual outputs working/ not working and copy of the program .

1 - tank has to fill and energise Q1
2 - When tank full Q5 & Q2 energize and DE-energize & start mixer Q3 for 10 seconds
3 - when 10 seconds expire, shut off Mixer (Q3) & energize Empty pump Q2
4 - assuming empty pump for 10 seconds (Not quite sure with advice i got given) as
5 - need to energize Q5 again When tank empty so need to decrement counter
6 - I2 ( stop button) needs to shut off ( Q1 , Q2 & Q3 immediately)

That is the advice i got when i asked trainer at work so wasn't really helpful in the slightest.
4 -
  Reply With Quote
Old January 11th, 2022, 12:15 PM   #7
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
I am starting to read the LOGO! syntax better, so I looked at the OP code again. It was very close, only two things needed fixing:
  1. Invert the input connection into B007 from B009 output, so the Emptying Pump would not run while the Mixer Timer Output was 1 and the mixer was running,
  2. Change B011 to a Latching relay.
See below.


Sidebar/minor issue: Is B006 needed? Can Q5 instead be connected directly to both B009/1 and B007/2?


xxx.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
  Reply With Quote
Old January 11th, 2022, 12:22 PM   #8
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Also, here is a similar approach, it's basically the same thing, but saves one block by using only a single pulse generator for both filling and emptying.

xxx.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
  Reply With Quote
Old January 11th, 2022, 03:23 PM   #9
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Reduce it by one more block, assuming the Fill/Mix/Empty sequence should repeat automatically once the process has been started with [I1 Start switch].

Also, B008 may not be necessary, if the [I2 Stop switch] to [B006 Reset] leaves B006 output in a 0 state after [I2] is released when the Tank Mixer is running, which would get us down to 7 blocks total.

Untested, of course.
Attached Images
File Type: png xxx.png (58.0 KB, 56 views)
__________________
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
  Reply With Quote
Old January 11th, 2022, 06:05 PM   #10
aidan5192
Member
United Kingdom

aidan5192 is offline
 
Join Date: Jan 2022
Location: tamworth
Posts: 7
Yeah i realized about the inverter. had a read through the manual etc and couple of youtube videos, made me realized thats what i was missing. also the latching relay did the job instead of the pulse relay thanks.

But i see what your on about ill give it a try see what happens, i know ive tried the "and-edge" b006 instead of the "or" but it did not work out with the circuit for some reason so had to go back tho the "or"

I can see you put some thought into this now which is amazing since im new to all of this and i found it very confusing to be honest but i do value your input and have found it informative

also i cannot try the last diagram you have presented as the 4 outputs and the 3 inputs (Q5 included) is what i have been told i must present and cant remove any of them, but thanks anyways, you have definitely showed me how i could make it much simpler if i had the choice.

This is what i have come up with, and it works, except the stop does not stop Q2 & Q5 now
Attached Images
File Type: png Task done.png (191.1 KB, 51 views)
  Reply With Quote
Old January 11th, 2022, 06:39 PM   #11
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Whoops, B006 is the wrong kind of timer; it should be the edge-tirggered wiping relay
__________________
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
  Reply With Quote
Old January 11th, 2022, 06:43 PM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Yes, my code blows off the Q2/Q5 outputs; those are only indicators
__________________
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
  Reply With Quote
Old January 11th, 2022, 06:45 PM   #13
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Quote:
Originally Posted by aidan5192 View Post

This is what i have come up with, and it works, except the stop does not stop Q2 & Q5 now

I think that is as it should be; in the OP it said that the Stop Switch should stop the process and specifically called out Q1, Q3, and Q4, but did not call out Q2 or Q5.


Q2 and Q5 indicate that the tank either is full, or was full and has not since been emptied; why should stopping the process (pumps and mixer) somehow "declare" the tank not full?
__________________
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; January 11th, 2022 at 06:48 PM.
  Reply With Quote
Old January 11th, 2022, 07:00 PM   #14
aidan5192
Member
United Kingdom

aidan5192 is offline
 
Join Date: Jan 2022
Location: tamworth
Posts: 7
You are absolutely correct , i have been so tunneled visioned trying to finish this task i forgot what was actually stating in the task. Thank you very much for support you have given me , i do appreciate you taking the time to help.
  Reply With Quote
Old January 11th, 2022, 08:03 PM   #15
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,981
Quote:
Originally Posted by aidan5192 View Post
You are absolutely correct , i have been so tunneled visioned trying to finish this task i forgot what was actually stating in the task. Thank you very much for support you have given me , i do appreciate you taking the time to help.
Glad to help.

Here it is in ladder, with a few extra twists.

P.S. well done, you fixed your code yourself, which code was almost working. It is very difficult to learn a new language like that; after a while you will know to look for things like edge detection, but for now just keep reading the manuals and asking questions.


I am a "code golfer," and that rarely makes for maintainable production code.

The next step I would suggest is commenting the code; if LOGO! doesn't allow for it in the app, copy screenshots into a document and write the comments. Comments are crucial three months down the road when summat changes in the process and you have to troubleshoot a problem. Also, often when I write comments I find subtle bugs. Comments should be process-focused, not code-focused e.g. "Start mixer and mixer timer when tank reaches full," not "Start B009 timer when B006 output has a rising edge."
Attached Files
File Type: pdf fill_mix_empty.pdf (181.3 KB, 10 views)
__________________
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; January 11th, 2022 at 08:17 PM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Flying windows button for RSView32 security Deer LIVE PLC Questions And Answers 9 September 23rd, 2018 03:01 PM
just wondering about event tasks escoplcguy LIVE PLC Questions And Answers 19 July 9th, 2011 05:10 AM
Siemens Logo AM2 PT100 powered by main logo unit? hop LIVE PLC Questions And Answers 3 December 25th, 2009 10:37 AM
ControlLogix L-55 Scan Problem MorphuisOGrady LIVE PLC Questions And Answers 19 July 15th, 2009 09:34 AM
Logo 230rc finskhan LIVE PLC Questions And Answers 7 April 27th, 2008 12:10 AM


All times are GMT -4. The time now is 07:11 AM.


.