Student Project Question

amm

Member
Join Date
Mar 2007
Location
Northern Illinois
Posts
17
I am a second year EET student and have a small final project that simulates a coin operated car wash.

As it is our last project for the intro to PLCs we are required to use subroutines or sequencers.

The car wash has 4 different cycle choices:
Wash only-1 coin
Pre-rinse & Wash-2 coins
Wash & Hot Wax-3 coins
Pre-rinse & Wash & Hot Wax-4coins

Pre-rinse:
Water-3sec

Wash:
Water&Soap-4sec
Water&Soap&Brushes-12sec
Water-4sec
Blower-5sec

Hot Wax:
Wax-3sec(before blower)

I seem to have gotten it to operate fairly well but in my final SBR7 where I am adding a shut down program is where I have gotten confused.

Any help or advice with this would be great. I am not really looking for a prefect answer to my problem just a suggestion.
 
If you also post a pdf you may get more replies, i am at home and have no application installed to view .rsl files
 
Thanks so much for the feedback. I get the feeling that student project questions are a bit of a pain for most of you.

The timing of the counter reset is my biggest problem I tried it a few diffrent ways.
Basically first I thought I wanted the counter to keep its ACC until the whole sytem resets when the car pulls out of the bay. It didn't work well.
But a project requirement is "Whether the full wash completes or not the system needs to reset when the car bay sensor indicates the vehicle left."
So I will probably have to include the reset either as a function of each subroutine or the main LAD2 after each JSR.

Think I got it.
:nodi:
Then any coins that are counted by the system during an active car wash cycle are ingnored as overpay. So an extra coin after a 3 coin wash starts doesn't trigger a whole new 4 coin wash.

The input for the coin count is just a NO that counts up as the coins are added. That part I think I got figured out.

The car bay sensor is the trickier part I want it to remain true until the car pulls out. But it isn't as easy as all that as I need a reset before a wash cycle is complete if the vehicle leaves mid wash.

Thanks Again. I have attached a zip file of the ladderrungs pics if anybody else is feeling helpful.
 
Last edited:
It may operate, but right away I see a very obvious and basic error, that you repeated in Subroutines 3, 4, 5, 6, and 7 (Shutdown). You have used each Ouptut more than once, in fact 5 times! Remember, in a PLC program only the last instance of an output is effective, so the other 4 instances are doing no good at all, and may lead your program not to work correctly.

What you should do instead is to set up Intermediate (also called Interposing) relays, for all but one case of your outputs. Add a routine called "Outputs". Put O:2/1 through O:2/5 in this routine. Now go back to the other routines and create relays for each output in each subroutine AND REMOVE the actual output. Then go again into the new "Outputs"and insert contacts from the new Interposing relays, to Start or Stop each motor as needed. In fact each Output rung should have a Stop function, most important so put that in first. If you can't stop a motor, then you never want to get it started in the first place. Then add the Start function.

Hint: Think of PLC outputs as if they were physical relay coils. How many coils can you have for any one relay? Only one of course. Having two or more would create a problem. But how many input switches can you use to control each relay? Any number, as many as are needed.

Now, I just ran your program with the LogixPro Simulator, and it does not work. Insert one coin, and it should go to Wash. It starts the Wash timer, but BECAUSE OF THE ABOVED-MENTIONED ERROR, it does not start the water pump, or any of the other motors. The Shutdown routine, the last part of the ladder that is scanned, keeps any of the motors from EVER running (highlighted Yellow in LogixPro).

Another problem, common to beginners, and a sure sign of an amateur, is that none of your inputs are labeled, and many of your rungs do not have comments explaining what they do.

Keep working, but learn patience and perservance. You can do it.
 
Last edited:
I figured the "Intro to PLCs" would have pointed out I am not a pro. But I do try to lable the hell out of my ladders.
:cool:
The I:1/0 is the coin sensor input and I:1/1 is the car in bay indicator.

Thanks for your advice about the outputs. I do understand the concept on not using a output over and over but as only one wash subroutine will ever run what is the problem of turning on the lights on in that way.

Also the bank of lights aren't really for anybody but me to check my timing and order, the project deliverables only calls for a light to indicate the car is being washed and another indicating the wash is over.

Sorry to waste your time.
;)
If you included SBR7 it will never work its the part that is giving me fits, but I think I can just drop it and place the shutdowns on LAD2

Thanks for your advice and help.
 
Last edited:
The I:1/0 is the coin sensor input and I:1/1 is the car in bay indicator.
Here I was thinking that I:1/1 was the System On/Off switch. See how important labels are for correct interpretation of what you meant to do?

