report

136
INSTITUTE OF TECHNOLOGY TALLAGHT DUBLIN Dept. of Mechanical Engineering Third Year Project Report Title: The Investigation of a DC Motor Position Control System through the Design and Manufacture of a Wind Direction Analytic Display Unit Supervisor: Ciaran Young Name: John Arigho Student Number: X00075278

Upload: john-arigho

Post on 12-Apr-2017

171 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Report

INSTITUTE OF TECHNOLOGY TALLAGHT DUBLIN

Dept. of Mechanical Engineering

Third Year Project

Report Title: The Investigation of a DC Motor Position Control System through the

Design and Manufacture of a Wind Direction Analytic Display Unit

Supervisor: Ciaran Young

Name: John Arigho

Student Number: X00075278

Page 2: Report

i

Table of Contents

INSTITUTE OF TECHNOLOGY TALLAGHT DUBLIN ......................................................................... i

1. Introduction ........................................................................................................................ 1

1.1 Project Description ...................................................................................................... 1

1.1.1 Deliverables ......................................................................................................... 1

1.2 Project Scope ............................................................................................................... 1

1.2.1 Design Specification ............................................................................................ 2

1.2.2 Desired Additional Features ................................................................................ 2

1.2.3 Criteria of Excellence .......................................................................................... 3

1.2.4 Safety ................................................................................................................... 3

1.3 Justification ................................................................................................................. 4

1.4 Project Plan ................................................................................................................. 4

2. Investigation ....................................................................................................................... 5

2.1 Background ................................................................................................................. 5

2.1.1 DC Motor ............................................................................................................. 6

2.1.2 Control Units/Methods......................................................................................... 6

2.1.3 Angle Sensors .................................................................................................... 10

3. Concept Selection ............................................................................................................ 12

3.1 Aim ............................................................................................................................ 12

3.2 Preliminary Concept Designs .................................................................................... 12

3.2.1 Concept 1. .......................................................................................................... 12

3.2.2 Concept 2. .......................................................................................................... 12

3.2.3 Concept 3. .......................................................................................................... 13

3.3 Concept Selection. ..................................................................................................... 13

3.3.1 Criteria Identification ......................................................................................... 13

3.3.2 Peer Evaluation .................................................................................................. 15

Page 3: Report

ii

3.3.3 Criteria Scoring Table ........................................................................................ 15

4. Concept Development ...................................................................................................... 16

4.1 Selected Concept Rework ......................................................................................... 16

4.2 Final Design .............................................................................................................. 16

4.3 Material Analysis ...................................................................................................... 17

4.3.1 Frame Material/Shape Analysis ......................................................................... 17

4.3.2 3D Printer Filament Analysis............................................................................. 19

4.4 Gear Chain Development .......................................................................................... 21

4.4.1 Gear Chain Design ............................................................................................. 21

4.4.2 Pitch Circle Diameter and Cog Shaft Alignment ............................................... 21

4.5 Encoder Development ............................................................................................... 22

4.5.1 Track-Pattern...................................................................................................... 22

4.6 Bill of Materials ........................................................................................................ 22

4.7 Requisition Sheet....................................................................................................... 22

5. Manufacturing and Assembly .......................................................................................... 23

5.1 Introduction ............................................................................................................... 23

5.1.1 Health and safety considerations ....................................................................... 23

5.2 Assembly Breakdown ............................................................................................... 24

5.3 Manufactured Components ....................................................................................... 25

5.3.1 Frame ................................................................................................................. 25

5.3.2 Cog housing ....................................................................................................... 26

5.3.3 Compass Rose .................................................................................................... 28

5.3.4 Motor position Indicator .................................................................................... 28

5.3.5 Encoder Plate Alignment Shaft .......................................................................... 29

5.3.6 Idler Gear Shaft .................................................................................................. 30

5.3.7 Output Shaft ....................................................................................................... 31

Page 4: Report

iii

5.3.8 Incremental Encoder Position Plate ................................................................... 32

5.4 Acquired Components ............................................................................................... 34

5.4.1 Motor Gear ......................................................................................................... 34

5.4.2 Drive Gear .......................................................................................................... 34

5.4.3 Idler Gear ........................................................................................................... 35

5.4.4 Optical Sensor .................................................................................................... 35

5.4.5 LED Bezel .......................................................................................................... 35

5.5 Final Assembly .......................................................................................................... 35

5.6 Exploded Part Assembley ......................................................................................... 35

5.7 Electronics and Wiring Manufacture ........................................................................ 36

5.7.1 Introduction ........................................................................................................ 36

5.7.2 Manufacturing Process....................................................................................... 36

5.7.3 Wiring Schematic............................................................................................... 37

5.8 Final Manufactured Product ...................................................................................... 37

6. Programming.................................................................................................................... 38

6.1 Introduction ............................................................................................................... 38

6.2 Programming Design Process ................................................................................... 38

6.2.1 Control Loop ...................................................................................................... 38

6.2.2 Flow Chart ......................................................................................................... 39

6.3 Programme Manufacture ........................................................................................... 40

6.3.1 Introduction ........................................................................................................ 40

6.3.2 Digital inputs ...................................................................................................... 40

6.3.3 Analogue Outputs .............................................................................................. 41

6.3.4 If and Else Statements ........................................................................................ 41

6.3.5 Input Pulse Counters .......................................................................................... 41

6.3.6 External Functions ............................................................................................. 42

Page 5: Report

iv

6.3.7 Serial Commands ............................................................................................... 42

6.3.8 While Loops ....................................................................................................... 43

7. Testing.............................................................................................................................. 44

7.1 Introduction ............................................................................................................... 44

7.2 Programme Testing ................................................................................................... 44

7.3 Tailored PWM vs Resistance Test ............................................................................ 45

7.4 Specification Conformity Testing ............................................................................. 47

8. Discussion ........................................................................................................................ 48

8.1 Manufacturing Difficulties ........................................................................................ 48

8.1.1 Material Issues ................................................................................................... 48

8.1.2 Dimensional Discrepancies of Rep Rap (3d-Printer)......................................... 50

8.1.3 Frame Bend Angle ............................................................................................. 50

8.1.4 Encoder Plate Alignment Shaft .......................................................................... 51

8.2 Programming Difficulties .......................................................................................... 51

8.2.1 Debugging .......................................................................................................... 51

8.2.2 Serial Communications ...................................................................................... 51

8.3 Instrumentation and Control Issues ........................................................................... 52

8.3.1 Encoder Resolution ............................................................................................ 52

8.3.2 Overshoot ........................................................................................................... 52

8.4 Additional Comments ............................................................................................... 53

9. Conclusion ....................................................................................................................... 54

Appendix A – Project Plan ........................................................................................................ a

Appendix B – Concept Sketches................................................................................................ a

Concept 1. .......................................................................................................................... a

Concept 2. .......................................................................................................................... b

Concept 3. .......................................................................................................................... c

Page 6: Report

v

Appendix C - Calculations ......................................................................................................... d

a. Gearing Ratio Calculations ............................................................................................. d

b. Pitch Circle Diameter and Cog Shaft Alignment Calculations ....................................... f

Appendix D – Encoder Development ........................................................................................ g

a. Encoder Orientation ........................................................................................................ g

b. Output Waveform Sequence ........................................................................................... g

c. Subsequent Input Signal Positions .................................................................................. h

d. Input Signals Relevant to Compass Rose ....................................................................... h

Appendix E – Bill of Materials ................................................................................................... i

Appendix F – Requisition Sheet ................................................................................................. j

Appendix G – Technical Drawings............................................................................................ k

Appendix H – Final Assembly ................................................................................................. cc

Appendix I – Exploded Part Assembly Model ........................................................................ dd

Appendix J – Electrical Schematic .......................................................................................... ee

Appendix K – Final Manufactured Product .............................................................................. ff

Appendix L – Flowchart ............................................................................................................ ii

Appendix M – Programme......................................................................................................... jj

a. Final Programme ............................................................................................................. jj

b. Testing Programme ........................................................................................................ rr

References .............................................................................................................................. qqq

Page 7: Report

1

1. Introduction

1.1 Project Description

The aim of this project is to design and manufacture a simple, cheap and accurate motor

position control system. To demonstrate this a wind direction analytic system will project the

8 positions of a compass rose (N, NE, E, SE, etc.) The mechanism will be powered by a DC

motor and regulated by a control element to move the motors position to the desired compass

direction. The desired angle will be set by the user and will be detected by an angle sensor. The

user will be able to control and command the mechanism either manually (by turning a turn

dial) or by using a computer interface, depending on the system. If using a computer interface,

the data from the micro-controller will be collected and displayed with the use of a computer

programme. The system will also need to adhere to European directive standards and any

additional criteria deemed necessary by the project supervisor/customer.

1.1.1 Deliverables

Completed mechanism: A working mechanism that accurately and precisely responds

to commands given by the user or computer interface.

A full working computer programme.

Safety: Full risk assessment with any safety issues addressed and precautions put in

place as per European directives and any additional criteria deemed necessary by the

project supervisor.

Full technical report.

Project logbook.

An interim design portfolio and presentation.

Final poster and presentation.

1.2 Project Scope

The completed mechanism should be simple, accurate and very user friendly. It should

demonstrate the precise, automated, position control capacities of a DC motor. The ability of

the system depends on fitness of intended purpose i.e. moving the motor to the desired compass

position commanded. The controller will be programmed using a computer code and will

process commands given to the motor in relation to the motor’s current position. The motor’s

Page 8: Report

2

location will be detected using a position sensor relevant to the motors shaft. The user will be

able to operate the device either manually, by turning a dial to the desired angle, or through

inputting information into a computer interface.

1.2.1 Design Specification

Plug and play: The device is to be easily set up, very user friendly and need little to

no previous experience to operate, interact or read data/analysis with the user

interface.

Geometry: The frame of the device should allow for easy, direct access to view all

internals of the system. The device is to be designed to sit neatly and comfortably

on a desktop.

Portability: The device should be designed to be light, compact and easily handled

so that the finished product is easily transported.

Cost: The cost of manufacturing should be <€23

Capacity: The device should not need to be run off more than 24V DC. It should

have an angle range of 360 degrees and only needs to operate clockwise.

Performance: The device should react immediately to commands, accurately

present the 8 cardinal points of a compass rose and incorporate high repeatability,

precision and durability of the system components. An unambiguous gauge display

should be included to read the angular location of the motor accurately. The data

collected from the device is to be displayed on a computer screen and should be

clearly visible, unambiguous and very comprehensible.

Basic Data Analysis: The device should collect information and provide feedback

about the motors current position.

Durability: High durability of components is necessary to allow high repeatability

of moving parts and other working components.

1.2.2 Desired Additional Features

Input commands to be received from a computerized wind direction vane for analysis

of actual wind direction.

A real time feedback/data collection feature to supply information from the device to

computer programme designed to facilitate the development graphs and another data

analysis tools to examine the trends, patterns and characteristics of wind direction.

Page 9: Report

3

1.2.3 Criteria of Excellence

The system will be tested using the following criteria:

Final level of control.

Overall accuracy and precision.

Final cost.

Clear human machine interface.

Feedback and data analysis capabilities.

1.2.4 Safety

In the interest of constructing safe working equipment in accordance with industry standards,

general engineering good practice and also trying establish an ethos of “safety first”

throughout, the European machine directive, European low voltage directive and also the

European general product safety directive were consulted via their equivalent harmonized

standards to insure conformance or exemption to the safety provisions supplied. *Note:

Compliance with harmonized standards results in automatic compliance with the respective

EU directive.

o It is stated in chapter 1, article 1.1 of DIRECTIVE 2006/42/EC OF THE EUROPEAN

PARLIAMENT AND OF THE COUNCIL of 17 May 2006 on machinery, and

amending Directive 95/16/EC (recast) that;

“The following are excluded from the scope of this Directive:

(k) Electrical and electronic products falling within the following areas, insofar as they

are covered by Council Directive 73/23/EEC of 19 February 1973 on the harmonisation

of the laws of Member States relating to electrical equipment designed for use within

certain voltage limits:

— Household appliances intended for domestic use, Audio and video equipment,

Information technology equipment, Ordinary office machinery, low-voltage switchgear

and control gear, Electric motors;” [1]

As this article exempts the product being constructed from the machine directive parameters

further research into other compulsory safety standards was under taken.

o It is stated in chapter article 1 of DIRECTIVE 2006/95/EC OF THE EUROPEAN

PARLIAMENT AND OF THE COUNCIL of 12 December 2006 on the harmonisation

Page 10: Report

4

of the laws of Member States relating to electrical equipment designed for use within

certain voltage limits that;

“For the purposes of this Directive, ‘electrical equipment’ means any equipment

designed for use with a voltage rating of between 50 and 1 000 V for alternating current

and between 75 and 1500 V for direct current, other than the equipment and phenomena

listed in Annex II.” [2]

As stated in the design specification, it is required that the device being constructed constrain

to a voltage rating of < 25 volts and therefore is exempt from the parameters of this directive.

o It is stated in chapter 1, article 2(a) of Directive 2001/95/EC of the European

Parliament and of the Council of 3 December 2001 on general product safety that

the definition of a product is as follows:

“”product" shall mean any product - including in the context of providing a service -

