final design report - harding university dispensing device... · final design report team pez...

58
15 Final Design Report Team PEZ 12/7/2010 Ben Anderson Kyle Smith Matt Strasser Jason Terhune Yao “Annie” Yao

Upload: buikien

Post on 22-Apr-2018

222 views

Category:

Documents


7 download

TRANSCRIPT

15

Final Design Report Team PEZ

12/7/2010

Ben Anderson

Kyle Smith

Matt Strasser

Jason Terhune

Yao “Annie” Yao

1

Table of Contents

Requirements Specification ………..…………………………………………………………………………………………………………. 3

Block Diagram ……………………………………………………………………………………………………………………...….. 6

Functional Description of Blocks ………………………………………………..………………………………………...….. 7

Final Design .……………………………………………………………………………………………………………………………………….. 10

Microprocessor ………………………………………………………………………………………………………………………. 11

Power Supply Design ………………………………………………………………………………………………………………. 16

User Interface …………………………………………………………………………………………………………………………. 20

Pill Bins …………..………………………………………………………………………………………………………………………. 23

Pill Tray ..……………………………………………………………………..…………………………………………………………. 25

Nozzle Apparatus Design ……………………..…………………………………………………………………………………. 27

Rack and Pinion Selection ………………………………………………………………………………………………………. 28

Motor Selection …..…………………………………………………………………………………………………………………. 33

Motor Control ..………………………………………………………………………………………………………………………. 39

Vacuum Selection ………..…………………………………………………………………………………………………………. 41

Vacuum Control ........................................................................................................................... 43

Encasement Design ………..………………………………………………………………………………………………………. 45

Software Development .………………………………………………………………………………………………………….. 48

Schedule …………………………………..…………………………………………………………………………………………………………. 52

Schedule Assessment ………………..……………………………………………………………………………………………. 53

Gantt Charts …………………………………………………………………………………………………………………………… 54

Budget Overview ………………………………………………………………………………………………………………………………... 56

Appendices …………………………………………………………………………………………………………………………………….…... 58 Rack Specification Sheet …………….…………………………………………………….……………........... Appendix A

Pinion Specification Sheet ……………………………………………………………….…………….…………. Appendix B

Specification Sheets for Motors One and Two ………………………………………………………….. Appendix C

Microchip dsPIC30F6015 …………………………………………..…………………………………..........…. Appendix D

Real Time Clock DS1307………..…………………………………………………………………………..….….. Appendix E

4 x 4 Grayhill Matrix Keypad ………..……………………………….…………….………….………...…….. Appendix F

Keypad Encoder EDE1144 ..…………………………………………………………………..………..…..…….. Appendx G

Liquid Crystal Display GDM2004M ..………………………………………….…………………….……….. Appendix H

PM3 to ICSP™ Converter AC164111 ..………………………………….…………..……………….………. Appendix I

Magnetic Switches ..………………………………………………………………………………...….….………… Appendix J

Electrical System Schematics ……………………………………………………………..…………….……… Appendix K

2

Working C30 C Code ……………………………….…………………………………………..…………………… Appendix L

Flow Charts ………………………………..……………………………………………………………………………. Appendix M

Power Supply ……………………………………….………………………………………………………………….. Appendix N

OpAmp LM741 .……………………………………………………………………………………...………….……. Appendix O

Quadruple Half-H Drive L293D .……………………………………………………………...…………..……. Appendix P

Diode UF4001 .………………………..……………………………………………………………...…………..…... Appendix Q

OpAmp LT1637 .……………………………………………………………………………………...……….………. Appendix R

Battery PS-12120 .…………………………………………………………………………………...………….……. Appendix S

All possible LCD Screens ................................................................................................ Appendix T

Speaker GC0251K-CUI ................................................................................................... Appendix U

Timer LM555 ................................................................................................................. Appendix V

3

Requirements Specification

Background

Presently, many people are dependent upon medications in their daily lives. An increasing number, especially the elderly, are required to take multiple different types of medications of varying dosages at different times throughout the day. This can become a complicated procedure for anyone, causing missed doses, incorrect doses, and potentially life threatening mistakes. Medication works best when taken on a routine schedule at the proper dosage. Although, medicine dispensing machines that can solve these problems currently exist, they can range upwards of $1200. Clearly, the average household cannot afford this luxury. Based on this situation, a user friendly, affordable, semi-compact device to dispense medicine at home will be developed.

System Overview

The PEZ Dispenser prototype will attempt to simplify the medication dosing process for the average customer. The correct dosage of medication will be dispensed throughout the day based on user determined specifications entered via the keypad. The user will be prompted to take medications throughout the day by an alarm with an audible range similar to that of an average bedside alarm clock. The interior of the dispenser, which can be accessed upon unlocking the lid, will hold a circular, rotating tray on which will be eleven individual containers. It has been determined through research1that the average individual takes no more than ten different types of medication. Therefore, up to ten of these containers can be filled by the user with the desired medication. The eleventh container will be used to dispense medication. The correct amount of medication will be obtained through a vacuum system by which individual pills will be lifted from their containers and transported to the dispensing container. The central processing unit, or the microprocessor, will store all information needed to display a clock, sound an alarm, and dispense a dose of medication. The dispenser will be powered by a standard 120V AC, 60Hz power supply. In case of emergency, the dispenser will be equipped with a back-up battery which will provide at least 12 hours of reserve power.

1. The pharmacist at Stanley Pharmacy provided us with the maximum daily doses expected from the average consumer.

Design Deliverables

1. User Interface: user recognition feature making unit compatible with one user, medication

alert by alarm, and of such a size and weight that an average person can lift it

2. User’s Manual

3. List of Parts and Prices

4. Schematics

4

Requirements

1. The unit will handle up to 10 different kinds of pills ranging from 10 milligrams to 1 gram.

2. No more than four kinds of pills will have the same mass, no more than four will have the

same coating, and no more than three will have the same shape.

3. The unit should take no more than one minute to transport one pill from its holding chamber

to the dispensing chamber.

4. The unit will allow the user to access the pills by entering a secret PIN code. This applies when

loading a supply of pills or retrieving a dose of pills.

5. Prescription information (how many of each kind of pill to be taken at a specific time of day on

certain days) can be entered manually through a user interface using a keypad and screen.

6. The alarm will alert the user when it is time to take a dose of medicine.

7. The alarm to take the dosage will sound within two seconds of the programmed time.

8. The alarm will alert the user when a pill supply gets low (three days dosage left).

9. The unit will be powered by a standard 120 V, 60 Hz, AC outlet.

10. The unit will have a battery back-up lasting at least 12 hours.

11. The unit should be a table-top device that can be carried by an average adult male/female.

Preliminary Test Plan

To test the pill dispensing functionality of the device, we will perform the following test (spanning 12 hours each run) three times:

The unit will be plugged into wall receptacle for necessary power. (requirement 9)

A user’s information, (first and last names and PIN), and medication information will be

entered into memory via the LCD/Keypad interface. (requirement 4)

Different dosing schedules (once a day, twice a day, and three times a day), dispensing times,

number of pills required for each dose and time of day will be entered via the LCD/Keypad

interface. (requirement 5)

The hopper will be loaded according to the directions on the LCD screen with 10 different

types of pills. In order to test the low pill supply feature, one hopper will be filled with one pill

more than needed for a three day supply. (requirements 1 and 8)

It will be verified that the medication alarm will sound as programmed. (requirement 6 and 7)

The assigned PIN will be entered and no less than one pill per minute (checked via a

stopwatch) will be dispensed until the dose has been completely dispensed. (requirement 3)

The three day supply feature will be verified when the user alarm and the on-screen message

informs the user that the retrieved dosage caused the amount of medication to fall below the

three day threshold. (requirement 8)

The system time will be checked against a digital clock/watch and will lose a maximum of 2

seconds during the test. (requirement 7)

5

The backup battery system will be tested by running the unit on battery power for two additional 12 hour settings. The success of the backup battery system will be determined if the unit meets all the requirements, with the exception of requirement 9 which states the unit will be powered by a standard 120 V, 60 Hz, AC outlet.

Five people will be chosen at random and asked to carry the device from one end of a room to the other in order to verify that the unit can be carried by an average adult male/female.

Organization and Management

Our team consists of two mechanical engineering students, two electrical engineering students, and a computer engineering student. Project management and design tasks will be broken down into the following responsibilities:

Kyle Smith (Electrical Engineer)

Kyle is the project manager and responsible for the project being completed on time and under budget. He will ensure the required documents and presentations assigned are completed and turned in on time. He is responsible for design and construction related to the alarm circuit and backup battery system.

Ben Anderson (Mechanical Engineer)

Ben will be in charge of the proper selection and modification of the vacuum assembly as well as a backup for Matt on the frame, pill tray, and nozzle assembly.

Matt Strasser(Mechanical Engineer)

Matt will be in charge of the design and construction of the frame, pill tray, and nozzle assembly. He will also act as a backup for Ben on the remaining mechanical processes in the project.

Jason Terhune(Computer Engineer)

Jason will be responsible for the microprocessor and the user interface for the device, which includes an LCD and a keypad. He will also design and order a PCB to act as a hub for all devices controlled by the microprocessor.

Yao “Annie” Yao (Electrical Engineer)

Annie will be responsible for the power supply design and construction as well as being a backup for Jason on the user interface and microprocessor.

Each engineer is responsible for the completion of the individual tasks to which they have been assigned; however, it is important to note that work done on each task is not exclusive to the engineers listed. Every member of the team will be expected to be familiar with each other’s systems and to keep their ultimate integration in mind at all times during the design process.

6

Block Diagram

7

Functional Description of Blocks

Power Supply

The power supply system receives 110 VAC from a wall outlet. It then steps down the voltage and current to the correct magnitude for each of the subsystems.

Input: 110 VAC, 60Hz Grounded

Output:

To microprocessor – 5 VDC at 29 to 45 mA

To alarm –5 VDC at 625 mA

To keypad – 5 VDC at 5 mA

To LCD – 5 VDC at 153 mA

To pill tray motor – 12 VDC at 400 mA

To vacuum nozzle control motor – 12 VDC at 400 mA

To vacuum – 22.2 VDC at 348 mA

Power Required:

For 5 V loads: P = (0.045 A + 0.625 A + 0.153 mA) * 5V = 4.115 W For 12 V loads: p = (0.4 A + 0.4 A) * 12 V = 9.6 W For 24 V loads: p = 22.2 * 0.348 = 7.73 W

Microprocessor

