From flowchart to ladder

From flowchart to schematic to ladder

I can design machine control circuits using relay logic but it's a grueling job for me. I don't do it often enough to be proficient. Typically, my circuits have 8 or less 344PDT relays with about as many switches and as many outputs like valve coils and such. I can do a flowchart in minutes but can't easily translate to a schematic.

We only have a couple of PLC controlled machines. I did the flowcharts and hired a company to do the programming. I would very much like to become proficient at doing the whole job in house. I can think of a number of applications that using PLCs to replace relay boxes would be very beneficial.

I use a bunch of stuff from "Automation Direct" and I've been looking at their "Click" line of PLCs. They seem inexpensive and powerful.

So, how do I get from flowchart to Ladder programming?

Reply to
Tom Gardner
Loading thread data ...

On 4/23/2012 5:34 PM, Tom Gardner wrote: ...

--

Reply to
dpb

BTW, I ran into the fellow who wrote this at an Embedded Systems Conference in SF/SJ quite a number of years ago...

He's on faculty at Grand Valley State U in Michigan...

Reply to
dpb

There are lots of other languages that might be suitable, such as function block, structured text, and phase diagrams. Ladder is my least favorite, but might be the best choice for your case. AB's phase diagram programming was undergoing some changes about the time I retired a couple years ago. I did a lot of AB and some Siemens.

If you can do the flowchart, you've done the tough part. Describing exactly what you want the program to do is a large part of the work. Still, I found it more and more difficult to focus while programming after the age of 55 or so. Before that, if you came in my office while I was working, I probably wouldn't hear you or notice you at all. I'm a lot easier to interrupt these days.

Pete Keillor

Reply to
Pete Keillor

Pete Keillor fired this volley in news: snipped-for-privacy@4ax.com:

I was a machine language programmer when I was first thrust into the ladder logic world, and it was a rough transition.

My path was eased when the team decided on a PLC with an event-triggered BASIC language extension capability. I don't have experience with many different PLCs, but from what I've seen, most of them offer some such ability.

It allows you to place the most fundamental cyclic state checks in ladder, and do the nitzy (and perhaps arithmetic-based) control in the 'higher' language.

In the case of the BASIC I was given, it was severely crippled, and required that I write my own floating-point math package to support the precision of work we were doing.

The learning curve was pretty steep, but short.

LLoyd

Reply to
Lloyd E. Sponenburgh

I'll chime in on this PLC thing. I have a lot of experience using different different computer languages to control equipment.

I always found PLC ladder logic to be difficult and arcane. I do know the folks that do this can whip out a control program quickly.

If you don't have a fella with great aptitude for this sort of thing in house, I'd hire it out. An expert will charge ya, but it will be worth it.

Karl

Reply to
Karl Townsend

What are phase diagrams? My cousin would make a diagram that would have square "bumps" on a line that would show if a relay contact or a switch was on or off. Each contact set would have a separate horizontal line and somehow he would create the logic by the state of each bump. Is trhat a phase diagram?

Reply to
Tom Gardner

I'm at the age where I feel the need to challenge my brain to keep it functioning. What control scheme would you learn if you were in my shoes?

Reply to
Tom Gardner

Thanks, lots of good stuff here!

Reply to
Tom Gardner

Tom Gardner fired this volley in news:8fadndW5l6KtsQrSnZ2dnUVZ snipped-for-privacy@giganews.com:

Both, Tom. It's the only way I stay at "medium alert" as opposed to just plain "old and dumb"! I'm learning on an Arduino chip now, as an alternative to PLCs.

Lloyd

Reply to
Lloyd E. Sponenburgh

If given the choice I code a state machine controlled by global Boolean variables, which roughly correspond to the relay coils. The comments that describe its operation come first and replace a flowchart.

I learned to decipher and then design relay ladder logic shortly before PLCs came out.

jsw

Reply to
Jim Wilkins

Assembly language...

No secrets, not high level help, total responsibility, but total control.

Then write any damned thing you want...

Reply to
Richard

I think I'm going to dig into the Arudino as well. The Propeller is a hell of a lot more powerful processor, but you don't always need that.

Reply to
Richard

A nice simulator for learning. I think there is (there used to be) a limited free download and a reasonable price for the full version.

formatting link
If you have a description of what you want to do you can work through a flow chart.

A ladder program runs though and you control what is happening by conditions.

One rung might say symbolically

If auto_mode and start button pressed then begin auto cycle.

Auto Start Stop cycle

----||--------||-------|\|--------()--

The cycle condition starts the sequence. Let's say, for example, our simple cycle is to drill a hole. I don't know how to draw it well on the screen with text so I'll use words that easily translate into ladder logic.

So,

If Auto and Start and Not Stop then start cycle.

If ((Cycle AND NOT step 1) OR step1) then step1=TRUE. If Step1Complete then Step2=TRUE. If Step2Complete then Step3=TRUE. .... In ladder logic the -( )- is ON when the logic condition is true and OFF when false, our IF statements above would need an Else StepX=FALSE.

This can be the generic sequence of operation.

So let's pretend we have an automatic drill press and we want a cycle of Step 1 Clamps Closed Step 2 Drill ON, wait 2 seconds for drill to come up to speed. Step 3 Drill Down, dwell 1 second so drill is fully extended. Step 4 Drill Up, Step 5 UnClamp Part.