which is intended for consumers or likely, under reasonably foreseeable conditions, to

be used by consumers even if not intended for them, and is supplied or made available,

whether for consideration or not, in the course of a commercial activity, and whether

new, used or reconditioned.”” [3]

Although the device being designed is not intended to be a commercial product it will in fact

be used by students of the college as a DC motor control demonstration unit so therefore it falls

into compliance with the definition of a product here and thus the general product safety

directive. So, in the interest of overall safe use of the project, the working temperature will be

kept below 60ºC, This will be achieved by restricting the level of current in the circuit by

limiting the power supply. Resistors will be used where necessary and all electrical wires, along

with the motors shaft safety concealed

1.3 Justification

The design, manufacture and overall production of this project will result in a device that can

be used as a teaching aid to demonstrate the position control capabilities that are possible with

the common DC motor.

1.4 Project Plan

Please view Appendix A Figure A-1 for project plan.

Page 11: Report

5

2. Investigation

Figure 2-1 Image of a Feedback 33-100 USB mechanical servo position control unit. [4]

2.1 Background

Precision position control of a motor is a key factor incorporated into many industrial

operations such as robotic manipulators and conveyors while also lending itself to many

commercial devices such as auto focus of a digital camera and inkjet printers. [5]

Applications where accurate, precise and highly repeatable angular locations of a motor are

critical such as CNC machinery. Computer numerical control (CNC) systems such as

automated milling machines and lathes rely on co-ordinate motor position control to machine

work pieces according to exact specification input commands. [5]

High precision control is an extremely desirable characteristic for automated weapons systems

such as aircraft and anti-aircraft gun turrets with their main design ambitions geared towards

attaining rapid and precise responses to commands given. [6]

This chapter includes investigated information on the main components that make up a basic

motor position control system i.e. a motor, feedback element, and control unit.

Figure 2-2 – Basic Negative Feedback Control System

Page 12: Report

6

2.1.1 DC Motor

The brushed DC motor is a tool used to convert electricity from a direct current to mechanical

work. [7] A stationary magnet with north and south poles about a commentator repel the

opposing and systematically changing magnetic polarity of the electrically charged motor

brushes. The brushes are fixed about an axel and begin to rotate as a result of the torque

produced by the electro-magnetic field. [8]

Putting current through a coil of wire creates an electro-magnetic field with the poles of the

magnetism dependant on the direction of current passing through it [9], the brushes are

connected to an individual winding which are wound identically in the same direction about

the armature. Depending on which side of the power connector (positive/negative) the brush is

in contact with as it rotates will dictate the direction of current flowing through these windings

and therefore determine the polarity of the brushes.

The spinning rotor is connected to an output shaft which supplies accessible mechanical

energy. [8]

Figure 2-3 Concept diagram of a basic DC motor. [10]

2.1.2 Control Units/Methods

This section includes researched examples of control units and methods that can be used

individually or in combination with each other to create different types control systems.

Page 13: Report

7

1. Micro-controllers

A micro-controller is “essentially a simple computer with eyes and ears.” [11]. It is a tool used

to facilitate the communications and interactions of a computer with a dynamic physical

environment. It receives data through inputs (e.g. push buttons and sensors) and sends signals

to output hardware (e.g. motors, solenoids and digital displays). Examples of basic micro-

controllers are extremely common in everyday use i.e. printers, microwaves, alarm clocks and

anything else in a household that has buttons and a digital screen. [11]

Micro-controllers is a small embedded computer containing a CPU, RAM, ROM, EPROM and

I/O terminals and are designed to communicate with computer software (e.g. Processing,

LabVIEW, MATLAB) and output hardware straightforwardly when compared to a normal

desktop computer. This makes it possible to create complex electro-mechanical and data

analysis systems easily “For example, a microcontroller might regulate the operation of an

artificial heart or perform critical functions in an aircraft.” [12]

Arduino is a recommended choice of micro-controller platform for beginners. It would be

recommended over other physical computing platforms that facilitate a similar service of

simplified micro-controller use such as Parallax Basic Stamp and MIT's Handy board due to

the following advantages:

Relatively inexpensive compared to other microcontroller platforms.

Software isn’t limited to Windows and is compatible with several other computer

operating systems e.g. Linux and Mac.

Easily programmed due to its simple programming environment.

Official details of hardware and software is open source giving freedom to users to

build on and expand the programming language and circuit design as they progress.

Compatible with other software i.e. LabVIEW and MATLAB. [11] [13] [14]

Figure 2-4 Arduino Uno Revision 3 Embedded Computing Platform. [15]

Page 14: Report

8

2. Computer Programs - LabVIEW

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) uses virtual

instrumentation that is specifically designed to ease the taking of measurements, analysis of

data, and presentation of results. It incorporates a graphical programming language “G” which

uses a pictorial icon user interface that makes it inherently easy-to-use as opposed to text-based

languages such as java. LabVIEW is a flexible and economic alternative to standard laboratory

instrument hardware as it is software based which allows the user to modify the instruments

functionality, virtually, to cope with the corresponding task at hand. [16] [17] [18]

Figure 2-5 Example of Structure and Sub VI: (a) Front Panel, (b) Block Diagram [19]

Page 15: Report

9

3. Analogue Control

The implementation of closed-loop feedback circuit consisting of a set point potentiometer,

summing amplifier, power amplifier and a feedback potentiometer on the shaft of the motor

can be used control the position of a motor analogously. By changing the voltage at the set

point from 0v (e.g. +10v) it causes a voltage difference between it and the feedback

potentiometer (0v) of +10v at the summing amplified.

Figure 2-6 [20]

This signals to the summing amplifier to produce DC voltage that is amplified and inverted by

the power amplifier which allows current to the motor. The motor rotates clockwise with the

connecting feedback potentiometer, now providing an increasing negative feedback voltage

until an equal but opposite voltage value has been reached (-10v). At this point the voltage

difference between potentiometers is 0v again so the summing amplifier stops producing Dc

voltage and thus the motor stops.

Figure 2-7 [20]

The same is true but opposite for reversing the process. By aquiring a voltage difference via

lowering the the set point voltage the motor will rotate anticlockwise with feedback

potentionometer in pursuit of leveling the voltage variances at the summing amplifier. [20]

Page 16: Report

10

2.1.3 Angle Sensors

1. Potentiometers

A Potentiometer, also known as a rheostat or a “pot” is a small electronic component that serves

as a variable voltage divider or variable resistor subject to which and how many terminals are

being used. This facilitates the manual adjustment of resistance being applied to current in a

circuit i.e. varying (Increasing or decreasing) the value of this resistance will control the

amount of current flowing in a circuit. [21] [22]

A sliding contactor, made up of a resistive element, is controlled manually by rotating a shaft

or dial and it connects the conductive and resistive strips together and depending on its position

will affect the resistance i.e. the more material the current must pass through, the higher the

resistance offered. Commonly used in electric circuits such as audio, digital and lighting

devices to control inputs e.g. a light dimmer or volume control on the radio or the television.

If coupled with the adaptation of more terminals on the shaft the potentiometer can also be used

as an on off switch for these devices e.g. turning the light dimmer all the way down will

eventually switch the light itself completely off.

A Potentiometer can also be used as a transducer for position identification of an external

mechanism e.g. A PlayStation controller or for musical instrumentation such as mixing decks

and effects pedals.

Its disadvantages are that it has limits on the rotations possible (standard pots are limited to less

than 360 degrees and even multi turn pots are limited to a certain number of rotations) and is

susceptible to corrosion of the sliding contact especially. [22] [23] [24]

Figure 2-8 Potentiometer Internals Diagram [25]

Page 17: Report

11

2. Incremental Shaft Encoders

An encoder is an electro-mechanical device that converts linear or rotary displacement into

pulse signals. This type of encoder consists of a rotating disk, a light source, and a photo

detector (light sensor). The disk, which is mounted on the rotating shaft, has patterns of solid

and clear sectors systematically printed or cut into the disk. As the disk rotates, these patterns

dictate the light received by the photo detector, generating a digital or pulse signal output. (See

Figure 2-9).

An incremental encoder generates a pulse for each incremental step in its rotation. Although

the incremental encoder does not provide complete positioning alone, it can provide a high

resolution in the change of its displacement. To provide useful position information, the

encoder can be coupled with an external electronic counter to record each pulse. The counter

must also be referenced to a ‘home’ position of the encoder i.e. location where counter = 0.

This is generally achieved using an indexing position signal.

Higher detail patterns increase the resolution while increasing tracks will increase the

functionality of the encoder. For example, an incremental encoder with a single code track,

generates a pulse signal that can detect velocity and displacement. However, a two-channel

encoder can also detect direction by using two detectors and two code tracks offset from each

other to achieve this. [26]

Figure 2-9 – Working Principal of a Single Channel Incremental Encoder [27]

Page 18: Report

12

3. Concept Selection

3.1 Aim

To design a well displayed wind direction analytic that shows the effectiveness and potential

positional capabilities of a DC motor coupled with a controller element.

3.2 Preliminary Concept Designs

Considering the researched information presented in chapter 2, three alternative concepts were

developed to meet the requirements specified. A basic development sketch was drawn up of

the finished solution for each individual concept. Their purpose is to illustrate and define each

concepts unique features and characteristics. These sketches are used as a visual aid and

considered a key factor in the concept materialization process. Each concept will be evaluated

and one will be chosen for further development.

3.2.1 Concept 1.

Digitally operated via Arduino

The frame of the device is manufactured from Aluminium and is in the form of a simple L-

bracket to house and easily display the internals. The motors speed and direction is controlled

by a Driver IC. It receives user defined location commands from an Arduino microcontroller.

An incremental encoder is used to detect the motors position and any relevant data is displayed

on a computer interface.

Please view appendix I figure I-1 for design sketch of concept 1.

3.2.2 Concept 2.

Digitally operated via computer programme

The frame of this device is identical to the design of that in concept 1. The motors speed and

direction is also controlled by a Driver IC with all user defined location commands being

dictated solely by a LABVIEW program. An incremental encoder is used to detect the motors

position and any relevant data is displayed on a computer interface.

Please view appendix I figure I-2 for design sketch of concept 2.

Page 19: Report

13

3.2.3 Concept 3.

Analogue operated

The frame of this device is identical to the design of that in concept 1. The motors speed,

direction and location will all be operated by a series of components connected in a circuit.

User defined commands dictate the desired position and a potentiometer is used to detect the

motors position with any relevant data displayed on a computer interface. Please view appendix

I figure I-3 for design sketch of concept 3.

3.3 Concept Selection.

3.3.1 Criteria Identification

In order to create a scoring system to evaluate each concept a list of relevant criteria was

created. The needs and specification of the project were considered when identifying relevant

criteria. The following criteria were selected for the reasons outlined below.

Safety: A key aspect that should be considered in the construction of any equipment. Its

importance was weighted very heavily in the interest of the end user/consumer. Safety has been

taken very seriously through-out this project in keeping with industry standards and general

engineering good practice. Immediate safety issues that should be addressed relate to the use

of electricity which poses the biggest threat. Other prominent safety issues include the shape

of the projects frame i.e. sharp edges and corners, the weight i.e. if it falls, and the stability i.e.

will it fall. This was all considered as the main intention of the finished product is to be an

interaction device. Each concept is scored based on the likelihood and levels of possible injury

occurring Weighting: 10

Ease of Manufacture: Time is one of the most important factors in manufacturing and the

simplicity of the manufacturing processes needed will dictate what materials and

machinery/tools are to be used to manufacture it. It will also indicate the speed and level of

skill needed to produce required work pieces or if ordering in pre-manufacture parts is an

option. Each concept is scored based on the simplicity and time needed to be dedicated to the

physical manufacturing of the project, the availability of the materials needed and how easy it

is to acquire to pre-manufactured parts. Weighting: 6

Assembly Materials/Components: The simplicity and time needed to be dedicated to the

physical assembly of manufactured work pieces and components. Once again, time is a very

Page 20: Report

14

important factor in producing any product and the assembly design will determine the skill

level needed and also the speed at which assembly can be completed. The assembly design is

also very important for the manufacturing process as it can reduce the likelihood of

encountering errors with a simple design. The size, type and amount of components is also

taken into account here. Each concept should be scored on the simplicity and time needed to

be dedicated to the physical attachment of manufactured work pieces/components to one

another. Weighting: 6

Ease of Circuit Construction: As stated before, time is invaluable in industry, therefore the

less time need to construct the electronic circuit and its components without losing

effectiveness, the better. Each concept should be scored on the simplicity and time needed to

be dedicated to the wiring of the electronic components and the general construction of the

electronic circuit. Weighting: 6

Portability: As mentioned in design specification, the device should be designed to be light,

compact and easily handled so that the finished product is easily transported. This was weighted

heavily as it would defeat the purpose of such a products existence otherwise. Each concept

should be scored on weight, size, shape and overall handle-ability. Weighting: 10

Cost: The idea of an engineer is to get the job done as cheaply as possible. With this in mind

and with a budget of €23, the cost criteria has been weighted heavily respectively. Each concept

should be scored on overall cost to manufacture the product. Weighting: 10

Ease of Programming: Weighted heavily due to lack of experience encountered in this

particular sector. Each concept should be scored on the amount of coding and its level of