The microprocessor will store all information needed to display a clock, sound an alarm, and dispense a dose of medication. The microprocessor will interface with an alpha/numeric keypad, LCD (Liquid Crystal Display), alarm components, vacuum circuitry, and the motor control circuitry. A user will be able to enter all requested information via the keypad. The clock display and all information needed for the program to run successfully will be displayed via LCD. The appropriate signals will be sent to control the motors. Also, the microprocessors will send a 5.0 volt digital signal to a solid state relay to activate the vacuum.

Input: Power 5 VDC at max of 29 to 45 mA

Digital signals from keypad 0 to 5 VDC at 0 to 20 mA

Output: Digital signal to alarm circuitry – 0 to 5 VDC at 0 to 25 mA

Digital signal to LCD – 0 to 5 VDC at 0 to 25 mA

Digital signal to keypad – 0 to 5 VDC at 0 to 25 mA

Digital signal to solid state relay – 0 to 5 VDC at 0 to 25 mA

Digital signal to motor control circuit – 0 to 5 VDC at 0 to25 mA

8

Input/Output System:

LCD

The user will be able to view any stored data pertaining to the alarms set, medications stored, and dosages entered. The LCD will display the current time along with a number of messages to the user. These messages include things such as, setting a user PIN (personal identification number), questions about entering new medication data, visual prompting when medication is ready for removal, and setting the clock.

Input: Power 4.7 to 5.5 VDC at 1.5 mA to 3mA

150 mA minimum backlight supply voltage

Digital signals from microprocessor 0 to 5 VDC at 0 to 25 mA

Output: Text to viewing area.

Keypad

When prompted, or if the user needs to interact with PEZ, the user will enter information via the keypad. The keypad will be alpha/numeric and send all digital signals to the microprocessor for decoding and storage.

Input: Power 5 VDC at 5 mA

Output: Digital signals to microprocessor 0 to 5 VDC at 0 to 5 mA

Alarm

The alarm will sound indicating a dose is scheduled to be taken. The alarm will be audible at a minimum of 80 dBand a tone of approximately 1000 Hz.

Input: Power 5 VDC at 200 mA

Output: > 80 dB Tone

Pill Tray/Motor

The pill tray will contain the user’s pills. It will hold up to ten different pill types, and it will be capable of holding up to 90 1.0 gram pills. A motor having an output torque in the range of 0.15-0.3 N-m will be sufficient to rotate the tray. The motor will rotate the tray through the necessary angle so that the prescribed pill’s bin will be located on the suction nozzle assembly’s axis of translation.

Input: 12 VDC at 400 mA

Output: Correct pill bin is positioned on the nozzle assembly’s axis of translation.

9

Vacuum

The vacuum will provide enough suction to lift and hold pills of various masses, ranging from 10 mg to 1.0 g. The necessary force provided by the vacuum, therefore, is equivalent to the force needed to overcome the force of gravity on a 1.0 g pill, 0.00981 N.

Input: 22 VDC at 348 mA

Output: 65 Airwatts (max)

Nozzle Assembly/Motor

The nozzle assembly will translate the suction tip of the vacuum hose into the pill bin directly below it, allowing the hose to make contact with each pill and affix to it. The nozzle will be selected such that small pills or pieces of pills cannot be sucked inside. The torque requirement for the motor driving translation is in the 0.1 to 0.2 N*m.

Input: 12 VDC at 400 mA

Output: Vertical translation of the vacuum’s nozzle of up to 11.43 cm

Frame/Encasement

The encasement will provide protection for the components of the dispenser, and the frame will provide sufficient strength to support the system and allow for transportation. The encasement will have a locking door which will allow access to the pill tray in the event that power cannot be supplied. The dimensions will be in the range of 41 cm x 41 cm x 41 cm (16 in x 16 in x 16 in) to 77 cm x 77 cm x 77 cm (30 in x 30 in x 30 in).

Input: None

Output: None

10

Final Design

11

Microprocessor Rationale

Microprocessors contain all the necessary parts of a computer fitted on a single chip. These four hardware modules include a CPU (central processing unit), memory, input/output (I/O) devices, and busses. The nature of PEZ’s function demands an event driven architecture making it a perfect candidate for a microprocessor. PEZ requires a microprocessor with at least these features: an analog to digital system, input/output pins, interrupt handling capabilities, and serial communication. An analog to digital system is needed in order to determine the current of the vacuum control circuitry. Input pins are needed to read data from the keypad, magnetic switches, the RTC (Real Time Clock) and the vacuum current monitoring system. Output pins are needed to control various systems like two stepper motors, alarm circuitry, RTC, and the vacuum on/off. Interrupt systems are needed for use in the keypad and for maintaining the correct time. Serial communication is needed to obtain data from the RTC integrated circuit, and to reprogram PEZ during development through the ICSP (In-circuit serial programming) system.

Decision Matrix

A few factors that can narrow the search for a microprocessor are suitability for project,

development support from microprocessor manufacturers, cost, availability, and manufacturer’s reputation. The decision matrix in Figure 1 can be based from an in depth analysis of these criteria.

1. Suitability for the project was analyzed by considering several features: PCB (printed circuit board) technology design, input/output requirements, memory size, memory type, and application features.

2. Developmental support from microprocessor manufacturers involved services such as customer inquiry response times and availability of free samples. All manufacturers contacted were willing to provide free samples. Manufacturers received a low score in the decision matrix if they never responded to an inquiry or if their response was diluted or robotic.

3. Many factors play a role in balancing cost versus features. Samples with ample features were free. Also, since a PEZ full-scale production is highly unlikely, cost is weighted significantly lower in the decision matrix.

4. Obsolescence is a concern for developers when the average lifespan of an embedded system is as long as twenty years; therefore, future availability of the manufacturer’s product can be a deciding factor.

5. Manufacturers’ reputations are also a concern when selecting a microprocessor. Contacts made with previous design students for input concerning their experiences with different companies can uncover companies to be avoided. For example, if someone reported the data sheets needed were in a foreign language, problems could arise during design and testing of the prototype.

12

With more of a grasp on how to analyze the needs of PEZ, a decision matrix was formed with the mentioned criteria. The attributes were given weights based on their impact on the success of project completion. Each available option was ranked (0 to 100 points, with 100 being best). The Excel sheet calculated the score for each option based on the weights and points given in the matrix. The score concluded that PIC’s (Peripheral Interface Controller) ds30F family of processors would meet the specifications for PEZ to be successful. See Figure 1.

Microprocessor references: http://www.microchipdirect.com/ProductDetails.aspx?Category=dsPIC30F6015 http://www.newark.com/jsp/search/productdetail.jsp?SKU=48F4492&CMP=AFC-GB100000001 http://us.element-14.com/jsp/search/productdetail.jsp?SKU=75C4034&CMP=AFC-GBE14 http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_1413051_-1

Microprocessor Selection

The selection guides on the Microchip web site for 16-bit microprocessors are based on a

few different factors, including family memory size, memory type, and application features. It was found that using the pin count and application features narrowed down the field considerably. The dsPIC30 series family comes in four varieties: general-purpose, sensor, motor control, and power conversion, all operating at 30 MIPS (million instructions per second). Each one has peripherals based on general or specific applications. For instance, the sensor family is based on low-pin-count devices in support of high-performance yet cost-sensitive applications. The motor control family has a quadrature encoder for position and velocity feedback. Taking all these factors in consideration we choose the dsPIC30F6015 for the microprocessor. The dsPIC30F6015 has the largest EEPROM (electrically erasable programmable memory) available in this family. PEZ will need sufficient space to store all user data. The following structure has been developed in MPLAB PM3 and data analysis follows.

Decision Matrix

Microprocessor Family

weights --> 3 3.5 0.5 1 2 10

30% 35% 5% 10% 20% 100%

Options Suitability for Project

Development Support

Cost Availability Manufacturer's

Reputation Score

Freescale 68HC

70 60 100 80 70 69 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

PIC ds30F 90 80 100 100 60 82 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

TI MSP430 60 60 100 60 70 64 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Intel 8051 60 50 100 80 55 60 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Figure : Decision Matrix developed during microprocessor selection.

13

Data Storage Testing Code and Analysis

/** *Data structure "medicationType" will store medication data. */ typedefstruct charname[20]; //Name of medication shortbinNumber; //Pill container med added to shortnumPillsAdding; //Total pills adding shortdosesPerDay; //Doses of med needed a day shortminutesTillDose[10]; //from midnight till next dose shortpillsOfDose[10]; //Amount of pills in a dose medicationType; /** *Data structure "userType" will store user data. */ typedefstruct shortPIN; //Personal Identification Number charfirst[20]; //User's first name charlast[20]; //User's last name shortnumMeds; //Number of meds user has stored

//in PEZ. medicationType medication[10]; //User will be allowed(<=10) meds userType; /** *Data structure "timeType" will store clock data. */ typedefstruct shortseconds; shortminutes; shorthours; shortday; shortdate; shortmonth; shortyear; timeType; /// Example user data works and prints to the LCD. userType user; user.PIN = 1111; strcpy (user.first,"Jason\0"); strcpy (user.last,"Terhune\0"); user.numMeds = 1; strcpy (user.medication[0].name,"Advil\0"); user.medication[0].binNumber = 1; user.medication[0].numPillsAdding = 100; user.medication[0].dosesPerDay = 2; user.medication[0].minutesTillDose[0] = 360; user.medication[0].minutesTillDose[1] = 720; user.medication[0].pillsOfDose[0] = 50; user.medication[0].pillsOfDose[1] = 2;

14

Table : Memory usage chart for user data (non-volatile)

Data Type

Memory Requirement

Range of Values PEZ Usage

Totals (bits)

Totals (bytes)

short 16 bits -32768-32767 239 3824 478

unsigned char 8 bits 0-256 240 1920 240

P E Z Totals 5744 718

Available EEPROM (bytes) 4000

Available Flash (bytes) 147456

Pills-Ez Free memory(bytes) 150738

The user data will only require 718 bytes (1.17 kb). The remaining 146.7 kb

can then be utilized to store the program code. The above code was compiled in MPLAM IDE along with code to print to an LCD (Appendix L). Even with adding code to print to the LCD and code to communicate through the I²C (Inter-Integrated Circuit), according to the data usage monitor, the program code will be insignificant when compared to 146 kb. See the memory gauge in Figure 2. The data storage structure would easily be large enough to store additional users.

Figure : Memory Gauge (Bytes).

15

ICSP™ (In-Circuit Serial Programming™)

