project informationpoisson.me.dal.ca/~dp_13_11/edr_final_print2.docx · web viewpcb- printed...
TRANSCRIPT
Team #11 Embodiment Design Report
MECH 4010 & 4015Design Project I
EMBODIMENT DESIGN REPORT
Magnetic Levitation Demonstration ApparatusTeam #11
Ajay PuppalaFuyuan Lin
Marlon McCombieXiaodong Wang
Submitted: November 22, 2013
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 1 of 46
Team #11 Embodiment Design Report
Table of ContentsList of Figures................................................................................................................................................4
List of Tables.................................................................................................................................................4
1. Project Information..............................................................................................................................5
1.1. Project Title..................................................................................................................................51.2. Project Customer..........................................................................................................................51.3. Group Members...........................................................................................................................51.4. Useful Definitions and Acronyms...............................................................................................5
2. Background and Context.....................................................................................................................6
2.1. Background and Overall Objective..............................................................................................62.2. Requirements...............................................................................................................................7
3. System Architecture.............................................................................................................................8
3.1. Selected Design............................................................................................................................83.2. Subsystems / Components...........................................................................................................8
4. Levitation: Electromagnet.................................................................................................................11
4.1. Component Description.............................................................................................................114.2. Component Design.....................................................................................................................114.3. Stand Design..............................................................................................................................13
5. System Feedback: Sensor..................................................................................................................14
5.1. Component Description.............................................................................................................14
6. Microcontroller Unit..........................................................................................................................15
6.1. Component Description.............................................................................................................15
7. Signal Conditioning : Control Circuit................................................................................................17
7.1. Component Description.............................................................................................................177.2. Component Design.....................................................................................................................17
8. User Interface.....................................................................................................................................20
8.1. Component Description.............................................................................................................208.2. Component Design.....................................................................................................................20
9. Testing and Verification Plan............................................................................................................22
10. Feasibility and Risk Assessment.......................................................................................................23
11. Cost Estimates & Budget...................................................................................................................24
12. Progress Report..................................................................................................................................25
13. Future Considerations........................................................................................................................26
14. Project Management Plan..................................................................................................................27
14.1. Organizational Responsibilities.................................................................................................2714.2. Work Breakdown Structure.......................................................................................................28
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 2 of 46
Team #11 Embodiment Design Report
14.3. Schedule.....................................................................................................................................3414.4. Specialized Facilities and Resources.........................................................................................36
14.4.1. Facilities..............................................................................................................................3614.4.2. Additional Advisors............................................................................................................36
15. References..........................................................................................................................................37
Appendix A Stand Design Draft Files....................................................................................................38
Appendix B Simulink block diagram for electromagnetic levitation.....................................................40
Appendix C MATLAB LED and LM35 Temperature Sensor Test Code..............................................41
Appendix D Excel Calculations for Electromagnet Design....................................................................43
Appendix E November to December Schedule.......................................................................................44
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 3 of 46
Team #11 Embodiment Design Report
List of Figures
Figure 1 Single electromagnet design with Hall Effect sensor...................................................8Figure 2 General Schematic of demonstration device.................................................................9Figure 3 Functional block diagram for the magnetic levitation apparatus................................10Figure 4 Magnetic field generated by the current carrying coil (courtesy of
superconductors.solidchem.net)..................................................................................11Figure 5 Assembled view of the stand (left) and exploded view (right)...................................13Figure 6 Picture of Hall Effect Sensor......................................................................................14Figure 7 Picture of Arduino UNO.............................................................................................15Figure 8 Electromagnetic coil driving circuit (Mekonikuv).....................................................18Figure 9 Sensor with amplifier circuit (Mekonikuv).................................................................18Figure 10 Arduino Simulink block diagram example................................................................21Figure 11 Materials used for building the prototype (left) and first build and testing
(right)..........................................................................................................................25Figure 12 General work breakdown structure.............................................................................29Figure 13 Research work breakdown structure...........................................................................30Figure 14 Product design work breakdown structure..................................................................31Figure 15 Concept evaluation breakdown...................................................................................32Figure 16 Process flow diagram..................................................................................................33
List of Tables
Table 1 Arduino UNO specification summary........................................................................16Table 2 Component and materials cost breakdown.................................................................24Table 3 Required engineering expertise...................................................................................27Table 4 Allocation of team responsibilities.............................................................................28Table 5 Summary of project tasks for fall 2013 term..............................................................34Table 6 Breakdown of remaining hours of work for the fall 2013 term..................................35Table 7 Summary of project tasks for winter 2013 term.........................................................35
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 4 of 46
Team #11 Embodiment Design Report
1. Project Information
1.1. Project TitleMagnetic Levitation Demonstration Apparatus
1.2. Project CustomerDr Robert BauerProfessorMechanical Engineering DepartmentDalhousie University
1.3. Group MembersAjay Puppala email: [email protected] Lin email: [email protected] McCombie email:[email protected] Wang email: [email protected]
1.4. Useful Definitions and AcronymsPID - Proportional Integral Derivative ControlP - Proportional ControlPI - Proportional Integra ControlGUI - Graphical User InterfacePC - Personal ComputerPPE - Personal Protective EquipmentPCB - Printed Circuit BoardMagLev - Magnetic LevitationEM - ElectromagnetMCU - Microcontroller UnitPWM - pulse width modulationI/O - Input/outputEOPD - Electro-Optical Proximity DetectorRISC - Reduced instruction set computingCMOS - Complementary metal-oxide semiconductorAVR - no meaningISCP - In-circuit serial programmingEEPROM - Electrically Erasable Programmable Read-Only MemorySRAM - Static random-access memoryDC - Direct currentAC - Alternating currentWBS - Work Breakdown Structure
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 5 of 46
Team #11 Embodiment Design Report
2. Background and Context
2.1. Background and Overall Objective
Demonstrations provide the opportunity for students to predict theoretical outcomes of real
life applications of course material which in turn allow them to confirm their initial understanding
of those same concepts. By making a prediction, students develop an expectation based on their
initial understanding of the concept. As they observe the demonstration they find out whether their
prediction is accurate. If not, the instructor can discuss any differences between their initial
understanding and what the demonstration actually shows.
Visual demonstrations help to bridge the gap between visual and verbal communication of
course material. Although diagrams may be a step further to having a better visual understanding of
a concept, a demonstration that produces live feedback vastly improves the delivery of course
material. This concept is similar to a salesman increasing the appeal of a product by showing its
many uses through infomercials; i.e. demonstrations of the basic use of a known concept (e.g.
blending with the Magic Bullet). The only difference for course material from this analogy is that
the concepts being taught are new to students and may not be initially understood from course
lectures. Consequently, demonstrations allow students an extra chance to try out their own theories
on a subject to confirm their understanding.
Thus, the scope of our project is to design and build a portable and compact device that
magnetically levitates an object to demonstrate different control design theories presented in
MECH4900 Systems II.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 6 of 46
Team #11 Embodiment Design Report
2.2. Requirements Purpose
o Build portable demonstration device
o Levitate object magnetically
o Educational tool
o Demonstrate theories presented in MECH4900(4905) Control Systems II
Visual Requirements
o Shall be viewable from a back of the classroom and/or using cameras
o Levitate object for range of 5 cm
User Convenience & Safety
o Easy to carry; i.e. lightweight
Levitating object will be approximately 30mm in diameter and weigh 10 g
Apparatus shall be no more than 1.5 kg (or about the weight of a standard
laptop)
o Easy to store
o No potential electrical risk to user
o No PPE required for operation
Power Requirements
o Conventional 120 VAC input
User Interactive Requirements
o Simulate a wide variety of control methods available in MATLAB/Simulink
o User shall interact with the device using a graphical user interface (GUI)
o Device shall be ready to operate once plugged into PC
o No additional programming shall be required
Demonstrative Requirements
o Comparison of desired, simulated, manipulated, and measured controller variables
o Nyquist plots
o Bode diagrams
o Lag, lead, lag-lead compensation techniques
o P, PI, PID control
Miscellaneous
o Shall be an active controller
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 7 of 46
Team #11 Embodiment Design Report
o Budget $1,500
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 8 of 46
Team #11 Embodiment Design Report
3. System Architecture
3.1. Selected DesignIt was decided to move forward with a single coil electromagnetic source, a Hall Effect sensor,
and an Arduino UNO for the project. This decision was made based on the basic requirements of
the project. The Arduino UNO is one of the more basic MCU models and was chosen since the
project does not require a large amount of computing power or I/O signals. A single cool
electromagnet was chosen for the design since it is more simplistic to build and test and has been
used for electromagnetic levitation before (Mekonikuv Blog, Lieberman). The Hall Effect sensor was
chosen because it is one of the more simple magnetic sensors on the market and has also been used
for magnetic levitation in the past. Additionally, all the above components were chosen because of
their low cost.
Figure 1 Single electromagnet design with Hall Effect sensor
3.2. Subsystems / Components
Figure 2 shows a general schematic of the system components needed to build a functional
magnetic levitation demonstration apparatus based on the specified requirements.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 9 of 46
Team #11 Embodiment Design Report
Figure 2 General Schematic of demonstration device
For magnetic levitation to be achieved for the purpose of demonstrating various design
techniques presented in Control Systems II, a user would need to vary a magnetic field which in
theory should vary the position of a levitating object. A varying magnetic field is most commonly
achieved by a non-permanent magnet or more specifically by using an electromagnet.
Electromagnets allows for a varying input current to be applied to them for the purpose of
manipulating a magnetic field and hence the position of a magnetically levitating object. In Figure 2,
the electromagnet is represented by the magnetic source.
It is required to use MATLAB/Simulink to design controllers for demonstration of the
different control theories presented in Systems II. The designed controllers must then be able to
control the apparatus to achieve the desired control being demonstrated; this is achieved through
the microcontroller unit. Using MATLAB/Simulink a user will be able to communicate with the
microcontroller which would then execute the desired I/O signals to perform the desired control of
the electromagnetic field. Once this communication is achieved, some form of feedback becomes
necessary to inform the designed controller of the output result of its input to the electromagnet. A
sensor will be responsible for providing this feedback. Generally, the microcontroller would be
instructed, by the user/designed controller through MATLAB/Simulink, to retrieve necessary data
from the sensor during the implementation of the control demonstration. The microcontroller then
sends this information back to MATLAB/Simulink where it is presented to the user in graphical
form.
The amount of current and voltage required to power an electromagnet (usually 12V) to
levitate a reasonably visible object is more than the amount that can be supplied by a
microcontroller unit which usually gives a maximum output voltage of 5V. Consequently, an
external power supply is required. Therefore, before any input is given to the electromagnet or any
data is retrieved from the sensor, some form of signal conditioning is required to:
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 10 of 46
Team #11 Embodiment Design Report
1. Maintain a relatively steady magnetic field
2. Sensitize system feedback
3. Protect the system and the user from electrical harm
Signal conditioning is handled by the circuitry. In order to maintain a steady magnetic field, a steady
input current must be supplied to the electromagnet. In addition, a more sensitive sensor would
produce a more sensitive feedback on the position of the levitating object. Finally, it is required to
design and build a safe-to-use apparatus; thus, it is required to have protective measures designed
into the systems signal transmission so that users are protected from electrical injury and the
apparatus is protected from electrical damage. The next figure summarizes the required
functionality of the operating device. The final design shall meet these major functionality
requirements.
Figure 3 Functional block diagram for the magnetic levitation apparatus
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 11 of 46
INPUT
Control method generated in MATLAB/Simulink
Current supplied to the magnetic coil
PROCESSExecute the control method from
MATLAB/Simulink through microcontroller
Maintain the desired position of a levitated object using position
feedback from sensor(s)
Record data from sensor(s) over a specified duration of the
demostration
OUTPUT
Position feedback of object from sensor
Graphical display of recorded data
Team #11 Embodiment Design Report
4. Levitation: Electromagnet
4.1. Component DescriptionElectromagnets is a type of magnet that can generate magnetic field when current is allowed to pass
through it (please see figure 4 below). The field induces flux on ferromagnetic material that is introduced in the
field. It is important to design an electromagnet that would meet the requirements of the project in terms of range of
levitation of the object, required flux to hold the object in place, duration of levitation, and power supply limitations.
Off the shelf electromagnets are available; however, they are designed and used for different purposes. Finding the
right one and testing it would be cumbersome. Instead, designing an electromagnet based on the required strength of
the magnetic field is suitable and most appropriate for this project.
Figure 4 Magnetic field generated by the current carrying coil (courtesy of superconductors.solidchem.net)
4.2. Component DesignThe electromagnet design is based on a few assumptions which are listed as follows:
The magnetic ball is subjected to gravitational and magnetic forces
air friction and damping effects are legible
The air gap range is assumed to be between 30 to 50mm
The electromagnet core diameter is 30mm and its length is 100mm
The number of turns in the solenoid is 1000 turns
The diameter of the levitated object is 25mm
The length of solenoid is 100mm and
The stacking factor is 0.9
Based on assumptions made on the diameter of the levitating object as well as the density of steel, it
is easy to get the volume as well as the mass of levitating objects. Air gap is an important parameter
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 12 of 46
Team #11 Embodiment Design Report
that will determine the amount of current that goes through the electromagnet and the force
required to levitate the magnetic ball. Since the air gap is assumed, the force balance on the object is
Fmagnet=Fgravity=mg=0.01kg∗9.81ms2 =0.981kg, where m is the mass of the object, g is
gravitational acceleration. Pole area is calculated as A=0.00071m2 with the magnetic force, the
magnetic field needed to levitate the object can be calculated by using the following equation:
B= 2√ 2∗μo∗FmagnetA
=2√ 2∗(4∗π∗10−7)∗0.981
0.0007=0.059wb /m2
where F is the magnetic force (N), B is the magnetic field generated by the electromagnet (T), A is
the pole area of the electromagnet (m2), and µo is the permeability of free space for air it is always
4 x 10π -7 HM-1. The calculation is to estimate the maximum magnetic field needed. Another factor is
that the magnetic field B saturated at certain value, which is approximately 1.6T. This will set a limit
on the maximum force per unit core area that the electromagnet can exert The strength of magnetic
field B can be used to calculate the flux density, Ф in the air gap ,A the surface area of magnetic core
using the equation:
Φ=BA
The magnetizing force H in the air gap can be calculated using the following equation:
H= Bμo
= 0.0594∗π∗10−7 =46997.89 AT /m
The magneto- motive force (mmf). It primarily depends on magnetizing force, H and air gap l. It is
possible to calculate the current value based on the assumption made on the air gap and number of
turns that are mounted on the magnetic core. The following is the equation used to calculate the
current,
I=mmfN
=H ×lN
=46997.89∗0.011000
=0.469 A
The current value will be used to choose the wire gage. Each gage has the maximum current that
can tolerate. It is necessary to compare the calculated current values with those limits on each gage
wire. Finally the gage 19 wire is chosen. The wire diameter for gage 19 wire is 0.912mm.The
maximum number of turns on the first layer is 109.67 calculated by dividing the length of solenoid
by the wire diameter of gage 19. The total number of layers is 10.13 calculated by total number of
turns (1000) dividing the total number of turns on the first layer and stack factor 0.9. The total
length of wire is calculated as follows: L=10.13
2∗(2∗π∗30+(10.13−1 )∗2∗0.912 )=1039.26m. the
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 13 of 46
Team #11 Embodiment Design Report
total length of wire for the cylinder is 0.9*1039.26*109.67=102574.68mm =336.53ft. Based on the
unit resistor of chosen wire, it is easy to calculate the resistance of wire is 2.71Ω.The associated
voltage is 1.27V. The heat generated is 3.45kw (Shuaibu & Adamu).
4.3. Stand DesignA suitable stand is designed to hang the electromagnet in place. The following model (figure
5) is generated using Solid Works. It is decided all of the parts will be made using light weight
wood. The cost for purchase of the raw material is considered in the budget analysis section of the
document. Workshop facilities in Dalhousie engineering department would be used for the
construction of the stand (please see section 11.4.1 for facilities available for the group). Draft files
are attached to Appendix A.
Figure 5 Assembled view of the stand (left) and exploded view (right).
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 14 of 46
Team #11 Embodiment Design Report
5. System Feedback: Sensor
5.1. Component DescriptionThe Hall Effect sensor was chosen for the project as it is a commonly used magnetic sensor
found most commonly in motor vehicles to detect the position of rotating parts. Figure 6 shows an
example of a Hall Effect sensor.
Figure 6 Picture of Hall Effect Sensor
The Hall Effect sensor is an analog position sensor that operates by generating a steady electrical
output, when excited, which can be altered to a higher state when a magnetic field is placed near its body
(Honeywell SS49 datasheet). The Hall Effect sensor output voltage intensifies with decreasing
distance between its body and a magnetic source. The Hall Effect sensor is an important component
of the apparatus as it is responsible for position sensing of the levitating object and thus, for
providing position feedback to designed controllers.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 15 of 46
Team #11 Embodiment Design Report
6. Microcontroller Unit
6.1. Component DescriptionThe selected Microcontroller for the project is the Arduino UNO (Figure 7). The Arduino UNO is
based on the ATmega328 (Arduino UNO webpage), a low-power CMOS 8-bit microcontroller based
on AVR enhanced RISC architecture. The ATmega328 is designed to optimize power consumption
versus processing speed (ATmega238 datasheet). The Arduino UNO consists of 14 digital I/O pins
(including six pins that can be used as PWM outputs), six analog inputs, a 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. Additionally, it can
be powered through USB or with an AC-to-DC adapter or battery. Unlike preceding boards, the UNO
uses Atmega16U2 programmed as a USB-to-serial. Table 1 summarizes the specifications of the
Arduino UNO board.
Figure 7 Picture of Arduino UNO.
The Arduino can be described as the hub of the magnetic levitation device and will be
responsible for controlling the power input of the electromagnet, retrieving data from the device’s
sensor, and returning the retrieved data back to MATLAB/Simulink to be plotted and displayed on a
PC. Consequently, the Arduino will be responsible for executing the function of controllers designed
in MATLAB/Simulink. For the Arduino to be controlled using MATLAB/Simulink, special I/O
integration toolboxes are needed. These toolboxes allow users to interface with and command the
Arduino using MATLAB syntax or by uploading controllers through Simulink.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 16 of 46
Team #11 Embodiment Design Report
Table 1 Arduino UNO specification summary
MCU Component Specification
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 17 of 46
Team #11 Embodiment Design Report
7. Signal Conditioning : Control Circuit
7.1. Component DescriptionNow that the processing control and sensing components of the apparatus are defined,
some form of signal conditioning is needed for the input current to the electromagnet and the
retrieval of the output voltage (data) coming from the sensor. Signal conditioning is crucial to the
manipulation of the raw I/O signals for further processing. For instance, a smooth electrical signal
is required to provide stable magnetic polarity and also a stable magnetic field strength in the
electromagnet. Additionally, it is required to amplify the electrical output of the sensor for further
use by MATLAB/Simulink for graphical display of data.
7.2. Component Design As mentioned in the description, the electromagnet requires a steady current flow through
its coils to be able to provide stable magnetic polarity and also a stable magnetic field strength.
However, current is transmitted in the form of an analog signal; thus, its signal varies or oscillates
during transmission. Consequently, a raw current signal would not be most suitable for powering
the electromagnet. Therefore, it is necessary to implement a form of signal conditioning that would
allow for a relatively steady flow of current into the electromagnet and hence a relatively steady
magnetic field strength. This conditioning can be supplemented by the use of a capacitor which is
often used in electrical circuits to smooth the output of power supplies (i.e. the power supplied by
the Arduino). In addition to this some form of switch is required to control the magnetic field
strength based on position of the levitating object (provided by the sensor). Figure 8 shows a
configuration of an electromagnet coil driving circuit that makes use of the above signal
conditioning methods (Mekonikuv).
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 18 of 46
Team #11 Embodiment Design Report
Figure 8 Electromagnetic coil driving circuit (Mekonikuv)
The driving circuit is setup to receive input from the Arduino (Digitalout3), to provide a smooth
electrical signal by use of a capacitor (C1), to switch the coil on and off with a transistor, and finally
to protect the transistor from fly-back currents using a rectifier diode (1N4001). Note that the coil
component in the coil driver circuit is the electromagnet coil.
The sensor of choice for the project was a Hall Effect sensor. On its own the Hall Effect
sensor does not produce a suitable enough feedback. For a given input voltage, when disengaged
from a magnetic field, the Hall Effect sensor produces an output voltage of about 2.48V and when
engaged, it produces an output voltage of about 4.0V. For more sensitive feedback, the sensor
output must be amplified; thus, an amplifying circuit must be built using operational amplifiers (op-
amps). The output of the sensor is connected through two op-amps which in turn is output to an
analog input pin of the Arduino. The amplifying circuit used by Mekonikuv is shown below:
Figure 9 Sensor with amplifier circuit (Mekonikuv).
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 19 of 46
Team #11 Embodiment Design Report
The output signal from the sensor is used to determine the position of the levitated object;
then, this data is used to provide feedback to the system which determines the necessary current to
be supplied to the electromagnet to maintain the levitating object at a required position. The op-
amp configuration used in
Figure 9 Sensor with amplifier circuit (Mekonikuv). subtracts approximately 1.5V at the
first op-amp stage and then amplifies by a factor of approximately 3V (Mekonikuv). Another
sensing method was also proposed by Lieberman that makes use of a differential setup of Hall
Effect sensors (two sensors fixed above and below the electromagnet) to isolates the magnetic field
of the levitating object.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 20 of 46
Team #11 Embodiment Design Report
8. User Interface
8.1. Component DescriptionThe required user interface for the project is MATLAB and Simulink. MATLAB is a high-level
programming language and interactive environment for numerical computation, visualization, and
programming (MathWorks MATLAB website). Simulink is a block diagram environment for
multidomain simulation and modZZel-based design. It supports system-level design, simulation,
automatic code generation, and continuous test and verification of embedded systems (MathWorks
website). MATLAB and Simulink are both frequently used environments for the Systems II course.
Consequently, it is a required component of this project to be able to design and demonstrate
magnetic levitation using the design theories taught in Systems II using MATLAB and/or Simulink.
The Arduino is commonly controlled using its own development environment which uses
proprietary C language; this is different from the language used in MATLAB and does not
incorporate use of block diagrams for code execution. However, it is possible to communicate with
the Arduino using MATLAB and Simulink through available Arduino support packages or
Toolboxes. MATLAB and Simulink each require a separate toolbox for the Arduino which can be
downloaded from the MathWorks website. The toolboxes are based on a server program running
on the board which listens to I/O commands arriving via serial port.
8.2. Component Design As mentioned above, Simulink is a block diagram environment. Essentially, the magnetic
levitation system can be simulated in Simulink using a block diagram specifically designed to
control magnetic levitation. Appendix B shows an example of a block diagram designed by the team
for testing.
It was designed to be complemented by a driving MATLAB script; however, for the project,
it is required to upload the designed block diagram to the Arduino for demonstration of a designed
controller. Uploading Simulink block diagrams to the Arduino is facilitated by the support toolbox
mentioned above. Figure 10 shows an example of the block diagrams made available by the
Arduino Simulink toolbox.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 21 of 46
Team #11 Embodiment Design Report
Figure 10 Arduino Simulink block diagram example
The main purpose of MATLAB is mainly for the project design to substitute Simulink block diagram
commands to test out required functions of the various components of the apparatus until more
information is acquired on how to use Simulink to achieve the desired control of the Arduino.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 22 of 46
Team #11 Embodiment Design Report
9. Testing and Verification Plan
There are a variety of different shapes of magnets that can be tested to confirm the concerns
of shape on object levitation. As mentioned above in the Feasibility section, different materials and
shapes of magnets are available for purchase; thus, tests will be conducted on as many different
shapes before making a final decision. In addition, it is possible to purchase electromagnets at local
hardware stores for testing, as opposed to purchasing wires and electromagnet core materials
separately without certainty of success. The electromagnets available for purchase come in the
form of pneumatic switches and igniters; these can be taken apart to retrieve the electromagnet
solenoid.
Given that the MCU must act as an input/output (I/O) hub, it is important to test out this basic
functionality in the simplest manner possible to verify its usefulness to the project. A common
means of testing out I/O applications is by toggling LEDs on and off to determine whether signal
transmission is possible. However, this may not be the most effective means of confirming data
retrieval from the MCU. Consequently, a viable alternative to testing data retrieval would be to
connect a simple sensor to be powered and read by the MCU; for example, a temperature sensor.
Successful execution of basic I/O tests, as mentioned, will prove that the necessary control of a
magnetic levitating device can be achieved. Toggling the on/off state of an LED is proof of concept
that the required external supply to the electromagnet can be regulated as needed. Retrieving data
from a sensor will be proof of concept that it is possible to retrieve data from a sensor. The next
step in testing and verification would be to attempt the same test mentioned above, but this time
using the MATLAB/Simulink toolboxes. Successfully accomplishing communication or control of
the MCU using MATLAB/Simulink would prove that it is possible to control the magnetic levitation
device using the chosen MCU and MATLAB/Simulink. In other words, this would fulfill part of the
necessary functional requirements of the project.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 23 of 46
Team #11 Embodiment Design Report
10. Feasibility and Risk Assessment
The concept design, single electromagnet design with the Hall Effect sensor, was selected
after evaluating all concepts. The major components of the design include the single electromagnet
levitation, spherical permanent magnet made of Neodymium, Hall Effect sensor, and Arduino
microcontroller. Almost all of the components are available in retail stores in Halifax, N.S. except
for the electromagnet which may have to be ordered custom-made or hand built according to the
magnetic field strength requirement. This concept design has the option of conducting ether
repulsion or attraction levitation depending on its position/orientation on the apparatus.
Consequently, this design provides the option of testing out both methods of electromagnetic
levitation. Testing of the device and the operating circuitry can also be a cause for concern in the
project as these components determine the feasibility of the design to meet the project’s
requirements.
In terms of availability of materials, the Hall Effect sensor and Arduino microcontroller can
be obtained from a local electronics store in Halifax called Jentronics. Permanent magnets made of
Neodymium are available at Princess Auto; however, these are disk shaped. Initial prototype and
testing phase can be carried out with the available magnet size but further research is needed to
find a spherical neodymium magnet locally; these can be purchased online. The circuit needed for
the system can be built with a prototype board, wires, and electrical components that can be bought
at Jentronics. Putting them together according to the requirement may require research into
electric circuits and guidance from Electrical advisors. Once the layout for the circuitry is
determined it can be made into a permanent circuit using a perforated prototype board or using a
custom made PCB design that can be prointed at a local PCB contract manufacturer, Sunsel Systems.
There are multiple options for the electromagnet design. Calculations in Appendix C
indicate the initial approach towards building the electromagnet. There are various limitations and
parameters that need to be determined. Off the shelf electromagnets are available; however, testing
is required to determine whether this is suitable or needs to be built based on specified calculations
for the apparatus.
A major challenge anticipated for the project is the integration of the components to achieve
functionality through input methods from MATLAB/Simulink. The group has so far successful
interfaced the microcontroller with MATLAB and Simulink. Other challenges include building a
block diagram, executing control methods from Control Systems II course syllabus, retrieving data
from the sensor, and adhering to the project requirements.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 24 of 46
Team #11 Embodiment Design Report
11. Cost Estimates & Budget
Table 2 outlines the expected project expenses. Most of the electronic components are
bought from Digi-key which is probably the cheapest supplier in market. Materials have to be
ordered through Digi-Key website, which incurs shipment and handling cost. Princess Auto and
Home Depot are local stores in Dartmouth, there is no additional shipment charges. The total
project cost is approximated $565 including taxes and shipment. Additional 10% contingency cost
is added to account for any uncertainty in cost estimation. The project cost is well within the
estimated budget of $1,500.
Table 2 Component and materials cost breakdown
Materials Unit Cost Amount Cost Supplier Part Number
ELECTRONICSArduino $30.31 2 $60.62 Digi-Key A000073
Perforated Prototype Board $15.35 1 $15.35 Digi-Key A000032
USB Cable $2.23 1 $2.23 Digi-Key 3021001-03
Hall Effect Sensor $1.00 2 $2.00 Digi-Key AH337-WGTR-ND
140 pc. Wire Kit $10.12 1 $10.12 Digi-Key 438-1049-ND
60 pc resistor kit $27.00 1 $27.00 Digi-Key RS105-ND
Potentiometer $27.40 2 $54.80 Digi-Key 5310-ND
Capacitors $0.40 5 $2.00 Digi-Key P15819CT-ND
Rectifier $0.15 5 $0.75 Digi-Key 1N4007DICT-ND
Transistor $0.55 5 $2.75 Digi-Key MPSA06-ND
Operation Amplifier $0.64 5 $3.20 Digi-Key AP358SGDICT-ND
12 V wall adaptor $77.42 1 $77.42 Digi-Key 285-2021-ND
Neodymium Magnet $4.99 1 $4.99Princess
Auto8183915
Electromagnet $12.99 3 $38.97Princess
Auto8465254
Sub Total $302.20
RAW MATERIALSKnotty Pine (2x3x6) $6.15 3 $18.45 Home Depot 228268
H. Paulin Nails $8.96 1 $8.96 Home Depot 832514
Sub Total $27.41
Billing Total $329.61
Taxes $32.96
Shipping & Handling $150.00
Total $512.5710% Contingency $563.83
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 25 of 46
Team #11 Embodiment Design Report
12. Progress Report
The group made significant progress towards building the prototype (figure 11) but there
are few more things that need to be done before completion of the prototype. The driver circuit for
signal conditioning is complete, the system feedback circuit requires soldering of lead wires to the
Hall Effect sensor and then the sensor needs to be attached to the electromagnet. A stand was
quickly made with cardboard to suspend the electromagnet. It was fastened with tape.
Figure 11 Materials used for building the prototype (left) and first build and testing (right).
Electromagnet used for the prototype is purchased from Princess Auto since the delivery of wire
required for coiling, might take more time than expected. From initial setup, electromagnet heated
up and it was expected as it acts as an inductor storing current. This might prove disastrous for
electrical components and the 12 V power supply itself.
Separately, the Arduino was successfully tested for interfacing with MATLAB and Simulink by
commanding it to blink an LED and read from a temperature sensor. However. for the Simulink test,
it was only possible to confirm the blinking of the LED; the team still needs to figure out how to
retrieve data from the sensor once the Simulink block diagram is uploaded to the Arduino. The code
used for testing is given in Appendix C. Further testing is required with the Hall Effect sensor after
the feedback circuit is built.
Apart from the prototype, a detail cost evaluation was carried out for the project. It was
found that the cost for building the device is well within the operating budget. Additionally, a 3D
model has been developed for the stand. Electrical components and other parts have to be added
for the full software model and mass analysis (see Appendix A for draft files for the stand).
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 26 of 46
Team #11 Embodiment Design Report
13. Future Considerations
Completion of the prototype is the foremost goal for the group. It is planned to test
out a full working prototype before the fall presentations. Further tests include
functionality of the drive circuit and feedback circuit and possible retrieval of data from the
system. The Fall term comes to a completion with the presentation, fall report and peer
assessments. Parts would be ordered during the break so that they would arrive when the
building phase begins in winter term.
Building phase would involve completion of Simulink block diagram to implement
the necessary control theories, designing of a GUI with Simulink/MATLAB for the user
interface, building a stand for the apparatus, and building an electromagnet using the
ordered wire or simply purchasing a suitable solenoid. Integration and testing of the
devices would follow after the building phase. The summary of all tasks and estimated
duration for completion is listed in Table 7 in the Schedule section of Project Management
Plan.
If the range of levitation is too low, the group will need to consider building a more
powerful electromagnet or adding an extra electromagnet to repel the levitated object from
the bottom to extend the range, basically switching to double electromagnet suspension
design. The cost of adding an extra electromagnet is considered in the budget. We also plan
to design the apparatus so that there is no overheating of the solenoid. Consequently, we
will need to purchase or build a solenoid that is rated at a lower current than the external
power supply.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 27 of 46
Team #11 Embodiment Design Report
14. Project Management Plan
14.1. Organizational Responsibilities
This project is a collective obligation that requires individual members to communicate,
cooperate and coordinate. In the Conceptual Design Report, a table is created to list the anticipated
engineering expertise required for project.
Table 3 Required engineering expertise
Technical Area Team Member Responsible
Level of Expertise Required
Technical Communication
Ajay PuppalaFuyuan LinXiadong WangMarlon McCombie
ExpertThis skill is important for the necessary documentation and communication required for the duration of the project
Research & Development
Ajay PuppalaFuyuan LinXiadong Wang
IntermediateDetail research must be carried out. This will help to determine the parameters necessary for levitation and component selection and testing. This expertise is important to the overall success of the project
Circuit Analysis Marlon McCombieFuyuan Lin
IntermediateA clear understanding of the function of circuit components is required for reliable and effective transfer of power and data among the components.
Microcontrollers Marlon McCombie AmateurA basic understanding of microcontrollers and programming is required to be able to test and communicate with the system components and the required GUI.
MATLAB/Simulink Controller Design
Ajay PuppalaXiadong WangMarlon McCombie
IntermediateAn intermediate level of understanding for this technical area is required for successful communication and testing between the microcontroller and the required GUI and simulation and testing of the apparatus’ ability to meet the projects main requirement for demonstration.
Apart from the technical point of view, it is also important to look at roles of individuals from a
project management point of view:
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 28 of 46
Team #11 Embodiment Design Report
Table 4 Allocation of team responsibilities
Name Title ResponsibilitiesAjay Puppala Project Manager - Division of work and duties
- Keep track of developments in the project
Marlon McCombie Chief Technology Officer - External Communication- In charge of research and application of technology required for the project
Fuyuan Lin Chief Design Specialist - Study of various design- Development of Solid Works model
Xiadong Wang Chief Financial Officer - Development of Budget- Study ways to cut costs and optimize design.
The roles are designated above are only nominal. It is expected by individuals to contribute in other
areas where the work is required.
14.2. Work Breakdown Structure
The design cycle for the project mainly consists of research, product design, development,
and testing. Figure 12 maps the first level of the work breakdown structure (WBS). A 3 level WBS is
adopted in the project management which is explained in the subsequent pages. Apart from the
regular product development, budget for material purchase for development prototype acts as a
constraining factor for the selection and implementation of concepts generated during the design
generation stage. Documentation that needs to be completed during the project is also listed in the
following Figure.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 29 of 46
Team #11 Embodiment Design Report
Figure 12 General work breakdown structure
The subsections are further divided with an effort to get good insight and understand the
specifics of each element. This is the level 2 of the WBS. The research phase of the project comprises
determination of requirements, division into focus groups, and survey of literature using different
techniques, and summary and analysis of the findings. Figure 13 explains what should be done for
each of the subsections. For example, the requirements should consider the purpose of the project,
visual requirements, power and demonstrative requirements.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 30 of 46
Magnetic Levitation System
1. Research
1.1 Requirements
1.2 Focus Groups
1.3 Survey
1.4Research Analysis
1.5Findings & Evaluation
2. Product Design
2.1 Concept
Generation
2.2 Concept Evalution
2.3 Concept Selection
2.4 Feasibility
Analysis
2.5 Method of
Testing
3. Product Developement
3.1 Calculations & Solid Works
Model
3.2 List of Materials
3.3 Prototype
3.4Prototype
Testing
3.5Design Verification
& Improvements
4. Financial Management
4.1 Bill of
Materials
4.2 Budget Analysis
5. Documentation
5.1 Requirements
Document
5.2 Conceptual
Report
5.3 Embodiment Report
5.4 Interim
Presentations
5.5 Web Page
5.6Term Report
Team #11 Embodiment Design Report
Figure 13 Research work breakdown structure
Similar to the research section, the product design is also divided into specific categories
that might help to conduct and optimize the design selection process.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 31 of 46
1. Research
1.1 Requirements
1.1.1 Purpose
1.1.2 Visual Requirements
1.1.3 User Convenience &
Safety
1.1.4 Power Requirements
1.1.5 Interactive
Rrequirements
1.1.6 Demonstrative Requirements
1.2 Focus Groups
1.2.1 Magnetic Levitation
1.2.2 Levitated Object
1.2.3 Sensors
1.2.4 Microcontroller
1.2.5 Circuitory
1.3 Survey
1.3.1 Journals &
Publications
1.3.2 Vendor Sites &
Catalogues
1.3.3 Databases
1.3.4 MECH 4900
Textbooks & Lecture Notes
1.4Research Analysis
1.5Findings & Evaluation
Team #11 Embodiment Design Report
Figure 14 Product design work breakdown structure
Each component in the concept evaluation section can be further broken down to get a good
understanding of the criteria for evaluating designs generated in the 2.1 section. Careful evaluation
of each one of these criteria is necessary to select appropriate design for the project. This was
already done in the concept selection report.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 32 of 46
2. Prodcut Design
2.1 Concept Generation
2.1.1 Electromagnetic
Suspension
2.1.2Electrodynamic
Replusion
2.1.3Vertical Maglev
Track
2.1.4Toroidal
Electromagnetic Track
2.2 Concept Evalution
2.2.1 Basic Requirements
2.2.2Parts Requirements
2.2.3Design Assessment
2.2.4Cost Assessment
2.3 Concept Selection 2.4 Feasibility Analysis
2.4.1 Avaliability of Materials
2.4.2 Supporting Calculations
2.4.3 Challenges
2.5 Method of Testing
2.5.1 Levitation
2.5.2 Sensor
2.5.3 Matlab/Simulink
2.5.4 MCU
Team #11 Embodiment Design Report
Figure 15 Concept evaluation breakdown
The structure helps to identify the steps involved in the design selection and development
process. It indicates the sequence of steps required for proper completion of the project for this
term. A spiral design method is adopted for the development. The documentation and budgetary
input are also incorporated into the flow chart. This method can also be adopted for the next term
as well.
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 33 of 46
2.2 Concept Evaluation
2.2.1 Basic Requirements
2.2.1.1 Viewability &
Stability
2.2.1.2Portablility
2.2.1.3Simulink
& GUI
2.2.1.4 Implementation of
Control Design Theories
2.2.2 Parts Requirements
2.2.2.1Electromagnet
2.2.2.2Sensor
Effectiveness
2.2.2.3MCU
2.2.2.4Displacement of Levitating Object
2.2.2.5 Frame Support
2.2.3 Design Assessment
2.2.3.1 Design Complexity
2.2.3.2 Ease to Build
2.2.3.3 Holistic Judgement
2.2.4 Cost Assessment
2.2.4.1Cost of wiring for
electromagnet
2.2.4.2 Cost of sensor
2.2.4.3 Cost of
microprocessor
2.2.4.4 Cost of frame
2.2.4.5 Cost of circuitory
Figure 16 Process flow diagram
14.3. Schedule
The following schedule is generated based on the WBS from the last section. Most of the
work for this term is almost completed with exception to the interim presentation and the fall
report. The schedule clearly indicates the team is making good progress meeting all the outcomes
within the due time. The calendar version of the task list which the group follows is attached to the
Appendix E. The next major objective for the group is to complete the prototype by 28 th November,
2013.
Table 5 Summary of project tasks for fall 2013 term
Task Name Duration
Start Finish Responsibility% Work Completed
Preliminary Research 6 days 9/25/13 10/2/13 Individual Effort 100%Group organization & house keeping
3 days 9/26/13 9/29/13 Group Effort 100%
Focus Groups for Subsystems
7 days 9/30/13 10/8/13
Electromagnetic Theory & Calculations - Fuyuan & Xiadong,Microcontroller & Circuitry - Marlon,Design & Sensors - Ajay
100%
Scope/Requirements 4 days10/15/13
10/18/13
Marlon & Ajay 100%
Analysis Review Pannel Inputs
1 day10/20/13
10/20/13
Group 100%
Summary of Findings of Focus Groups
2 days10/20/13
10/21/13
Individual 100%
Concept Generation and Selection
3 days10/24/13
10/27/13
Group 100%
Theory Evaluation and Calculations
3 days10/31/13
11/4/13 Fuyuan & Xiadong 100%
Conceptual Design Report
3 days 11/5/13 11/7/13 Marlon & Ajay 100%
Solid Works Model 1 day11/20/13
11/20/13
Fuyuan & Xiadong 100%
List of Materials required for Prototype
1 day11/20/13
11/20/13
Group 100%
Material Collection 5 days 11/4/13 11/8/13 Ajay 100%
Embodiment Report 3 days11/20/13
11/22/13
Group Effort 100%
Prototype Building 14 days11/10/13
11/27/13
Marlon & Ajay 60%
Prototype Testing 4 days11/24/13
11/27/13
Marlon 35%
Interim Presentation 5 days11/24/13
11/28/13
Group Effort 0%
Fall Design Report 5 days 11/27/1 12/3/13 Group Effort 0%
Team #11 Embodiment Design Report
3
Purchase Parts 1 day12/10/13
12/11/13
Group 85%
Next table in the section indicates the required number hours from individual team
members and as group to finish the remaining tasks left for this term.
Table 6 Breakdown of remaining hours of work for the fall 2013 term
Team Member Name Major Responsibility Hours of Work RequiredMarlon McCombie Prototype Testing
Interim Presentation12
Ajay Puppala Matlab SimulinkWebsite
10
Fuyuan Lin Solid Works ModelingFinal Report
10
Xiadong Wang Solid Works ModelingBudget Analysis
11
Total Hours of Work Required 43
Supervisor meetings and interim presentations would increase the total number of hours required
to approximately 50 hrs. There is only two weeks left for school. This requires the group to put in
extra work in the evenings and weekends to complete the project to the desired level.
The following table estimates the time it takes to complete tasks in the winter 2014 term. It
also indicates the percentage of work completed for each task. A value higher than zero suggests
that work from fall term can be used directly towards completion of the tasks in the winter term.
Table 7 Summary of project tasks for winter 2013 term
Task Name Duration Finish Responsibility% Work Completed
Gather Parts 2 days 1st week January Marlon & Ajay 15%Review Fall Report 1 day 1st week January Group task 0%Building PhasePrototype Testing 3 days 1st -2nd week January Marlon & Xiadong 30%Complete Simulink Block Diagram
7 days 2nd -3rd week January Fuyuan & Ajay 25%
Implement Control Theories 4 days 3rd week January Group 0%Build GUI using Simulink 4 days 4th week January Fuyuan & Ajay 0%Build Stand & Electromagnet 3 days 4th week January Xiadong 5%Rebuild circuitry 1 day 4th week January Marlon 45%System Integration 5 days 2nd week February Group task 0%Testing PhaseSet up System in Lab 3 days 2nd week February Group task 0%Testing system 15 days 3rd– 4th wk. February Group task 0%Collect and Sample data 10 days 1st -3rd week March Scheduling 0%Test completion 2 days 4th week March Marlon & Ajay 0%
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 36 of 46
Team #11 Embodiment Design Report
DeliverablesBuild Report 4 days February Group task 20%Website 2 days 1st week April Ajay 15%Final Report 4 days 1st week April Group task 15%Final Presentations 2 days 1st week April Group task 10%
14.4. Specialized Facilities and Resources
14.4.1. Facilities
The following is a list of facilities that are required for the project duration and a short
description for their necessity:
Design workbench
o For testing prototype apparatus and for storing materials and components
to allow easy access by team members
Measurements Laboratory (C255)
o For testing EM with varying current input using an bench power supply;
especially in the unlikely case that the currents needed for levitation are
potentially dangerous
Machine Shop/Carpentry Shop
o For fabricating a suitable chassis for the final apparatus
14.4.2. Additional Advisors
Name: Dr. Ya-Jun PanPosition: Professor, Mechanical Dept.Email: [email protected]
Name: Dr. Timothy LittlePosition: Professor, Electrical Dept. Email: [email protected]
Name: Jonathan MacDonaldPosition: Electrical Technician, Mechanical Dept.Email: [email protected]
Name: Angus MacPhersonPosition: Mechanical Technician, Mechanical Dept. Email: [email protected]
Name: Corey MacNeilPosition: Automation Specialist, Jentronics Ltd.Email: [email protected]
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 37 of 46
Team #11 Embodiment Design Report
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 38 of 46
Team #11 Embodiment Design Report
15. References
Brandt, E. H. "Levitation in Physics." N.p., 20 Jan. 1989. Web. 28 Oct. 2013.]
"Electronic Components Distributor | DigiKey Corp. | CA Home Page. N.p., n.d. Sat. 03 Nov. 2013
“LEGO Mindstorms Online Store.” http://shop.lego.com/en-CA/LEGO-MINDSTORMS-NXT-2-0-
8547. Retrieved November 6, 2013
“Liquidware Online Store” http://www.liquidware.com/shop/show/ARD-UNO/. Retrieved
November 6, 2013
"RobotShop : The World's Leading Robot Store." RobotShop. N.p., n.d. Sat. 03 Nov. 2013
Thompson, Marc T. "Eddy Current Magnetic Levitation: Models and Experiments." IEEE. N.p., 200.
Web. 28 Oct. 2013.
Williams, Lance. "Electromagnetic Levitation Thesis." N.p., 2005. Web. 28 Oct. 2013.
Shuaibu, D. S. S. & Adamu, S. S., “Design, Development and Testing of an Electromagnet for magnetic
levitation system”, Nigeria, Publication date unknown
“MathWorks MATLAB/Simulink website.” http://www.mathworks.com/products/simulink/. Retrieved
November 20, 2013
Lieberman, J. 2005, “Magnetic levitation project.” http://bea.st/sight/levitation/. Retrieved
November 20, 2013
Mikonikuv Blog, “Arduino Magnet Levitation – detailed description.”
http://mekonik.wordpress.com/2009/03/17/arduino-magnet-levitation/. Retrieved
November 20, 2013
Arduino UNO webpage. http://arduino.cc/en/Main/arduinoBoardUno. Retrieved November 20,
2013
ATmega238 datasheet. http://www.atmel.com/Images/doc8161.pdf. Retrieved November 20,
2013
Honeywell SS49 datasheet. http://www.wellsve.com/sft503/Counterpoint3_1.pdf. Retrieved
November 20, 2013
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 39 of 46
Appendix A Stand Design Draft Files
Team #11 Embodiment Design Report
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 41 of 46
Team #11 Embodiment Design Report
Appendix B Simulink block diagram for electromagnetic levitation
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 42 of 46
Appendix C MATLAB LED and LM35 Temperature Sensor Test Codeclear;clc;comPort='COM9';
% create arduino object and connect to boardif exist('a','var') && isa(a,'arduino') && isvalid(a), % nothing to do else %-- connect to the board a = arduino(comPort);end
%Set duration of loop and time delay for LEDsruntime = 20; %duration of looptd = 0.05; %time delay for on or off state of LED
%% Pin 13 has an LED connected on most Arduino boards.%% give it a nameled = 13;led2 = 11;led3 = 10;led4 = 9;LM35 = 0;
%% initialize the digital pin as an output.a.pinMode(led, 'OUTPUT');a.pinMode(led2, 'OUTPUT');a.pinMode(led3, 'OUTPUT');a.pinMode(led4, 'OUTPUT');t=0:runtime;
%% the loop routine runs for the duration of the runtime set aboveticwhile toc/runtime < 1 %%1==1 for infinite while for i=1:runtime+1 temp(i) = (5.0*a.analogRead(LM35)*100)/1024.0; end a.digitalWrite(led2, 1); %% turn the LED on (HIGH is the voltage level) pause(td); %% wait for time delat set above a.digitalWrite(led3, 1); %% turn the LED off by making the voltage LOW pause(td); a.digitalWrite(led4, 1); %% turn the LED off by making the voltage LOW pause(td); a.digitalWrite(led, 1); %% turn the LED off by making the voltage LOW pause(td); a.digitalWrite(led2, 0); %% turn the LED off by making the voltage LOW pause(td); %% wait for a second a.digitalWrite(led3, 0); %% turn the LED on (HIGH is the voltage level) pause(td); a.digitalWrite(led4, 0); %% turn the LED on (HIGH is the voltage level) pause(td); %% wait for a second a.digitalWrite(led, 0); %% turn the LED on (HIGH is the voltage level) pause(td); end
%-- serial port a.serial % get serial port a.flush; % flushes PC's input buffer
Team #11 Embodiment Design Report
%Plot temperature against time plot(t,temp,'b-'); xlabel('Time (s)'); ylabel('Temperature (Degrees C)'); grid on; title('Temperature using a LM35 sensor');
% for i=0:255 %a.roundTrip(42) % sends 42 to the arduino and back% end
%-- close session and free serial port delete(a) delete(instrfind('Port',comPort))
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 44 of 46
Team #11 Embodiment Design Report
Appendix D Excel Calculations for Electromagnet Design
Options 1.000 2.000 3.000 4.000 LimitationCore Diameter (former) (mm)
30.000 30.000 30.000 30.000 30.000
Density of object (kg/m^3) 7850.000 7850.000 7850.000 7850.000 7850.000Diameter of object (mm) 25.000 25.000 25.000 25.000 25.000Volume of ball (m^3) 0.000 0.000 0.000 0.000 0.000Mass of ball (kg) 0.064 0.064 0.064 0.064 0.064Gravity 9.810 9.810 9.810 9.810 10.810Pole area 0.001 0.001 0.001 0.001 0.001B (wb/m^2) 0.059 0.059 0.059 0.059 0.059Air gap (mm) 100.000 90.000 80.000 0.000 300.000Turns (n) 1000.000 1000.000 1000.000 1000.000 1000.000r (half diameter of core) (mm)
15.000 15.000 15.000 15.000 15.000
Length of former (mm) 100.000 100.000 100.000 100.000 100.000Cylinder (total area) (m^2) 0.011 0.011 0.011 0.011 0.011H (AT/m) 46997.891 46997.891 46997.891 46997.891 46997.891Magneto-motive force (mmf) 4699.789 4229.810 3759.831 0.000 14099.367I (A) 4.700 4.230 3.760 0.000 14.099F (N) 15.042 15.042 15.042 15.042 15.042Wire chosenAWG 19 gage() (mm) 0.912 0.912 0.912 0.912 0.912Maximum number of wires in the first layer
109.666 109.666 109.666 109.666 109.666
Stacking factor 0.900 0.900 0.900 0.900 0.900Total # of layers 10.132 10.132 10.132 10.132 10.132Total length of wire (layers) 1039.264 1039.264 1039.264 1039.264 1039.264Total length of wire (total cylinder) (mm)
102574.682 102574.682 102574.682 102574.682 102574.682
(m) 102.575 102.575 102.575 102.575 102.575The unitl Resistor of chosen wire (Ohms per 1000 ft)
8.051 8.051 8.051 8.051 8.051
Total Resistor 2.709 2.709 2.709 2.709 2.709Total Voltage 12.734 11.460 10.187 0.000 38.201Heat produced by wire 34.501 31.051 27.601 0.000 103.502
MECH4010/4015 Magnetic Levitation Demonstration Apparatus Page 45 of 46
Appendix E November to December Schedule