Elevator Circuit

Status
Not open for further replies.

PRS

Joined Aug 24, 2008
989
I just got finished reinstalling Vista and, man oh man, is my computer fast! Videos no longer jerk along, they flow just like on TV. I should have done this a long time ago! Vista is okay now that Microsoft has updated it with fixes. I think I may have flushed a lot of spy ware accumulated over the years. A neighbor says he has to reinstall his OS every two years, and for the same reason.
 

PRS

Joined Aug 24, 2008
989
jegues, are you still there. I haven't given up on this project, have you? I'm willing to bet I can help you get an A for the project. I haven't yet begun to fight! Your instructor is just messing with your head. You stick it to him by doing it. And I know we can do it. It's hard work, but are you with me? If you are, we'll get it done! I lost the use of my scanner, but I'll use that dang MS program, Paint, to make up for it. Are you willing to do the work? jeqies, what is the deadline? Roll up your sleeves, man, put up your fists. Do it.
 

Thread Starter

jegues

Joined Sep 13, 2010
733
jegues, are you still there. I haven't given up on this project, have you? I'm willing to bet I can help you get an A for the project. I haven't yet begun to fight! Your instructor is just messing with your head. You stick it to him by doing it. And I know we can do it. It's hard work, but are you with me? If you are, we'll get it done! I lost the use of my scanner, but I'll use that dang MS program, Paint, to make up for it. Are you willing to do the work? jeqies, what is the deadline? Roll up your sleeves, man, put up your fists. Do it.
Yes I'm still at working it. I've got alot of other coursework to do as well, so this is only one of many things I'm trying to manage.
 

PRS

Joined Aug 24, 2008
989
Thanks for the reply. I thought you had given up. Good to see you are still thinking about it. How much time do you have to come up with a solution? I lost my printer/scanner and therefore I can't draw diagrams for except using Paint and that's not easy for me. I feel like a child drawing with a big crayon in his fist.

I actually have thought more about the problem and I think that if you want an elevator that mimics an actual elevator, you've got a big project on your hands. Is this an end-of-course lab project? Do you have to actually build it?

Here is a major consideration for a real elevator: To some extent, the push buttons need to be remembered. This requires a data latch (flip flop) for each push button. At what point do you reset a bush button? At the point where the floor has been serviced? But in that case, what if the car is heading to F2 (floor 2) when someone on F3 pushes F2? The elevator then stops at F2 and its flip flop is cleared. Then the person on F3 is left wondering why the elevator never showed up?

The upshot is a need to remember multiple calls for the elevator to specific floors. It occurs to me that when a person on floor three presses 2, he is giving info about where is is currently at and where he wants to go. Somehow all of this information has to be condensed by a simple algorithm. Ask your teacher if he or she will allow for certain simplifying assumptions and just what those are.

Getting back to the first point: Say the car is heading to F2 from F1 and two people -- one on F1 and the other on F3 -- push 2? And what if we cleared flip flop 2 when the F2 was serviced (i.e. the car stops there)? The car would stay at F2 in this case. So we need to remember the call at F3 and F1, and I'm guessing two calls are enough. Therefore we need the flip flop 2 to be reset after the current call if there are no more calls to F2. This means we need to remember as many as 3 calls to F2. So we need a hardware implementation of LIFO up to 3 calls. LIFO is last in first out, like a stack of cafeteria trays. The number of calls for each floor would be stored in an up down counter that counts no higher than 2. (0, 1, 2). Each time the floor is serviced the counter is decremented. Each time the floor is called the counter is incremented, but up to 3 and no higher.

If the ceiling of 3 calls is not made a design feature, it's possible a prankster could hit a button 30 times and make the car go there on every assent or descent.
 

Georacer