In-circuit serial programming is a major design choice which was implemented. ICSP™ was accomplished with an adapter sold by Microchip (AC164111 - PM3 to ICSP™ Converter). This converter will be advantageous to the programmer because modified code can be flashed to the microprocessor at any point (i.e. even after the PCB is mounted inside the encasement permanently.) This is an important feature since the microprocessor must be mounted on a professional circuit board as stated in the syllabus. Microchip offers several techniques during the development phase to program their microprocessors, such as a development board, but the cost made its use prohibitive. Some of these boards can cost up to $100. Therefore, the engineer had to produce his own development board. This is more time consuming and labor intensive. To keep costs down for this project, the Engineering Department’s MPLAB PM3 programmer for the PIC microprocessors was chosen because of its free access. The PIC’s IDE (Integrated Development Environment) device has many features to help ensure that the project is successful. The more relevant include:

RS-232 or USB interface

Integrated In-Circuit Serial Programming™ (ICSP™) interface

Fast programming time

Three operating modes:

– PC Host mode for full control

– Safe mode for secure data

– Standalone mode for programming without a PC

Large easy-to-read display

Field upgradable firmware allows quick new device support

Buzzer notification for noisy environments

The data sheet for this product can be found in Appendix I.

16

Power Supply Design

Power Supply Selection:

The power supply is designed to convert 120 VAC power to a suitable low voltage supply for electronic circuits and other devices. A power supply can be broken down into a series of steps.

These separate function modules have already been produced as a unit by many different companies. For the project, dual voltages performed as +/- 5 V and +/- 12 V are needed. The calculation for the total watts is presented below.

To microprocessor – 5 VDC at 29 to 45 mA

To alarm –5 VDC at 625 mA

To keypad – 5 VDC at 5 mA

To LCD – 5 VDC at 153 mA

To pill tray motor – 12 VDC at 400 mA

To vacuum nozzle control motor – 12 VDC at 400 mA

To vacuum – 22.2 VDC at 348 mA

For 5 VDC loads: P = (0.045 A + 0.625 A + 0.153 mA) * 5 V = 4.115 W For 12 VDC loads: P = (0.4 A + 0.4 A) * 12 V = 9.6 W For 24 VDC loads: P = 22.2 * 0.348 = 7.73 W

Several factors, such as cost, quality, input/output specification, needed to be considered in the selection process. The decision matrix is presented in Figure 3.

Transformer Rectifier Smoothing Regulator

Decision Matrix

Power Supply Choices

weights --> 0.5 3.5 2 3 1 10

5% 35% 20% 30% 10% 100%

Options Input Range

Output Range

Cost Ease of

Use Size and Weight

Score

Universal Adapter for Laptop 50 50 50 20 40 40 ||||||||||||||||||||||||||||||||||||||||

24V,5A Switching Power Supply

50 40 40 30 40 38 |||||||||||||||||||||||||||||||||||||

250W Computer Power Supply 50 50 40 50 30 46 ||||||||||||||||||||||||||||||||||||||||||||||

Figure : Decision Matrix for power supply.

17

The 250W Computer Power Supply was more appropriate than the other two. The output table is presented in Figure 4.

Figure : YM-6251C.

Table : Voltage and current capabilities of YM-6251C.

Price: $19.95 +$3.95 (for power supply input connector) + $6 (shipping fee) Total: $29.90

18

PowerSupply

12 V

D1

DIODE_VIRTUAL

D2

DIODE_VIRTUAL

D3

DIODE_VIRTUAL

D4

DIODE_VIRTUAL

R110Ω

-----> To Battery

---->To Voltage Divider Circuit

D5

13 V

0