difficulty necessary to accomplish the desired requirements. Weighting: 8

Angle Accuracy: As mentioned in design specification, the accuracy of the angular location

of the motor should be to the degree and with great precision. For this reason the criteria was

weighted heavily as it would defeat the purpose of such a products existence otherwise.

Weighting: 10

Angle Display: The accuracy of the angular location of the motor is only as good as the display

that it’s read off of. Creating an unambiguous gauge display is paramount when designing any

measurement device and especially for one to be used in the classroom as a learning device.

Although important an accurate compass rose is easily acquired and therefore the overall

weighting for this criteria was weighting lightly. Weighting: 4

Page 21: Report

15

3.3.2 Peer Evaluation

To help eliminate designer bias towards the best selection of the above concepts, a peer

evaluation meeting was held. A group was forged of selected peers that currently or have

previously completed similar projects. Using equally qualified peers designing similar projects

was a benefit to the scoring process as the ability to fulfil the criteria via experience was a large

factor in some cases. A scoring table with weightings assigned to each individual criterion

depending on the gravity of its importance to the finished product was handed out to be filled

in (see Table 3-1). Each member allocated an individual score (1-10) respectively, depending

on how well it satisfied that criteria for each of the concepts above.

The scoring data was collected, averaged and the total of the results was calculated. The

concept with the highest overall score was chosen as the most feasible option.

3.3.3 Criteria Scoring Table

Criteria Weighting Avg. Concept 1

Avg. Concept 2

Avg. Concept 3

Safety 10 9 9 9

Ease of Manufacture 6 9 9 9

Assembly of Materials/Components 6 8 9 7

Ease of Circuit Construction 6 8 9 6

Portability 10 10 10 10

Cost (10 = cheapest) 10 9 10 8

Ease of Programmability 8 8 5 9

Angle Accuracy 10 10 10 10

Angle Display 4 4 4 1

Avg. Overall Score 610 602 578

Table 3-1 – Criteria Scoring Table

The concept chosen via peer evaluation was concept design 1. The deciding factors came down

to the overall ease of programmability of the computer interface for which concept 2 suffered

greatly due to unfamiliarity of lab VIEW amongst peers, as well this was weighted heavily due

to limited experience in this sector; Also upon the comparison of the infinite rotational

capabilities associated with a shaft encoder, to the single/multi turn limitations of a

potentiometer present in concept 3, the shaft encoder was chosen as the more suitable method

of position detection for this application.

Page 22: Report

16

4. Concept Development

4.1 Selected Concept Rework

The original design had seen the motor, face mounted, flush against the back of the aluminium

frame and held in place by a bracket. The motor shaft was to be slotted through a hole in the

face of the frame, thus exposing the shaft on the other side (see figure 4-1 below). This design

allowed the motor shaft to act as the output shaft directly which in theory seemed to be very

efficient and neat. Upon further investigation it was realised that having the motor shaft directly

controlling the output shaft would result in the short, sharp, twitchy movements of the motor

being translated directly to the pointer connected at the end of the output shaft.

It was also recognized that the motor would be rotating at a ratio of 1-1 and it would therefore

most likely be rotating in revolutions of < 1 at any time considering its application of displaying

the direction of wind. Bearing this in mind, it was decided that this set up would make it very

difficult to control the motors angle/position accuratly. The above information was relayed to

the customer/supervisor for consideration and it was declared that this area needed to be

redesigned suitably.

Figure 4-1 Original directly-mounted motor design

4.2 Final Design

A gear chain consisting of a series of interlinked cogs is to be placed between the motor and

the output shaft to lower the ratio at which the output shaft reacts to the motor (see figure 4-2

below). This solution would see the output shaft and therefore the pointer move more smoothly

upon the activation of the motor. The cogs of the gear chain would also provide a very suitable

medium to set up the encoder to measure the motors position/angle from.

Page 23: Report

17

This redesigned concept was presented to the customer/supervisor for review and approval and

was given the go ahead as a suitable solution to the problem encountered above.

Figure 4-2 – Sketch of Reworked Selected Concept

4.3 Material Analysis

4.3.1 Frame Material/Shape Analysis

The project has been designed as a desktop display unit. It will not be undergoing any great

structural stresses so materials chosen will be prioritized by cost effectiveness and ease of

machinability. In terms of strength and durability the frame of the device will only be expected

to house the internal components and to be capable of withstanding an impact from a fall from

< 1.5 metres. Considering the involvement of the Arduino PCB it would also benefit to find

the natural frequency of the frame upon impact to ensure that damage of the PCB via resonance

is avoided.

3mm Aluminium sheet metal was available to use from the college labs and would be ideal for

the frame material as it is widely used in industry as a relatively inexpensive and lightweight

metal. It is also easily machined allowing for the drilling of holes and fitting of brackets which

will save manufacturing time.

Material and structure analysis was undertaken to insure that the frame material chosen had the

required mechanical properties to fulfil specification and that its resonant frequency would not

affect the project electronics. As undertaking an overall impact test of an object falling from a

height would be extremely extensive and be far beyond the scope of this project it was proposed

Page 24: Report

18

that a simple drop test be conducted. A basic prototype model of the frame is to be constructed

from the 3mm aluminium sheet metal mentioned above and dropped several times from a

specified height. The destructive behaviour (if any) and natural frequency of the work piece is

be observed and recorded via high speed camera and accompanying software.

Figure 4-3 – High Speed Camera Image of Model Frame During Drop Test

Below is a table of results and relevant graphs taken from the drop test.

Drop Test # Orientation

Upon Landing

Velocity

(m/s)

Frequency

(Hz)

G-Force

Deceleration (G)

Damage Recorded

Drop # 1 @ 1.5 m Short Face 2 m/s 10 Hz 154.4 G None

Drop # 2 @ 1.5 m Bend

Corner/Side

2.1 m/s 16 Hz 200 G Small Surface

Blemish

Drop # 3 @1.5 m Long Face 2.1 m/s 15 Hz 154.7 G None

Table 4-1 – Drop Test Results

Figure 4-4–Velocity Time Graph of Drop 2 Figure 4-5–G Force Vs Time Graph for Drop 2

0 20 40 60 80 100 [ms]

-4

-2

0

2

[m/s] XT Diagram (drop2_C001S0001) T=0.0 ms

0 50 100 150 200 250 [ms]

-100

0

100

[g] XT Diagram (drop2_C001S0001) T=224.0 ms

Page 25: Report

19

Upon examination of the damage results above it can be said that the 3mm aluminium sheet

metal is of sufficient strength to resist the forces applied during the drop test. Considering this

and its overall machinability it can be said that it is suitable material to be used in manufacture

of the projects frame.

Upon comparison of the frequencies experienced during the drop test to that of the researched

resonant frequencies found of a PCB of similar dimensions (810 Hz) [29]. It can also be said

that it is unlikely that the material of this size and shape will resonate at a frequency that will

endanger any of the electronic components involved in the Arduino board if dropped from the

tested height.

Ethics:

Aluminium is the most abundant metal in the world and 3rd most common element in the world

therefore stocks are plentiful. Primarily mined in China and Brazil, it provides countless jobs

across these countries. Its production is a very young process that is just over a century old and

due to the heavy necessity of heating and electrical current needed in the production process,

aluminium costs is seven times more per tonne produced then that of steel. A great effort has

been untaken to make the process more environmentally friendly and reduce the energy used

in the process with a decrease from 28,000 KWh – 13,000KWh per tonne produced. Although

its production is energy taxing it boasts an extremely high recyclability rate with two thirds of

aluminium produced remaining in use. Aluminium also indirectly reduces petroleum

consumption as its most common alternative is high strength plastics. [30] [31]

Considering all the information above it was agreed that for this projects purpose’s aluminium

was a practical and ethically acceptable option thus, a comparison to alternative materials was

not necessitated.

4.3.2 3D Printer Filament Analysis

ABS (Acrylonitrile butadiene styrene) is a petroleum based thermoplastic and is the preferred

filament to use when printing parts with engineering applications in mind. This is due to its

more ductile nature when hardened which will therefore facilitate machining better than its

more brittle counterpart PLA which can splinter or sometimes crack if the proper care is not

taken. Although with PLA it is possible to create more accurate components, the inaccuracies

in the 3D printer supplied make those improvements in accuracy negligible. ABS requires a

heated under table for which to print on as it is in its nature to bend upon contact with a cold

Page 26: Report

20

surface and unfortunately the only 3D printer made available in the college labs does not have

a heated under table so therefore PLA is made the material of choice unless it is found

structurally unsound and in which case an effort will need to be made to externally source a 3d

printer with a heated bed. [32] [33]

PLA (Polylactic Acid) is a plant based thermoplastic and provided this material facilitates

general machining (drilling of holes etc.) and the use of adhesives it could potentially save a

lot of manufacturing time and overall project costs by making the option of 3D printing several

parts of the device available e.g. the cog housing, Encoder plate, Indicator and Compass Rose.

Further Research into PLA shows that it does take well to adhesives such as super glue even

when not sanded smooth. In terms of mechanical properties there seems to be a lot of deviations

in the recorded values, in particular with strength and stiffness values depending on a list of

many factors ranging from infill orientation to colour. Colour has a significant effect on both

factors with stiffness ranging from 2.77 GPa – 2.55 GPa and strength ranging from 105MPa –

54MPa [34]. As for the machinability PLA has a low thermal deformation temperature of 65°C

which could bring about warping of the work piece during machining of the material [35].

Although the information researched above indicates that PLA is averse to machining, several

online accounts showed projects involving simple machining such has drilling screw holes and

filing which is the extent of the intended machining for this material. [36] [37]

Ethics:

A commonly used biodegradable plastic made from corn starch or sugar cane as opposed to

fossil fuels. Left to its own devices it can take up 1000 years to decompose and also will release

methane, a lead contributor to global warming, if the correct methods are used it is eco-friendly

in its creation and its disposition i.e. incinerated or recycled correctly will avoid the release

toxic fumes unlike its petroleum based counterparts. Its production promotes the use of

genetically modified corn as it adds to the already massive demand for ethanol and food which

in turn has a negative effect on the environment and also human health. It also promotes 3d

printing which is 50-100 times more energy consuming the injection moulding of a part of the

same weight. 3d-printing in itself is a worry as it becomes an easily accessible manufacturing

process for the general public i.e. 3d printed weaponry. PLA is bio compatible and as a result

is a massive beneficiary for medical and surgical application. It can be degraded and absorbed

by the human body so it is possible to be used as medical plates and screws to be surgically

inserted.

Page 27: Report

21

Considering all of the above, the customer/supervisor was consulted and it decided that PLA

would be a practical and ethically acceptable material to be used for the following components:

Cog Housing – largest, most robust part after frame

Compass Rose – design intricacies would make this difficult to machine from metal.

Indicator – no machining necessary

NOTE: All other materials used in this structure were sourced from the college laboratory and

selected on the basis of availability, cost and ease of machinability.

4.4 Gear Chain Development

4.4.1 Gear Chain Design

A set a four cogs and a DC motor was scavenged from a gearing chain in a desktop CD drive.

Through a set of calculations the most practical cog combination was chosen to be used in

project gear chain (See Appendix C-a for gearing ratio calculations). The calculated gear chain

will consist of a motor cog directly coupled to a chosen output cog.

The motor cog was attached to the motor shaft and the output cog was then aligned in the

proposed calculated orientation. It was then quickly realized that the distance between the

centre holes of the cogs would not allow enough clearance for a shaft to surpass the motor. The

impedance of the motor would obstruct the depth of the rear fixture hole in the cog housing

and therefore it was decided an idler cog was to be placed in between the motor cog and output

cog. The idler cog had a greater diameter and therefore gave itself enough clearance to be fixed

without impedance from the motor. The idler cog also allows for extension of the gearing chain

while still maintaining the originally calculated gearing ratios.

4.4.2 Pitch Circle Diameter and Cog Shaft Alignment

Upon settling on a gearing chain it was of utmost importance to ensure that the shaft holes to

the cogs in the cog housing were to be positioned exactly so that the cogs would mate correctly.

Too loose, the cogs would slip and too tight, the cogs will wear. This precise mating position

is known as the pitch circle diameter (PCD). In an attempt to ensure the highest accuracy

possible the optical profile projector was used to take measurements of the cogs. These high

accuracy measurements will be used in the following calculations to determine the exact PCD

for each of the cogs. (See Appendix C-b for PCD and shaft alignment calculations)

Page 28: Report

22

4.5 Encoder Development

4.5.1 Track-Pattern

Given that there are eight possible compass rose points at exactly 45° from one another and

that each position was to be manipulated from the motor at a ratio of 2:1, it was determined

that that motor would need to turn 90° to produce a 45° movement at the motor shaft.

Therefore it can be said that the encoder plate will need four points at exact 90° about the

central axis as a result i.e. track 1. This presented a problem in that only four points could exist

on the encoder where eight positions were needed. Considering this, the addition of a second

track was introduced i.e. track 2. This track would consist of a single point offset from track 1

to detect the point of a full 360° rotation. (Please see appendix D Figure D-1 to view encoder

orientation graph).

As a result the existence of a 4:1 ratio between the encoder tracks was presented. (Please see

appendix D Figure D-2 to view output waveform sequence).

