Help designing an elevator controller!

Discussion in 'Homework Help' started by ArmchairZeus, Nov 7, 2012.

  1. ArmchairZeus

    Thread Starter New Member

    Nov 7, 2012
    3
    0
    I've been looking around this and other forums and saw a few other people who were given a similar assignment but their's were a bit different than mine.
    I need to implement an elevator that uses the following components: A timer, A controller, Seven Segment Displays, and a Debouncer.
    Inputs should be 4 dip switches and a push button, and outputs should be an LED the is on when the door is open, a display for the selected floor, and a display for the floor the elevator is currently on.
    I'm using Quartus II and I already have the debouncer, displays, and timer set up. All that's left is to create the controller and that's where I'm not sure how to start. The elevator needs to be able to go from basement (b), to lobby (0), and floors 1 through 9.

    Any help would be greatly appreciated!
     
  2. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,157
  3. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Think of it as a large state machine.... from there, it should be relatively straight forward...

    On a side-note, you are using the Altera FPGAs at school? What board?
     
  4. ArmchairZeus

    Thread Starter New Member

    Nov 7, 2012
    3
    0
    We are using the Altera up2 board with EPM7128SLC84-7 chip. The directions say that we need inputs for the dip-switches to select which floor we want to go to, and the push-button as like the go to the floor button. The outputs should be two 7-segment displays, one for current floor, and one for selected floor, and an LED that shows the door is open. So what I was thinking is that in I could somehow use a multiplexer(?) to change the inputs into a single input for the selected floor. And then I would somehow in verilog say that the difference in the selected and current floors is how many the elevator has to move, and the sign would be if it moves up or down. Negative down and positive up. My main problem is really where to start on making the state diagram and how to include all the things I mentioned into it.
     
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You could simply read the states of the switches instead of trying to us a multiplexer. You'd loses clock cycles trying to figure out which floor is selected, plus, you have the available I/O.

    Once you've read in your desired floor, simply display it.

    You are on the right track. A comparator could tell you whether the elevator needs to go up or down, from there, your state machine gets pretty easy...

    each state corresponds to each floor... if the desired floor and current floor are equal, open the door, otherwise, keep it closed.
     
  6. ArmchairZeus

    Thread Starter New Member

    Nov 7, 2012
    3
    0
    Thanks! I think I'll work on it some more over the weekend and post again if I have any more questions.
     
Loading...