Flow diagram -> ladder diagram HELP

I wrote a nice solution to your diagram using stage programming, very simple and strsight forward. Unfortunatetly, I have more difficulty with printscreen and graphics programs, so I can't post it.

Anyway, using stages makes ladder diagrams programs very easy to write and to read. Learning stages take 10 mins. Not using stages is like using MS-DOS "cuz it's faster".
 
DirectSOFT has a simple way to 'share' programs. You can export the program as text, which can be easily inported by others. You can cut and paste it into your post, or simple attach the text file. alehandler and others can 'import' that file right into DirectSOFT. Keeps all your nicknames, rung comments, etc. too! It's a lot easier than zipping all the project files.
[attachment]
beerchug

-Eric

export.jpg
 
Here is another option. I believe this meets all of the requirements.

One thing to think about with this (and the version doran offered) is if you allow CT0 to reset itself your pulse to the output at Y1 will only be the length of one CPU scan. Approximately 2 to 4 ms. Your external timer might not respond to a trigger that short. You might want to condition that signal with an internal timer.

The other thing is that there is no provision for a "controlled stop" in this program. That is, when you push the Stop Button the sequence will stop wherever it is and then restart at the top without regard for where it stopped. You might want to think about a controlled stop condition where you can push the stop button anywhere during the cycle but it won't stop until the last bottle has passed the outgoing counter.

This is good brain food and it is nice to see other people's ideas.



I took the attachment off because it was huge. I'll try to get it down to an appropriate size.
 