The theory is as follows,

The first four positions should be detected upon the first rotation of the encoder and

send input signals via an optical sensor

A full rotation should then be detected and send an input signal via a separate optical

sensor

The second four positions should then be detected upon the second rotation of the

encoder and send input signals via an optical sensor

Reset and Repeat upon the detection of the second full rotation.

(Please see appendix D Table D-1 to view subsequent input signal positions and Figure D-3 to

view and input signals relevant to compass rose).

4.6 Bill of Materials

(Please view Appendix E Figure E-1).

4.7 Requisition Sheet

(Please view Appendix F Figure F-1).

Page 29: Report

23

5. Manufacturing and Assembly

5.1 Introduction

The project overview and final design was presented to the supervisor/customer for review.

Upon acceptance the assembly was cleared for manufacture.

In the following sections the steps taken to manufacture the wind direction analytic will be

outlined in detail.

5.1.1 Health and safety considerations

The use of aluminium and presence of other design features in the assembly of this structure

necessitated the use of high power machine tools for cutting metal and finishing processes.

All machining processes were undertaken in the college machining laboratory under the safety

rules provided and under the supervision of the lab technician.

For the band-saw, lathe, and pillar drill, the lab technician provided training in how to safely

use and setup the machines, after which the student used them alone.

Some of the operations performed on the milling machine were more difficult demanding

extensive accuracy.

For this reason the manufacturing lab technician provided assistance on necessary operations.

This is normal practice as in industry as manual milling machines are often only used by highly

skilled fitter/turners who have completed apprenticeship training.

Page 30: Report

24

5.2 Assembly Breakdown

Figure 5-1 – Assembly Breakdown of Components

Page 31: Report

25

5.3 Manufactured Components

5.3.1 Frame

Manufacturing Process Conditions

Marking Out

Figure 5-2 - CAD Model of Frame

Mark outline on 3mm Aluminium sheet,

Mark desired position of bend as per CAD

drawings.

Mark hole positions via centre punch as per Cad

drawings

Cutting (Band-Saw) Equip: Aluminium Blade,

Clamp to rig,

Set descent speed,

Coolant on,

Adjust work piece accordingly after each cut.

De-Burring File down burrs on corners and edges,

Smooth using emery paper.

Drilling- Centre Shaft Hole (Milling Machine) Equip: 6mm Drill Bit

Set spindle speed: 1167 RPM

Drill Centre Hole

Drilling – Offset LED Hole (Milling Machine) Equip: 4.5mm Drill Bit

Set spindle speed: 1594 RPM

Drill LED Hole - 4.5mm

Bending (Manual Bender) Position component and align accordingly,

Bend to desired angle as per CAD drawing,

Remove and measure angle,

Re-bend if necessary

(Please view Appendix G figure 1 for CAD part drawing).

Page 32: Report

26

5.3.2 Cog housing

Manufacturing Process Conditions

3D-Printing (Rep-Rap)

Figure 5-3 – CAD Model of Cog Housing

Create CAD model, Convert to STL file, Select

fill, definition and tolerances, select material

(PLA), print, remove scaffolding

Drilling (Milling Machine) (Motor Shaft Hole) Equip: drill bit (2.5mm),

Work Piece Orientation: Horizontal, Step

facing up, Addition of fitted support block in

the gap to prevent bending/damage to work

piece.

Set Speed: 2653 RPM,

Zero Z-axis on work piece

Zero X-axis on work piece

Zero Y-axis on work piece

Drill motor shaft hole as specified in CAD

drawings.

Neglect counter sink of shat hole and the two

additional offset motor fixture holes (See

Discussion)

Drilling (Milling Machine) (Idler Shaft Hole) Equip: centre drill bit (2mm),

Work Piece Orientation: Horizontal, Step

facing down, Addition of fitted support block

in the gap to prevent bending/damage to

work piece.

Set Speed: 3183 RPM,

Zero Z-axis on work piece

Zero X-axis on work piece

Zero Y-axis on work piece

Drill pilot hole as specified in CAD drawings.

Equip: drill bit (6mm),

Page 33: Report

27

Set Speed: 1594 RPM,

Drill idler shaft hole as specified in CAD

drawings.

Neglect above housing fixture hole (See

Discussion)

Drilling (Milling Machine) (Output Shaft Hole) Equip: centre drill bit (2mm),

Work Piece Orientation: Horizontal, Step

facing down, Addition of fitted support block

in the gap to prevent bending/damage to

work piece.

Set Speed: 3183 RPM,

Zero Z-axis on work piece

Zero X-axis on work piece

Zero Y-axis on work piece

Drill pilot hole as specified in CAD drawings.

Equip: drill bit (4mm),

Set Speed: 1594 RPM,

Increase diameter of output shaft hole as

specified in CAD drawings.

Equip: drill bit (6mm),

Set Speed: 1167 RPM,

Increase diameter of output shaft hole on

face of work piece as specified in CAD

drawings.

Neglect below housing fixture hole (See

Discussion)

(Please view Appendix G figure 2 for CAD part drawing).

Page 34: Report

28

5.3.3 Compass Rose

Manufacturing Process Conditions

3D-Printing (Rep-Rap)

Figure 5-4 – CAD Model of Compass Rose

Create CAD assembly model, Convert to STL

file, Select fill, definition and tolerances, select

material (PLA), print, remove scaffolding

Drilling (Pillar Drill) (Motor Shaft Hole) Equip: drill bit (2.5mm),

Work Piece Orientation: Face up

Set Speed: 2653 RPM,

Line up work piece

Clamp to rig

Drill motor shaft hole as specified in CAD

drawings.

(Please view Appendix G figure 3,4,5 for CAD part drawing).

5.3.4 Motor position Indicator

Manufacturing Process Conditions

3D-Printing (Rep-Rap)

Figure 5-5 – CAD Model of Position

Indicator

Create CAD model, Convert to STL file, Select

fill, definition and tolerances, select material

(PLA), print, remove scaffolding

(Please view Appendix G figure 6 for CAD part drawing).

Page 35: Report

29

5.3.5 Encoder Plate Alignment Shaft

Manufacturing Process Conditions

Facing off (Lathe)

Figure 5-6- CAD Model of Alignment Shaft

Equip: Cutting Tool,

Set Speed: 1150 RPM ,

Face off 6mm Aluminium rod,

Zero X-axis,

Turning (Lathe) Zero Y-axis,

Incrementally turn down external diameter to

specified dimension.

Initially increments of 1mm per cut,

Finally increments of 0.2mm for the last five

cuts.

Cut length as per specification in CAD

drawing

Parting off (Lathe) Equip: Parting Tool,

Zero X-axis,

Take into account width of the tool (3mm),

Part off work piece at required length as per

CAD drawings.

De-Burring File down burrs on corners and edges,

Smooth using emery paper.

(Please view Appendix G figure 7 for CAD part drawing).

Page 36: Report

30

5.3.6 Idler Gear Shaft

Manufacturing Process Conditions

Facing off (Lathe)

Figure 5-7 – CAD Model of Idler Gear Shaft

Equip: Cutting Tool,

Set Speed: 1150 RPM ,

Face off 8mm Aluminium rod,

Zero X-axis

Turning (Lathe) Zero Y-axis,

Incrementally turn down external diameter to

specified dimension.

Initially increments of 1mm per cut,

Finally increments of 0.2mm for the last five

cuts.

Cut length as per specification in CAD

drawing

Parting off (Lathe) Equip: Parting Tool,

Zero X-axis,

Take into account width of the tool (3mm),

Part off work piece at required length as per

CAD drawings.

De-Burring File down burrs on corners and edges,

Smooth using emery paper..

(Please view Appendix G figure 8 for CAD part drawing).

Page 37: Report

31

5.3.7 Output Shaft

Manufacturing Process Conditions

Facing off (Lathe)

Figure 5-8 – CAD Model of Output Shaft

Equip: Cutting Tool,

Set Speed: 1150 RPM ,

Face off 8mm Aluminium rod,

Zero X-axis

Turning – larger Diameter Section (Lathe) Zero Y-axis,

Incrementally turn down external diameter to

specified dimension.

Initially increments of 1mm per cut,

Finally increments of 0.2mm for the last five

cuts.

Cut length as per full length of work piece

specification in CAD drawing

Turning – Smaller Diameter Step Down Section

(Lathe)

Incrementally turn down external diameter to

specified dimension.

Initially increments of 1mm per cut,

Finally increments of 0.2mm for the last five

cuts.

Cut length as per section length specification in

CAD drawing

Parting off (Lathe) Equip: Parting Tool,

Zero X-axis,

Take into account width of the tool (3mm),

Part off work piece at required length as per

CAD drawings.

De-Burring File down burrs on corners and edges,

Smooth using emery paper..

(Please view Appendix G figure 9 for CAD part drawing).

Page 38: Report

32

5.3.8 Incremental Encoder Position Plate

Manufacturing Process Conditions

Drilling (Lathe)

Figure 5-9 – CAD Model Position Plate

Equip: Tailstock drill bit (2mm),

Set Speed: 1150 RPM ,

Zero X-axis

Drill exact centre hole 20mm deep,

(See Additional Information)

Facing off (Lathe) Equip: Cutting Tool,

Set Speed: 1150 RPM ,

Face off 20mm Aluminium rod,

Zero X-axis

Parting off (Lathe) Equip: Parting Tool,

Zero X-axis,

Take into account width of the tool (3mm),

Parted off work piece at length 30mm.

(See Additional Information)

Drilling (Milling Machine) Equip: drill bit (2mm),

Work Piece Orientation: Vertical

Set Speed: 3183 RPM ,

Zero Z-axis

Zero X-axis via centre hole

Zero Y-axis via centre hole

Drill holes as specified in CAD drawings at depth

30mm (See Additional Information)

Drilling (Milling Machine) Equip: Slot-drill bit (2mm),

Work Piece Orientation: Horizontal

Set Speed: 3183 RPM ,

Zero Z-axis

Zero X-axis via Shim (for exact position)

Zero Y-axis zeroed via Shim (for exact position)

Page 39: Report

33

Drill 2mm slot as and where specified in CAD

drawing. Length of cut @ 20mm

(See Additional Information)

Turning (Lathe) Equip: Cutting Tool,

Set Speed: 1150 RPM ,

X-axis zeroed

Y-axis zeroed,

Turn down external diameter to specification

incrementally at 1mm per cut initially and finally at

0.2mm for the last 5 cuts. Cut length @ 20mm

(See Additional Information)

Parting off (Lathe) Equip: Parting Tool,

Zero X-axis,

Take into account width of the tool (3mm),

Part off work piece at required length as per CAD

drawings.

Repeat this cut twice more.

(See Additional Information)

Additional

Information

Considering the level of accuracy needed to ensure exact manipulation of the motor

position and also the time estimated to make this delicate component, it was decided

to part off are larger segment of original rod to aid gripping in the milling machine

vice. Along with this all drilled holes and slots were also increase in length to allow

for multiple components to be made at once with extras to be used as spares.

(Please view Appendix G figure 10 for CAD part drawing).

5.3.9 Output Shaft Spacer

Manufacturing Process Conditions

Cutting (Hack-Saw)

Figure 5-10 – CAD Model of Motor Gear

6mm inner diameter tubing cut to

specification as per CAD Drawings

(Please view Appendix G figure 11 for CAD part drawing).

Page 40: Report

34

5.3.10 Extruded Outer Track Pattern Piece

Manufacturing Process Conditions

Cutting (Hack-Saw)

Figure 5-11 – CAD Model of Motor Gear

Create CAD assembly model, Convert to STL

file, Select fill, definition and tolerances, select

material (PLA), print, remove scaffolding

(Please view Appendix G figure 12 for CAD part drawing).

5.4 Acquired Components

5.4.1 Motor Gear

Acquisition Process Conditions

Scavenged

Figure 5-11 – CAD Model of Motor Gear

CD-Drive

(Please view Appendix G figure 13 for CAD part drawing).

5.4.2 Drive Gear

Acquisition Process Conditions

Scavenged

Figure 5-12 – CAD Model of Drive Gear

CD Drive

(Please view Appendix G figure 14 for CAD part drawing).

Page 41: Report

35

5.4.3 Idler Gear

Acquisition Process Conditions

Scavenged

Figure 5-13– CAD Model of Idler Gear

CD Drive

(Please view Appendix G figure 15 for CAD part drawing).

5.4.4 Optical Sensor

Acquisition Process Conditions

Scavenged

Figure 5-14 – CAD Model of Optical Sensor

Electronics Laboratory

(Please view Appendix G figure 16 for CAD part drawing).

5.4.5 LED Bezel

Acquisition Process Conditions

External Purchase

Figure 5-15– CAD Model of LED Bezel

External Purchase (See Requisition Sheet)

(Please view Appendix G figure 17 for CAD part drawing).

5.5 Final Assembly

5.6 Exploded Part Assembley

(Please view appendix I figure I-1 for exploded part assembly model).

Page 42: Report

36

5.7 Electronics and Wiring Manufacture

5.7.1 Introduction

After the physical components were manufactured and assembled, it was now necessary to

construct an electrical control circuit to allow for automation of the project. The electronics

will also provide communicative information to the Arduino and allow for interactions with a