Probe1 V: 12.0 V V(p-p): 1.21 pV V(rms): 0 V V(dc): 12.0 V I: 12.0 pA I(p-p): 0 A I(r...

Probe2

V: 11.8 V V(p-p): 1.55 pV V(rms): 0 V V(dc): 11.8 V I: 11.8 pA I(p-p): 0 A I(rm...

Battery Backup Design:

Part of the Requirements Specification states that the PEZ must run for 12 hours without an external power source. To satisfy this requirement, a backup battery as well as a bridge rectifier was used. In regard to different battery types, research was done on sealed lead acid (SLA) and nickel metal hydride (NiMH). The following decision matrix is the result of the research on the different battery types:

Decision Matrix

Battery Chemistry

weights 3 2 0.5 3 1.5 10

30% 30% 10% 30% 10% 100%

Options Ease of

Circuitry Cost Weight Size

Build Time

Score

Sealed Lead Acid 100 90 60 40 90 84 ||||||||||||||||||||||||||||||||||||||||||||

NiMH 80 70 80 60 60 77 |||||||||||||||||||||||||||||||||||||||

L-ion 60 40 90 80 40 67 ||||||||||||||||||||||||||||||||||

Figure : Decision Matrix of battery chemistry choice.

From the results, a sealed lead acid battery was chosen. Being a robust battery chemistry, the charging circuit can be much simpler and not damage the battery. After searching the internet for an appropriate battery, the Power-Sonic PS-12120 was chosen for its capacity and size ratio. The battery is a 12V, 12Ah Sealed Lead Acid type battery that weighs 3.6 kilograms. The data sheet has been added into Appendix S to further detail the battery. With the battery costing only $26.00 including shipping from Amazon.com, it fit well within the budget.

Using a bridge rectifier, the system will be able to charge the battery as well as supply the rest of

the system off of the same circuit. A zener diode is also used as overcharge protection so that the battery can retain its full potential over time. When the power supply is receiving power from the wall outlet, power will be supplied to the battery for charging. Once the battery is charged and the power supply is unplugged, power will be supplied to the voltage regulation system already in place on the output of the wall power supply for a minimum of 12 hours, as per the requirements specification. The following Multisim circuit demonstrates the battery backup and charging circuit:

Figure : Battery Backup and Charging System.

19

Voltage Divider Design:

A schematic of the voltage divider is shown in Figure 7. The circuit can divide a single voltage source into a dual voltage sources. By adjusting the potentiometer, different voltage sources can be derived. This circuit is not only designed to obtain dual voltage sources but also used to step down DC voltages.

Figure : Voltage Divider Design.

V112 V

U1

741

3

2

4

7

6

51

C1100µF

C2100µFC3

1.0µF

R3

200kΩ

Ke y=A

55%

Probe3,Probe1

V: 6.04 V V(p-p): 8.06 pV V(rms): 0 V V(dc): 6.04 V I: 6.04 pA I(p-p): 0 A I(rms): 0 A I(dc): 6.04 pA Freq.:

Probe4,Probe2

V: -5.96 V V(p-p): 8.06 pV V(rms): 0 V V(dc): -5.96 V I: -5.96 pA I(p-p): 0 A I(rms): 0 A I(dc): -5.96 pA Freq.:

20

User Interface

Keypad

A decision matrix was formed to decide how a user would be able to enter data into PEZ’s memory. Based on the given attributes, along with the points rated, an alpha/numeric keypad would be ideal for PEZ. The current keypad choice is a Grayhill 4x4, conductive rubber keypad with a matrix circuitry type. This keypad will utilize a keypad encoder integrated circuit EDE1144, which will scan the keypad and then send an interrupt signal to the microprocessor once valid data is ready to be read from the bus. The data sheet for this keypad and encoder can be found in Appendix F and Appendix G, respectively.

Keypad references: http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2113455_-1 http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_169245_-1 http://www.allelectronics.com/make-a-store/item/KP-23/16_BUTTON_KEYPAD_%284_X_4%29/-/1.html

Decision Matrix

Data Entry Methods

weights --> 3 2 0.5 3 1.5 10

30% 20% 5% 30% 15% 100%

Options Ease of Use Cost Consistent

Input Complexity of Design

Build Time

Score

Bar Code Scanner

100 40 60 40 40 59 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Numeric Key Pad

60 100 100 80 80 79 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Blue Tooth 80 20 40 20 40 42 ||||||||||||||||||||||||||||||||||||||||||

Push Buttons

40 80 100 80 60 66 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Figure : Decision matrix developed for data entry selection.

Figure : Keypad.

21

LCD (Liquid Crystal Display)

We have chosen a 4x20 character LCD to allow PEZ to communicate with the user based on the outcome of the decision matrix formulated. The following criteria were evaluated in the decision matrix:

Ease of use encompasses communication with microprocessor. (Serial or 8-bit parallel)

Cost of the products evaluated.

Display sizes all were 4x20 backlit displays.

Viewing angle’s -40 to 40 degrees on all displays.

Build times are equivalent. (mounting of parts and soldering) Four rows at twenty characters each will be sufficient to display all the proper messages. A

decision matrix was formed to choose the best LCD for our project. See Appendix H for specifications.

LCD references: http://www.robotshop.com/sfe-basic-20-4-character-lcd-stn-black-on-green.html?utm_source=google&utm_medium=base&utm_campaign=BingShopping http://www.crystalfontz.com/product/CFA634-NFA-KS http://www.robotshop.com/parallax-4x20-serial-lcd-backlit.html

Real Time Clock

To keep sufficient time, a Real Time Clock IC (integrated circuit) made by Dallas Semiconductors was used. The DS1307 Serial Real-Time Clock is a low-power, full binary-coded decimal (BCD) clock/calendar. This external peripheral contains all the needed features to obtain current time/date to correctly run the PEZ dispenser. Out-sourcing this work was cost effective and less time consuming than setting up a timer port to keep time. Data sheets for the chosen RTC can be found in Appendix E.

Decision Matrix

LCD Choices

weights --> 2 3 4 0.5 0.5 10

20% 30% 40% 5% 5% 100%

Options Ease of

Use Cost

Display Size

Viewing Angle

Build Time

Score

Crystalzonts 60 55 80 70 50 67 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Parallax 60 60 80 70 50 68 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Sparkfun Electronics 60 83 80 70 50 75 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Figure : Decision matrix developed for LCD selection.

Figure : LCD chosen.

22

Alarm Subsystem Design

The design specifications require that the alarm subsystem be capable of producing a tone of

approximately 1000 Hz with an 80 dB pressure rating. To produce the wave required, the components chosen were a 555 timer in conjunction with an 80 dB rated speaker. This proved to be a quick and inexpensive solution for the project. For a 555 oscillator, the frequency equation is:

𝑓 =1

𝑇=

1.44

𝑅1+2𝑅2 𝐶1 Eq. 1

With a goal frequency of 1000 Hz, it was simple to derive the remaining values for the circuit. After

some tweaking to find easy to get, readily available resistors, the following values were set:

R1 = 1 kΩ R2 = 220 Ω C1 =1 µF

The circuit was built on a breadboard and modeled in Multisim to test for accuracy. The desired

square wave was achieved in Multisim, as well as having a frequency of 1041 Hz as recorded on the breadboard circuit. The speaker that was used to test the system seemed loud enough, but until a decibel meter is used to check the sound pressure, it will not be known if an amplifier (op-amp circuit) will be necessary to boost the current to the load.

Figure : Multisim Schematic of Alarm Circuitry.

23

Pill Bins

The pill bins will rest on the pill tray, and each bin will be large enough to contain up to 90 one-

gram pills. The user will be able to access each bin and pour a supply of pills into each one. Since the vacuum nozzle drops into the pill bins from above and cannot translate horizontally, the bins need to be shaped so that pills will always be within the vacuum nozzle’s axis of translation. The bins will be conical in shape, so that as the pill level drops, the pills will be forced toward the center of the bin, and the tray will always be positioned so that the vacuum lowers into the center of the bin. By shaping the bins like a frustum, which is a cone with a flat bottom of smaller diameter than the top, the bottom diameter can be set to the diameter of the vacuum suction cup. This allows for when the bin is almost empty, any pills left will be contained within the diameter of the suction cup, and the suction cup will be able to fit all the way to the bottom of the bin.

To determine the volume needed for each bin, measurements of a one-gram, ellipsoid-shaped pill were taken using digital calipers, and the pill’s volume was estimated as if it were a box, which overestimates the actual volume of the pill. The pill used was a liquid-filled capsule, and because liquids are less dense than solids, these pills are larger than solid one-gram pills, so this is good to use for this calculation. This volume was then multiplied by 90, the maximum number of pills, to give a total volume of about 203.5 cm3 (12.42 in3). This volume was then increased by 30% to 264.7 cm3 (16.15 in3) to account for the fact that the pills will not fit uniformly inside the bin, causing gapping and air space to occur. This then, is the minimum volume needed for each pill bin. The volume of a frustum is given by:

𝑉 =𝜋𝑕

12 𝑑2 + 𝑑𝑏 + 𝑏2 Eq. 2

where h is the height, d is the top diameter, and b is the bottom diameter. The bottom diameter will be chosen once the suction cup to be used is selected. The height of the bins was set to 10.2 cm (4.0 in) because the nozzle assembly was designed for a travel distance of approximately 10 to 13 cm (4 to 5 in). The top diameters needed to produce the minimum volume are as follows:

Bottom Diameter (cm) Top Diameter (cm)

0.318 9.79

0.635 9.62

0.953 9.45

1.27 9.27

This equation produces two solutions for the top diameter, but the second result is a negative

result without any meaning in this application. This is due to the fact that because the height of the frustum is fixed, there is only one possible real diameter for the top that will produce the desired volume.

24

Figure : Pill Bin (dimensions in cm).

25

Pill Tray

The pill tray will be able to hold up to 10 pill bins and have a hole through which pills will be

dropped into the dispensing cup. Since the vacuum nozzle will only translate vertically, the tray will be rotated by a motor to position the pill bins beneath the vacuum such that a bin will be centered with the nozzle’s axis of translation. The vacuum nozzle will lower into a pill bin, grab a pill, and then rise back up holding the pill. The tray will then rotate so that the hole will be located beneath the vacuum, and the vacuum will disengage, dropping the pill through the hole. The dispensing cup will be positioned in the system encasement so that it rests beneath the vacuum nozzle. When a pill is dropped through the hole in the pill tray, it will fall into the dispensing cup. In the following SolidWorks models of the pill tray and bins, the bins are simply resting in 5.08 cm (2.0 in) holes in the tray, so that they can be easily removed and replaced by the user and be supported during rotation of the tray. The tray has a diameter of 47.0 cm (18.5 in) and a thickness of 1.27 cm (0.5 in). The bins are 10.2 cm (4.0 in) tall, and have a top diameter of 9.27 cm (3.65 in) and a bottom diameter of 1.27 cm (0.5 in). The pill tray will be cut from acrylic sheet and have the holes cut out of it, and the pill bins will either be made out of plastic by a 3D printer or be machined out of a lightweight metal, such as aluminum.

Figure : Top view of pill tray and pill bins.

26

Figure : Bottom view of pill tray and pill bins.

Magnetic switches to indicate home position

The pill tray will be equipped with a magnetic switch placed

underneath the tray at the point determined to be the home position. This switch will send a 5.0 volt feedback signal to the microprocessor when the tray has arrived at the home position. This home position will give PEZ a frame of reference to begin initialization procedures.

Figure : Magnetic Switch.

27

Nozzle Apparatus Design

The design of the nozzle apparatus will implement the use of a simple drawer runner. One piece

of the runner will be secured to the wall of the encasement, allowing the sliding portion to translate parallel to the axis of rotation of the pill tray. The rack will be secured to this slider, along with the nozzle of the vacuum hose. The vacuum hose will be attached to the vacuum body and have a nozzle with a suction cup at its end, and it will be held by a support attached to the top of the rack so that the nozzle is held securely facing the pill bins.

A motor will drive the pinion that drives the rack up and down, moving the vacuum nozzle into and out of the pill bins. The motor will be secured to the wall of the encasement, and it will be braced by cross braces running across the width of the encasement. The rack will be 16.5 cm (6.5 in) long, allowing the vacuum nozzle to translate all the way to the bottom of the 15.2 cm (4 in) deep pill bins and providing enough space for the pill tray to rotate when the nozzle is raised. A SolidWorks drawing of this assembly is shown below.

Figure : Nozzle Assembly.

28

Rack and Pinion Selection

Following research in the area of rack and pinion design and discussion with mechanical engineers

from a design team that incorporated a rack and pinion system in their design project in the previous year, it was determined that a metal rack and pinion should be incorporated if the budget would allow.

Metal gearing is more expensive than plastic gearing; however, the increased precision provided by metal gearing makes metal gears stand out from plastic gearing. The rack is to be incorporated as part of the linear guidance system for the nozzle apparatus, therefore, precision in the tooth cutting and spacing is very important. Imprecisely cut gear teeth increase friction between the gears, thus increasing the load on the motor that is driving the system. Improperly spaced teeth will also add friction and could lead to binding: in short, the precision cut of metal gear teeth will reduce friction between gears, thus reducing the risk of binding.

Obviously, the use of metal gears will provide gearing that is significantly stronger than is

necessary for the specified application. Though the maximum load that the system should be able to place on the gear teeth is far less than that which will make them fail, the added strength provided by metal gearing will ensure that the gearing will not be damaged during the testing or building phases of the project.

The selection of the rack to be used is interdependent on the design of the pill bins, as the vacuum

nozzle apparatus must be allowed to translate such that the nozzle can reach the bottom of the bins, yet be raised high enough so the pill tray can be rotated without the bins coming in contact with the raised nozzle. Current designs call for a rack that will allow the nozzle to translate a distance of up to 0.1143 m. For this reason, it is necessary to select a rack that will be, at the minimum, 0.1143 m in length.

The selection procedure for the rack and pinion system consisted of locating a rack of sufficient length to fulfill the translation distance requirement of the nozzle apparatus, finding a compatible pinion (having the same diametral pitch, pitch angle, etc.), and performing stress calculations to see if either would fail under the maximum possible loading (see calculations beginning on the next page verifying that prospective pinion and rack will not fail under loading).

29

Having selected prospective gearing for the nozzle apparatus, the approximate bending stress on the pinion’s teeth was quantified to check for gear failure due to bending under static and dynamic loading. The equation used below is the basis for the current AGMA (American Gear Manufacturer’s Association) bending stress equation. It is good approximations to use when gear life is not a concern; if stress values obtained using Eq. 3 were found to be close to the yield strength of the gear’s material, further calculations would be performed to ensure that failure would not occur.

𝜍 =𝐾𝑣𝑊

𝑡

𝐹𝑚𝑌 Eq. 3

𝜍 − 𝑏𝑒𝑛𝑑𝑖𝑛𝑔 𝑠𝑡𝑟𝑒𝑠𝑠 (𝑀𝑃𝑎) 𝑊𝑡 − 𝑡𝑟𝑎𝑛𝑠𝑣𝑒𝑟𝑠𝑒 𝑙𝑜𝑎𝑑 (𝑁) 𝑚 −𝑚𝑜𝑑𝑢𝑙𝑒 (𝑚𝑚) 𝐹 − 𝑔𝑒𝑎𝑟 𝑓𝑎𝑐𝑒 𝑤𝑖𝑑𝑡𝑕 (𝑚𝑚) 𝑌 − 𝑌𝑜𝑢𝑛𝑔′𝑠 𝑓𝑜𝑟𝑚 𝑓𝑎𝑐𝑡𝑜𝑟 𝐾𝑣 − 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦 𝑓𝑎𝑐𝑡𝑜𝑟

𝐾𝑣 =6.1+𝑉

6.1 𝑉 = 𝑝𝑖𝑡𝑐𝑕 𝑙𝑖𝑛𝑒 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦

𝑚

𝑠 Eq. 4

The first step in performing these calculations was to determine a test value for the transverse

load. Under static conditions, the transverse load is simply the weight of the system that is being translated by the gear. Consequently, the approximated transverse load used for the calculations was determined to be the force due to gravity’s acceleration on the mass of the system to be translated by the gear: the rack, the slider of the aluminum runner to which the rack is attached, and the vacuum nozzle (see nozzle apparatus page).

𝑊𝑡 = 𝑊𝑟𝑎𝑐𝑘 + 𝑊𝑟𝑢𝑛𝑛𝑒𝑟 + 𝑊𝑛𝑜𝑧𝑧𝑙𝑒 = 0.8312𝑁 + 0.4348𝑁 + 0.1825𝑁 = 1.561 𝑁 (0.351𝑙𝑏𝑓) Eq. 5

After attaining a value for the transverse load, a value for the Lewis form factor was determined,

based upon the number of teeth on the pinion, to be 0.290. With this information, it was possible to calculate the bending stress on the pinion’s teeth due to the static loading:

𝜍 =

6.1+0.0508

6.1 (1.561𝑁)

3.175𝑚𝑚 1.058𝑚𝑚 (0.290)= 1.615 𝑀𝑃𝑎 (234.189 𝑝𝑠𝑖) Eq. 6

Following calculations of bending stress on the gear teeth due to static loading, it was acknowledged

that the bending stress will be greater under dynamic loading, as accelerations of the nozzle apparatus will induce greater loading on the teeth. Therefore, it was necessary to determine the maximum acceleration that could be placed on the nozzle apparatus and add this value to the acceleration on the apparatus due

to gravity. To do this, a maximum velocity for the apparatus was specified to be 0.0508𝑚

𝑠 2

𝑖𝑛

𝑠 . Knowing

that the stepper motors to be used will employ a step of 1.8 degrees, it was obvious that the maximum possible acceleration on the nozzle would be achieved by bringing the velocity of the nozzle from its

0.0508𝑚

𝑠 max velocity to a stop in one step of the motor.

𝑉 = 0.0508𝑚

𝑠

60𝑠

1𝑚𝑖𝑛𝑢𝑡𝑒 = 3.048

𝑚

𝑚𝑖𝑛 120

𝑖𝑛

𝑚𝑖𝑛 Eq. 7

30

After calculating apparatus velocity in meters per minute, the required revolution rate for the pinion in revolutions per minute was calculated.

𝑛 =𝑉

𝜋𝑑=

3.048∗1000 𝑚𝑚

𝑠

𝜋∗0.625∗2.54∗10 (𝑚𝑚 )= 61

𝑟𝑒𝑣

𝑚𝑖𝑛𝑢𝑡𝑒 Eq. 8

After determining the necessary revolution rate for the pinion, the time required for the motor to

perform one step at this revolution rate was calculated.

𝑠𝑠𝑒𝑐 = 360

1.8 61

1

60 = 203.333

𝑠𝑡𝑒𝑝𝑠

𝑠𝑒𝑐𝑜𝑛𝑑 Eq. 9

𝑡𝑠𝑡𝑒𝑝 = 𝑠𝑠𝑒𝑐 −1 =

1

203.333= 0.004918

𝑠𝑒𝑐𝑜𝑛𝑑𝑠

𝑠𝑡𝑒𝑝 Eq. 10

Having determined the time per step for the stepper motor, it was possible to determine the

maximum apparatus acceleration, by making the apparatus go from a speed of 0.0508𝑚

𝑠 to a stop in the

time required for one step of the motor.

𝑎𝑚𝑎𝑥 = 0.0508

𝑚

𝑠−0

𝑚

𝑠

0.004918𝑠

𝑠𝑡𝑒𝑝

= 10.329𝑚

𝑠2 33.728 𝑓𝑡

𝑠2 Eq. 11

Adding this additional acceleration to the acceleration already on the apparatus due to gravity, a maximum acceleration was attained for calculating the maximum bending stress due to dynamic loading.

𝑊𝑚𝑎𝑥𝑡 = 𝑎𝑚𝑎𝑥 + 𝑎𝑔𝑟𝑎𝑣𝑖𝑡𝑦 ∗ 𝑚𝑠𝑦𝑠 = 20.139

𝑚

𝑠2 ∗ 1.561𝑁

9.81𝑚

𝑠2

= 3.205𝑁 (0.720 𝑙𝑏𝑓) Eq. 12

𝜍𝑚𝑎𝑥 =

6.1+0.0508

6.1 (3.205𝑁)

3.175𝑚𝑚 1.058𝑚𝑚 (0.290)= 3.317 𝑀𝑃𝑎 (481.153 𝑝𝑠𝑖) Eq. 13

Having calculated the maximum bending stress that could be exerted on the pinion’s teeth due to the dynamic loading of the nozzle apparatus system, the yield strength of the material from which the gear teeth are made can be compared with maximum bending stress that can be put on them by the apparatus. Knowing that the gear teeth are made of 303 stainless steel, the yield strength of this material can be looked up. 𝜍𝑦 ,303 = 241.317 𝑀𝑃𝑎 (35000 𝑝𝑠𝑖) Eq. 14

Upon comparing the yield strength of the material (Eq. 14) with the maximum bending stress to be placed on the gears, it is obvious that the gear teeth are strong enough to sustain the loading without failing. Having verified that the gear teeth will not fail under loading, it must be demonstrated that the rack’s teeth will not fail under the same loading. Calculations will be different, as Eq. 3 cannot be directly related to a rack. Instead, a single tooth of the rack will be focused on and bending stress calculations will

31

proceed, modeling this single tooth as a cantilevered beam (see diagram below). Bending stress will be calculated using the Lewis bending equation (Eq. 15).

𝜍 = 6𝑊𝑡 𝑙

𝐹𝑡2 Eq. 15

𝜍 − 𝑏𝑒𝑛𝑑𝑖𝑛𝑔 𝑠𝑡𝑟𝑒𝑠𝑠 (𝑀𝑃𝑎) 𝑊𝑡 − 𝑡𝑟𝑎𝑛𝑠𝑣𝑒𝑟𝑠𝑒 𝑙𝑜𝑎𝑑 (𝑁) 𝑙 − 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑟𝑜𝑚 𝑡𝑕𝑒 𝑏𝑜𝑡𝑡𝑜𝑚 𝑙𝑎𝑛𝑑 𝑡𝑜 𝑝𝑖𝑡𝑐𝑕 𝑟𝑎𝑑𝑖𝑢𝑠 (𝑚𝑚) 𝐹 − 𝑓𝑎𝑐𝑒 𝑤𝑖𝑑𝑡𝑕 (𝑚𝑚) 𝑡 − 𝑡𝑜𝑜𝑡𝑕 𝑡𝑕𝑖𝑐𝑘𝑛𝑒𝑠𝑠 𝑎𝑡 𝑝𝑜𝑖𝑛𝑡 𝑜𝑓 𝑐𝑜𝑛𝑡𝑎𝑐𝑡 (𝑚𝑚) Using tooth thickness at the point of contact and distance from the bottom land to the pitch radius values obtained from SolidWorks models, face width obtained from the rack’s specification sheets, and the transverse load from Eq. 5, the bending stress on the rack due to static loading was calculated.

𝜍 = 6 1.561 𝑁 1.2268 𝑚𝑚

5.842 𝑚𝑚 1.4478 𝑚𝑚 2 = 0.765 𝑀𝑃𝑎 (110.932 𝑝𝑠𝑖) Eq. 16

Following calculations for rack bending stress under static loading, calculations for bending stress under dynamic loading were performed using the maximum transverse load calculated with Eq. 12.

𝜍 = 6 3.205 𝑁 1.2268 𝑚𝑚

5.842 𝑚𝑚 1.4478 𝑚𝑚 2 = 1.927 𝑀𝑃𝑎 (279.419 𝑝𝑠𝑖) Eq. 17

Having calculated the maximum stress on the rack due to static and dynamic loadings, it was possible to compare the attained bending stresses with the known yield strength for the rack’s material, 416 stainless steel. 𝜍𝑦 ,416 = 600 𝑀𝑃𝑎 (87,000 𝑝𝑠𝑖) Eq. 18

Comparing the maximum bending stress due to dynamic and static loadings on the rack with the known yield strength of the rack’s material, it is obvious that the rack will be able to sustain the maximum loading without failure due to bending. After verifying that the rack and pinion used in the previous calculations would not fail under the loading that the nozzle apparatus could induce on it, they were accepted to be used in the design process.

Figure : Rack Tooth as Cantilevered Beam.

𝐹

𝑙

𝑡

𝑊𝑡

32

The rack selected was from the company Stock Drive Products/Sterling Instruments. A detailed Specification sheet is provided in Appendix A (catalog number S1811Y-RB-1P). The rack is significantly longer than will be needed, having a length of 0.4572 m (18”). However, purchasing a rack of a shorter length from this company is more expensive, so the longer rack was deemed a better purchase, as it will allow for potential building error and will be cut to the desired length when assembly of the PEZ machine commences. (Cost: $58.76 excluding shipping)

The pinion was also selected from the company Stock Drive Products/Sterling Instruments. A detailed Specification sheet is provided in Appendix B (catalog number S1066Z-024S015). Initial design was carried out for hub-less gears, as the pinion was going to be secured to the motor shaft by a shrink fit. However, due to the ease of attachment provided by a set screw and the cheaper price of the pinion with a hub, the decision was made to incorporate the pinion with a hub into the gearing system. (Cost: $9.91 excluding shipping)

Figure : Pinion.

Figure : Rack.

33

Motor Selection

In the current design plan, two motors are necessary: one to rotate the pill tray and one to drive

the pinion which will drive the translation of the nozzle apparatus. The main issue involved finding motors within the designated price range that will provide sufficient torque and precision for the required applications. For this reason, it was decided from the beginning that stepper motors would be incorporated. Following this decision, calculations were carried out to determine what torque output would be required from each motor.

Initial design calculations were conducted under the assumption that the geometry of the pill tray and bins could be approximated as a uniform disk having a diameter equivalent to that of the pill tray, 0.47 m (18.5 in), and a mass equivalent to the combined mass of the pill tray (0.6 kg), the pill bins ( (10 bins)*(0.09 kg/bin)), and 90 and the maximum possible mass of the pill that the tray can hold ( (90 pills)*(0.001 kg/pill)*(10)). Using the mass, tray dimensions, and geometry assumption given above, the inertia of the tray about its axis of rotation was calculated using Eq. 19 (see below).

𝐼𝑧𝑧 =1

2𝑚𝑟2 Eq. 19

𝐼𝑧𝑧 −𝑚𝑎𝑠𝑠 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 (𝑘𝑔 ∗ 𝑚2) 𝑚 −𝑚𝑎𝑠𝑠 𝑜𝑓 𝑡𝑕𝑒 𝑑𝑖𝑠𝑘 𝑘𝑔 𝑟 − 𝑟𝑎𝑑𝑖𝑢𝑠 𝑜𝑓 𝑡𝑕𝑒 𝑑𝑖𝑠𝑘 (𝑘𝑔)

𝐼𝑧𝑧 =1

2 2.4 𝑘𝑔

0.47

2 𝑚

2= 0.066 𝑘𝑔 ∗ 𝑚2 Eq. 20

However, after calculating the pill tray’s inertia about its axis of rotation (Eq. 20), it was determined that a more accurate description of the pill tray and bins’ geometry should be used in calculating their inertia. Observing that the height of the cones was 0.10 m and the diameter of the tray was only 0.47 m led to the belief that the approximation of the tray and bins as a thin disk (diameter >> thickness) was not a good approximation for the system. Therefore, the system was remodeled as a composite body. The first part of this composite body to be modeled was the pill tray itself. Excluding the mass of the bins from the inertia calculations, the tray’s inertia about its center of rotation was found using eq. 17.

𝐼𝑧𝑧𝑡𝑟𝑎𝑦 =1

2 0.6 𝑘𝑔

0.47

2𝑚

2= 0.017 𝑘𝑔 ∗ 𝑚2 Eq. 21

The next portion of the composite body taken into account was the inertia due to the pill bins. The geometry of the pill bins is that of a frustum: a conical shape with a flat base. However, because the diameter of the base is considerably less than the diameter of the top of the bins (𝑑𝑡𝑜𝑝 ≈ 0.1 𝑚 𝑎𝑛𝑑 𝑑𝑏𝑎𝑠𝑒 ≈ 0.02 𝑚), the bins’ geometry was approximated as a cone, and their mass, as

stated above, to be 0.18 kg. Using the approximation of the bins’ geometry as that of a cone, it was possible to calculate the inertia introduced due to the pill bins; additionally, each bin added a parallel axis theorem term, as the bins were not rotating about their mass centers (Eq. 22).

𝐼𝑧𝑧1 𝑐𝑜𝑛𝑒=

3

10𝑚𝑟2 + 𝑚𝑅2 Eq. 22

34

𝐼𝑧𝑧 −𝑚𝑎𝑠𝑠 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 (𝑘𝑔 ∗ 𝑚2) 𝑚 −𝑚𝑎𝑠𝑠 𝑜𝑓 𝑏𝑖𝑛 + 𝑝𝑖𝑙𝑙𝑠 𝑘𝑔 𝑟 − 𝑢𝑝𝑝𝑒𝑟 𝑟𝑎𝑑𝑖𝑢𝑠 𝑜𝑓 𝑡𝑕𝑒 𝑐𝑜𝑛𝑒 (𝑚) 𝑅 − 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑟𝑜𝑚 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑡𝑟𝑎𝑦 𝑡𝑜 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑐𝑢𝑡𝑜𝑢𝑡 𝑡𝑜 𝑝𝑙𝑎𝑐𝑒 𝑏𝑖𝑛 𝑖𝑛 (𝑚)

𝐼𝑧𝑧1𝑐𝑜𝑛𝑒 =3

10 0.18 𝑘𝑔 ∗ 0.0489 𝑚 2 + 0.18 𝑘𝑔 ∗ 0.21 𝑚 2 = 0.0081 𝑘𝑔 ∗ 𝑚2 Eq. 23

The final portion of the composite body to be taken into account when calculating the composite body was the holes cut out of the tray to place the bins in. To take them into account, it was necessary to determine the inertia each hole would contribute to the inertia of the composite body and subtract it from the inertia of the tray and 10 bins. Each hole was approximated as a thin disk having a diameter of 0.051 m; once again, it was noted that each hole would introduce a parallel axis term because the mass composing it was not rotating about its own center of gravity. Before the inertia contribution of the holes could be calculated, it was necessary to determine the mass of the material that was removed in the making of each hole; this was done by using a mass to area ratio (Eq. 24).

𝑚𝑕𝑜𝑙𝑒 =𝑚 𝑡𝑟𝑎𝑦

𝐴𝑡𝑟𝑎𝑦∗ 𝐴𝑕𝑜𝑙𝑒 =

0.6 𝑘𝑔

𝜋∗ 0.24 𝑚 2 ∗ 𝜋 ∗ 0.025 𝑚 2 = 0.0065 𝑘𝑔 Eq. 24

After determining the mass that determined each hole, the inertia that needed to be subtracted from the inertia of the composite body due to each hole was calculated (Eq. 25).

𝐼𝑧𝑧1 𝑕𝑜𝑙𝑒=

1

2𝑚𝑕𝑜𝑙𝑒 𝑟

2 + 𝑚𝑕𝑜𝑙𝑒𝑅2 Eq. 25

𝐼𝑧𝑧1 𝑕𝑜𝑙𝑒 –𝑕𝑜𝑙𝑒 ′𝑠 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 (𝑘𝑔 ∗ 𝑚2)

𝑚𝑕𝑜𝑙𝑒 − 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑑 𝑚𝑎𝑡𝑒𝑟𝑖𝑎𝑙′𝑠 𝑚𝑎𝑠𝑠 (𝑘𝑔) 𝑟 − 𝑕𝑜𝑙𝑒 ′𝑠 𝑟𝑎𝑑𝑖𝑢𝑠 (𝑚) 𝑅 − 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑓𝑟𝑜𝑚 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑡𝑟𝑎𝑦 𝑡𝑜 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑕𝑜𝑙𝑒 (𝑚)

𝐼𝑧𝑧1𝑕𝑜𝑙𝑒 =1

2 0.0065 𝑘𝑔 0.025 𝑚 2 + 0.0065 𝑘𝑔 0.21 𝑚 2 = 0.00029 𝑘𝑔 ∗ 𝑚2 Eq. 26

Lastly, after determining the inertia contributions of each component of the composite body, the total inertia of the composite body was calculated (Eq. 27). 𝐼𝑐𝑜𝑚𝑝 = 𝐼𝑡𝑟𝑎𝑦 + 10 ∗ 𝐼𝑏𝑖𝑛 − 11 ∗ 𝐼𝑕𝑜𝑙𝑒 Eq. 27

𝐼𝑐𝑜𝑚𝑝 = 0.017 + 10 ∗ 0.0081 − 11 ∗ 0.00029 = 0.095 𝑘𝑔 ∗ 𝑚2 Eq. 28

Comparing the inertia of the composite body (Eq. 28) with the inertia of the thin uniform disk approximation of the system (Eq. 20) displays that lumping the components of the pill tray into one geometry would yield an inertia value that is about 30 % less than the system’s actual inertia. For a given system, if the mass moment of inertia and angular acceleration about a given axis are known, it is possible to calculate the required torque to induce that angular acceleration using Eq. 29. For the prescribed application, it is not necessary that the motor provide a large angular acceleration, yet it is desirable to insure that the motor will be able to rotate the tray at a reasonable rate. Therefore, for design

35

purposes, an angular acceleration of two radians per squared second was prescribed, and then the necessary torque to yield this angular acceleration was calculated (Eq. 30) (see Figure 21 below). 𝑀𝐺 = 𝐼𝑧𝑧𝛼𝑧 Eq. 29 𝑀𝐺 − 𝑠𝑢𝑚𝑚𝑖𝑛𝑔 𝑡𝑕𝑒 𝑚𝑜𝑚𝑒𝑛𝑡𝑠 𝑎𝑏𝑜𝑢𝑡 𝑡𝑕𝑒 𝑧 − 𝑎𝑥𝑖𝑠 (𝑁 ∗ 𝑚) 𝐼𝑧𝑧 −𝑚𝑎𝑠𝑠 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 𝑎𝑏𝑜𝑢𝑡 𝑡𝑕𝑒 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑔𝑟𝑎𝑣𝑖𝑡𝑦 (𝑘𝑔 ∗ 𝑚2)

𝛼𝑧 − 𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑎𝑏𝑜𝑢𝑡 𝑡𝑕𝑒 𝑧 − 𝑎𝑥𝑖𝑠 𝑚

𝑠2

𝑇𝑟𝑒𝑞𝑢𝑖𝑟𝑒 𝑑 = 𝐼𝐺,𝑧𝑧𝛼𝑧 = 0.095 𝑘𝑔 ∗ 𝑚2 ∗ 2𝑟𝑎𝑑

𝑠2 = 0.19 𝑁 ∗𝑚 Eq. 30

From Eq. 30, the torque requirement to rotate the tray with an angular acceleration of two radians per second squared is 0.19 N*m (26.91 oz*in). At this point, it was noted that the prescribed torque requirement would only provide a factor of safety of one. To account for binding and friction in the system rotating the tray, the target criterion for the output torque of the motor for rotating the pill tray is to achieve a factor of safety of at least 1.25. After completing calculations of the torque requirement for the motor to rotate the pill tray, it was next necessary to determine the torque requirement for the motor to drive the pinion of the nozzle apparatus system. Once again, the thin disk geometry approximation was used, as the pinion was approximated as a thin disk rotating about an axis rising normal to its cross section. The mass of the pinion was also approximated using the assumption that the pinion was a disk.

𝑉 = 𝜋𝑟2𝑡 = 𝜋 ∗ 0.625

2∗

2.54𝑐𝑚

1𝑖𝑛∗

1𝑚

100𝑐𝑚

2∗ 0.125 ∗

2.54𝑐𝑚

1𝑖𝑛∗

1𝑚

100𝑐𝑚 = 6.28 10 −7𝑚3 Eq. 31

Using the pinion’s volume (Eq. 31) and the known density of steel, 8030𝑘𝑔

𝑚3, the mass of the

pinion for calculating the mass moment of inertia of the pinion was calculated.

𝐼𝑧𝑧 =1

2 𝑉 ∗ 𝜌 ∗ 𝑟2 =

1

2 6.28 10−7 𝑚3 ∗ 8030

𝑘𝑔

𝑚3 ∗ 0.3125𝑖𝑛 ∗2.54𝑐𝑚

1𝑖𝑛∗

1𝑚

100𝑐𝑚 =

1.59 10 −7𝑘𝑔 ∗ 𝑚2 Eq. 32

Figure : Pill Tray Free Body Diagram.

36

Having calculated a mass moment of inertia for the pinion, it was necessary to specify a maximum angular acceleration for the pinion so that a torque requirement could be calculated. It was decided that the angular acceleration of the pinion that would yield the maximum acceleration of the nozzle apparatus should be used for calculations. Having already calculated the maximum acceleration of the nozzle apparatus (Eq. 9, p. 30), it only remained to convert this angular acceleration of the pinion into the linear acceleration of the nozzle apparatus.

𝛼𝑚𝑎𝑥 ,𝑝𝑖𝑛𝑖𝑜𝑛 =𝑎𝑎𝑝𝑝𝑎𝑟𝑎𝑡𝑢𝑠

𝑟𝑝𝑖𝑛𝑖𝑜𝑛=

10.329𝑚

𝑠2

0.0079375 𝑚= 1401

𝑟𝑎𝑑

𝑠2 Eq. 33

In reality, no such angular acceleration will ever be experienced by the system, as the current goal is to have the apparatus accelerate from rest to max velocity and decelerate from decelerate from max velocity to rest over a 10-50 step interval. However, with the goal of over-engineering this critical subsystem, design conditions involved the maximum possible acceleration: going from at rest to maximum velocity in one step. It was desired to over-design this system, as it is not yet certain how the task of guiding the vacuum nozzle will affect the subsystem. The next step involved drawing a free body diagram of the pinion. In calculating the motor’s torque requirement, the maximum transverse load due to dynamic loading must be taken into account. This dynamic loading is incorporated into the design by implementing a force acting at the pitch radius equal to the effect of gravitational plus max system acceleration on the mass of the nozzle apparatus (Eq. 10, p. 30), which will create a moment in the direction opposite to the input torque of the motor and angular acceleration of the pinion (see Figure 22). 𝑀𝐺 = 𝐼𝑧𝑧𝛼𝑧 = 𝑇 −𝑊𝑡 𝑙 Eq. 34 𝑀𝐺 − 𝑠𝑢𝑚 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑠 𝑎𝑏𝑜𝑢𝑡 𝑡𝑕𝑒 𝑐𝑒𝑛𝑡𝑒𝑟 𝑜𝑓 𝑔𝑟𝑎𝑣𝑖𝑡𝑦 (𝑁 ∗𝑚) 𝐼𝑧𝑧 −𝑚𝑎𝑠𝑠 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑖𝑛𝑒𝑟𝑡𝑖𝑎 𝑎𝑏𝑜𝑢𝑡 𝑧 𝑎𝑧𝑖𝑠 (𝑘𝑔 ∗ 𝑚2)

𝛼𝑧 − 𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑎𝑏𝑜𝑢𝑡 𝑐𝑒𝑛𝑡𝑟𝑎𝑙 𝑎𝑥𝑖𝑠 𝑟𝑎𝑑

𝑠2

𝑇 − 𝑖𝑛𝑝𝑢𝑡 𝑚𝑜𝑡𝑜𝑟 𝑡𝑜𝑟𝑞𝑢𝑒 (𝑁 ∗ 𝑚) 𝑊𝑡 −𝑚𝑎𝑥 𝑡𝑟𝑎𝑛𝑠𝑣𝑒𝑟𝑠𝑒 𝑑𝑦𝑛𝑎𝑚𝑖𝑐 𝑙𝑜𝑎𝑑𝑖𝑛𝑔 (𝑁) 𝑙 − 𝑝𝑖𝑡𝑐𝑕 𝑟𝑎𝑑𝑖𝑢𝑠 𝑜𝑓 𝑝𝑖𝑛𝑖𝑜𝑛 (𝑚)

Figure : Pinion Free Body Diagram.

37

Using calculated values for the mass moment of inertia, angular acceleration, and pitch radius, the torque requirement was calculated.

𝑇 = 𝑊𝑡 𝑙 + 𝐼𝑧𝑧𝛼𝑧 = 3.205 𝑁 ∗ 0.00689𝑚 + 1.59 10 −7𝑘𝑔 ∗ 𝑚2 ∗ 1401𝑟𝑎𝑑

𝑠2 =

0.02205 𝑁

𝑚 (3.122 𝑜𝑧 ∗ 𝑖𝑛) Eq. 35

In calculating the output torque requirement for the motor to drive the pinion, the maximum

possible loadings that the motor would have to accommodate were taken into account. In other words, the maximum loading on the gearing and the maximum acceleration of the nozzle apparatus, in their overestimations, incorporate a factor of safety into the design. Therefore, the motor to be used in the application of driving the pinion and linear translation system needs only to provide a factor of safety of one or slightly higher. The computer engineer on the PEZ design team stated that employing the same model of motor in each of the two applications would save a considerable amount of time in programming the microprocessor. After determining the output torque requirement from each motor, two motors were selected by the mechanical engineers and presented to the electrical engineers, allowing them to decide which motors they would prefer to work with (See Appendix C for specification sheets for motors one and two). Motor one provides an output torque of 0.254 N*m, and motor two provides an output torque of 0.31 N*m. A decision matrix was used to make the final selection (See p. 38).

Motor Selection Decision Matrix

Weight Motor One Motor Two

Low Cost 0.3 4 2

Low Power Draw 0.1 3 3

High Step Accuracy 0.3 4 4

Small Step Angle 0.3 4 4

3.9 3.3

Figure : Decision Matrix for Motor Selection.

As can be seen in the decision matrix for motor selection, motor one was selected for both applications. It is manufactured by a company called SOYO and available from the source www.robotshop.com. Motor one provides an output torque of 0.254 N*m (36 oz*in). (Cost: $19.99 per unit excluding shipping

When the motors were initially selected, errors in calculating the torque requirements for both

motors led to the selection of motors providing significantly higher output torque than was called for by design criteria. An immediate consideration was returning the motors for a refund and finding smaller motors; however, the cost of returning the motors would offset any positive gain from incorporating smaller, cheaper motors.

Figure : Stepper Motor.

38

Recently, larger calculated inertia values for the pill tray and bins, resulting from their size increases and new geometry assumptions, resulted in increased torque requirements for the motor rotating the pill tray. This provides an example of the benefits of overdesigning a system, as the increased torque requirements can be fulfilled by the motor that was initially selected (Will fulfill new torque requirement with a factor of safety of 1.34).

Additionally, though the motor driving the pinion far exceeds torque requirements, providing a

factor of safety of 11.5 it is marked for high precision and accuracy, thus making it applicable in PEZ’s design.

39

Motor Control

H-Bridges are the most common means of

controlling stepping motors. A basic H-bridge can be seen in Figure 25. The H-Bridge arrangement is generally used to reverse the polarity of the motor, but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. The following table summarizes operation. Notice that the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. The same applies to the switches S3 and S4.

Table : H-Bridge Control.

For the unipolar stepper motor, a specific motor control chip can be used to perform those operations. The current for the stepper motor is 0.4 A/phase, so that the key requirement for the motor control chip is the ability to handle at least 0.4 A per channel. After studying and researching, the L293D motor control chip has been chosen.

The L293D IC has the basic H-bridge design already implemented internally, which was illustrated before. The schematic for the motor control circuitry is presented in Figure 26.

Figure : Simple H-Bridge.

Figure : Interfaces with subsystems.

40

The application circuitry for L293D and the stepper motor is showed as follow in Figure 27.

Figure : Unipolar Stepping-Motor Control

41

Vacuum Selection

The vacuum is a self-contained system that will be used to retrieve the pills from the pill bins and carry them to the dispensing cup. The vacuum nozzle will have a rubber suction cup that will be able to grab pills, regardless of shape or coating, that fall in the range of 10 milligrams to 1.0 gram in mass. It must only be able to grab one pill at a time and must be able to pick up pills in a number of different orientations. This is necessary because the pills will just be resting in the bins without any uniform ordering. The nozzle must also be constrained or filtered such that small pieces of broken pills will not be sucked into the vacuum and clog the system. Vacuums that met the requirements were found from Virtual Industries, Inc. The vacuum was selected based on suction strength, meaning the lifting capacity of the suction cup nozzle. The minimum lifting force that the vacuum needs to produce is the gravitational force acting on a 1.0 gram mass. This was found using Newton’s second law: 𝐹𝑚𝑖𝑛 = 𝑚𝑎 = 0.001 𝑘𝑔 9.81𝑚 𝑠2 = 0.00981 𝑁 Eq. 36

The lifting capacity was determined using an equation from www.iqvalves.com, which gives the lifting capacity, in units of force, of one vacuum suction cup that is in vertical motion. This equation is given as:

𝑙𝑖𝑓𝑡𝑖𝑛𝑔 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 = 0.4912 0.6 𝐴𝑐𝑢𝑝 (𝑃𝑣𝑎𝑐 )

𝑁 Eq. 37

where A is the area of the suction cup, and P is the pressure of suction generated by the vacuum. The values 0.4912 and 0.6 are constants used in the equation, and N, the desired factor of safety, was set to a value of four based on information provided at www.sas-automation.com. The vacuum that was selected produces a pressure of 20.32 kPa (6.0 in Hg) and has four different suction cups, which have the following diameters: 0.318 cm, 0.635 cm, 0.953 cm, and 1.27 cm (1/8 in, 1/4 in, 3/8 in, and 1/2 in). The lifting capacity for the smallest suction cup was determined by converting the pressure to units of Pa and finding the suction cup area in units of m2 in order to give lifting capacity in Newtons.

𝐴𝑐𝑢𝑝 = 𝜋 ∙ 𝐷𝑐𝑢𝑝

2

2= 𝜋 ∙

0.00318 𝑚

2

2= 7.94 × 10−6 𝑚2 Eq. 38

𝑙𝑖𝑓𝑡𝑖𝑛𝑔 𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦 = 0.4912 0.6 7.94×10−6 𝑚2 (20320 𝑁 𝑚2)

4= 0.0119 𝑁 Eq. 39

This force fulfills the minimum requirement for lifting capacity, and the force will increase with

larger suction cups, so this vacuum should be effective. However, after receiving this vacuum and testing it, the vacuum proved to not be effective for this application. Though it was capable of lifting a one-gram pill, it required a firm seal with the suction cup in order to lift a pill. This means that it was not capable of lifting the pills at any orientation, because it could not create a firm seal with the edges of the pills. Also, creating a seal required that the nozzle be pressed down on the pill with a fair amount of pressure. Because of this, the nozzle would just push pills aside when it was lowered into a container holding many loosely-stacked pills. It was determined that to remedy these problems, a vacuum that would be strong enough to actually draw a pill toward it would be required. Research led to the selection of the Dyson DC31 handheld vacuum (see Figure 28 below).

42

Figure : Dyson Vacuum

This vacuum is capable of producing a maximum of 65 airwatts. An airwatt is a unit of power used to quantify the strength of a vacuum. It is a value that is only derived from English units, and is given by the following equation:

𝑝𝑜𝑤𝑒𝑟 =𝑎𝑖𝑟𝑓𝑙𝑜𝑤 (𝑓𝑡 3 min )× 𝑠𝑢𝑐𝑡𝑖𝑜𝑛 (𝑖𝑛𝑐 𝑕𝑒𝑠 𝑜𝑓 𝑤𝑎𝑡𝑒𝑟 )

8.5 Eq. 40

The airwatt gives a more complete quantification of vacuum strength than the lifting capacity

equation given previously, because it incorporates both airflow and suction. The vacuum from Virtual Industries was not sufficient because of its very small airflow rate. Because the only specification that Dyson provides for the DC31 vacuum is the airwatt value, the airflow rate and pressure of suction cannot be calculated for this vacuum. However, the airflow and suction are known for the insufficient Virtual Industries vacuum, and its airwatt value can be calculated and compared to that given for the Dyson vacuum as follows:

𝑎𝑖𝑟𝑓𝑙𝑜𝑤 = 1.7𝐿 𝑚𝑖𝑛 0.035315 𝑓𝑡 3

1 𝐿 = 0.06004 𝑓𝑡3 𝑚𝑖𝑛 Eq. 41

𝑠𝑢𝑐𝑡𝑖𝑜𝑛 = 6.0 𝑖𝑛 𝐻𝑔 13.5 𝑖𝑛 𝐻2𝑂

1.0 𝑖𝑛 𝐻𝑔 = 81 𝑖𝑛 𝐻2𝑂 Eq. 42

𝑝𝑜𝑤𝑒𝑟 = 0.06004 𝑓𝑡 3 𝑚𝑖𝑛 (81 𝑖𝑛 𝐻2𝑂 )

8.5= 0.572 𝑎𝑖𝑟𝑤𝑎𝑡𝑡𝑠 Eq. 43

This shows that the Dyson vacuum is over 100 times as powerful as the Virtual Industries vacuum,

and testing with the Dyson vacuum has already produced positive results. The Dyson vacuum will be used by affixing a hose to the orifice of the vacuum. The hose will have a nozzle and suction cup at the end and will be fastened onto the nozzle apparatus that will control its motion.

43

Vacuum Control

The vacuum will need to turned on and off via the microprocessor. During normal operations, PEZ will display the current time to the user. Only when a medication is needed to be dispensed will the vacuum be toggled on and off. A power MOSFET can be used to toggle the vacuum on and off.

The current monitoring technique is used for determining if the vacuum has successfully picked up a pill for the microprocessor. The basic schematic is presented below in Figure 29.

Figure : Current Monitoring.

The load resistance will be different between when the vacuum picks up a pill and it does not; this

changes the output voltage range. When those voltage values are converted by the A/D system in the microprocessor, the microprocessor will be told if the pill is picked up or not. The Multisim simulation for the current monitor is presented in Figures 30 and 31. The simulation models a 5V source with a load demonstrating varying current draws on the system. The LT1637 integrated circuit will accept loads with voltages up to 44V. This range will allow us to monitor current ratings on the vacuum selected.

44

Figure : Multisim Simulation of Current Monitor Circuit (low resistance).

Figure : Multisim Simulation of Current Monitor Circuit (high resistance).

The load represented in Figure 29 is presented as resistor R5 in both Figure 30 and Figure 31. When the vacuum has picked up a pill, the current going through the line will go lower. In order to demonstrate the lowering of the current, a higher resistance is required to be connected in the circuit. Figure 30 represents the opposite condition for the circuitry. The output voltage will vary from 0 to 5 volts in these conditions; however, this model won’t be the exact simulation for the current monitor circuit because of the information missing for the vacuum. An amplification of Vcc in the figures is needed for the actual vacuum control circuit the system will implement.

45

Encasement Design

The encasement was designed to enclose the subsystems of the machine while minimizing the

volume of the case. It is a box-like enclosure with a slanted face to which the LCD screen and keypad will be attached. The encasement will be made from acrylic sheet, having a framework made from aluminum or steel to add sturdiness to the structure. Greater stability is required for transportation of the device, as the acrylic sheet will not be strong enough for handles to be screwed in and held tight. The base of the frame is a 61 cm X 61 cm (24 in X 24 in) square, and the frame is 48.3 cm (19 in) tall. The top panel of the frame will be hinged and held down with a lock, which will allow access to the pills in the event of an electrical failure. Pictured below are the design of the encasement and the layout of the subsystems within the encasement.

Figure : PEZ- outside view.

Dispensing Cup

LCD Screen

Keypad

Alarm Speaker

46

Figure : PEZ- inside view.

Vacuum

Battery / Power Supply Nozzle Assembly

Dispensing Cup

Pill Tray & Bins

47

Figure : PEZ- inside view.

Pill Tray Motor

Pinion Motor

48

Software Development

During all interactions with PEZ, it can be assumed PEZ will display data to the LCD (Figure 35) when the user needs notified. Also, if the user needs to enter information in PEZ’s memory it can be assumed this will be done via the keypad. All screens referred to during this section may be found in Appendix S. Some of the more common events PEZ will encounter have been described below. Flowcharts indicating the user’s interaction with PEZ can be seen on pages 47 and 48. Description: PEZ initialization sequence: Event: PEZ is reset or out of the box with no user data present in memory.

1. First a subroutine is used to set-up ports for either input or output. 2. Next a subroutine will send a short audible beep to the user through the alarm circuitry to ensure

the user power is has been achieved. 3. During the startup procedures the user is notified via the LCD screen with the message “Wait while

PEZ starts up.” 4. The nozzle assembly and pill tray are rotated and placed in such a manner the microprocessor has

a frame of reference for dispensing subroutines. 5. User configuration routine will follow this routine if user set flag is cleared.

Description: User configuration after PEZ initialization sequence: Event: PEZ had no user data stored in non-volatile memory.

1. First the user must enter a PIN (personal identification number), first name, and last name via the keypad. The user will be ensured their entered information is correct by viewing the LCD.

2. After the previous data is stored in PEZ’s flash memory, the user will be asked if they are ready to enter medication data. If they are ready the following data will be collected through prompting and receiving through the LCD and keypad respectively.

a. Name of medication b. Total pills adding c. Doses of medication needed per day d. Amount of pills in a dose e. Time each dose needs to be administered

3. After entry of a single medication is completed, the user will be instructed to place the medication

in a specified pill bin. The bins will be filled in an order to maximize balance of the tray. Up to ten medications can be entered during this routine.

4. The user will then be asked to set the time/date. The format requested will be as follows: 12.12.2010 12:00am

Figure : Actual Printed User Data.

49

5. Once user finishes time entry methods, PEZ will print the home screen to the LCD. The home

screen will be formatted as follows:

12.12.2010 12:00am PEZ Pill Dispenser Press # for Menu

Description: User configuration after PEZ initialization sequence: Event: PEZ is unplugged or loses power for any reason while user data is present in memory.

1. The sequence of this initialization sequence will be the same as initialization sequence while no

user data is present in memory. 2. PEZ will print the home screen.

Description: Menu display Event: User presses the # key from the home screen.

1. PEZ will print a message to the LCD asking the user to enter their PIN. 2. Once PIN is verified PEZ will print ask :

1 = Change User Data 2 = Change MedData 3 = Set Date/Clock 4 = Back

Description: Change user data Event: User pressed the “1” key on the menu1 screen.

1. PEZ will print the following set of choices(Menu2) to the screen:

1 = Change First 2 = Change Last 3 = Change PIN 4 = Back

2. Depending on the choice, PEZ will prompt the user for new data. After new data is accepted, the

user will be returned to Menu2.

Description: Change medication data Event: User pressed the “1” key on the Menu1 screen.

1. PEZ will print the following set of choices (Menu3) to the screen:

1 = Add Med 2 = Remove Med 3 = Alter Med 4 = Back

Menu3

Menu2

Menu1

Home screen

50

Figure : User initiated LCD content.

51

Figure : Non-user initiated LCD content.

52

Schedule

53

Schedule Assessment

Currently, most of the project is right on schedule. All electrical subsystems have been designed and tested in Multisim, and likewise, most of the mechanical systems have been designed and simulated in SolidWorks. The two subsystems that are currently lagging slightly behind are the frame and the vacuum system. The frame had to be pushed back to allow for the other subsystems to be designed so that the frame could be built to house them. It is then acceptable that it is slightly behind where it was initially planned and should be completed in the next couple of weeks before this semester ends. The second set back occurred when the vacuum that was ordered was not adequate to pick up the pills that were indicated in the design specifications. A new vacuum was purchased on November 29, 2010 and a rework of that system is in progress. It is still the goal of the team to get all of the design work completed in the next two weeks so that going into next semester, the build of the project will not be hindered.

Looking forward to next semester’s schedule for the project, it seems reasonable if not on the aggressive side. Enough slack was left in the schedule so that when issues do arise, we will be able to resolve them and continue moving forward to the final presentation and stage gate. As it stands, the project will be completed on time and with all the intended functionality that was described in the requirements specification.

15

Fall Gantt Chart

90%

90%

50%

95%

Ongoing

54

55

Spring Gantt Chart

55

47

Budget Overview

Revised Budget

Item Vender Original Estimate Cost Mass Production Cost

Alarm Subsystem Digikey.com $0.00 $6.57 $4.23

Dyson Vacuum Lowe's $90.00 $167.08 $167.08

Gear and Rack Sterling Instruments $100.00 $88.58 $58.87

Keypad Jameco.com $21.95 $0.00 $5.00

Keypad Encoder Jameco.com $0.00 $5.19 $4.75

LCD Robotshop.com $17.95 $23.95 $15.86

Magnetic Position Switch phidgets.com $0.00 $5.00 $4.58

Microprocessor Microchip.com $10.00 $0.00 $7.00

Motor (for nozzle assembly) Robotshop.com $20.00 $23.30 $20.00

Motor (to rotate tray) Robotshop.com $38.00 $23.30 $20.00

PCB Board PCBexpress.com $75.00 $50.00 $30.00

Pill Tray Lowe's $2.00 $5.00 $5.00

Plexiglas Sheet Lowe's $150.00 $0.00 $100.00

Power Supply Jameco.com $30.00 $29.90 $15.95

SLA Battery Amazon.com $35.00 $40.09 $25.75

Motor Control IC Chips Canada.newark.com $0.00 $18.80 $16.22

Total $589.90 $486.76 $484.07

Contingency $410.10 $513.24

56

48

Revised Budget Discussion

The budget for the project has deviated from the original estimates, but it is still satisfactory. The biggest

deficit by far is from the vacuum, being as the original purchased from Virtual Industries did not meet the requirements of the project. The new vacuum that is much more powerful came in at $77.08 more than the original but meets the requirements set forth earlier in the semester. The electrical and frame “misc” sections have been removed from the budget to show a more accurate total to date, and it will be updated as necessary as the project progresses. In the original budget, Plexiglas was estimated to cost the team $150.00, but due to an excessive amount purchased from a team last year, enough is available on hand to meet the needs of the PEZ design. This will of course be accounted for in the final budget, but it is no longer needed in the current budget account. As it stands, the budget is over half contingency and that is a very safe place to be at the moment. If for any reason a design needs to be modified or a component replaced in the spring, it will be possible to replace that part and not exceed the budget limitations.

57