Last edited:
ajbachhuber: How did you make that graphic? I need to learn how to do this. I feel defenseless if a code fight breaks out!
:( :confused: :unsure:
Thanks,
Deitz
 
Uuhhh... I dunno...

No really, it was fairly convoluted. I went about it the hard way for sure. I printed to the Acrobat Distiller. Then I tried to attach it but that isn't an accepted file type. So I re-opened it in Acrobat and saved it as a .jpg. Then I posted it and saw that it was huge (displayed size wise and file size wise). The file attachment size limit is just over 307kb and it was 271kb. I figured Phil didn't want us posting a bunch of pictures and eating up his bandwidth so... I reopened Acrobat and saved it as a .png file. Then the file size was only 18kb so I didn't think that was too bad. Then I browsed to my saved .png file and attached it. It is still way too big but I don't seem to have anything to edit the picture size.

I didn't realize it was going to show up as a picture in the post (though I had been trying to do that earlier). I thought that I had seen someone else with a small icon that took you to an attachment when you clicked on a link. That's what I was trying to do.
 
The best thing is to have a graphics program, I have Microsoft Image Composer that came with MS Office that I have gotten use to using. I have others that are more elaborate like Paint Shop Prothey have a free download if you want to try it.

What you do is have the program/file open (like DirectSoft) then press Alt and PrintScreen at same time, this copies the screen to the clipboard. Open the graphics program (even paint will work) and paste it, you can goto edit in menu (or right click the open page) and paste.

I normally do a Save As to name it and select file type, then I can modify it but always have the original in case I screw up. Then you can modify it depending on the abilities of the graphics program. Most graphic file types will display...gif, bmp, jpg, png, mic etc.

This way will only copy the viewed screen, there are programs that will let you copy the whole screen and make it viewable, I havent used those yet.
 
More ideas...

rsdoran...

The timer is external because the value needs to be user input - it is VARIABLE. The timer dictates the fill time - gooey stuff takes longer, watery stuff fills faster! Otherwise, of course, I'd be using internal timing.



Eric...

Thanks for sharing that export idea - I will include an export w/the next revision of my diagram. I will keep posting graphics, however, for immediate viewing.



ajbachhuber...

The external timer response is a valid concern - I will try it as is now and condition the signal if needed. If you can post a rung to do this, I would appreciate it. In your counter rungs, why are you using the start button as a reset? I'm not sure what SET, PD and RESET are as opposet to OUT... is SET=1 and RESET=0? Also, the STOP needs to actually STOP everything, rectract everything, etc - I definitely DO NOT want the machine to complete the scan. If a worker is caught in some moving part in the filler, I want the thing to stop immediately in a safe fashion. So in short, I'd like STOP to reset counters, etc and retract the ram. Thanks for the help!

-Alex B.
 
The timer is external because the value needs to be user input - it is VARIABLE. The timer dictates the fill time - gooey stuff takes longer, watery stuff fills faster! Otherwise, of course, I'd be using internal timing.
This is where the PLC offers more options...ie an HMI/Operator Interface. The cost vs convenience is minimal, it allows operators to set variables like timers, counters etc. The plc timer in most cases will be more accurate than most electric timers, unless using a digitally programmable timer which the cost is in the category of some operator interfaces.
The external timer response is a valid concern - I will try it as is now and condition the signal if needed. If you can post a rung to do this, I would appreciate it. In your counter rungs, why are you using the start button as a reset? I'm not sure what SET, PD and RESET are as opposet to OUT... is SET=1 and RESET=0? Also, the STOP needs to actually STOP everything, rectract everything, etc - I definitely DO NOT want the machine to complete the scan. If a worker is caught in some moving part in the filler, I want the thing to stop immediately in a safe fashion. So in short, I'd like STOP to reset counters, etc and retract the ram. Thanks for the help!
Set allows you to use a pulsed input..ie pushbutton pushed once to latch a bit or output ON.\
Reset unlatches that ON bit/output.
PD is positive differential...same as a one shot, which means its only true for one scan.

Opinion: Avoid using Set/Reset, its a confusing option with all brands of plcs. This may be the maintenance man part of me but I am scared of that option.
I can see using the start button as part of the counter resets...verifies that the counter is reset..good idea.
As Eric mentioned even if a program will work without a contact using another contact may offer options/safety that is not otherwise there.
 
Whoaaa baby...

Alex

RSDoran is right, sometimes set and reset get a little cofusing but I don't think that it is something to be scared of. MLS and MLR are scary though... just kidding.

There are more things going on here than you initially mentioned and there are more things to think about. I mentioned earlier considering a controlled stop function and I was afraid that you were going to try to use the Stop Button (PB2) as an E-Stop which is another thing. All the equipment I have built had Contorlled Stop buttons and E-stop buttons. I think that is just good practice.

There are some details that are important to the operation that you need to know. Some things I wondered:

Are your air valves two position or three position, single solenoid or double solenoid? This is important when you decide how to handle and E-stop condition. A single soleoid-2-position valve usually uses a spring or pilot air to return the spool to the other postion when solenoid power is turned off. In that case, power needs to stay on to that solenoid in an E-stop so that motion stops dead.

I'm figuring this PLC is just getting "piggy-backed" onto an existing system because you don't have any control to your filling equipment. At some point you need to give a signal to the filling equipment so that you aren't just putting six bottles together then passing them along. Is there an E-stop for the rest of the machine? What does it do, i.e. what power does it secure, does it drop out the air supply?

I've seen E-stops handled a couple of different ways, I can't think of a time when it was JUST an input to the PLC. I believe there are some requirements by code (or OSHA) that an E-stop must do certain things. I don't know all of those things but I'm sure that you could find it online or someone here could help you. At least in part, the code would say something like, "The E-stop must secure or release all stored energy that could harm an operator."

The way I have seen it most often is like this: a momentary Power-ON button latches a Master Control Relay which in turn provides power to the outputs of the PLC. The E-stop releases the MCR and drops power to the outputs thereby stopping all elctrical control. In addition, with our pneumatic equipment, releasing the MCR secures power to the "soft start valve" which opens and allows the air to quickly exhaust preventing any movement from the equipment.

In my ladder, I used the start button to reset the counters just in case it was stopped mid-cycle then restarted. You could just as easily use the stop button. You started this thread looking for best practices; let me assure you that what I gave you is not that. There are so many unknowns for someone who can't lay his eyes on the equipment. You provided a basic flow-chart and I returned a basic ladder.

You might want to speak with a Mechanical Engineer or an Electrical Engineer if you don't know the details of your equipment. I'm willing to keep helping but you gotta know I am neither an ME nor an EE. Good luck. Let's see what you come up with.

-AJ-
 
Thanks again...

Let me begin by thanking you all for the great advice. I have received help well beyond any of my initial expectations!

Okay, let me begin at the beginning… I am a recent MSME graduate RETROFITTING a WWII-era bottle filler. I have a concentration in mechatronics and worked with PLCs for about a month several years ago (I mostly work with microcontrollers) and have a decent “academic” understanding of what I’m doing. The automation is VERY simple, as you have seen – it will replace a guy (sorry, man) who now stands there and lowers a metal bar, counts some bottles, pushes a button, etc.. and does it again & again. The PLC is indeed “piggy-backed” onto the rest of the machine. I intentionally decided to keep as much of the old hardware as possible. My hardware’s point of contact with the “old” hardware is the external timer. The timer was previously triggered by the aforementioned button – now it is triggered by the PLC. The timer acts as a relay and operates a solenoid valve which in turn actuates a cylinder and lowers/raises a rack of injectors. On it’s way “down”, the rack (mechanically) stops the conveyor. It was designed by the Flintstones, I think.

I understand the safety issues involved. I believe, however, that “grandfathering in” the safety levels of the original machine is sufficient. The “old” safety measures involved a single stop button which simply deactivated the main solenoid, nothing more (even the conveyor keep running!). If I designed a machine from scratch, it’d have 10 safety buttons and a first-aid kit. I understand the difference between the controlled stop and the emergency stop buttons. A modern bottle filler currently in use at our plant, however, has ONLY an E-stop! I think this will be fine – the thing runs all day and is only stopped, in my experience, in case of emergencies (bottle jams, not fatalities).

In short, I need to make it as safe and reliable as possible using only the current hardware. Anything more would be putting air bags on a donkey cart.

Also, the valve I am using to drive the air ram is a Humphrey H420 4-way 2-position. The valve is a spring-return. If you have any more suggestions or design criticism, please let me know – I am happy to learn from everyone!

-Alex B.
 
Ah ha, I knew it...

I have put brains into dinosaurs and ended up with some pretty efficient equipment. It's a unique challenge working in parallel with the relays, timers, cams and sequencers. Lots of fun.

Now it all makes sense.

Here's the "signal conditioning" rungs we talked about earlier.

In the first rung Y0 will go high for only one second as long as X0 is high for longer than one second. i.e. if X0 is high for .5 sec Y0 will be high for .5 sec but if X0 is high for 2 seconds Y0 will only be high for 1 second. This may or may not be useful to you.

In the second rung, Y0 will be high for one second even if X0 is only high for one CPU scan. This is the rung you could use where we had CT0 resetting itself. Just replace X0 with CT0 in this case.

Lines 3, 4, and 5 say the same thing logically that rung 2 does. This shows you how you can use SET and RST.

There are a bunch of different ways to do this using the compare instructions as well.

-AJ-

untitled.png
 
Oh yeah

I forgot to mention this, you said:

alehander said:
...however, that “grandfathering in” the safety levels of the original machine is sufficient.

I was under the same impression. One of our safety guys (I think he is like the OSHA liaison or something) came to me once and mentioned that we had a lot of equipment that was technically faulty. Whenever a machine is upgraded in any way, it must be brought up to the safety standards in place at the time of the modification.

I'll see if I can get a clarification on that tomorrow. It comes out of 29CFR1900 I think but that's off the top of my tired head.
 
Would have been nice if you had included the documentation/nicknames for this. For some of us idjits it means alot.

Would have been nice to know that X0 was a signal from somewhere else that could "hold/latch" an output.

You realize that overall u got "100's" of dollars worth of info...I think many may be upset with me.

BTW yes there are OSHA regulations involved with modifying/upgrading a machine. This is besides the code pertaining to the machine's connection to power etc.

Many places it doesnt matter BUT if your name is ON the papers involved in the upgrade it can open you to liability.

Most will dismiss this...think about this carefully...are u willing to lose a lawsuit and have wage garnished?
 
Last edited:

Similar Topics

Hi, Do you guys provide flow diagrams for HMI screens with new systems? By this I mean a document outlining how the HMI moves from one screen...
Replies
4
Views
2,306
I'm wondering if anyone has encountered some decent software out there for documenting logic flow, particularly for control systems. Preferably...
Replies
11
Views
5,600
U
Hi, I'm a student and need to make a process flow diagram of a plc installation and have no idea what one looks like. Can anyone help? Also, I am...
Replies
4
Views
8,690
Hi Everyone, Does anyone know of a good resource describing how to generate a program flow diagram that can easily be interpreted into ladder...
Replies
1
Views
5,830
Hi Everyone, Does anyone know of a good resource describing how to generate a program flow diagram that can easily be interpreted into ladder...
Replies
2
Views
9,900
Back
Top Bottom