UPC EETAC Bachelor's Degree in Telecommunications Systems and in Network Engineering EEL

Chapter 3 problems

- D3.7 -

Dumbwaiter or simple lift (µC - C)

Products

D3.6

D3.8


1. Specifications

Design phase #1: basic FSM

Our company has to design the control system for a simple dumbwaiter (a small freight lift used to transport food, wine, and other items between floors of a building) using a µC PIC18F46K22. It will transport loads between a 2-level kitchen. Fig. 1 shows a photograph of an installed commercial dumbwaiter and a detail of the motor and the control system installed under the car.

The same project designed using hardware is stated in D2.7.

Dumbwaiter

Fig. 1. Photograph of a commercial window dumbwaiter and its motorised car.

Produce a sketch of the dumbwaiter system that includes up and down buttons for both levels, location of the floor sensors, green and red LED's, and outputs for driving the stepper motor. See Fig. 2.

Sketch

Fig. 2. Sketch of the 2-level dumbwaiter indicating sensors, pushbuttons and output functions to drive the stepper motor and the LED.

Sensors and buttons:

- U1, D1, U0, D0: buttons for calling the car.

- LS1, LS0: limit switches to detect the presence/absence of the car stopped at each floor.

Special signals:

- CD: if pressed or after power on, this special signal takes the car to the initial state stopping the car at level 0.

- CLK: For polling buttons and controlling the FSM.

Outputs for controlling the car motor:

- INH: when high this signal inhibits the motor movement.

- UD_L: when INH is not asserted, this signal generates up movement when high and down movement when low.

Additional visual outputs:

- GL1, RL1, GL0, RL0: LEDs for indicating operation: green LED is ON when the car is stopped in the corresponding level, red LED is ON when the car is moving between floors.

Secondly, adapt and draw the symbol of the entity to be designed.

Symbol

Fig. 3. Symbol (adapt it from D2.7).

It is a good idea at this point, to discuss what logic levels to consider from the pushbuttons and switches. For instance, LS1 and LS0 will never be '1' at the same time. Both will be '0' when the car is in transit between levels. If the car is at level 1, clicking U1 will have no effect, and when the car is stopped at level 0, clicking D0 has no effect. When the car is in transit, clicking buttons has no effect.

Sketch a timing diagram showing the main operations on how the machine works.

Diagram

Fig. 4. Example timing diagram.

 

2. Planning

Let us build the product organising several design phases, and several steps within each phase if necessary.

Design phase #1: basic features

Some ideas to kick off the project and organise it. Apply the FSM architecture adaptation L10.1 to this problem.

Project location:

 C:\CSD\P10\dumbwaiter\(files)

A) Planning hardware

Copy and adapt a circuit from a convenient tutorial project and name it "dumbwaiter.pdsprj". Assign pins to inputs and outputs accordingly to one of the following options (your instructor will tell you which):

Pin assignment option #1:

LS0 --> RB2;  LS1 --> RB1; CLK --> RB0;

U1 --> RC7; D1 --> RC6; U0 --> RB4; D0 --> RB3;

INH --> RA1;  UD_L --> RA2

RL1 --> RC1;  GL1 --> RC5; RL0 --> RA0; GL0 --> RB5;

Pin assignment option #2:

LS0 --> RB0;  LS1 --> RB1; CLK --> RB2;

U1 --> RC6; D1 --> RC5; U0 --> RB7; D0 --> RB6;

INH --> RA2;  UD_L --> RA0

RL1 --> RC7;  GL1 --> RC4; RL0 --> RA3; GL0 --> RB5;

Pin assignment option #3:

LS0 --> RB1;  LS1 --> RB0; CLK --> RB2;

U1 --> RC5; D1 --> RC4; U0 --> RB6; D0 --> RB3;

INH --> RA3;  UD_L --> RA1

RL1 --> RC7;  GL1 --> RC6; RL0 --> RB4; GL0 --> RC1;

Draw the hardware schematic. Buttons and switches, resistors, inputs, outputs, reset circuit MCLR_L and quartz crystal oscillator of 8 MHz. Explain how to configure inputs and outputs in init_system().

B) Planning software

Draw the flowchart of the general program organisation.

Draw the hardware/software diagram indicating the required RAM variables and their type. Explain the difference between variables and flag variables.

Infer the state diagram governing the machine.

Explain how to poll (read) the floor buttons in read_inputs() using bitwise operations. Explain how to measure how many times per second these switches are read.

Explain how to drive output pins in write_outputs().

Explain the external interrupt mechanism for connecting the limit sensor buttons. Explain how the ISR() is used.

Draw the state_logic() truth table and its equivalent flowchart ready for translation to C language.

Draw the output_logic() truth table and its equivalent flowchart ready for translation to C language.

 

Developing & testing (debugging)

Develop and test (debugging) the project capturing the hardware circuit in Proteus and writing the C source code.

Note: Step-by-step tactical approach for developing and testing the project: Read one input at a time and run to check that the voltage value is correctly captured as a valid digital value in RAM memory. Write one output at a time and run to check that your code is correct to light the LED connected at the output pin.

 



Design phase #2: LCD display

Project location:

C:/CSD/P11/dumbwaiter_LCD/files)

An LCD will indicate ASCII messages and numbers. In this application, we should install an LCD screen at each level. However let's imagine only one at level 0.

Explain how to connect and program the LCD display to show ASCII messages such: "Car stopped at floor 0", "moving UP", "Close door when ready", etc.

Let us suppose that the car takes 22 s from one level to the next. While the car is moving up or down, display as a number the down count of the seconds left before stopping in the level. 

 




Design phase #3: Using TMR2 peripheral subsystem

Use the TMR2 to replace external CLK interrupts.

Project location:

C:/CSD/P12/dumbwaiter_LCD_TMR2/files)

Configure and program TMR2 to replace the external CLK oscillator. Explain whether new states are required.

Add an buzzer to indicate by means of a 2 s acoustic signal at 1.3 kHz that the car has arrived to the level.

 


Optional: A security enhancement for preventing user accidents can be added in a new design phase #2. Install sensors switches (DS1, DS0) and electric drop bolt locks (DL1, DL0)  in the level doors, so that the car does not move unless doors are closed, and they do not open while the car is in transit or is not yet stopped in the corresponding floor. 

Storey door secured wiith androp bold lock

Fig. 5. Example of a level door secured with an electric drop bolt lock (ref.). The idea is to keep the level doors closed while the car is in transit and inhibiting car movements while doors are open.