Redlight!

dkbrwnsugar

Member
Join Date
Jul 2005
Location
charleston
Posts
2
My engineer gave me a task to create a program for a traffic light to perform as follows:
turn red 10 seconds, yellow- 2 seconds, green - 12 seconds.
The catch is..I have to create it to operate in both directions.

Please help me!
 
Cool This really is a fun project.

By both directions I assume you mean...
East/West as direction 1.
North/South as direction 2.

First let's get direction 1 going.

What have you got?
 
Actually, I haven't a clue. My engineer just started training me on plc yesterday, but he is not the best trainer. He will be away from work tomorrow. I thought maybe I could get some advice on how to get started.
 
You may as well do it properly to start with.

Begin by writing a functional specification.
In this case, just a sequence of numbered steps will do.
At each step, describe what the lights will be doing. You should need only one sentance per step, and my guess is that the entire functional spec should be 3 to 6 steps in total (maybe a few more).

After that you can start your coding, and if you get stuck, post your functional spec. Hint for coding, use timers.

Hope this helps,

Doug
 
Since the sequence of lights is incomplete as posted, I'm guessing that by 'both directions' your trainer means that red - yellow - green is one direction and green - yellow - red is the other direction.

You might find it easier to think of it as a circular sequence of 26 seconds duration; red - yellow - green - yellow - red - etc.
 
As a student I did this several months ago. I guarntee two things
1. You will not need a haircut when done. It is a good hairpull exercise - but that is what learning is all about.
2. You will feel some sense of accomplishment when done.

Start with sheet of paper. Keep project simple to start.
1. East / west and North / South are stop and go - ONLY. No left turns pedestrians etc etc.
2. Eastbound and west bound both start and stop together. Same for No So.
3. Start with one direction stopped and one flowing ie No So stop E W go.
4. Now do lites (use matrix to minimize typing) ie

No So E W
Red
Y
Green

Do above for every stage.

When you have that done NOW you can think of timers.
Dan Bentler
 
Don't get discouraged. We love to help people learn - so long as learning is what is really happening. You've had some good hints, and you might be tempted to look somewhere for a completed solution, but hang here with us and the learning will be more fun.
 
Casey, I'm the controls engineer here at my co., but I'm also responsible for making sure the maintenance sparks are trained - so from time to time we have little training discussions. I just thought that this might be a similar situation - either that or its a student trying to not look like a student.

It really doesn't matter if he is a student or employee in training, its the same either way. If he will talk it through with us and let us lead him along then we are happy to help him learn. If we do it for him, he does not learn.
 
lets make it interesting and add Left turn lanes in each direction. Then maybe crosswalks with the little pushbutton and walk/dont walk lights.
Talk about pulling your hair out.
 
Alaric:

I am a firm believer in training anyone who might have the need, whether new, or 35 year old timers.

A stoplight is kinda lame. Okay, it does teach some basics.

But why not something more related to the job, such as a small automatic drill press, with extended, retracted, and midpoint sensors, with an air valve to lower the cylinder, and a timer on the dril, with an output for the drill relay, with an auxillary stop button.

Or perhaps a simple conveyor control.

I guess that I have gotten as sensitive as some of the old timers on here who won't even look at a thread that says stoplight.

best regards.....kc
 
CaseyK said:
A stoplight is kinda lame. Okay, it does teach some basics.

But why not something more related to the job, .....

Agreed. Maybe the engineer just isn't too imaginative. But I have never met any un-imaginative boring stiff engineer types, so that's probably not it.:ROFLMAO:
 
Alaric said:
Agreed. Maybe the engineer just isn't too imaginative. But I have never met any un-imaginative boring stiff engineer types, so that's probably not it.:ROFLMAO:

After I clicked the button to post this reply, I saw the "smiley" at the end of your quote.

NOW we are on the same page!

I have seen some older engineers, many that were managers, that were so stiff, they had their suits pressed with a steam roller, sometimes with them in them!

Then there are those that are so tight, they close their wallets with a torque wrench! 130 pounds minimum, please.

Have a good one! kc
 
Back
Top Bottom