Thanks for your advice about the outputs. I do understand the concept on not using a output over and over but as only one wash subroutine will ever run what is the problem of turning on the lights on in that way?
First, what makes you think that only one of your subroutines runs? You may mean for that to happen, but say a guy comes up and inserts two coins. When the first one drops, your program will go to the Wash routine (Remember that PLCs run much faster than humans can drop coins). When the second one drops, it will go to the Pre-Rinse and Wash routine. The problem is that your Shutdown routine runs EVERY scan, and because it is also the LAST ladder, then the Outputs in it will always determine the final state of the outputs (after each PLC scan). In this case, the other routines 2, 3, 4, & 5 have no effect WHATSOEVER on the outputs.

Don't feel disappointed. This is a very common programming error, and it happens because it takes awhile to realize that PLCS scan, or run, from top to bottom of the program, implementing one rung at a time. If an output occurs two or more times, only the LAST one will have an effect. If the first case turns on an output, and the last case turns it off, then it will be off and will show up as off when you run the program.

To insert rung comments in Logixpro, click on the Rung number at the left side of your ladder, then RIGHT-click and select "Edit Rung Comments".
 
Last edited:
I actually got the part with the extra wash covered and it does run if you drop SBR7 which is a bad concept. But it has no resets for the TONs or the CTU yet so it runs just once.
 
Well it might kind of work, but if your instructor knows anything at all about PLCs, he will count this (two or more cases of the same output) as an error and adjust your grade accordingly. Trust me, this is a basic well-known error.

If you were really building a car wash, you probably would want to start a timer when the first coin drops, then allow say 30 seconds for the next one. If no other coins show up, then you latch in the wash cycle. If other coins show up within the 30 seconds, then you count them and determine which cycle to run. All of this should be in the main routine.

Another problem you will face very soon is that your timers are inside the subroutines. A timer or counter in a subroutine only runs when the program is scanning the subroutine.
Update critical I/O within subroutines using immediate input and/or output instructions (IIM, IOM) especially if your application calls for nested or relatively long subroutines. Otherwise the controller does not update I/O until it reaches the end of the main program (after executing all subroutines.)

Warning! Outputs controlled within a subroutine remain in their last state until the subroutine is executed again.
Rockwell Software 2000
 
Last edited:
Question: What if a guy drives his car in first, then decides he wants wax, and walks back an puts in more money? Are you going to keep his money, thus making him so mad that he gets out his sledge hammer and beats your coin changer into small pieces....

This is how I would add symbols and rung descriptions:


CAR_WASH_R1.JPG
 
Last edited:
I get the feeling that student project questions are a bit of a pain for most of you.
No, we love them, but we reserve the right to demand some work and we like to see improvement.

Here are some more suggestions in a file that meets all your specifications.
 
Car Wash R2 PDF Files

Here are the suggestions in PDF format, except for last (and most important) Outputs subroutine. You MUST make sure that all outputs are off BEFORE the timer goes DONE in subroutines 3 through 6.
Car_Wash_Sub7.JPG
 
Last edited:
amm-

I like the fact that you called Lancie1 on the double coil thing. It means to me that you are paying attention and are thinking for yourself. I like that.

You are correct, it can work. But that doesn't necessarily mean you should do it. If I were your instructor I wouldn't dock you anything for using the same output in selectively called subroutines. I would, however, grab you after class and strongly suggest you don't do it.

This falls into the 'flexibility with responsibility' category. The vast majority of people who deal with plcs on a daily basis have had it drummed into them that multiple output references are the cardinal sin. So they tend not to look for them in the first place and will change them when they see them whether they are an issue or not. Doing something like this will tend to cause pain and heartache to those following in your wake.

It's kind of like driving your car. Just because your spedometer says your car can go 120 MPH doesn't mean you should drive that fast on a public roadway.

Keith
 

Similar Topics

hello I am currently enrolled in an electrical program in which i am learning about PLC's. I have been given several projects that require me to...
Replies
2
Views
1,936
i am presently doing my final year undergraduate course, i need few tips to start my project in plc
Replies
16
Views
4,330
dear friend I studing electronic engineering and my final project is related to Wincc(under 50 tags)I download wincc(without authorisation)and...
Replies
2
Views
2,732
Hi guys and gals have a question: I'm currently a student and just started taking a class on PLCs. So this is my first time doing Ladder Logic...
Replies
3
Views
8,060
K
please, I need a process controlled using plc.
Replies
5
Views
3,537
Back
Top Bottom