dynamic physical environment.

Given that the author had little previous experience in circuit design this was a less intuitive

aspect of the project than the mechanical design.

5.7.2 Manufacturing Process

1. Arduino

To determine how to operate the Arduino PCB properly the Arduino.cc website was consulted

where operation information and board schematics were discovered.

The Arduino is powered by USB connection and the PCB ports supply connection points for

external inputs and outputs [38]

2. Motor Control

To determine how to control the motor properly the Arduino.cc website was consulted to

provide information on the basic wiring of a motor to an Arduino.

It was discovered that an Arduino can only supply up to 50 milliamps of current which is too

low for driving most motors [38]. Upon this realization it was determined that a driver chip and

an external power supply would have to be sourced and included in the circuit design.

A 9 Volt battery was obtained to be used as the external power supply.

The chip sourced was an L293d H-Bridge motor driver chip from ST electronics. Technical

files were downloaded for the chip, and Arduino specific online tutorials were consulted to

provide information on how to properly wire the L293d driver chip to an Arduino and thus the

motor. [39]

3. Optical Sensors

To determine how to incorporate the optical sensors into the circuit the Arduino.cc website was

consulted to provide information on the wiring of external inputs.

Page 43: Report

37

The technical file for optical sensor was also downloaded for reference and it was discovered

that the current in the circuit was higher than the operating current stated. [41]

Upon this realisation it was determined that a resistor would need to be incorporated in series

for each optical sensor for safe operation.

This problem was presented to the electronics lab technician who advised the use of a 220Ω

resistors for each of the optical sensors

4. LED

To determine how to incorporate an LED into the circuit the Arduino.cc website was consulted

to provide information on the wiring of LED’s.

The technical file for LED was also downloaded for reference and it was discovered that the

current in the circuit was higher than the operating current stated. [42]

Upon this realisation it was determined that a resistor would need to be incorporated in series

with the LED for safe operation. This problem was presented to the electronics lab technician

who advised the use of a 220Ω resistor.

5. Wiring

The majority of electrical connections in this project were made using a solder-less bread board

and solid cored prototyping wire however, some of the components acquired used copper cored

wire from production. In this case the copper cored wire was connected to solid core

prototyping wire via crimped connection sleeves. This was necessary as alone copper cored

wire was too flexible to connect to the solder-less bread board.

Upon gathering sufficient information a draft circuit diagram was produced using Fritzing, a

free open source software programme for electronic prototyping and PCB design. The electrical

circuit was presented to the supervisor/customer who cleared the design for production. [43]

5.7.3 Wiring Schematic

(Please View Appendix J for Fritzing Wiring Schematic of Wind Analytic System).

5.8 Final Manufactured Product

(Please View Appendix G for Final Manufactured Product).

Page 44: Report

38

6. Programming

6.1 Introduction

The Arduino platform provides an integrated development environment (IDE) based on

Processing. The initial objective was to use this platform as the medium to programme the

system. Additionally it is desired to use MATLAB programming language for data analysis

features if time was available.

6.2 Programming Design Process

The programming process was one of the most difficult aspects of the project as the author had

no previous experience of programming microcontrollers.

Fortunately there exists extensive first and third party support for the Arduino platform in the

form of free tutorials, books and forums which were consulted extensively.

The difficultly with the project in question was that it was impossible to find any tutorials for

a similar project. This was mainly due to the incorporation of a bespoke incremental encoder

present in this project. Researched projects generally included servo motors and commercially

produced encoder set ups.

As a result the programming research took the form of examining specific elements of various

codes and tutorials that were necessary for the final programme such as

Motor control

Reading of digital inputs

Configuration of pulse counters

Application of “if and else” statements, while loops, external functions, pulse width

modulations and serial communications

Writing analogue outputs.

These aspects will be discussed in the following headings.

6.2.1 Control Loop

To achieve the desired objectives it was determined that the final programme would need to

incorporate closed loop control. Therefore the system would constantly be checking the motors

current position using a negative feedback loop via the encoder.

Page 45: Report

39

Figure 6-1– Basic System Operation Control Loop

6.2.2 Flow Chart

(Please view Appendix L Figure L-1 Programme Flowchart).

The next process used in the development of a working programme is to build a flowchart that

gives a good overall description of the system operation.

Due to the nature of the incremental encoder, its functionality is dependant of on a system of

counters and is not able to give absolute positioning.

As a result the encoder needs to be referenced to a home position i.e. North where, counter1 =

1 via an indexing program.

The outer track of the encoder has only one pattern and due to the 2:1 gearing ratio, it will be

detected twice (at North and South) by the system per revolution of the output shaft.

The indexing programme activates the motor until the outer pattern is detected. Upon detection,

the user will be asked to confirm the North location.

If the resulting position is South, the programme is to be reset and repeated. Through the

process of elimination the motor will position itself to North.

Upon North confirmation the programme will be able to execute accurate position commands

relevant to this home position.

As the motor rotates the encoder will produce a unique input signal combination for each of

the eight cardinal compass rose (See encoder pattern development section and appendix D).

The objective of the position loop programme is to bring about equilibrium between the desired

combination and the current motor position combination.

It achieves this by activating the motor and cyclying through the position combinations until

the current and desired position are equal. At this point the motor will stop.

Page 46: Report

40

6.3 Programme Manufacture

(Please view Appendix M-a for Final Programme).

6.3.1 Introduction

A functional approach was taken in the construction of the programme which was applied as

follows:

Identification of functions that the software is expected to perform

Creation of input data based on the function's specifications

Determination of output based on the function's specifications

Execution of the test case

Comparison of actual and expected outputs

Pass/Fail Comparison to functional requirements as per customer specification.

Resolve if necessary (See testing)

Below is an insight into the majority of the functions and statements that were combined

together in the construction of the programme.

6.3.2 Digital inputs

Given that the project required the use of optical sensors, it was essential that the programme

was given the ability to read the digital pulse inputs from this component. Upon consolation of

the Arduino.cc website it was discovered that digital signals are relatively simple in their

configuration this device produces signals in binary form i.e. HIGH or LOW. It was found that

it would be sufficient for the Arduino to read the value of the sensors by connecting the output

signal wire of the components to one of digitalRead input pins of the Arduino. This digital

reading could then be assigned to a variable e.g.

quadRead, NSRead

These variables were then used in a selection of functions and statements to control the motor

behaviour according to its current position.

Page 47: Report

41

6.3.3 Analogue Outputs

Similar set up to digital inputs only the signal is sent as opposed to received. In this case the

enable pin of the driver chip was connected to a specific analogWrite input pin of the Arduino

and then assigned a variable as discussed before. E.g.

on.

This variable was again used in a selection of statements and functions to control the enable

pin which in turn controlled the actuation of the motor.

Upon activation this pin will generate a steady, square wave, Duty cycle output dependant on

the specified frequency e.g.

analogWrite(motor, 85);

This is known as pulse width modulations (PWM) and in this case allows for speed control of

the motor.

6.3.4 If and Else Statements

Basic conditional statements discovered during research. They are used together and separately

in the programme to decide between two courses of action or whether to do something at a

specific point such as stopping the motor upon the detection of the desired cardinal position

e.g.

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

digitalWrite(motor, LOW);

6.3.5 Input Pulse Counters

Given the nature of the incremental encoder discussed previously, a counter system for each

track of the encoder was required to be put in place. A “pushbutton state change” tutorial was

found to be useful and a variation of this was used to create a system to detect any change in

the digital input signals (from HIGH to LOW or vice versa) e.g.

Buttonstate1, Buttonstate2,

This system also recorded how many times this state change happened e.g.

buttonPushCounter1, buttonPushCounter2.

Page 48: Report

42

Combining this with a counter reset function of specific values for each of the digital inputs

produced by the optical sensors e.g.

if (buttonPushCounter1 > 2) buttonPushCounter1 =1;

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

The basis was now formed for which the system could begin to relate a desired position to that

of its current position.

6.3.6 External Functions

Each cardinal position on the compass rose had a unique counter combination to define its

position but other than this, the code required to achieve this position was identical.

Upon consultation of relevant forums0 the division of code into external functions was

recommended for repeatable tasks

This method allows a section of code that performs a defined task to be created e.g.

void Move()

It then returns to the area of code from which the function was "called" e.g.

void loop().

6.3.7 Serial Commands

Considering the project was required to at least react to user commands input from a computer

keyboard, it was essential that the programme incorporated a human machine interface.

Upon consultation of the arduino.cc website it was found that a serial monitor window exists

in the Arduino software development environment.

Continued research discovered that a certain function will open communications between the

computer and the programme e.g.

(Serial.available() > 0)

Next the data transmission rate between the computer and the serial monitor must be set e.g.

Serial.begin(9600);

With this a variable must be constructed to allow for the serial inputs to be read but the

programme e.g.

Page 49: Report

43

ByteReceived = Serial.read();

Sufficiently in place it should would be possible to see functions called in response to signals

received from the serial monitor e.g.

if (ByteReceived == '1') // Point North

PCB1=1;

PCB2=1;

Move(); )

6.3.8 While Loops

The project required that the programme constantly checked the motor current position so that

the system was able to react instantaneously to the detection of the desired cardinal position.

Upon consultation of the arduinop.cc forum it was recommend that a while loop be used.

The while loop can be thought of as a repeating if statement that will loop continuously, and

infinitely, until the expression inside the loop becomes a specified Boolean condition (TRUE

or FALSE).

A variable was made to denote that the motor was not in the desired position e.g.

boolean moveMOTOR =false;

The position detection code was placed inside the while loop e.g.

while (!moveMOTOR)

With the result that, as the desired position or moveMOTOR, was FALSE, the motor would

rotate and continue to do so while the programme continually checked the current position of

the motor.

This loop will continue to be repeated until the desired position was detected and thus specified

as TRUE e.g.

moveMOTOR=true;

At this point the motor will stop and the programme will await the user’s next serial command.

Page 50: Report

44

7. Testing

7.1 Introduction

The following headings define the testing processes undertaken throughout this project.

7.2 Programme Testing

Assessment of the programme came in the form of functional testing which was applied as

follows:

Identify and Diagnose the Problem

Determine the Root Cause(s) of the Problem

Research and Develop Alternative Solutions

Select most Suitable Solution

Implement the Solution

Evaluate the Outcome

This was an extremely lengthy process as a substantial programme code had been produced to

achieve the desired functions specified.

To aid the designer in the testing process trouble shooting techniques were incorporated

throughout the manufacture of the programme.

This was achieved by integrating LED’s and serial monitor output prompts at critical points in

the code. E.g.

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

buttonPushCounter2++; // if the state has changed, increment the counter

digitalWrite(ledPin2,LOW); // Turn on LED every time the counter is incremented

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print(" button2 pushes: "); // Display encoder hole detection (HIGH or LOW)

Page 51: Report

45

Serial.println(buttonPushCounter2); //Display encoder hole detection count

As a result this created a feedback system through which it was possible to monitor the

programmes activities and therefore it acted as a reference platform during the debugging

process.

In relation to the detection and recording of encoder input signals, this was found to be a

particularly helpful method in the differentiation between the root of a problem to be either

physical or interfacial.

7.3 Tailored PWM vs Resistance Test

(Please view Appendix M-b for Testing Programme).

The extensive and lengthy programme test process had a negative effect on some of the less

durable mechanical components present in the device. As a result the mechanism experienced

poor mating of the cogs in the gear chain and increased frictional factors about the output shaft.

This is discussed in detail in the following section but in summary the output shaft would now

encounter different levels of resistance for each of the 8 cardinal rose positions. Consequently

the indicator would experience either sticking or overshooting depending on the level of

resistance met. In an attempt to prove that it was in fact purely slight mechanical resistances

and frictional factors preventing the smooth operation of the device, a test programme was

constructed. This programme incorporated eight specific PWM duty cycles that were tailored

to the resistance met at each position allowing sufficient motor power in each case. E.g.

if (ByteReceived == '2') // Point NE

PCB1=1;

PCB2=2;

Move2();

void Move2()

moveMOTOR=false; //motor on

analogWrite(motor, 85); // bespoke PWM tailored to resistance

Serial.println(" motor ON ");

while (!moveMOTOR) // Code identical to original code from here on

Page 52: Report

46

The objective of this test was to prove that any resistances met in transition could be overcome

given enough power from the motor and thus demonstrate that overall the project was a success.

The limitations of this programme restricted the movement of the motor to a successive routine

(i.e. North, North-East, East, South-East, etc.)

Below is a table of the test results.

Transition PWM PASS FAIL

N - NE 82

NE - E 85

E- SE 80

SE - S 80

S - SW 65

SW - W 105

W - NW 85

NW - N 85

Index (North Calibration) 92

Table 7-1 - Results from Tailored PWM vs Resistance Test

It was realised that this programme could have been adapted to cycle clockwise through each

point in a stop and start manner applying the tailored PWM’s in each case and stopping upon

the desired position. This realisation was in the latter stages of the project time frame and will

be noted in the recommendations/possible solutions.

It can be seen in the table of results above that in every case it was made possible to overcome

the resistance encountered and therefore it can be said that increased performance was possible

provided either a specialized programme based on the test programme discussed in this section

was introduced or ideally, undertaking the replacement of any faulting components.

