Student needs Ladder Logic help

S

Thread Starter

shane marti

Im struggling in my Beginning plc class and wondering if someone can help me out with the ladder logic.

The problem: you momentarily push the start button to start the cart in the right direction. the cart moves right hits the limit switch. the cart stays there for 5 secs then returns to the left limit switch and stops. as well as the stop button can be pushed at any point and the cart will stop and stay stopped and start back to the right when start is pushed and to be repeatable. i know it isn't that hard of a problem but not the teacher sucks and i'm struggling.

thank you if u can help
 
T

Trevor Ousey

Hi,

There are several methods you could use. Not knowing where you are up to with your competencies I think your best method would be to look at the process and break it in to sections. For example look at the stop-start as one section, then look at the move right sequence and so on.

Use a latched circuit to detect the first sequence has completed.

A couple of pointers for novices, minimise the use on set-reset or latch-unlatches so you wont be as easily mislead.

Being careful to only suggest ways to go rather than do the program for you.

Regards,
Trevor.
 
P

Patrick Beckett

Hi,
Trevor is right. Software engineering is about breaking a problem down into the constituent parts and solving each of those. PLC programming is no different.

PLC programmers develop an arsenal of 'standard' solutions to simple problems and simply build back up from there.

Your problem has three parts, and at its simplest three rungs will solve it. Particularly as your tutor has made it easier for you! He may not be the best at explaining it but it least you do not have to remember which way it was travelling when the stop button is pressed.

The way you describe it is :
1. Wait for a Start Pushbutton, then move right until a limit switch is made.
2. at the limit switch wait at set time.
3. then move back to the other limit switch.
The stop button button rule applies is both parts 1 and 3.

Solve problem 1 first, as problem 3 is very nearly the same as the first. then solve problem 2, and then go back and modify your solution to problems 1 and 3 with the requirement of the stop button.

Another agreement I have with Trevor is to avoid using Set and Reset, or in your case --(L)-- and --(U)-- instructions. (you are using Allen Bradley, right?).
Get into the habit of avoiding unless there is no other way. It is far too easy to get the number of Set and Reset instructions out of sync, or have a condition in both true at the same time and then having weird things happen.

Good Luck
Patrick
 
K

Ken Emmons Jr.

Shane,
Do you have a PLC or simulator to work with? This can help a lot.
Follow my previous message about using programming sequence steps. I'd
say you might consider putting the stop button behavior out of the
sequence though since it is asynchronous. I don't want to do your
homework for you, but I think these are good pointers to start with.

KEJR
 
K

Ken Emmons Jr.

Patrick has a lot of good points, but I disagree with the set and reset (latch,unlatch) avoidance. You can make very good methodical code using step sequences and set/reset. This is my preferred programming method in ladder as it yields very safe code if you follow a few basic rules. I've seen examples from Rockwell on this as well.

Basically every rung starts with a step counter (an equals instruction) and a step constant. At the end of the rung you increment the step count variable. For beginners I would recommend doing one thing per step even if it looks like you are wasting space.

As you learn how the PLC scans you can add some more things per rung. Step one would be the zero step and it waits for the start switch and then increments to the next step where you wait for the limit switch, etc, etc.

The step approach sounds inefficent, but as you become more professional in your programming you will find that you need to add additional operations and you can insert other steps without blowing up your code if you are careful and do things right.

KEJR
 
Hi All,

You didn't say what PLC you were working with. I have heard that there are different online simulators for the simple processors. I was wondering if any of you have had any experience with them?

It would be much easier to do this than build a simulator like i did.

Pat
 
Top