Joined Nov 25, 2009
5,182
This is why I pretty much gave up this thread a week ago, and I admit it proudly. Check my submission on the Completed Projects Forum. I spent 5 months of work and at about 100 euros (without counting my partner's work and money) on it. The build was at about the same complexity as yours. Now, I don't say I regret doing it, but it is too much to go over something so demanding again, without a real reason.
I hope you understand.
 

thatoneguy

Joined Feb 19, 2009
6,359
Your approach may work, but that's not what jegues learned in class; that is, if things haven't changed much since I went to school. If he used your approach and succeeded in meeting the requirements for the elevator, he would probably not get an A or even a B. I know this because I did it with the result that it only made the instructor angry since I didn't use the approach taught in class. By the way, I got a C on that project. I think jegues wants an A.

After I finished school, when I actually had some time on my hands, I went back over sequential logic and cleared up the things that had gotten past me. I'd like to help jegues and his friends from making the same mistake I did. :)

Sadly, I must also agree with PRS. College/University profs tend to not like it when a "Thinking outside the box" solution is presented. Especially if it includes elements which that prof didn't have any in-class instruction time on.

My "F/A" was doing the same old linked-list Shoe inventory problem, but back in the days of DOS. I wrote one in Pascal as instructed, but used the "new" object oriented programming, as well as the built in I/O libraries for a mouse/text graphics interface.

I originally got an F, as the prof didn't have a mouse connected (they were sorta rare), and didn't realize he could use the ALT key to access the menu choices (though it mentioned he could hit F1 for help), hence, the program didn't WORK. Once I showed him how to run it, and how to use the libraries, he changed my grade to an A.

From what I've seen, colleges and other higher learning have only gotten more strict about doing what the prof says, exactly how he explained it, and don't try to expand on an idea.
 

beenthere

Joined Apr 20, 2004
15,819
Exactly why I don't come in much with help in this area. I have made a functioning elevator for a laundry lift that covers three floors. The total number of CMOS IC's ran to about 14.

It's very different to get something to work, and another to have to follow some arbitrary criterion.
 

Thread Starter

jegues

Joined Sep 13, 2010
733
Thanks for the reply. I thought you had given up. Good to see you are still thinking about it. How much time do you have to come up with a solution? I lost my printer/scanner and therefore I can't draw diagrams for except using Paint and that's not easy for me. I feel like a child drawing with a big crayon in his fist.

I actually have thought more about the problem and I think that if you want an elevator that mimics an actual elevator, you've got a big project on your hands. Is this an end-of-course lab project? Do you have to actually build it?

Here is a major consideration for a real elevator: To some extent, the push buttons need to be remembered. This requires a data latch (flip flop) for each push button. At what point do you reset a bush button? At the point where the floor has been serviced? But in that case, what if the car is heading to F2 (floor 2) when someone on F3 pushes F2? The elevator then stops at F2 and its flip flop is cleared. Then the person on F3 is left wondering why the elevator never showed up?

The upshot is a need to remember multiple calls for the elevator to specific floors. It occurs to me that when a person on floor three presses 2, he is giving info about where is is currently at and where he wants to go. Somehow all of this information has to be condensed by a simple algorithm. Ask your teacher if he or she will allow for certain simplifying assumptions and just what those are.

Getting back to the first point: Say the car is heading to F2 from F1 and two people -- one on F1 and the other on F3 -- push 2? And what if we cleared flip flop 2 when the F2 was serviced (i.e. the car stops there)? The car would stay at F2 in this case. So we need to remember the call at F3 and F1, and I'm guessing two calls are enough. Therefore we need the flip flop 2 to be reset after the current call if there are no more calls to F2. This means we need to remember as many as 3 calls to F2. So we need a hardware implementation of LIFO up to 3 calls. LIFO is last in first out, like a stack of cafeteria trays. The number of calls for each floor would be stored in an up down counter that counts no higher than 2. (0, 1, 2). Each time the floor is serviced the counter is decremented. Each time the floor is called the counter is incremented, but up to 3 and no higher.

If the ceiling of 3 calls is not made a design feature, it's possible a prankster could hit a button 30 times and make the car go there on every assent or descent.
So where does this leave me? I'm not entirely sure what assumptions I should ask him about.

Is there any assumptions in particular that I should ask about that will significantly clear things up?

Like I said, they want us to implement it using finite state machines, but I'm not sure how many marks we'd lose if we used some other stuff as well. I could always check I suppose. (But what else would we be using?)

No, we don't have to "actually build" the elevator, we would design it on a program with a FPGA, (i.e. Quartus II), and simulate our "elevator" on the circuit board provided.

On this circuit board are SSD's, led's, switches and a keypad.

Essentially the SSD's and led's will determine whether your "elevator" is working correctly depending on how you toggle the given switches.

Does this make our goal as a project clearer?
 

thatoneguy

Joined Feb 19, 2009
6,359
If this is for an FPGA design class, and will be implemented on an FPGA dev board, then I would think you should implement a "Complete Solution", since you don't need to worry about adding another IC to a board.

Design it with no assumptions, since the gates are already there. You will be using a large number of them. Is there a limit placed for this project?

--ETA: Earlier comments about "going overboard" with the project do not seem to apply, as you won't be trying to wire wrap 40 IC's together, manage power and outputs, etc. That's the beauty of FPGAs! Not that long ago, you would be doing this with 74xx series ICs, which is what many here, including myself, were assuming.

Yes, design it as a Finite State Machine, but be sure to include all contingencies, such as race conditions (calls at the same time, calls while moving, etc)
 

Thread Starter

jegues

Joined Sep 13, 2010
733
Okay, we've actually just started learning about finite state machines in class so I'm not entirely sure how to start drawing these finite state diagrams.

You'd think they'd assign us this project AFTER they teach us how to draw finite state machine diagrams. I guess not.

Does anyone else see the light at the end of the tunnel now that we know I'm using a FPGA?
 

hgmjr

Joined Jan 28, 2005
9,027
This might be a good time to google the topic to gain insight and get a headstart on learning about these diagrams.

hgmjr
 

Georacer

Joined Nov 25, 2009
5,182
Did they have to wait for a week to tell you that you will be using an FPGA? REALLY?

This makes building soooo much easier. You don't have to worry about the size of the build anymore. You can make Karnaugh Maps as large as you want. You don't care for the number of the gates you will use, because you won't have actual ICs on your hands.

In that case I suggest you construct an FSM with all possible inputs. It will be kind of hard to solve the Karnaugh maps, but the operation will be straightforward. Check this submission for more on constructign an FSM. http://forum.allaboutcircuits.com/showthread.php?t=44399

The hard part is to make the state diagram. I will be away 'till Sunday but if I find a PC I will try to help you more.
 

thatoneguy

Joined Feb 19, 2009
6,359
This makes building soooo much easier. You don't have to worry about the size of the build anymore. You can make Karnaugh Maps as large as you want. You don't care for the number of the gates you will use, because you won't have actual ICs on your hands.
I don't think he understands how easy he has it!

Now I sound like a grumpy old man that had to walk to college in the snow without shoes....

I still find a bit of Zen in sitting down with a bunch of logic ICs and a wirewrap tool.
 

Thread Starter

jegues

Joined Sep 13, 2010
733
Did they have to wait for a week to tell you that you will be using an FPGA? REALLY?

This makes building soooo much easier. You don't have to worry about the size of the build anymore. You can make Karnaugh Maps as large as you want. You don't care for the number of the gates you will use, because you won't have actual ICs on your hands.

In that case I suggest you construct an FSM with all possible inputs. It will be kind of hard to solve the Karnaugh maps, but the operation will be straightforward. Check this submission for more on constructign an FSM. http://forum.allaboutcircuits.com/showthread.php?t=44399

The hard part is to make the state diagram. I will be away 'till Sunday but if I find a PC I will try to help you more.
I'm going to make an attempt (sometime today hopefully) at making a state diagram.

Does anyone have any suggestions as to what states I will have to consider?
 

PRS

Joined Aug 24, 2008
989
Having read the recent responses to you, I repent of having brought up the use of any device other than flip flops and gates. I am certain your prof wants you to carry out this design the way you were taught in class.

That's not to say our discussion has been fruitless so far. All of the discussions about the behavior of an elevator apply. And as pointed out previously you'll have 6 inputs and 5 outputs. Three inputs represent buttons for floors 1, 2, and 3, two are to designate the 3 states involved, and one is needed for the special case where you're in state 2 and both buttons 1 and 3 have been pushed. This line is merely the last state of the Up/Down' output.

Someone just mentioned the racing condition that occurs when 2 buttons are pushed at the same time. That 6th input takes care of that condition, too, in that it prioritizes such a race by the direction the car is presently traveling.

You'll have five outputs, three of them LEDs showing the car is at F1, F2 or F3 and one LED to show the direction the car is heading, and the last output turns the motor on and off.

Go ahead and make a state diagram and fill out a table simultaneously. Post them so that the folks on this thread can give you a critique. After you succeed on these, you'll have to determine the Karnaugh Maps, simplify them, and from them draw the logic diagram to implement on your simulator.
 

PRS

Joined Aug 24, 2008
989
I think I've solved the whole problem. There is no need for 5 or 6 variable Karnaugh Maps. Once the truth table is put together you can recognize relationships between the input and the output by examination. I'm pretty much convinced of this.

Here's a hint. Make a table like this:

Rich (BB code):
s2  s1  b3  b2  b1  u/d'  on/off'  L3  L2  L1
0   0   0   0   0
0   0   0   0   1
0   0   0   1   0
.... and so on for 24 rows i.e. where we have 10111 and fill in the output columns as you think they should be asserted. The inputs are the state, given by s2 and s1, and note that there is no state 11 since there are not 4 floors to service; also the push buttons, b3, b2, b1 are inputs. The outputs are u/d' which determines the direction of the elevator with 1 for up and 0 for down; on/off' for motor on, motor off; and the LEDs showing the car to be on a particular floor. Be sure to make a state diagram when you do this.

The state diagram is 3 circles one on top of the other with plenty of space between them. You need to draw lines that originate from the state under investigation. 00 is the first floor 01 is the second, and 10 is the third. This is s2 and s1 in the table above. Then go down the rows and for each set of b3 b2 b1 draw an arrow from the state circle to the circle the car should go to. For example with 000 the car will go nowhere so draw a loop from circle 00 to circle 00, and label the arrow as per the buttons 000. Same happens when the car is in state 00 and someone pushes a 1 such that b3 b2 b1 is 001. Using common sense fill out the output.
 
Last edited by a moderator:

PRS

Joined Aug 24, 2008
989
Upon further consideration, there are a couple items that need to be taken into account.

First, there is a point where the car has traveled between floors such that, you don't want to stop the car at f2 because of momentum. Therefore there are 5 states: s2, s1, s0. This adds the in-between floors condition of Not Stopping at 2 (NS2). It comes about when leaving f3 for f1 OR leaving f1 for f3and and you pass the NS2 condition, and someone on f2 presses button Bx. In this case don't stop. But if you did not pass the NS2 conditions, do indeed stop at f2. By the way, in the elevators all three floor buttons are present but in the halls only the floors other than that hall are present. And so in your truth table and state diagram, take this into consideration.

As if that did not dishearten you enough, here's another consideration (read that as complication, LOL!). It has to do with clearing the flip flops. Should we merely clear a flip flop just because the car stops at its destination? Not necessarily, consider this: The car is at F2 and someone at both F1 and F3 presses 2. Say we prioritize F1 in this case. Then we go to F1 and head up to and stop at F2. If we clear that flip flop then the guy at F3 is SOL.

To fix this we include two flip flops for each floor. Take the same case as above and let there be two flip flops ff2a and ff2b. The guy at f1, by pressing 2, sets ff2a; and the guy at F3 sets ff2b. And these switches are logically OR'd together to form the signal b2. Thus if either one is set, b2 is 1 in our logic table. Then we use another signal in conjunction with our s2 s1 s0 information, this signal being Up/Down' to determine which ff to reset.

As for timing, the elevator motor does that. We have here an Algorithmic State Machine, or ASM. We need a flip flop for each input s2, s1, and s0, and a pair of flip flops for b3, b2, b1, for a total of nine flip flops.

There is a set of outputs called next state variables and I'll use capital letters for them, and these refer to the input in small case letters. More on that later.

You need to do a table and diagram to get more info out of me. I will only help you if you work at it yourself.
 
Last edited:

Georacer

Joined Nov 25, 2009
5,182
I keep thinking about it, and I try to find an encoding system with 6 variables at most. I think this is a sensible number of bits. 7 will lead to 128 lines in the state table and a hefty handwork.

What I currently have in mind is to construct the State Table like this:
Floor Doors Direction Calls
A0A1 A2 A3 A4A5A6A7

Where Floor is the floor the elevator is at, Doors is the state of the doors (open or closed) the Direction of the cabin and the 4 call buttons at the various floors (1 at the ground floor, 2 on level 1 for up and down, and 1 on the second floor).

This is a complete system but it is too big for me to call it successful. I will think about it further.
 
Status
Not open for further replies.
Top