Page 53: Report

47

7.4 Specification Conformity Testing

Below is a pass/fail examination of overall project conformity to original design specifications.

Specification Comments PASS FAIL

Plug and Play Project simply needs to be connected to a computer via the USB connection provided. Upon connection, the IDE

programme is opened, USB port and board type selected, serial monitor opened, and North position calibrated. User

is presented with instructions and can now request desired cardinal rose positions. Collected data is displayed on the

computer screen in a clear, unambiguous manner via the serial monitor.

Geometry Neat, steady desktop orientation with all internals displayed for viewing.

Portability Net weight: 405g therefore easily transported by hand.

Cost Total cost: €1.85 therefore < €23 Budget

Capacity Product runs on a combination the 3.3V produced by the PCB and the 9V external battery.

Potential Angle range of 360° with infinite rotational capabilities in the clockwise direction

Performance Mechanism responds instantaneously and has the capacity to fulfil the accuracy and precision specifications but is

held back by issues outlined in the discussion

Basic Data Analysis System collects, records and displays current position information

Durability Poor durability of the materials/components directly effecting mechanical functions and friction factors therefore

reducing repeatability of intended processes to zero. (See Discussion)

Table 7-2 - Pass/Fail Examination Table

Page 54: Report

48

8. Discussion

After the final programme was developed and any outstanding mechanical problems fixed to a

realistic degree the system performed reasonably close to expectations. Upon receiving

instruction via the human-computer interface the device the reacted and moved to the

corresponding desired position. However throughout the project a number of unforeseen

problems arose which caused significant performance constraints particularly in relation to

mechanical and frictional factors.

8.1 Manufacturing Difficulties

8.1.1 Material Issues

Wearing action on the output cog and also the decay of the PLA used in the manufacture of the

cog housing presented a great deal of problems throughout the project. In this section these

problems will be discussed.

1. Lack of Machinability

A low deformation temperature and brittle nature was experienced in preliminary attempts to

drill the PLA. Warping, cracking and melting of the material was common. A range of spindle

speeds were examined with in some cases the material liquefied and re-hardened on the drill

bit rendering the tool useless.

Solution

As a result it was decided that only compulsory holes were to be drilled i.e. shaft holes.

Therefore all fixture holes present in the original design of the cog housing were to be

neglected. In each case an engineering adhesive was to be used instead.

2. Shaft parallelism Issues

A low wear resistance of the PLA used to construct the cog housing was experienced. As

specified the output shaft was free to rotate in full contact with the PLA. During the testing

process a growing offset in the parallelism between the output and idler shaft was noticed. The

source of the problem was due to erosion present in the rear output shaft housing. As a result

the rear side of the shaft was sitting slightly lower than the front side (which is supported by

the frame metal, reducing wear).

Page 55: Report

49

Recommended Follow on Solution

The incorporation a washer made from a suitable material to surround the rotating shaft which

would decrease any erosion greatly. Alternatively the complete replacement of PLA as the cog

housing material to that of a more suitable material e.g. Aluminium.

3. Lateral Cog Misalignment

Due to the low wear resistance of PLA more erosion problems involving the output shaft were

encountered. As the output shaft was rotated it began to erode the back wall of the shaft

housing. This was most likely exaggerated due to the aid of gravity considering the declining

angle the shaft was positioned at. As the shaft wore into the PLA of the cog housing it began

to misalign the out but and idler cog respectively.

Solution

Originally the position indicator was going to be placed flat against the face of the output shaft

protruding from the face of the frame. A redesign of the indicator (seen in CAD drawings) was

developed to double up as a spacer to hold the lateral position of the output shaft in place from

the front of the device as opposed to the shaft housing at the rear of the device.

4. Post Manufacture Deformation of PLA

As a result of low deformation temperature of PLA the cog housing began to bend and misshape

slightly both during the manufacturing process and as well after. Left to sit in a small closed

area subjected to sunlight, such as a car, the PLA will continue to distort. This deformation has

a significant effect on component dimension and positioning of feature as previously discussed

Recommended Follow on Solution

The complete replacement of PLA as the cog housing material to that of a more suitable

material e.g. Aluminium

5. Wear of Output Cog

Even though the optical profile projector was used to comprehensively measure the dimension

of the cogs and relevant calculations made with these results to produce accurate pitch circle

diameters for ideal mating distances, the output shaft was seen to mate too tightly. Given the

range and magnitude of sources of error mentioned above it can be said that this misalignment

was significantly affected by the distortion of the cog housing for a variety of reason mentioned.

Page 56: Report

50

As a result the teeth of the output cog began to wear and decay, producing poor traction and

sometimes slippage in the transition of the motors position to the output shaft.

Recommended Follow on Solution

The complete replacement of PLA as the cog housing material to that of a material with more

suitable mechanical properties e.g. Aluminium

8.1.2 Dimensional Discrepancies of Rep Rap (3d-Printer)

Position dimensions of features i.e. holes, provided in CAD drawings are, in general,

referenced from an edge of the component. Therefore any feature position dimensions present

in a CAD drawing are only relevant if the component is produced as specified. Unfortunately

the Rep Rap is not capable of reproducing exact manipulations of desired components.

Deviations from specification of up to 3mm were experienced. This was a particular problem

in the production of the cog housing considering the exact positioning needed its accompanying

shafts.

Solution

A full body measurement analysis of the component was undertaken. All hole positions were

recalculated in relation to the new dimensions supplied and were drilled accordingly.

8.1.3 Frame Bend Angle

The manual bender used was limited to a bend of 90°. The required angle of bend needed in

the frame was 115°.

Solution

The frame was bent to a maximum of 90° in the manual bended. And wooden reference block

with a chamfer cut to the exact specified angle of 115° was manufactured via the band saw.

The reference block was placed inside the frame with the chamfer at the back of the frames

face. Both pieces were secured in a vice and a rubber mallet was used to initiate remaining

bend until the back face of the frame was flush with the reference block. Note: A discrepancy

of 0.5° was presented at the end of this process.

Page 57: Report

51

8.1.4 Encoder Plate Alignment Shaft

Considering the minute scale of the part and the high level of accuracy needed to ensure its

axis was concentric with that of the motor shaft, it was very difficult to manufacture this

component on the lathe. Unavoidable oscillations and bending due to naturally occurring

imbalances combined with the force of the cutting tool on the work piece resulted in decay of

the part during machining.

Solution

0.1mm increments were employed for the final 10 cuts and a parting off length of 10mm

opposed to the required 4mm was undertaken. The desired length of the work piece was

accomplished by a delicate filing process.

8.2 Programming Difficulties

As previously mentioned the author has had no programming experience prior to undertaking

this project. Naturally, this presented many obstacles in the construction of the programme

which will be discussed in the following section.

8.2.1 Debugging

Difficulties in the overall process of identification and diagnosis of problems present in the

program.

Solution

Trouble shooting techniques were incorporated throughout the manufacture of the programme.

Please review the previous programme testing section for a more detailed definition of this

process.

8.2.2 Serial Communications

As previously mentioned, research found that by applying a certain function e.g.

(Serial.available() > 0) in the Arduino development environment, typed communications

between the computer and the programme would be possible i.e. functions could be called in

response to signals received from the serial monitor. However it was discovered that the serial

monitor could only work with ASCII characters rather than raw input strings. This meant that

the Arduino programme could only receive and process single digit figures at the serial

Page 58: Report

52

monitor. Given that the initial desirable was that the user could input a position such as “NE”,

this was a problem.

Solution

Consultation of relevant programming lectures confirmed that multi character serial inputs

would be possible by linking the Arduino with a high level programming language such as

PHP or Python. Considering this it was determined that this was outside the scope of the

project. Instead, for the purpose of this project, each position was allocated a signal digit

number of 1–8 accordingly.

8.3 Instrumentation and Control Issues

8.3.1 Encoder Resolution

The accuracy of the encoder mainly depends on the resolution of the track patterns. Considering

that the track patterns were made by drilling holes, slots and attaching extrusions to the encoder

plate it can be said that although each pattern was accurately placed, they were of significant

size in relation to the diameter of the plate itself. Inevitably using a plate of this size would

always slightly negatively affect the instruments resolution given the implementation of

reasonable engineering techniques.

Solution

Ideally a servo motor would be used instead of the encoder in general but upon investigation it

was found that it was not financially feasible to afford this component. The purchase of a

commercially produced encoder set up would have also been a very accurate solution but again

financial restriction would not allow this. To evolve the current encoder system into a more

accurate one, a great increase in the diameter of the rotating plate would be the initial step.

8.3.2 Overshoot

As previously discussed tailored PWM signals could have been used to overcome frictional

factors within the system. Unfortunately as a result of using some of the higher frequency

PWM’s the motor would overshoot its intended position.

Solution:

The implementation of a PID controller would be an ideal resolution to overcome this problem.

Page 59: Report

53

Alternatively, the addition of a motor reversal code could be incorporated with the intention

that upon overshoot the motor would rotate in the reverse direction until the desired position

was detected.

8.4 Additional Comments

Follow on objectives for this project would be to incorporate the desired additional features

mentioned in the scope of this project:

The ability to receive and process input commands via Wi-Fi from a computerized wind

direction vane for analysis of actual wind direction.

A real time feedback/data collection feature to supply information from the device to a

computer programme designed to facilitate the development of graphs and another data

analysis tools to examine the nature, characteristics, trends and patterns of wind

direction.

Page 60: Report

54

9. Conclusion

Although, there were certain frictional and mechanical factors that became prominent during

the testing process, the overall workings of the mechanism proved to be a feasible and therefore

the project, overall, was completed to the desired specifications of the customer/supervisor.

The wind direction analytic produced as a result of this project now provides the mechanical

engineering department with a learning platform to teach robotic first principles, Arduino

programming and control theory.

Overall was this a constructive experience as it helped further the authors understanding of

modern engineering fundamentals. The technical skills which were involved and consequently

improved in undertaking this project are as follows:

CAD design,

Machining, metal

working, plastic moulding,

material property analysis,

electronic component design

Programming fundamentals.

The author also improved profession soft skills that have become extremely important in

present-day engineering. The professional soft skills which were involved and consequently

improved in undertaking this project are as follows:

Communicative abilities were improved in attempts to unambiguously discuss the

various problems that presented themselves.

The authors paper based communicative skills were progressed in the production of

this report in an attempt to concisely express information about the project.

The author’s compromise skills were also enhanced for the following reasons:

o Lab times had to be booked in advance with the various lab technicians.

o Waiting to be attend to by supervisor at supervisory group meetings.

o Booking to meeting with various lectures to discuss their area of expertise

relevant to the project.

The author’s skills of research were also improved greatly. Given that there wasn’t an

exact example of the project, the author had to divide up the project to research

elements into relevant segments such as possible motors, angle sensors, and

Page 61: Report

55

controllers, then determining how to combine the obtained knowledge and focus it

into productive applications.

The author’s time management abilities were greatly tested between sharing

workshop space and machines and also with pressure of meeting the plentiful,

compulsory, deadline present throughout the duration of the project.

In conclusion, considering what was learned in the process of completing this project and the

conformity of the end product to desired specifications, it can said that overall this project was

a success.

Page 62: Report

56

Table of Appendix

Appendix A – Project Plan ........................................................................................................ a

Appendix B – Concept Sketches................................................................................................ a

Concept 1. .......................................................................................................................... a

Concept 2. .......................................................................................................................... b

Concept 3. .......................................................................................................................... c

Appendix C - Calculations ......................................................................................................... d

a. Gearing Ratio Calculations ............................................................................................. d

b. Pitch Circle Diameter and Cog Shaft Alignment Calculations ....................................... f

Appendix D – Encoder Development ........................................................................................ g

a. Encoder Orientation ........................................................................................................ g

b. Output Waveform Sequence ........................................................................................... g

c. Subsequent Input Signal Positions .................................................................................. h

d. Input Signals Relevant to Compass Rose ....................................................................... h

Appendix E – Bill of Materials ................................................................................................... i

Appendix F – Requisition Sheet ................................................................................................. j

Appendix G – Technical Drawings............................................................................................ k

Appendix H – Final Assembly ................................................................................................. cc

Appendix I – Exploded Part Assembly Model ........................................................................ dd

Appendix J – Electrical Schematic .......................................................................................... ee

Appendix K – Final Manufactured Product .............................................................................. ff

Appendix L – Flowchart ............................................................................................................ ii

Appendix M – Programme......................................................................................................... jj

a. Final Programme ............................................................................................................. jj

b. Testing Programme ........................................................................................................ rr

Page 63: Report

a

Appendix A – Project Plan

Figure A-1 – MS Project Ghant Chart

Page 64: Report

a

Appendix B – Concept Sketches

Concept 1.

Figure B-1 – Design Sketch of Concept 1

Page 65: Report

b

Concept 2.

.

Figure B-2 - Design Sketch of Concept 2

Page 66: Report

c

Concept 3.

Figure B-3 - Design Sketch of Concept 3

Page 67: Report

d

Appendix C - Calculations

a. Gearing Ratio Calculations

Given that there was to be eight positions (N, NE, E, SE, Etc.) to be identified within a range

of 360° it was calculated that each position would consist of a 45° transition i.e.

360°

8= 45°