If Step1 AND NOT Step5 AND NOT CycleComplete then ClampClose=True, Step1Complete = TRUE. If Step2 AND NOT Step 5 then Turn On Motor and start 2 second timer. If Step2 AND Timer Done then Step2Complete = TRUE. If Step3 AND NOT Step4 then Drill Down = TRUE. If Step3 and Drill Down Prox Switch then start Down Dwell Timer. If Step3 and Down Drill Timer Done then Step3Complete=TRUE. If Step4 and Drill Up Prox then Step4Complete = TRUE. if Step5 then CycleComplete=TRUE

Cycle Complete stops step1, that stops step2, that stops step3.... The the cycle is ready to restart by the start button, another timer, an input from the part feeding program....

The above isn't very refined but can give you the general idea of making things happen when they are supposed to by the conditions of where you are in the sequence.

Now you can add manual operation using OR (a parallel branch in ladder logic) so you can have something like If (AutoMode AND Step1 AND NOT Step5) OR (ManualMode AND ClampCloseButton) Then ClampClose=TRUE.

Hope this is some help.

Here's a machine I programmed over 10 years ago:

formatting link
RogerN

Reply to
RogerN

I found some good PDF files for Arduino, mostly just searching Arduino PDF.

I'm learning more useful Arduino programming with the gnu-c-manual.

I used to write ladder type rungs with the if() statement, now I kind of like:

Output = (((A && B)||C)? 1:0) ;

instead of:

If((A && B)||C) Output = 1; // If (A AND B) OR C, Output is turned on else Output = 0; // else Output is turned off.

Seems like an interesting little shortcut.

I was able to use pointers to structures to use one function with multiple sets of data, I did PLC style timers with each instance of the timer having it's own data so I can set multiple timers.

I'm not very good at it but it's been fun learning.

RogerN

Reply to
RogerN

Rockwell has a phase manager, but it was just coming out when I retired. I played with it a little when one of their software gurus came out to visit for a couple of days to bounce the concept off me. Phases are like "Load ingredient A, Load Ingredient B, Stir, Cook, etc. One I left off that I used more was sequential function chart.

On the projects I worked on I used a lot of function block, some structured text, a little sfc, and damn little ladder. You can get most types to do a job, but some are easier for a type of job than others. For continuous processing (flow meters, pumps, etc) function block beats ladder hands down. For discrete manufacture(more on-off type logic), ladder may be the way to go, although I don't like the stuff and would probably use a different tool. You can find a downloadable demo for RSLogix 5000 for playing around good for 90 days. It'll give you a good idea of the different types and what they do, but cost for a working license is what you'd expect for corporate type projects. They do have cheaper products for smaller jobs. All of the big control software outfits pretty much conform to S88 now, so the tools are similar overall, although there are considerable differences in the details. I sure preferred rockwell to siemens. I'm guessing there is no german equivalent to "user friendly".

When I first started using Rockwell's software, as a beginner they reviewed my code under a secrecy agreement. Then they drove over with the software guru mentioned above. Strange meeting, he sat with me in my office, showed me some tricks to get everything to work (involving some vestigial ladder), and the other five people including other Rockwell folks and our local vendor stood around trying to figure out what the hell we were talking about. Then they invited me to do a presentation at one of their user conferences. Fun days.

The guru is a brilliant guy, but they'd moved him to management by the time I retired.

One thing I'd want is a system that supports indirect addressing. You name the variables names that make sense and don't worry about where they're stored. That was not the case in old plc programming, like plc-5's. Variables were named by their location, which is a real pain in the ass.

Sorry to run on, you got me going remembering the old days. My job description was never programmer, but r&d technical leader. I programmed stuff I designed because I liked it, although it's a poor career choice. Mostly they hire contract programmers, cheap.

Pete Keillor

Reply to
Pete Keillor

Start simple and build on it! Start by replacing a single timer or something like that. Don't start with a whole machine unless you can block out a whole bunch of uninterrupted time to bootstrap things.

PLCs are the right tool for your applications, IMHO, you just have to play with them a bit more. You might want to start with a micro-PLC that doesn't have zillions of features, and then move to something a bit overqualified for your applications that you can standardize on.

The nice thing about being in full control of the programs is that you will be able to tweak them without getting someone in.

BTW, I would be sure to implement any safety-related requirements outside of the PLC. For example, don't route an e-stop switch or an overtemperature alarm through the PLC logic, make it actually shut things down positively if human safety could be compromised. That way a PLC failure, glitch or programming error can't hurt anyone.

Reply to
Spehro Pefhany

Spehro Pefhany fired this volley in news: snipped-for-privacy@4ax.com:

Yeah... and they do happen, even if your code is pristine.

LLoyd

Reply to
Lloyd E. Sponenburgh

Everything I ever need a machine to do is simple. My target project controls two hydraulic cylinders. The machine makes solid-fill end brushes. One cylinder holds the cup in a die, the outer cylinder inserts a bundle of wire, then the first cylinder goes to high pressure and pushes the cup further into the die that crimps it. As it is now, there are 3 hydraulic valves, five limit switches and two palm switches in series. Eight 3 to 4 pole-double throw relays and a 24VAC transformer is all that's in the control box. This is fairly simple with a bit of trickiness. It runs fine now but it seems like a good project to cut my teeth on while eyeing more complex machines.

Reply to
Tom Gardner

Good ideas, thanks!

Reply to
Tom Gardner

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.