Therefore it can be said that,

45 =1

8 𝑜𝑓 360

From this the ideal gearing ratio was denoted as

1

8= 8: 1

And from this other possible ratio can be indicated as

1

2𝑛= 2𝑛: 1

A set a four cogs and a DC motor was scavenged from a gearing chain in a desktop CD drive.

Three of the cogs contain 2 rows of teeth but it was discovered that one set of teeth is not

compatible with the rest of the cogs.

The teeth of each relevant cog was counted and recorded. All possible cog orientation

combinations were determined. Using the formula below the gearing ratio for each combination

was calculated.

𝑇1

𝑇2∗

𝑇3

𝑇4= 𝐺𝑒𝑎𝑟𝑖𝑛𝑔 𝑅𝑎𝑡𝑖𝑜,

Where,

T1 = Number of Teeth on First Cog

T2 = Number of Teeth on Second Cog

T3 = Number of Teeth on Third Cog

T4 = Number of Teeth on Fourth Cog

Sample Calculation:

(MC, BC), (SC, BW) = 15

38 𝑥

15

30 =

15

76 = 76: 15 [45]

Page 68: Report

e

Cog Type teeth # Cog Combinations Calculated Fraction Ratio

Motor Cog (MC) 15 MC 1 1:1

Big Cream Cog (BC) 38 MC, BC 15/38 38:15

Small Cream Cog (SC) 15 MC , SC 1 1:1

Big White Cog (BW) 30 MC, BW 1/2 2:1

Small White Cog (SW) 15 MC, SW 1 1:1

Big Transparent Cog (BT) 45 MC, BT 1/3 3:1

(MC, BC), (SC, BW) 15/76 76:15

(MC, BC), (SC, SW) 15/38 38:15

(MC, BC), (SC, BT) 5/38 38:5

(MC, SC), (BC, BW) 1 4/15 15:19

(MC, SC),(BC, SW) 2 8/15 15:38

(MC, SC), (BC, BT) 38/45 45:38

(MC,SW),(BW,BC) 15/19 19:15

(MC,SW),(BW,SC) 2 1:2

(MC,SW),(BW,BT) 2/3 3:2

Table 0-1 – Gearing Ratio Calculations and Results

It can be concluded that the closest ratio to the ideal gearing ratio with in the specified

parameters (2n:1) is 2:1 (highlighted above).

This gearing ratio belongs to the cog combination MC, BW and therefore this is the cog

orientation that will be used in the project.

Page 69: Report

f

b. Pitch Circle Diameter and Cog Shaft Alignment Calculations

The following equation was used to calculate the PCD of relevant cogs,

𝑃𝐶𝐷 =𝑂𝐷 𝑥 𝑁

𝑁+2 [46]

Where,

OD = Outer Diameter

N = Number of Cog Teeth

Sample Calculation,

𝑃𝐶𝐷 = 8.77𝑥15

15 + 2 = 7.74𝑚𝑚

Object Being Measured Number of Teeth

OPP Outer Diameter Measurements (mm) PCD (mm) PCr (mm)

Motor Cog 15 8.77 7.74 3.87

Idler Cog 45 23.28 22.29 11.14

Output Cog 30 15.9 14.91 7.45

Table 0-2 – Pitch Circle Diameter Calculations and Results

Therefore the exact shaft distance needed between the motor cog and the idler cog is,

𝑃𝐶𝑟1 + 𝑃𝐶𝑟2 = 3.87 + 11.14 = 15.01𝑚𝑚

And the exact shaft distance needed between the idler cog and the output cog is,

𝑃𝐶𝑟2 + 𝑃𝐶𝑟3 = 11.14 + 7.45 = 18.59𝑚𝑚

Page 70: Report

g

Appendix D – Encoder Development

a. Encoder Orientation

Figure D-1 – 4 x 1 Encoder

b. Output Waveform Sequence

Figure D-2 – Encoder Output Waveform Sequence

Optical Sensors

Inner Track – Hole Pattern

Motor Shaft Hole Encoder Reference Plate

Outer Track - Hole Pattern

Outer Track

Channel

Inner Track

Channel

Page 71: Report

h

c. Subsequent Input Signal Positions

Table L-1– Subsequent Input Signal Positions

d. Input Signals Relevant to Compass Rose

Figure L-3 - Input Signals Relevant to Compass Rose [44]

Compass Position Outer Track Input Signal Inner Track Input Signal

North 1 1

North-East 1 2

East 1 3

South-East 1 4

South 2 1

South-West 2 2

West 2 3

North-West 2 4

Page 72: Report

i

Appendix E – Bill of Materials

Figure E-1 – Project Bill of Materials

Units Component Dimensions/Ratio Other Specifications Acquired

1 Sheet Metal 300 x 100 x 3 mm Aluminium College Provided

1 3D-print Filament 4200 x 3 mm (29,688 mm3) PLA College Provided

1 Metal Rod 66 x 6 mm Steel College Provided

1 Rod 10 x 6 mm Steel College Provided

1 LED 3mm Red College Provided

1 LED Bezel 3mm Ordered (see requisition Sheet)

1 Dc Motor 12 V Computer Disk Drive

(Scavenged)

2 Optical Sensor Slotted College Provided

3 Gear Chain Ratio: 1:2 3 cogs altogether, 1 Idler

cog

Computer Disk Drive

(Scavenged)

1 Washer 6mm College Provided

1 Arduino Launch Pad College Provided

1 Driver IC ST L293 College Provided

1 Battery 9V College Provided

1 Breadboard Solderless College Provided

Sundries

1 Electrical Wire 2m Solid Core College Provided

10 Connector Sleeves Crimped College Provided

1 Adhesive 5ml Super Glue College Provided

Page 73: Report

j

Appendix F – Requisition Sheet

Figure F-1 – Project Requisition Sheet

Page 74: Report

k

Appendix G – Technical Drawings

All part drawings for the final design were created using PTC Creo Parametric 2.0 Educational Edition industrial design software. The software

package was provided by the engineering school in the computer labs.

3-D models for each component were created, from which 2-D part drawings were derived.

After the individual 3-D models were created, the components were used to create a final assembly.

Page 75: Report

l

Figure G-1 - Part drawing of aluminium frame.

Page 76: Report

m

Figure G-2 - Part Drawing of Cog Housing.

Page 77: Report

n

Figure G-3 - Part Drawing of Compass Rose Cardinal Arm

Page 78: Report

o

Figure G-4 - Part Drawing of Compass Rose Intermediate Arm

Page 79: Report

p

Figure G-5 - Part Drawing of Compass Rose Assembly

Page 80: Report

q

Figure G-6 - Part Drawing of Motor Position Indicator

Page 81: Report

r

Figure G-7 - Part Drawing of Encoder Measuring plate Alignment Shaft.

Page 82: Report

s

Figure G-8 - Part Drawing of Idler Gear Shaft.

Page 83: Report

t

Figure G-9 - Part Drawing of Output Shaft

Page 84: Report

u

Figure G-10 - Part Drawing of Encoder Measuring Plate.

Page 85: Report

v

Figure G-11 - Part Drawing of Output Shaft Spacer.

Page 86: Report

w

Figure G-12 - Part Drawing of Extruded Outer Track Pattern Piece

Page 87: Report

x

Figure G-13 - Part Drawing of Motor Gear.

Page 88: Report

y

Figure G-14 - Part Drawing of Output Drive Gear.

Page 89: Report

z

Figure G-15 - Part Drawing of Idler Gear.

Page 90: Report

aa

Figure G-16 - Part Drawing of Optical Eye.

Page 91: Report

bb

Figure G-17 - Part Drawing of Rubber Bezel.

Page 92: Report

cc

Appendix H – Final Assembly

Figure H-1 – Final Assembly

Page 93: Report

dd

Appendix I – Exploded Part Assembly Model

Figure I-1 - Exploded Part Assembly Model

Page 94: Report

ee

Appendix J – Electrical Schematic

Figure J-1 – Fritzing Wiring Schematic of Wind Analytic System

Page 95: Report

ff

Appendix K – Final Manufactured Product

Figure K -1 – Rear-view Photograph

Page 96: Report

gg

Figure G-2 – Plan-view Photograph

Figure G-3 – Side-view Photograph

Page 97: Report

hh

Figure G-3 – Face on View Photograph

Page 98: Report

ii

Indexing Loop

Position Loop

Appendix L – Flowchart

Figure L-1 – Programme Flow Chart

Page 99: Report

jj

Appendix M – Programme

a. Final Programme

// this constant won't change:

#define quadRead PB_2

#define NSRead PB_3

#define on PB_0

const int buttonPin1 = PUSH2; // the pin that the pushbutton

is attached to

const int ledPin1 = GREEN_LED; // the pin that the LED is

attached to

const int buttonPin2 = PUSH1; // the pin that the pushbutton

is attached to

const int ledPin2 = BLUE_LED; // the pin that the LED is

attached to

const int motor = on;

// Variables will change:

int buttonPushCounter1 = 1; // counter for the number of

button presses

int buttonState1 = 0; // current state of the button

int lastButtonState1 = true; // previous state of the

button

int buttonPushCounter2 = 1; // counter for the number of

button presses

int buttonState2 = 0; // current state of the button

int lastButtonState2 = true; // previous state of the

button

int motorstate = 0;

Page 100: Report

kk

int lastmotorstate = 0;

int ByteReceived;

boolean moveMOTOR =false; //Flag to denote that the motor still

needs to move

int PCB1 =0;

int PCB2 =0;

void setup()

Serial.begin(9600);

Serial.println(" Type Direction in Box above, . ");

Serial.println(" Type 1 for North . ");

Serial.println(" Type 2 for North-East . ");

Serial.println(" Type 3 for East ");

Serial.println(" Type 4 for South-East. ");

Serial.println(" Type 5 for South . ");

Serial.println(" Type 6 for South-West . ");

Serial.println(" Type 7 for West, . ");

Serial.println(" Type 8 for North-West . ");

// initialize the button pin as a input:

pinMode(quadRead, INPUT);

// initialize the LED as an output:

pinMode(ledPin1, OUTPUT);

// initialize the button pin as a input:

pinMode(NSRead, INPUT);

// initialize the LED as an output:

pinMode(ledPin2, OUTPUT);

// initialize serial communication:

Page 101: Report

ll

pinMode(motor, OUTPUT);

void loop()

if (Serial.available() > 0)

ByteReceived = Serial.read();

if (ByteReceived == 'n') // Single Quote! This is a

character.

PCB1=2;

Search();

if (ByteReceived == 'o') // Single Quote! This is a

character.

digitalWrite(motor, HIGH);

Serial.println(" motor ON ");

if (ByteReceived == '1') // Point N.

PCB1=1;

PCB2=1;

Move();

if (ByteReceived == '2') // Point NE

PCB1=1;

Page 102: Report

mm

PCB2=2;

Move();

if (ByteReceived == '3') // Point E

PCB1=1;

PCB2=3;

Move();

if (ByteReceived == '4') // Point SE

PCB1=1;

PCB2=4;

Move();

if (ByteReceived == '5') // Point S

PCB1=2;

PCB2=1;

Move();

if (ByteReceived == '6') // Point SW

PCB1=2;

PCB2=2;

Move();

Page 103: Report

nn

if (ByteReceived == '7') // Point W

PCB1=2;

PCB2=3;

Move();

if (ByteReceived == '8') // Point NW

PCB1=2;

PCB2=4;

Move();

if (ByteReceived == 'x') // Single Quote! This is a

character.

digitalWrite(motor, LOW);

Serial.println(" motor OFF ");

void Move()

moveMOTOR=false; //Lets move

digitalWrite(motor, HIGH);

Serial.println(" motor ON ");

Page 104: Report

oo

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Page 105: Report

pp

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

digitalWrite(motor, LOW);

Serial.println(" motor OFF ");

void Search()

moveMOTOR=false; //Lets move

digitalWrite(motor, HIGH);

Serial.println(" motor ON ");

Serial.println(" Searching ");

Page 106: Report

qq

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

// motorstate = digitalRead(motor);

if (buttonPushCounter1 == PCB1)

moveMOTOR=true; // we are there

digitalWrite(motor, LOW);

Serial.println(" motor OFF ");

Page 107: Report

rr

Serial.println(" North? ");

buttonPushCounter1 = 1;

b. Testing Programme

#define quadRead PB_2

#define NSRead PB_3

#define on PB_0

const int buttonPin1 = PUSH2; // the pin that the pushbutton

is attached to

const int ledPin1 = GREEN_LED; // the pin that the LED is

attached to

const int buttonPin2 = PUSH1; // the pin that the pushbutton

is attached to

const int ledPin2 = BLUE_LED; // the pin that the LED is

attached to

const int motor = on;

// Variables will change:

int buttonPushCounter1 = 1; // counter for the number of

button presses

int buttonState1 = 0; // current state of the button

int lastButtonState1 = true; // previous state of the

button

int buttonPushCounter2 = 1; // counter for the number of

button presses

Page 108: Report

ss

int buttonState2 = 0; // current state of the button

int lastButtonState2 = true; // previous state of the

button

int motorstate = 0;

int lastmotorstate = 0;

int ByteReceived;

boolean moveMOTOR =false; //Flag to denote that the motor still

needs to move

int PCB1 =0;

int PCB2 =0;

void setup()

Serial.begin(9600);

Serial.println(" Type Direction in Box above, . ");

// initialize the button pin as a input:

pinMode(quadRead, INPUT);

// initialize the LED as an output:

pinMode(ledPin1, OUTPUT);

// initialize the button pin as a input:

pinMode(NSRead, INPUT);

// initialize the LED as an output:

pinMode(ledPin2, OUTPUT);

// initialize serial communication:

pinMode(motor, OUTPUT);

void loop()

Page 109: Report

tt

analogWrite (on, 0);

if (Serial.available() > 0)

ByteReceived = Serial.read();

if (ByteReceived == 'n') // Single Quote! This is a

character.

PCB1=2;

Search();

if (ByteReceived == 'o') // Single Quote! This is a

character.

digitalWrite(motor, HIGH);

Serial.println(" motor ON ");

if (ByteReceived == '1') // Point N.

PCB1=1;

PCB2=1;

Move1();

Page 110: Report

uu

if (ByteReceived == '2') // Point NE

PCB1=1;

PCB2=2;

Move2();

if (ByteReceived == '3') // Point E

PCB1=1;

PCB2=3;

Move3();

if (ByteReceived == '4') // Point SE

PCB1=1;

PCB2=4;

Move4();

if (ByteReceived == '5') // Point S

PCB1=2;

PCB2=1;

Move5();

if (ByteReceived == '6') // Point SW

Page 111: Report

vv

PCB1=2;

PCB2=2;

Move6();

if (ByteReceived == '7') // Point W

PCB1=2;

PCB2=3;

Move7();

if (ByteReceived == '8') // Point NW

PCB1=2;

PCB2=4;

Move8();

if (ByteReceived == 'x') // Single Quote! This is a

character.

digitalWrite(motor, LOW);

Serial.println(" motor OFF ");

Page 112: Report

ww

void Move()

moveMOTOR=false; //Lets move

analogWrite(motor, 85);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

Page 113: Report

xx

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

Page 114: Report

yy

void Move1()

moveMOTOR=false; //Lets move

analogWrite(motor, 82);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

Page 115: Report

zz

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

Page 116: Report

aaa

void Move2()

moveMOTOR=false; //Lets move

analogWrite(motor, 85);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

Page 117: Report

bbb

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

Page 118: Report

ccc

void Move3()

moveMOTOR=false; //Lets move

analogWrite(motor, 80);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

Page 119: Report

ddd

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

Page 120: Report

eee

void Move4()

moveMOTOR=false; //Lets move

analogWrite(motor, 80);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

Page 121: Report

fff

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Page 122: Report

ggg

Serial.println(" motor OFF ");

void Move5()

moveMOTOR=false; //Lets move

analogWrite(motor, 65);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

Page 123: Report

hhh

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

Page 124: Report

iii

analogWrite(motor, 0);

Serial.println(" motor OFF ");

void Move6()

moveMOTOR=false; //Lets move

analogWrite(motor, 105);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Page 125: Report

jjj

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 =1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

Page 126: Report

kkk

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

void Move7()

moveMOTOR=false; //Lets move

analogWrite(motor, 85);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Page 127: Report

lll

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

Page 128: Report

mmm

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

void Move8()

moveMOTOR=false; //Lets move

analogWrite(motor, 85);

Serial.println(" motor ON ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Page 129: Report

nnn

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// read the second pushbutton input pin:

buttonState2 = digitalRead(quadRead);

// compare the buttonState to its previous state

if (buttonState2 ==HIGH && lastButtonState2 ==LOW)

// if the state has changed, increment the counter

buttonPushCounter2++;

digitalWrite(ledPin2,LOW);

if (buttonPushCounter2 > 4) buttonPushCounter2 = 1;

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

lastButtonState2 = buttonState2;

// motorstate = digitalRead(motor);

Page 130: Report

ooo

if ((buttonPushCounter1 == PCB1) && (buttonPushCounter2 ==

PCB2))

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

void Search()

moveMOTOR=false; //Lets move

analogWrite(motor, 92);

Serial.println(" motor ON ");

Serial.println(" Searching ");

while (!moveMOTOR) // do until motor in right place

// read the pushbutton input pin:

buttonState1 = digitalRead(NSRead);

// compare the buttonState to its previous state

if (buttonState1 ==LOW && lastButtonState1== HIGH)

// if the state has changed, increment the counter

buttonPushCounter1++;

digitalWrite(ledPin1,LOW);

// Serial.println(" PB1 on");

if (buttonPushCounter1 > 2) buttonPushCounter1 = 1;

Page 131: Report

ppp

Serial.print("button1 pushes: ");

Serial.print(buttonPushCounter1);

Serial.print(" button2 pushes: ");

Serial.println(buttonPushCounter2);

// save the current state as the last state,

//for next time through the loop

lastButtonState1 = buttonState1;

// motorstate = digitalRead(motor);

if (buttonPushCounter1 == PCB1)

moveMOTOR=true; // we are there

analogWrite(motor, 0);

Serial.println(" motor OFF ");

Serial.println(" North? ");

buttonPushCounter1 = 1;

buttonPushCounter2 = 1;

Page 132: Report

qqq

References

[1] 09 06 2006. [Online]. Available:

http://eurlex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2006:157:0024:0086:EN:

PDF. [Accessed 16 10 2014].

[2] 27 12 2006. [Online]. Available: http://eur-

lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2006:374:0010:0019:EN:PDF.

[Accessed 16 10 2014].

[3] “legal-content,” 3 12 2001. [Online]. Available: http://eur-lex.europa.eu/legal-

content/EN/TXT/HTML/?uri=CELEX:32001L0095&from=EN. [Accessed 22 11 2014].

[4] [Online]. Available:

http://www.eem.anadolu.edu.tr/laboratuar_eng/control_systems.htm. [Accessed 16 10

2014].

[5] F. Reed, “how-servo-motors-work.html,” [Online]. Available:

http://www.jameco.com/jameco/workshop/howitworks/how-servo-motors-work.html.

[Accessed 20 10 2014].

[6] N. G. M. G. E. M. Galal, 26 05 2009. [Online]. Available:

http://www.mtc.edu.eg/asat13/pdf/ct34.pdf. [Accessed 20 10 2014].

[7] T. Bourdin, “How to Calculate DC Electric Motor Efficiency,” [Online]. Available:

http://www.ehow.com/how_7868814_calculate-dc-electric-motor-efficiency.html.

[Accessed 17 10 2014].

[8] G. Lazaridis, “How DC Motors are made and how they work,” 25 03 2010. [Online].

Available: http://www.pcbheaven.com/wikipages/How_DC_Motors_Work/. [Accessed

17 10 2014].

[9] J. Trubin, “The Founder of Electromagnetism,” [Online]. Available:

http://www.juliantrubin.com/bigten/ampereexperiments.html. [Accessed 17 10 2014].

[10

]

R. Condit, “Brushed DC Motor Fundamentals,” 26 01 2001. [Online]. Available:

http://ww1.microchip.com/downloads/en/AppNotes/00905a.pdf. [Accessed 17 10 2014].

Page 133: Report

rrr

[11

]

C. Sorrel, 15 04 2008. [Online]. Available: http://www.wired.com/2008/04/just-what-is-

an/. [Accessed 16 10 2014].

[12

]

M. Rouse, 03 2012. [Online]. Available:

http://whatis.techtarget.com/definition/microcontroller. [Accessed 16 10 2014].

[13

]

John, 26 3 2014. [Online]. Available: http://www.circuitstoday.com/story-and-history-

of-development-of-arduino#. [Accessed 16 10 2014].

[14

]

“Arduino,” [Online]. Available: http://arduino.cc/en/Guide/Introduction. [Accessed 16

10 2014].

[15

]

“/product/A000066,” [Online]. Available: http://store.arduino.cc/product/A000066.

[Accessed 20 10 2014].

[16

]

California State University Northridge, “Labview Lecture-Overview,” [Online].

Available: http://www.csun.edu/~rd436460/Labview/Lecture-Overview.pdf. [Accessed

19 10 2014].

[17

]

J. T. a. J. Kring, “Introduction to Graphical Programming with LabVIEW,” 27 10 2006.

[Online]. Available:

http://www.informit.com/articles/article.aspx?p=662895&seqNum=3. [Accessed 19 10

2014].

[18

]

National Instruments, “labview,” [Online]. Available: http://www.ni.com/labview/.

[Accessed 19 10 2014].

[19

]

N. K. P. L. Mohammad Rahman, “Introduction_to_LabVIEW,” [Online]. Available:

http://cnx.org/contents/aeec99e1-5caf-4ca2-a245-

67f8c457056d@5/Lab_1:_Introduction_to_LabVIEW. [Accessed 19 10 2014].

[20

]

T. Bartelt, “Analog Position Control,” 02 08 2007. [Online]. Available:

https://www.wisc-online.com/learn/career-clusters/stem/iau4406/analog-position-

control. [Accessed 20 10 2014].

[21

]

A. Matthew, “understanding-what-is-a-potentiometer,” [Online]. Available:

http://www.engineersgarage.com/tutorials/understanding-what-is-a-potentiometer.

[Accessed 22 11 2014].

Page 134: Report

sss

[22

]

“potentiometers,” [Online]. Available: http://www.thomasnet.com/about/potentiometers-

62355607.html. [Accessed 22 11 2014].

[23

]

“potentiometer,” 8 10 2008. [Online]. Available:

http://www.reference.com/browse/potentiometer. [Accessed 24 11 2014].

[24

]

“techpages/Pots/,” [Online]. Available: http://www.beavisaudio.com/techpages/Pots/.

[Accessed 24 11 2014].

[25

]

“wire-wound-potentiometer-reliability,” 17 05 2014. [Online]. Available:

http://resistorspecialists.com.au/wire-wound-potentiometer-reliability/. [Accessed 24 11

2014].

[26

]

[Online]. Available: https://www.pc-control.co.uk/incremental_encoders.htm.

[27

]

[Online]. Available: https://rekadayaupaya.wordpress.com/2013/06/13/.

[28

]

[Online]. Available: http://thinng.com/9109-spent-the-afternoon-breaking-some-pencils.

[Accessed 16 10 2014].

[29

]

H. N. Ö. Banu Aytekin, “Vibration Analysis of a Simply Supported PCB with a

Component,” The Scientific and Technological Research Council of Turkey - Defence

Industries Research and Development Institute, 2008.

[30

]

[Online]. Available:

http://www.scu.edu/ethics/practicing/focusareas/environmental_ethics/Aluminum.pdf.

[31

]

[Online]. Available: http://www.alueurope.eu/talat/lectures/1501.pdf.

[32

]

A. English, “http://www.protoparadigm.com/news-updates/3d-printer-filament-buyers-

guide/,” 14 06 2012. [Online]. Available: http://www.protoparadigm.com/news-

updates/3d-printer-filament-buyers-guide/. [Accessed 10 02 2015].

[33

]

L. Chilson, “/the-difference-between-abs-and-pla-for-3d-printing,” 27 01 2013. [Online].

Available: http://www.protoparadigm.com/news-updates/the-difference-between-abs-

and-pla-for-3d-printing/. [Accessed 10 02 2015].

Page 135: Report

ttt

[34

]

[Online]. Available: https://www.fictiv.com/resources/starter/pla-3d-printing-color-

comparison.

[35

]

[Online]. Available: http://www.makeitfrom.com/material-properties/Polylactic-Acid-

PLA-Polylactide/.

[36

]

I. Kelly, “machining-pla-from-reprap,” 16 02 2014. [Online]. Available:

http://www.issackelly.com/blog/2014/02/16/machining-pla-from-reprap/. [Accessed 10

02 2015].

[37

]

[Online]. Available: http://makezine.com/projects/make-34/skill-builder-finishing-and-

post-processing-your-3d-printed-objects/.

[38

]

“arduino,” [Online]. Available: http://www.arduino.cc/en/Main/ArduinoBoardUno.

[39

]

T. Instruments. [Online]. Available: http://www.ti.com/lit/ds/symlink/l293.pdf.

[40

]

“Wikipiedia,” [Online]. Available:

http://commons.wikimedia.org/wiki/File:L293D_Motor_Driver.jpg.

[41

]

[Online]. Available: http://www.omron.com/ecb/products/pdf/en-ee_sx1042.pdf.

[Accessed 27 4 2015].

[42

]

[Online]. Available: https://www.sparkfun.com/datasheets/Components/LED/COM-

00533-YSL-R531R3D-D2.pdf. [Accessed 27 04 2015].

[43

]

[Online]. Available: http://fritzing.org/home/. [Accessed 27 4 2015].

[44

]

“www.clipartbest.com,” [Online]. Available: http://www.clipartbest.com/clipart-

niXBkq8iB. [Accessed 28 4 2015].

[45

]

[Online]. Available: http://bowlesphysics.com/images/Robotics_-

_Gears_and_Gear_Ratios.pdf.

[46

]

“metrication.com,” [Online]. Available:

http://www.metrication.com/engineering/gears.html. [Accessed 30 4 2015].

Page 136: Report

uuu

[47

]

[Online]. Available: http://www.arduino.cc/en/Main/ArduinoBoardUno.