This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
MULTI-AXIS HYBRID RAPID PROTOTYPING USING FUSION DEPOSITION MODELING
NOTICE: The author has granted a non-exclusive license allowing Library and Archives Canada to reproduce, publish, archive, preserve, conserve, communicate to the public by telecommunication or on the Internet, loan, distribute and sell theses worldwide, for commercial or non-commercial purposes, in microform, paper, electronic and/or any other formats. .
AVIS: L’auteur a accordé une licence non exclusive permettant à la Bibliothèque et Archives Canada de reproduire, publier, archiver, sauvegarder, conserver, transmettre au public par télécommunication ou par l’Internet, prêter, distribuer et vendre des thèses partout dans le monde, à des fins commerciales ou autres, sur support microforme, papier, électronique et/ou autres formats.
The author retains copyright ownership and moral rights in this thesis. Neither the thesis nor substantial extracts from it may be printed or otherwise reproduced without the author’s permission.
L’auteur conserve la propriété du droit d’auteur et des droits moraux qui protège cette thèse. Ni la thèse ni des extraits substantiels de celle-ci ne doivent être imprimés ou autrement reproduits sans son autorisation.
In compliance with the Canadian Privacy Act some supporting forms may have been removed from this thesis. While these forms may be included in the document page count, their removal does not represent any loss of content from the thesis.
Conformément à la loi canadienne sur la protection de la vie privée, quelques formulaires secondaires ont été enlevés de cette thèse. Bien que ces formulaires aient inclus dans la pagination, il n’y aura aucun contenu manquant.
Author’s Declaration I hereby declare that I am the sole author of this thesis. I authorize Ryerson University to lend this thesis to other institutions or individuals for the purpose of scholarly research. ________________________ I further authorize Ryerson University to reproduce this thesis by photocopying or by other means, in total or in part, at the request of other institutions or individuals for the purpose of scholarly research. ________________________
ii
Abstract
Multi-Axis Hybrid Rapid Prototyping using Fusion Deposition Modeling
Masters of Applied Science of Mechanical Engineering Ryerson University, Toronto, 2006
Andrew Mason
The objective of this study is to improve prototypes produced by fusion deposition
modeling (FDM). FDM, a method of rapid prototyping, produces parts with desirable
engineering properties. A new drive and extrusion method for continuous and indefinite
deposition of ABS is developed. Process improvements include adding a machining station to
tighten tolerances. Research is initiated into 5-axis deposition, which aims to reduce stair-
stepping errors associated with standard 3-axis deposition. Metrology comparisons to current
industry FDM machines are made showing the improvements implemented tighten tolerance
ranges, while using a larger nozzle orifice diameter to reduce build times.
iii
Acknowledgements
I would like to thank Dr. Vincent Chan for his guidance, encouragement and support
throughout the duration of this project. Special thanks also go out to Joseph Amankrah for his
supervision and machining advice, and to Devin Ostrom for his electrical and related CNC
support. The Mechanical Engineering Department and the Office of Graduate Studies have also
been supportive throughout my time at Ryerson. I would also like to thank NSERC for funding
this research.
iv
Table of Contents Author’s Declaration .....................................................................................................................ii
Abstract ....................................................................................................................................... iii
1.1 Introduction and Industry Needs ...................................................................................1 1.2 Literature Review..........................................................................................................2
1.2.1 Solidifying a Liquid Polymer ................................................................................2 1.2.2 Solidifying a Molten Material ...............................................................................4 1.2.3 Fusing Particles by Laser ......................................................................................6 1.2.4 Joining Particles or Layers with a Binder .............................................................7
1.3 Stair Stepping Error.......................................................................................................8 1.4 Current State of the FDM Industry and Past Research Work .....................................10 1.5 Proposed Research Goals ............................................................................................12
2.1 Drive System Design...................................................................................................14 2.2 Tangential Drive System.............................................................................................15 2.3 Internally Threaded Pulley and Belt Drive System.....................................................16 2.4 Extrusion Diameter Reduction and Modular Nozzle ..................................................18 2.5 Temperature Control and Insulation............................................................................20 2.6 Drive Notches..............................................................................................................23
5.1 Prototype part G-code Generation...............................................................................38 5.2 Machining, G-code, and Router Tool Offset Calibration............................................41 5.3 Prototype Parts Produced ............................................................................................44
7.1 Hexapod Introduction..................................................................................................64 7.2 Electrical Work Done..................................................................................................67 7.3 Mechanical Work Done...............................................................................................75 7.4 5-axis G-Code and MasterCAM Post Processor Modifications..................................77
Table 7 Linear Dimensional Results with Machining.................................................................56
Table 8 Linear Dimensional Results with Machining Summary ................................................56
Table 9 Angular Dimensional Results with Machining ..............................................................57
Table 10 Angular Dimensional Results with Machining Summary............................................58
Table 11 Average Surface Roughness Results with Machining .................................................59
Table 12 Average Surface Roughness Results with Machining Summary.................................59
Table 13 Linear Dimensional Results without Machining..........................................................61
Table 14 Linear Dimensional Results without Machining Summary .........................................61
Table 15 Angular Dimensional Results without Machining .......................................................62
Table 16 Angular Dimensional Results without Machining Summary ......................................62
Table 17 Average Surface Roughness Results without Machining ............................................63
Table 18 Average Surface Roughness Results without Machining Summary............................63
Table 19 Gecko Wiring Inputs and Outputs................................................................................71
Table 20 FDM Machine Experimental Linear Accuracies .........................................................84
ix
Nomenclature 2D Two Dimensional 3D Three Dimensional 3DP Three Dimensional Printing 3DW Three Dimension Welding ABS Acrylonitrile Butadiene Styrene BIS Beam Interference Solidification BMP Ballistic Particle Manufacturing c Circumference CAD Computer Aided Design CAM Computer Aided Manufacturing CNC Computer Numerical Control dm Pitch Diameter dmin Thread Root Diameter dpitch Gear Pitch Diameter EDM Electron Discharge Machining EMF Electro Magnetic Force f Dynamic Coefficient of Friction
Fa Axial Force FDM Fusion Deposition Modeling Ft Tangential Force GPD Gas Phase Deposition hp Horse Power HRP Hybrid Rapid Prototyping I Current LOM Laminated Object Manufacturing LM Layered Manufacturing n Thread Normal Reaction Force N Number of Population Data Points p Thread Pitch P Power PAS Product Architecture Schematic PIC Peripheral Interface Controller Pshaft Power per Shaft q Thread Twisting Force R Liquefier Head Main Internal Diameter r Pitch Radius rs Die Swell Ratio Rq Actual RMS Surface Roughness Ra,t Theoretical Average Surface Roughness RMS Root Mean Square rnozzle Nozzle Orifice Internal Diameter RP Rapid Prototyping RPM Revolutions per Minute SDM Shape Deposition Manufacturing
x
SI Statistically Independent SL Stereolithography SLS Selective Laser Sintering t Layer Thickness T Torque Tshaft Torque per Shaft UNC United National Coarse UNF United National Fine UV Ultra Violet v Threaded Rod Velocity V Voltage VAC Volts Alternating Current VDC Volts Direct Current Ve Extrudate Velocity Vr Liquefier Head Velocity w Vertical Thread Force _
x Population Mean xi Data Point Value Greek Letters αdie Die Half-Angle αn Angle of the Thread Normal Reaction Force λ Thread Lead Angle ƞ Efficiency Ø Diameter π Pie σ Standard Deviation ∑ Sum τ Shear Stress θN Normal Build Angle θT Tangential Build Angle
xi
Chapter 1
1.1 Introduction and Industry Needs The increasing need to accelerate the design process in industry has led to faster
prototypes at less cost. Depending on the complexity of the prototype, weeks or even months are
required to produce each design iteration by conventional manufacturing methods. There are
many conventional methods of material removal such as: milling, lathe work, drilling, grinding,
electron discharge machining (EDM), and sawing. Each conventional manufacturing process has
inherent restrictions on the geometry of the removal due to the tool geometry. This makes some
part features difficult or impossible to produce.
Processes such as injection molding and casting are also widespread in industry. These
create parts by material addition techniques. Although injection molding is a material addition
process at the final stage, the creation of the mold is typically accomplished by material removal
at high costs. The injection molding process is capable of creating complex and intricate parts.
However, high volume production is often necessary to justify the cost of the mold and tooling,
which makes prototype production very costly. The faster production of prototypes permits an
increase in the number of iterations, allowing for fine tuning of the design. This has potential to
save costly changes needed later in the manufacturing process. Out of these needs, rapid
prototyping (RP) was developed. RP is still in its early stages of development, but is growing
rapidly.
RP is classified as a material addition technique, as opposed to the more common
material removal processes. The part(s), or even assembly/assemblies, are produced in one stage,
in one point, line, or layer at a time. This also classifies RP as a layered manufacturing (LM)
technique. The part(s) are produced directly from the computer aided design (CAD) model after
1
being optimally oriented and sliced by RP software either in the CAD package, or internally in
the RP machine. This saves the designer from producing technical drawings to communicate
with a toolmaker or machinist. The elimination of skilled workers at this stage of the
manufacturing process also reduces costs. Once the RP machine begins creating the part, little to
no human interaction is required until the part(s) is (are) complete. This can save up to 30%-50%
of the entire manufacturing process time, plus substantial cost savings [1]. RP machines also
give the designer the option of creating complex shapes, even internal geometries, that may not
have been possible with conventional manufacturing processes [2][3].
1.2 Literature Review
The main RP methods can be divided into four major categories. These categories
include: solidifying a liquid polymer, solidifying a molten material, fusing particles by laser, and
joining particles or layers with a binder. Each of these techniques has its own advantages and
disadvantages. Hybrid rapid prototyping, HRP, is a new technology where machining is
performed after deposition. A search of literature did not yield any systems that perform both
deposition and machining in one station, or use more than 3-axis for deposition.
1.2.1 Solidifying a Liquid Polymer
Stereolithography (SL) was the first commercially available RP technology. SL has been
the widest area of research and development in RP. SL is a technique of prototype production
that utilizes an ultra violet (UV) laser to photo-cure a thermoset acrylate polymer resin. The
polymer resin sits in a vat and is maintained at a temperature just below the polymerization
2
temperature. A movable platform sits within the resin initially just below the surface. The
platform is controllably moved in the vertical direction. This incremental motion controls the
thickness of the layers of the prototype. As the platform is lowered to the depth required, a blade
passes over it, depositing a precision layer of the resin [4].
The laser in SL is used to slightly increase the temperature of the resin at the localized
point where the laser beam contacts the resin surface. The increase in temperature at that
location elevates it above the polymerization temperature of the resin and initiates curing. The
depth into the resin at which the laser penetrates is dictated by the light absorption limit [4].
Typically, the supports are added by the RP software. This allows the laser to create the
custom supports required as it builds the part. Once the prototype is complete, the resin is
approximately 95% cured. The prototype, however, is still very fragile. For this reason, it must
be handled very delicately and placed in a fluorescent oven where it is saturated with UV light
until it is fully cured [2].
After the prototype has completed the curing process, the support material must be
removed manually. Once the supports are removed, there are typically markings left in that
location which may negatively impact the appearance or functionality of the surface. Acceptable
surface finish is attainable in SL by reducing the layer thickness. On each layer, it can take over
a minute to cure a 1.969 in by 1.969 in [50 mm by 50 mm] area with the laser. The resins used in
SL are expensive and are not reusable since they are thermoset polymers. The resins are also
toxic before they are fully cured, which makes handling the fragile prototype more difficult and
dangerous [3].
Beam interference solidification (BIS), which is also still under development, is also
similar to SL, but two interfering lasers are used to cure the resin. There is no elevator platform
required in BIS. The part is created in a vat, below the resin surface. Each laser beam, which
3
operates at different frequencies, passes through the entire vat, and slightly elevates the
temperature of the resin in contact. A single laser beam does not increase the temperature
significantly enough to reach the polymerization temperature. Only when both lasers intersect,
polymerization occurs. The difficulties are that the laser intensity decreases with depth into the
resin, diffraction occurs because of temperature gradients in the resin, and the previously cured
regions cast shadows that affect the laser [3].
1.2.2 Solidifying a Molten Material
The following RP technologies can all be classified as solidifying a molten material. One
of the emerging methods of RP is Fusion Deposition Modeling (FDM). The material used in
FDM is typically a thermoplastic polymer. The material commercially used for FDM is typically
Acrylonitrile Butadiene Styrene (ABS). The ABS polymer is initially in a solid state, such as a
filament wrapped around a large spool, or in the form of a rod. The material is fed into a
liquefier head that is heated by resistance heaters. These heaters are controlled to elevate the
material above its melting temperature. The solid portion of the material is used as a ram to force
the molten material through a fine nozzle at the end of the liquefier head. The head uses
Computer Numerical Control (CNC) in the X and Y directions. The build table is CNC
controlled in the Z direction. From the cross section data from the RP software, the head is
controlled to deposit the first cross section of the prototype on the build table. The head is then
moved away from the table by one layer thickness, and deposits the next layer. The reason that
FDM technology has so much potential is because an FDM machine can be placed in an office
space with the designers that need it. This allows the designers to produce prototypes whenever
4
they need to verify part of a design, or communicate and idea to another designer, management,
or a client.
There are several other methods available to form a prototype from a molten material.
Ballistic particle manufacturing (BMP) is another nozzle based system, where tiny molten
droplets 2-3 µin [50-100 µm] are ejected in either a continuous stream or one droplet at a time.
BMP prototypes can be created from several types of materials such as: aluminium, copper, zinc,
lead, tin, and even thermoplastics. As the particles are very small, densities similar to casting are
possible. BMP has three sub-technologies. The first is called BMP1 where which uses “drop on
demand” to deposit spheres of molten material [2]. After each layer is deposited, a milling head
cuts the layer to the required thickness to maintain accuracy in the Z direction. BMP2 is a
similar technology, but the nozzle is controlled by a 5-axis CNC head, so the droplets are always
deposited perpendicular to the tangent of the surfaces to eliminate stair-stepping. A third BMP
technology is called multi jet modeling (MJM), which uses inkjet technology to deposit the
droplets [3].
Three dimension welding (3DW) is a new technology under development that uses arc
welding to build up prototypes. Issues with excessive heat build-up limit the accuracy of this
technology, but thermocouple and water jet cooling implementation helps control heat build-up.
Work is being done to control the size of the weld pool [5]. Shape deposition manufacturing
(SDM) is another layer based method that uses both material addition, and removal. Initially a
molten material is sprayed to produce the rough cross sections of the prototype. Then, a CNC
milling centre is used to remove unwanted material, and each layer is shot-peened to remove
residual stresses. With this technology, it is possible to create prototypes out of stainless steel
with similar to cast material properties.
5
1.2.3 Fusing Particles by Laser
Another method of producing rapid prototypes is to fuse individual particles together
with a laser. The main method under this category is Selective laser sintering (SLS). SLS
machines work in a similar manner to that of SL machines. The vat in a SLS machine contains a
material in particulate form such as: sand, metals, ceramic powders, wax, nylon, and other non
toxic polymers such as polycarbonates and even ABS [3]. Instead of using a blade as in SL, SLS
machines use a counter rotating roller to spread a precision layer of particles. A low powered
CO2 laser, approximately 20-50 W, then fuses the particles together in the pattern of the
prototypes cross section. For proper fusion, the entire vat is enclosed in an inert environment
such as a Nitrogen atmosphere. Supports are not required in SLS as the un-fused particles act to
support the entire layer built on top of it. When the prototype is complete, the support material
simply falls off the prototype, passed through a sieve, then reused. The vat is maintained just
below the material melting point to reduce excessive thermal distortions from a high powered
laser. The main disadvantages of SLS are thermal distortion and stair-stepping [6]. Thermal
distortion occurs as a result of the fusing process, then cooling. As soon as the prototype is
complete, it is also in a “green state”, similar to SL, because it is just below the melting
temperature. To minimize distortion, the prototype is kept in the SLS machine until it cools,
which can take many hours. A wax part can take 12 h to cool [3]. This makes the build time very
long per prototype as the machine can not be used until the previous prototype is cooled down
and removed. Once the part is sufficiently cooled to transport, it must be post-sintered for full
strength [6].
Gas phase deposition (GPD) produces prototypes by solidifying a material in a gaseous
state. The entire build area is enclosed in an environment of reactive gas. When a laser passes
6
through the gas, the gas decomposes and a solid is left on the surface of the prototype to build it
to the correct form one layer at a time. Materials such as carbon, silicon, carbides, and silicon
nitrides are the materials that can be solidified to form the prototype directly from a gaseous
state. Other methods of GPD include covering the prototype in a powder for each layer that
reacts with the gas with aid of the laser, to solidify into silicon carbide or silicon nitride [3].
1.2.4 Joining Particles or Layers with a Binder
Producing a prototype where no phase change occurs has a great advantage because of
the lack of thermal distortions. Three dimensional printing (3DP) is a derivative of inkjet
printing technology. The inkjets prints a liquid binding agent to bond a powder. The powder
distribution method is identical to that in SLS to deposit the next layer. Also, in a similar fashion
to SLS, the un-bonded powder acts as support material that can be reused once sieved. When the
print-head deposits the binder onto the powder, it bonds several powder grains together into a
sphere due to surface tension forces. As the powders are very fine, capillary action acts to
distribute the binder to neighbouring grains. This can adversely affect accuracy because of the
randomness of the distribution of the binder. For this reason, each layer is sprayed with a mist of
water droplets. Parts created by 3DP can be very brittle and fragile, depending on the powder
and bonding agent used. Some parts may required firing, once the support powder is removed, to
strengthen the bonds by sintering together the powder. Another option is epoxy coating the
prototype to add strength. It is possible, with the correct powder and bonding agent, to produce
flexible rubber prototypes [3].
7
Another bonding RP process is laminated object manufacturing (LOM) which bonds
entire layers together. Typical materials of LOM are paper and cellulose foils, but any foil
material can be used to create prototypes. Typically a laser is used to cut out each cross section,
and then each layer is bonded together with an adhesive. Stair-stepping in LOM is a function of
the paper thickness. Although the layers are as thin as foils, stair-stepping is very prevalent in
the prototypes. Since the paper layers are cut with a laser, a fire hazard exists which requires
appropriate fire extinguishing safety precautions. Internal cavities are difficult to produce on
LOM machines because of the difficulty of removing the supports. Distortion is a major problem
in LOM prototypes because of water absorption. For this reason, the prototypes must be sealed
once they are complete [7].
1.3 Stair Stepping Error The primary issue with layer based RP is stair-stepping, which is governed by layer
thickness and build angles. Figure 1 and Figure 2 illustrate the geometry associated with 3-axis
deposition and 3-axis machining. The resultant of this geometry imposes an inherent average
surface roughness, Ra,t, even under ideal conditions.
8
Figure 1 Stair Stepping Geometry
Figure 2 Surface Roughness Geometry
From the above geometry, the average theoretical roughness is given by:
,2 stana t N
N
tR inθθ
⎛ ⎞= ⎜ ⎟⎝ ⎠
(1)
,sin
2 tanN
a tN
tR θθ
⎛ ⎞= ⎜⎝ ⎠
⎟ (2)
, cos2a t NtR θ⎛ ⎞= ⎜ ⎟
⎝ ⎠ (3)
where t is layer thickness, and θN is the normal build angle.
9
A reduction in nozzle size improves surface finish by reducing layer thickness. As layer
thickness decreases, the build time increases because of the increase in number of layers
required for the prototype. Also with smaller nozzles, there are also an increased number of
passes required to fill in each cross section. As the normal build angle, θN, increases, the surface
roughness decreases giving it an inversely proportional relationship.
1.4 Current State of the FDM Industry and Past Research Work
The leading commercially available FDM machines are Dimension 3D by Stratasys,
Invision by 3D Systems, and Zprinter by Z-Corp. The new FDM machines have two nozzles,
one for the prototype material, and the other for the support material which is usually a water
based wax. The support material nozzle (secondary nozzle) works on the same principle as the
prototype material nozzle (primary nozzle) with respect with material deposition. Both nozzles
are attached to the same liquefier head. This allows the same motion controllers to operate the
deposition of both materials during the build process. The entire operation is completed without
human interaction until the removal of the support material.
Small nozzle diameters, producing low layer thickness, can produce problems with
delamination, since the low volume of extruded material solidifies quickly. If sufficient time
isn’t allowed for proper welding to the previous layer, delaminated of the layer may occur from
the liquefier pulling away the extrudate as it deposits [8]. The ABS is deposited at such a low
rate that it re-solidifies in approximately 0.1 sec. The commercial build area environments are
maintained at an elevated temperature between 50 ºC – 80 ºC which improves layer adhesion. [1,
10
2] For the solid ABS to extrude the molten ABS through the nozzle, the spooled filament is
approximately 0.071 in [1.8 mm] to avoid buckling prior to entering the liquefier head [9].
In the journal “prototype” August 2004 edition [10], Stratasys claim part accuracy ±
0.005 in [± 0.125 mm]. The metrology data within plus/minus one standard deviation will lie
within this tolerance, but will be exceeded by local minimum and maximum errors. The build
volume where the prototypes are built is 8 in x 8 in x 12 in [203 mm x 203 mm x 305 mm].
Depending on the accuracy required, the layer thickness can be toggled between 0.0096 in or
0.0130 in [0.245mm or 0.33mm]. Road widths are approximately 0.0197 in [0.5 mm] wide, with
the smallest features that can be built just under 0.040 in [1 mm]. In September/October 2005,
Time-Compression Technologies presented an article, where the top three FDM machines in
industry were compared by each producing the same four prototypes. The prototypes were each
approximately 2.5 in x 2 in x 1 in. Once complete, the metrology data was captured with a laser
scanner [10]. The overall maximum and minimum tolerances from all four parts are summarized
for each machine in Table 1. The results have been rounded to three decimal places to conform
Since the current extruder does not have the ability to instantly stop deposition, the
Perimeter Zigzag deposition method is adopted in the code to produce the deposition paths. The
path illustrated in Figure 17 can be used to deposit each cross-section of any topless pyramid.
The outer perimeter deposition helps hold overall dimensional tolerances, and produces
smoother outer surfaces. The internal zigzag pattern ensures complete, but possibly over,
internal filling on the final pass of each cross section.
40
Figure 17 Pyramid Cross Section Path
For the G-code generation, the physical parameters in Table 5, are used in the code to
calculate the required deposition paths for each layer of the prototype. The full code can be
found in Appendix B. To ensure that the nozzle does not contact the previously deposited layer,
a “Nozzle Offset” is required. The offset used for all parts is 1.25 times the layer thickness.
Table 5 MATLAB Code Input Parameters Road Width 0.080 in
Layer Thickness 0.080 in Feed Rate 6.0 in/min
Nozzle Offset 1.25 times layer thickness
5.2 Machining, G-code, and Router Tool Offset Calibration
The custom MATLAB program also generates the G-code for the machining path. The
purpose of the machining is to remove excess deposited material, and to reduce the ABS to the
final shape in the CAD model. This allows for a larger nozzle diameter because excess material
can be deposited, and then machined off later. For the case when machining will be used for
making the prototype, a slightly different deposition strategy is used. An additional half road
41
width is added to each side of the part. Instead of depositing around the perimeter a half road
width inside the desired part edge, the centre line of the road width is deposited along the
theoretical perimeter of the part. The router then machines away the excess material to reduce
the prototype to the desired dimensions. The router bit is a two edged straight cutter, with a
cutting diameter of 0.250 in.
The relative position of the router bit with respect to the deposition nozzle is fixed.
Calibration was required to determine the offsets in each axis. The Z-axis offset was initially
measured directly with vernier callipers between the tip of the router and the build table base.
This measurement was 0.727 in. In order to get initial offset values for the X and Y axis the
nozzle was lowered to touch a random point on the build table. This location was then manually
marked on the table. DeskNC was then used to manually move the router bit over and down so
that it was visually over the mark. To move the router bit down to the table, the nozzle must be
moved over at least 2.5 in to avoid hitting the extruder resistance heaters and insulation on the
build table.
From the display screen on DeskNC, the X-axis offset was 3.316 in, and the Y-axis offset
was initially taken as zero. To confirm the accuracy of these offsets, several calibration cubes
were deposited and machined. A modified version of the custom G-code software was made to
generate the G-code for these cubes. The theoretical dimensions of the cubes were 1 in by 1in by
0.160 in, which is equal to two times the layer thickness. Table 6 contains the calibration trials
including the offsets for each axis, the G-code file names, and the bilateral part tolerances used
to calculate the required adjustments to the next iteration. Adjustments to the offsets were made
by the midpoint of the bilateral part tolerance. The iteration termination criterion, was met when
each axis was repeatable and symmetric for two iterations, with all dimensions within ±0.005 in.
42
Table 6 Machining Offset Calibration Trials
Iteration Number
G-code File Name Axis Offset Used
(in)
Part Bilateral Tolerance
(in) Z -0.727 +0.045”
+0.029” X -3.316 ±0.005”
1 Initial Offsets
Y 0 n/a Router missed the part in the +Y axis by approximately 1/16 in.
Z Z-axis table sticking X -3.318 ±0.004” 2 "Sept7 Machining
Testing.txt" Y -0.125 -0.010” -0.030”
Z Z-axis table sticking X -3.318 ±0.002” 3 updated "Sept7
Machining Testing.txt" Y -0.105 -0.020”
-0.034”
Table sticking affecting Y and Z axis. Z-axis table linear guide added to prevent sticking. Calibration Continued from previous values.
Z -0.764 ±0.005” X -3.318 ±0.002” 4 updated "Sept7
Machining Testing.txt" Y -0.078 +0.005”
-0.001” Z -0.764 ±0.005” X -3.318 ±0.002” 5 updated "Sept15
Machining Testing.txt" Y -0.082 ±0.002”
Z -0.764 ±0.002” X -3.318 ±0.001” 6 updated "Sept15
Machining Testing.txt" Y -0.082 ±0.004”
Z -0.764 Calibrated X -3.318 Calibrated 7 Converged.
Actual Offsets used in code. Y -0.082 Calibrated
*Note: these values should not be considered as overall machine tolerances, as the parts made were fairly simple. If the machine runs for longer, it is possible that error accumulations will cause more complicated prototypes to have errors that exceed these tolerances.
43
Figure 18 depicts the generated path for machining the perimeter of a topless pyramid.
Although not shown in Figure 18, machining also occurs after each layer is deposited. This helps
hold the Z-axis tolerances, as each layer is machined flat at 0.080 in thick. This removes any
imperfections and reduces error stack-up between layers. After all layers are deposited, the top is
machined to the correct height then the router bit mills around the perimeter in vertical steps of
0.010 in [19]. Time did not permit a sensitivity analysis of the machining pitch. Machining starts
off by machining the part down to the correct height, then the perimeters are machined one level
at a time. The router spins clockwise, and travels counter clockwise around the part, using
conventional milling. Conventional milling helps eject the chips away from the part to avoid re-
welding back onto the part. All code associated with machining can also be found in Appendix B.
Figure 18 Machining Path
5.3 Prototype Parts Produced
The following is a chronology of deposition trials, and prototype production. Initially, the
ABS would not adhere to the aluminum Z-axis table, so an ABS sheet was used for a deposition
44
base because of the excellent cohesive properties of ABS. During initial prototype production, it
was difficult to manually control the extrudate temperature, while making sure that all systems
were working properly. Unfortunately, the project budget did not allow for a closed loop
temperature controller, so initially the parts ended up very crude. The temperature would ramp
up and exceed 290 °C because the temperature controller does not instantly reduce the
temperature at the nozzle. As a result, the ABS would burn and discolor. The discoloration can
be seen as blackening of the naturally colored ABS in Figure 19. Originally black ABS was used,
but it made it difficult to see when it was burning. Beige ABS was also readily available, and
provided additional visual feedback of burning.
Figure 19 ABS Burning
After building several sample depositions, the temperature became easier to control, and
the prototypes no longer contained discoloration from burning. Although the temperature
constantly fluctuates, it was possible to maintain the temperature to 280 °C ± 5 °C by
anticipating when, and how much, to modulate the temperature controller.
45
While building initial calibration parts, the molten extrudate ABS cohered to the build
table base ABS very well. After deposition, these parts were very difficult to remove from the
base once they were complete. To over come this, several attempts were made to modify the
deposition base. The final solution was to make a base with many hinge points that could be
used to break away from the part. The ABS sheet was cut into strips that were then held together
with Duct Tape on the underside. This allowed the strips to be held tight together during
deposition, then the Duct Tape would act as a hinges to break the base away from the part. The
same breakaway base was reused for all depositions and prototypes built subsequently.
Many practice prototypes were made to ensure machine consistency before collecting
metrology data. Topless Pyramids were made to test the machine, and work out bugs in the
custom program that generates the G-code. Figures 20 and 21 respectively show the 3-axis
machine and computer setup, and the screen layout of DeskNC. DeskNC displayed a graphic of
the machine path, the current lines of G-code, the current X, Y, and Z coordinates, and the
current machining parameters. Figure 22 shows the 3-axis machine in operation, with the Multi-
meter outputting the temperature at the deposition nozzle in degrees Celsius.
46
Figure 20 3-axis Machine and Computer Setup
Figure 21 DeskNC Screen Layout
47
Figure 22 Multimeter Temperature Monitoring
Figure 23 is a picture of one of the first multi-layered prototypes created. Several
prototypes like this one were created during initial testing. Many of these contained flaws that
were later attributed to problems in the custom G-code generation software. They are indicative
of some of the initial difficulties producing consistent prototypes on a custom built machine with
a limited budget. These parts were not included in the following dimensional and surface
roughness analysis assessing the machines quality assessment.
Figures 24 and 25 show the extruder consistently depositing layers of a Topless Pyramid
prototype. Figure 26 shows the bottom side of a typical Topless Pyramid after it has been
removed from the build table base. The road widths and Perimeter Zigzag deposition strategy are
48
clearly visible. Figures 27 and 28 both show the router machining the perimeter of prototypes.
As can be seen, the chips produced do not re-weld to the part. They only rest on the part, and fall
off when blown or brushed off. Figure 29 shows one of the completed machined Topless
Pyramid prototypes used for geometric analysis in the following chapter.
Figure 23 Early Prototype Sample
49
Figure 24 Deposition
Figure 25 Multi-layer Deposition
50
Figure 26 Underside of Topless Pyramid
Figure 27 Router Bit Machining
51
Figure 28 Router Bit Machining and Liquefier
Figure 29 Machined Topless Pyramid Prototype
52
Chapter 6
6.1 Prototype Metrology
To determine accuracy and surface quality, twelve consecutive topless pyramid
prototypes were produced. Six prototypes were made with, and six without, machining. In order
to analyze the accuracy of the prototypes produced with respect to the theoretical CAD model,
several metrology methods were used. Surface roughness average, linear, and also angular
measurements were recorded for each prototype produced. To obtain the linear dimensions from
the prototype, vernier callipers were used. The base of the pyramid is used to assess the X and Y
dimensions of the part. The Z dimensions were also measured directly with a vernier. In order to
determine the surface roughness, and actual angle of each face, the parts were scanned with a
touch probe scanner. A Roland PIX-30 3D scanner was used to capture the surface data of each
prototype. The scanner is capable of achieving accuracy of +/- 0.0004 in. The probe used is a
high aspect ratio needle mounted on a piezo-electric sensor [11].
For all prototypes made, the scanning pitch in the X and Y axis was set to 0.008 in. Z-axis
measurements are taken every X-Y location as defined by the scanning pitch. The pitch is
adjustable by increments of 0.002 in. Scans for each part took approximately 15 hours when the
scanning area was manually set as small as possible based on approximate dimensions and
location of the part on the scanning table. For each part, approximately 45,000 data points were
collected by the scanner. Having the scanner perform an automatic preview to locate the part
increases the scan time by approximately 2-3 hours. When the pitch was reduced to 0.006 in,
part scans approached 2 days each, which was not practical when scanning twelve parts.
Increasing the pitch above 0.008 in would save time, but imperfections in each machining step
would be missed.
53
Figure 30 shows the 3D cloud data, captured by the touch probe scanner, of a machined
topless pyramid produced on the 3-axis machine. A flaw with this style of touch probe scanner is
that it is unable to capture data points on vertical surfaces. As linear dimensions were measured
with vernier callipers, the vertical side data was not required from the parts.
Figure 30 Topless Pyramid Touch data
Imageware Surfacer software was used to isolate each surface from the data cloud. A
plane surface was fit to each side that passed through an average of the data points. Surfacer then
output the distance from each data point to the average plane. These distances were then used to
calculate the root mean square, RMS, actual surface roughness values, Rq, for each of the five
surfaces. The five surfaces include the four angled surfaces, and the top surface, which is
denoted as the 90º surface. Surfacer was also used to measure the best-fit slope angles of each
54
side for slope analysis. The results of the twelve scans are presented in the following sections of
this report.
6.2 Topless Pyramid Results with Machining
Figure 31 illustrates an example of the error distances of a topless pyramid with machining,
displayed graphically with a rainbow plot for a 45º surface. For the error distances, red
represents +0.010 in, green represents 0.000 in, and dark blue represents -0.019 in perpendicular
from the theoretical best fit plane, on a linear scale. Similar graphics were captured for all
surfaces of all parts produced, including the un-machined prototypes analysed in next section.
Figure 31 45º Error Distances
55
Surfacer outputs all of the error distances in a text file. Microsoft Excel was then used to
calculate the surface roughness average for each surface. All of the following results for the
topless pyramids include 3-axis machining at a vertical pitch of 0.010 in. The linear dimensional
results and tolerances for the six prototypes are available in Table 7.
Table 7 Linear Dimensional Results with Machining
Part # Direction
Nominal Dim (in)
Actual Dim (in)
Tolerance (in)
Error (%)
#1 X 1.440 1.448 +0.008 +0.56 Y 2.000 2.006 +0.006 +0.30 Z 0.560 0.582 +0.022 +3.93
#2 X 1.440 1.448 +0.008 +0.56 Y 2.000 2.009 +0.009 +0.45 Z 0.560 0.576 +0.016 +2.86
#3 X 1.440 1.444 +0.004 +0.28 Y 2.000 2.008 +0.008 +0.40 Z 0.560 0.552 -0.008 -1.43
#4 X 1.440 1.448 +0.008 +0.56 Y 2.000 2.012 +0.012 +0.60 Z 0.560 0.575 +0.015 +2.68
#5 X 1.440 1.446 +0.006 +0.42 Y 2.000 2.016 +0.016 +0.80 Z 0.560 0.546 -0.014 -2.50
#6 X 1.440 1.449 +0.009 +0.63 Y 2.000 2.017 +0.017 +0.85 Z 0.560 0.557 -0.003 -0.46
Included in Table 8 are the linear tolerances and errors averaged from all six prototypes in Table
7, as well as the linear bilateral tolerances for the six prototypes.
Table 8 Linear Dimensional Results with Machining Summary
Direction Avg. Tol.
(in) Min. Tol.
(in) Max. Tol.
(in) Avg. Error
(%) X +0.007 +0.004 +0.009 +0.50 Y +0.011 +0.006 +0.017 +0.57 Z +0.005 -0.014 +0.022 +0.85
56
Table 9 contains the angular dimensional results and tolerances for the six prototypes. Each
angular dimension was obtained in Surfacer by taking average angles from each side face to the
top surface.
Table 9 Angular Dimensional Results with Machining Part
In order to create prototypes with 5-axis control, a custom hexapod machine will provide
the motion of the extruder. This machine was designed and built by Dr. Chan of the Mechanical
Engineering Department at Ryerson University. The initial intention for the hexapod was to
mount a laser for 3D laser scanning parts for reverse engineering purposes. The hexapod consists
of a triangular base that is controlled by six linear actuators. The linear actuators are extended
and retracted with the rotational motion of a threaded rod. The threaded rods are rotated by servo
motors that are actuated by a complex control system.
The servo motor controllers are driven by custom software developed by Dr. Chan written
in Visual Basic. The software inputs 5-axis G-code with X, Y, Z, U, and V coordinates and a
desired feed rate. The X, Y, and Z coordinates are Cartesian 3-axis coordinates, and the U and V
coordinates indicate the pitch and roll angles. The geometric calculations used in the software to
convert the G-code to linear actuator arm lengths were derived by Dr. Chan, and are beyond the
scope of this report.
To allow the triangular base to move, the linear actuators are mounted on basic sheet metal
universal joints at each end. These universal joints were anticipated to rigid enough since all the
loads in the linear actuators are in tension. Figure 32 illustrates the basic layout of the hexapod
machine. This picture was taken while the machine was still in the condition it was at the outset
of the current FDM extrusion research. Figure 33 shows a close-up view of the lower universal
joints.
64
Figure 32 Initial Hexapod Condition
Figure 33 Hexapod Base
65
The research schedule was made with the assumption that the hexapod would be running
and calibrated by January 2006. As a result, all previous 3-axis testing was concluded in
December 2005. Figures 34 and 35 were taken when the extruder was mounted the first week of
January. Mounts were designed and manufactured that allowed adjustable positional control, so
the deposition nozzle could be centred on the triangular hexapod base. Instead of producing 5-
axis prototypes, effort was put forward to getting the hexapod machine operational.
Mounts
Figure 34 Extruder Mounted on Hexapod
66
Figure 35 Mounted Extruder Nozzle from Underneath
7.2 Electrical Work Done
Before calibration of the machine could be done, the electrical system had to be installed.
Dr. Chan manufactured the electronic control boards, but they still needed to be wired together,
and wired to the motors. The motors and control boards also required a power supply. A power
supply was obtained that had 5 VDC up to 3 amps, and 24 VDC up to 8 amps output, from a 120
VAC input. The stock input to the power supply was a female three-pronged connector, to which
a male connector was not available. The power supply was taken apart, the stock female
67
connector removed, and a three standard tree prong plug was cut and hardwired into the power
supply.
The 5 VDC was required for the control logic and to power the controllers, and the 24
VDC was required to power each servo drive, and the servo motors for the linear actuators.
Fuses were placed in the 24 VDC output lines of the power supply as illustrated in Figure 36.
These fuses were installed to protect the power supply from potential back electro magnetic
force (EMF) power spikes. The fuse for the 5 VDC outputs was placed near the control boards
as can be seen later in Figure 41 in a white plastic fuse holder.
Figure 36 Fused Power Supply
68
Each stepping motor is equipped with an optically isolated encoder. Each motor has six
wires in total required for motion. The red and black wires in Figure 37 are the positive and
negative 24 VDC wires respectively that supply power the motor armatures. These wires come
from the control boards. The other four wires on the motor are for the operation of the optical
encoder. The blue and green wires are the 5 VDC positive and ground wires that power the
encoder. The white and yellow are Phase A and Phase B encoder wires respectively.
Green
Blue
Black
Red
Yellow
White
Figure 37 Motor Wiring
Gecko drive DC servo drivers “Geckos” were selected to control the linear actuator
stepping motors for their robustness, simplicity, and affordability. The Geckos have three
69
externally adjustable pots for Limit, Damping, and Gain for system response control stability.
These values are all initially set to the midpoints of the pots, but can be adjusted to optimise
system response. There are twelve screw clamp connectors on the end for input and output wires.
These are numbered from one to twelve numbered from left to right respectively in Figure 38.
Table 19 consists of a summary of the current Gecko wiring, including the screw connector
numbers and labels on the Gecko, and the colour and location of the corresponding wires.
Figure 38 Gecko Servo Drive Controller
70
Table 19 Gecko Wiring Inputs and Outputs # Label Wire to/from Wire Color1 Power Ground - 24 VDC ground from power supply Black 2 +18 to 80 VDC + 24 VDC from power supply Red 3 Arm - - 24 VDC ground to stepping motor Black 4 Arm + + 24 VDC to stepping motor Y/G/Red 5 Err/Res Jumpered to Enc + Brown 6 Enc - - 5 VDC Ground for stepping motor encoder Green 7 Enc + + 5 VDC to stepping motor encoder Blue/Black 8 Phase A To Phase A of stepping motor encoder White 9 Phase B To Phase B of stepping motor encoder Yellow/Red10 Dir Direction from PIC chip control board Black 11 Step Step from PIC chip control board Brown 12 Common/+5VDC + 5VDC from power supply Brown/Black
Table 19 includes a reference to a PIC chip control board. This board was also
manufactured by Dr. Chan, and is shown in Figure 39. A PIC chip is a micro controller, and
stands for Peripheral Interface Controller. It is programable to perform required computation and
communication tasks. The purpose of each PIC chip board is to instruct its respective Gecko
how many pulses, and in which direction, to move its linear actuator stepping motor. The pic
chip board recieves 5 VDC from the power supply and communications from the Master PIC
chip board. The Master PIC chip board is shown in Figure 40. The role of the Master PIC chip is
to receive data from the communication board, and send the appropriate instructions to each PIC
chip. The communication board is the leftmost white board in Figure 41. This board recives data
from the computer, and transmits it to the Master PIC chip board. Once the wiring and
communications were working properly, the wiring was neatly routed from each linear actuator
stepping motor to the control boards as seen in Figure 42. This was done to keep all wires away
from mechanical moving components, and out of the the way so the build area can be observed
from all sides of the machine.
71
PIC CHIP
Figure 39 PIC Chip Board
72
Master PIC Chip
Figure 40 Master PIC Chip Board
73
CommunicationsBoard
5 VDC Fuse
Figure 41 Communication Board
74
Figure 42 Wiring Routed Neatly
7.3 Mechanical Work Done
Once the controls system was in place, initial motion testing commenced. It was
immediately apparent that the hexapod was not as rigid as anticipated. To alleviate some of the
vibrations, the table was drilled, tapped, and the frame was bolted down to aluminium table base.
This helped reduce vibrations.
When the linear actuators were moved, one of the lower universal joints interfered with
the gear drive stepping motor. To correct this, a new universal joint was made as illustrated in
Figure 43. The new universal joint was also made of sheet metal, and designed so that the
75
original geometry was maintained. Interference may still be an issue at the maximum rotation
angles of the hexapod.
Figure 43 Motor Clearance Modification
Further motion testing revealed other mechanical flaws. An internally threaded bushing
inside one of the linear actuators jammed on the threaded rods and stuck. When the linear
actuator was disassembled, the distorted plastic bushing was replaced with a custom made brass
one, which allowed the linear actuator to extend and retract freely. As a result of this jamming,
the corresponding upper universal joint failed. Another sheet metal universal joint was made, as
seen in Figure 44, which maintained the original geometry. The linear actuators stepping motor
76
shafts were also shortened and remounted to eliminate backlash associated with the motor
motion when changing rotational directions. The brackets holding the linear actuators body to
the universal joint was also riveted and clamped to the actuator body as the original threads
holding them together stripped because of the vibrations. These modifications can also be seen
in Figure 44.
Figure 44 Replacement Universal Joint
7.4 5-axis G-Code and MasterCAM Post Processor Modifications
Generating G-code for a 5-axis machine is more complicated than creating 3-axis code.
With 3-axis G-code, the CAD model can be sliced into layers, and then the G-code can be
generated to fill in each slices cross section. With 5-axis deposition, the extrudate is deposited on
77
the surface of the previously deposited layer over the entire part. This means that the slices are
not simply taken vertically in the Z-direction. Each deposited layer builds up the part by adding
a shell, of one layer thickness, to the previous layer.
For initial 5-axis prototype parts built by the hexapod, the strategy will be to just deposit
the final shell layer thickness for a topless pyramid. The core of the part will be manufactured by
conventional machining methods. This way the G-code generation was simplified, and the stair
stepping elimination on the external surfaces can still be studied. To generate the outer shell 5-
As the ranked results in Table 20 indicate, the extrusion module developed during this
research produces prototypes with accuracies competitive to current leading FDM machines in
industry. Vibrations during machining compromise linear accuracy. However, the addition of a
machining module improves the surface quality of inclined planes. Machining allows for the use
of a larger nozzle orifice diameter to produce prototypes that match the CAD model geometry
better than deposition alone. The upgrade to using ABS as extrudate aligns this research with
industry standards, and the proposals for 5-axis deposition will further advance the technology
of RP.
8.3 Future Recommendations
84
This study can be advanced by further developing the following items:
Before using the 3-axis machine again, the entire Z-axis table should be redesigned with
linear bearings on two sides of the build table to provide smoother motion.
Use a closed loop temperature controller to maintain the extrudate temperature at the nozzle.
Implement twelve zero-backlash universal joints to replace the sheet metal universal joints
on the hexapod. Since they will be smaller, these will also avoid the extruder stepping motor.
Replace the plastic threaded inserts in the hexapod’s linear actuators with brass ones for
smoother, more reliable, motion.
Use lead screws with anti-backlash nuts in the linear actuators to replace the threaded rod.
Develop calibration G-code for the hexapod to ensure accuracy and repeatability of the
machine before producing prototypes.
Adjust system stability controls on the Gecko drives to optimise the system response and
stability.
If time is not available to write full 5-axis G-code generating software, make several CAD
models, of decreasing size for the topless pyramid, and paste together the MasterCAM G-
code output using the modified post processor. To do this will involve determining the
size/shape of each CAD file so the part’s external surfaces are the correct geometry once all
layers are deposited.
85
Appendix A – Technical Drawings A1 – Extruder Drawings
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
A2 – Hexapod Modifications
101
102
103
Appendix B – Source Code
B1 – MATLAB Deposition with Machining Path Generation Code
MAIN CODE Pyramid_Topless.M (sub-function codes follow) clc clear all nozzle_diameter = 5/64 %input('\n\nPlease input the nozzle orafice diameter (fraction or decimal) you are using: '); tic %Inputting Vertecies and normals [top_normal, top_face_vertecies, south_normal, south_face_vertecies, north_normal, north_face_vertecies, bottom_normal, bottom_face_vertecies, west_normal, west_face_vertecies, east_normal, east_face_vertecies] = input_vertecies; clc fprintf('Please wait while the G-Code is being Generated\n') % Find distance between top and bottom plane of prototype prototype_height = top_face_vertecies(1,3) - bottom_face_vertecies(1,3); % End Find distance between top and bottom plane of prototype % Caclulating side inclination angles from vertecies % Angle is defined as vertical to surface tangent (opposite to Directed Studies Report definition) west_angle = atan( (west_face_vertecies(1,1)-west_face_vertecies(2,1)) / (west_face_vertecies(1,3)-west_face_vertecies(2,3))); west_angle_displayed = round((180/pi)*west_angle); south_angle = atan( (south_face_vertecies(1,2)-south_face_vertecies(2,2)) / (south_face_vertecies(1,3)-south_face_vertecies(2,3))); south_angle_displayed = round((180/pi)*south_angle); east_angle = atan( (east_face_vertecies(1,1)-east_face_vertecies(2,1)) / (east_face_vertecies(2,3)-east_face_vertecies(1,3))); east_angle_displayed = round((180/pi)*east_angle); north_angle = atan( (north_face_vertecies(1,2)-north_face_vertecies(2,2)) / (north_face_vertecies(2,3)-north_face_vertecies(1,3))); north_angle_displayed = round((180/pi)*north_angle); % End Caclulating side inclination angles from vertecies % Calculate Cad Model (theoretical) volume (in^3) if west_angle_displayed==15 & south_angle_displayed==30 & east_angle_displayed==45 & north_angle_displayed==60 cad_model_volume = 0.8152; %(1.44x2) end % End Calculate Cad Model (theoretical) volume bottom_base = bottom_face_vertecies(1,1)-bottom_face_vertecies(3,1); bottom_length = bottom_face_vertecies(1,2)-bottom_face_vertecies(2,2); deposition_delay = 0.75; % sec machining_delay = 5*60;%sec layer_thickness = 0.080; nozzle_offset_value = 1.25; %(times current layer thickness)
104
road_width = 0.080; deposition_overlap = 0.375*road_width; % Extra material deposited to compensate for round profile of deposition. % See "Machining Parameters.xls" for current calibrated offsets. X_offset = -3.318; Y_offset = -0.082; Z_offset = -0.764; X_loss_compensation = 0; Y_loss_compensation = 0.080; Z_loss_compensation = -0.025; X_offset = -3.318 + X_loss_compensation; Y_offset = -0.082 + Y_loss_compensation; Z_offset = -0.764 + Z_loss_compensation; Router_diameter = 0.250; XY_feed_rate = 6.0; Machining_feed_rate = 3.75; Z_feed_rate = 1.5; code_line_number = 10; data_points = 0; % Array for datapoints to be written to a text file. data_points_index = 1; fittest = 1; spindle_speed = 4; layer = 0; height_level = 0; X = 0; Y = 0; Z = 0.12; base_height = 0.080;%inch while height_level < prototype_height + base_height % Looping for every layer. %The Base is actually deposited in the negative heigh_level. %The +base_height is to deposit another layer on the top so it can be machined down to the correct height. layer = layer + 1; if height_level < prototype_height + base_height - layer_thickness %for every layer but the top. base = bottom_base - height_level*( tan(west_angle) + tan(east_angle) ); length = bottom_length - height_level*( tan(south_angle) + tan(north_angle) ); min_x = height_level*tan(west_angle); min_y = height_level*tan(south_angle); else %for the top extra deposited layer only. base = bottom_base - (height_level - layer_thickness)*( tan(west_angle) + tan(east_angle) ); length = bottom_length - (height_level - layer_thickness)*( tan(south_angle) + tan(north_angle) ); min_x = (height_level - layer_thickness)*tan(west_angle); min_y = (height_level - layer_thickness)*tan(south_angle); end cross_sectional_area = base*length; sectional_volume = cross_sectional_area*layer_thickness; nozzle_offset = nozzle_offset_value*layer_thickness; feed_rate = XY_feed_rate; % Setting to always do same feed rate as calibrated for the machine deposition_method = 2; % Setting to always do this deposition method if layer == 1 % print out setup G-Code. clc % fprintf('O Topless_Pyramid_G_Gode - Program Name\n') % fprintf(['N',num2str(code_line_number),' G20 (Inch mode)\n'])
105
% code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G90 (Absolute mode)\n']) % code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G54 (Set coordinate system to part)\n']) % code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G43 H1 (nozzle height compensation)\n']) %MUST DEFINE H1**********s*********** % code_line_number = code_line_number + 10; % ************************************************************************************************************* % This code is for adding a single layer base to the pyramid. % Must set Z=0 at Z=layer_thickness. Thus the first layer (the base) will be deposited in the -Z region. height_level = height_level - layer_thickness; Z = nozzle_offset - layer_thickness; X = -1.5; Y = -0.75; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' Z',num2str(Z),' F',num2str(Z_feed_rate),' (Return to home) (-1.5,-0.75,Z)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; X = min_x + (0.5*road_width) - deposition_overlap; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y-0.75 Z',num2str(Z),' F',num2str(XY_feed_rate),' (Move to initial position)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; nozzle_offset = nozzle_offset_value*layer_thickness; num_of_x_roads = ceil((base + (2*deposition_overlap)) / road_width); [code_line_number, X, Y, Z, data_points, data_points_index] = Perimeter(fittest, height_level, base, length, min_x, min_y, num_of_x_roads, X, Y, Z, code_line_number, road_width, nozzle_offset, spindle_speed, data_points, data_points_index, feed_rate, deposition_delay, deposition_overlap); % Retracting nozzle to move to the next position X = bottom_base + (4*road_width); fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(XY_feed_rate),' (Retract over)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; Y = -0.75 - (1.25*road_width); fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(XY_feed_rate),' (Retract out)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X;
106
data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; X = 0 - deposition_overlap; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(XY_feed_rate),' (Retract out)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; Z = Z + layer_thickness; fprintf(['\nN',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' Z',num2str(Z),' F',num2str(Z_feed_rate),' (Retract up)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; feed_rate = XY_feed_rate; height_level = height_level + layer_thickness; % ************************************************************************************************************* Z = height_level + nozzle_offset; X = -1.5; Y = -0.75; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' Z',num2str(Z),' F',num2str(XY_feed_rate),' (Return to home) (-1.5,-0.75,Z)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; X = min_x + (0.5*road_width) - deposition_overlap; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y-0.75 Z',num2str(Z),' F',num2str(XY_feed_rate),' (Move to initial position)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end % Calling appropriate function to generate the G-Code for the fittest chromosome selected. nozzle_offset = nozzle_offset_value*layer_thickness; num_of_x_roads = ceil((base + (2*deposition_overlap)) / road_width); %if deposition_method == 1 % Zig-Zag Deposition. [outputs] = function(inputs). MUST be the same as IF statement below.
data_points_index = data_points_index +1; feed_rate = XY_feed_rate; % Zig-Zag_Machining for machining down to the correct height. if height_level + layer_thickness > prototype_height + base_height % Only do it for the top surface. X = -3.0;%inch fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(XY_feed_rate),' (Retract out)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; fprintf(['N',num2str(code_line_number),' G04 X',num2str(machining_delay*10),' (dwell ',num2str(machining_delay/60),'min)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; height_level = height_level - layer_thickness; while height_level > prototype_height - (2*layer_thickness) height_level = height_level - 0.010; [code_line_number, X, Y, Z, data_points, data_points_index] = Zig_Zag_Machining(height_level, layer_thickness, base, length, min_x, min_y, num_of_x_roads, X, Y, Z, nozzle_offset, code_line_number, data_points, data_points_index, feed_rate, Z_feed_rate, Machining_feed_rate, X_offset, Y_offset, Z_offset, Router_diameter, prototype_height, deposition_overlap, base_height); end height_level = height_level + (3*layer_thickness); end height_level = height_level + layer_thickness; save data_points.txt data_points -ASCII % Outputting data_points array to a text file for openening in Surfacer. data_points_index = data_points_index +1; % Creates a blank line to break up data cloud for each layer. Data file manipulation Steps next. % 1.Open data_points.txt % 2.Find and Replace "0.0000000e+000 0.0000000e+000 0.0000000e+000" with nothing (blank line) OR "***End Cloud***" not including quotes for either. % 3.Open in SURFACER with option Open File As: ASCII Delimited. end % Layer Loop %fprintf(['N',num2str(code_line_number),' G28 (Return to home (0,0,2.5)\n']) %code_line_number = code_line_number + 10; %fprintf(['N',num2str(code_line_number),' G49 (End Tool Height Compensation)\n'])
109
%code_line_number = code_line_number + 10; %fprintf(['N',num2str(code_line_number),' M01 (End)\n']) %code_line_number = code_line_number + 10; % Perimeter_Machining for stairstep machining the angled sides. %[code_line_number, X, Y, Z, data_points, data_points_index] = Perimeter_Machining(height_level, bottom_base, bottom_length, X, Y, Z, code_line_number, data_points, data_points_index, feed_rate, Z_feed_rate, Machining_feed_rate, X_offset, Y_offset, Z_offset, Router_diameter, prototype_height, north_angle, south_angle, east_angle, west_angle); % Perimeter_Machining_TopDown for stairstep machining the angled sides. [code_line_number, X, Y, Z, data_points, data_points_index] = Perimeter_Machining_TopDown(height_level, bottom_base, bottom_length, X, Y, Z, code_line_number, data_points, data_points_index, feed_rate, Z_feed_rate, Machining_feed_rate, X_offset, Y_offset, Z_offset, Router_diameter, prototype_height, north_angle, south_angle, east_angle, west_angle, base_height); feed_rate = XY_feed_rate; fprintf(['\n\nN',num2str(code_line_number),' M02 (End Program and Rewind)\n\n']) save data_points.txt data_points -ASCII % Outputting data_points array to a text file for openening in Surfacer. data_points_index = data_points_index +1; % Creates a blank line to break up data cloud for each layer. Data file manipulation Steps next. % 1.Open data_points.txt % 2.Find and Replace "0.0000000e+000 0.0000000e+000 0.0000000e+000" with nothing (blank line) OR "***End Cloud***" not including quotes for either. % 3.Open in SURFACER with option Open File As: ASCII Delimited. toc SUB-FUNCTION import_verticies.M
function [top_normal,top_face_vertecies,south_normal,south_face_vertecies,north_normal,north_face_vertecies,bottom_normal,bottom_face_vertecies,west_normal,west_face_vertecies,east_normal,east_face_vertecies] = input_vertecies %Inputting Vertecies and normals in a function [top_normal,top_face_vertecies,south_normal,south_face_vertecies,north_normal,north_face_vertecies,bottom_normal,bottom_face_vertecies,west_normal,west_face_vertecies,east_normal,east_face_vertecies] = input_vertecies (dummy) % PROCEDURE FOR FORMATTING THE .STL FILE FOR THIS INPUT % 1. Save CAD model as .stl format (ASCII, Inches, Coarse, should be 12 triangles, check off "Do not translate STL output data to positive space", output coordinate system = default. % 2. Open the .stl file and Remove all text % 3. Convert all coordinates to 3 decimal places, no exponental form. Use Find-Replace function for all numbers in Note Pad to be consistant with rounding. % 4. The numbers should be in formated blocks of 4 lines (3 numbers per line.) These lines are i.surface normal ii.first vertex iii.second vertex iV.third vertex.
110
% 5. Remove the 2, 4, 6,.... blocks. These blocks are the second triangles that make up each side. The .m file only takes one triangle per side as the vertecies of one triangle provides sufficient information to process the coordinates of each side. % 6. Save the formatted .stl file to .txt and put in the matlab directory (E:\matlabR12\work) with the .m files. importdata('Pyramid_topless_15_30_45_60_90_1.44x2.txt'); vertecies = ans; top_normal = vertecies(1,:); top_face_vertecies(1,:) = vertecies(2,:); top_face_vertecies(2,:) = vertecies(3,:); top_face_vertecies(3,:) = vertecies(4,:); south_normal = vertecies(5,:); south_face_vertecies(1,:) = vertecies(6,:); south_face_vertecies(2,:) = vertecies(7,:); south_face_vertecies(3,:) = vertecies(8,:); north_normal = vertecies(9,:); north_face_vertecies(1,:) = vertecies(10,:); north_face_vertecies(2,:) = vertecies(11,:); north_face_vertecies(3,:) = vertecies(12,:); bottom_normal = vertecies(13,:); bottom_face_vertecies(1,:) = vertecies(14,:); bottom_face_vertecies(2,:) = vertecies(15,:); bottom_face_vertecies(3,:) = vertecies(16,:); west_normal = vertecies(17,:); west_face_vertecies(1,:) = vertecies(18,:); west_face_vertecies(2,:) = vertecies(19,:); west_face_vertecies(3,:) = vertecies(20,:); east_normal = vertecies(21,:); east_face_vertecies(1,:) = vertecies(22,:); east_face_vertecies(2,:) = vertecies(23,:); east_face_vertecies(3,:) = vertecies(24,:); %End Inputting Vertecies and Normal vertecies SUB-FUNCTION Perimeter.M function [code_line_number, X, Y, Z, data_points, data_points_index] = Perimeter(fittest, height_level, base, length, min_x, min_y, num_of_x_roads, X, Y, Z, code_line_number, road_width, nozzle_offset, spindle_speed, data_points, data_points_index, feed_rate, deposition_delay, deposition_overlap) perimeter_slow_down = 0.75; %For with machining. Y_deposition_compensation = 0; %in with and without machining. deposition_radius = 0; %For with machining. deposition_overlap = 0; %actually set in Pyramid_Topless, but set to 0 here for with machining.
data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; Y = min_y + road_width + deposition_radius - Y_deposition_compensation; for road_pass_number = 1 : (num_of_x_roads - 3) % "-3" because 2 are deposited in the perimeter, and the thrid because it is already in position for the first. X = min_x + (road_pass_number*road_width) - deposition_radius; if road_pass_number > 1 % To skip first lower left point of the zig zag pattern (already at the correct X first time). fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end if Y == min_y + road_width + deposition_radius - Y_deposition_compensation % Zig-Zagging to fill in section. Y = min_y + length - road_width - deposition_radius; else Y = min_y + road_width + deposition_radius - Y_deposition_compensation; end if X > (base + min_x - (1.15*road_width) - deposition_radius) % Deposits slower if there is < 15% of a road gap. fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(0.75*feed_rate),' (Move)\n']) else % Deposit at normal speed fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) end code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end if X < (base + min_x - (1.25*road_width) - deposition_radius) % Deposits another road if there is < 25% of a road gap. road_pass_number = road_pass_number + 1; X = min_x + (road_pass_number*road_width) - deposition_radius; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n'])
113
code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; if Y == min_y + road_width + deposition_radius - Y_deposition_compensation % Zig-Zagging to fill in section. Y = min_y + length - road_width - deposition_radius; else Y = min_y + road_width + deposition_radius - Y_deposition_compensation; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end SUB-FUNCTION Zig_Zag_Machining.M function [code_line_number, X, Y, Z, data_points, data_points_index] = Zig_Zag_Machining(height_level, layer_thickness, base, length, min_x, min_y, num_of_x_roads, X, Y, Z, nozzle_offset, code_line_number, data_points, data_points_index, feed_rate, Z_feed_rate, Machining_feed_rate, X_offset, Y_offset, Z_offset, Router_diameter, prototype_height, deposition_overlap, base_height) fprintf('(Begin Machining)\n') Overlap = 1.25; Router_diameter = Router_diameter/Overlap; Y = Y_offset - (3*Router_diameter); X = min_x + X_offset - (0.5*Router_diameter) - deposition_overlap; % Slightly left of first road width num_of_x_roads = ceil((base + (2*deposition_overlap)) / Router_diameter) + 1; % Using overlap fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move to initial XY)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; Z = height_level + layer_thickness + Z_offset + base_height; %this one is for machining all layers.
114
fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' Z',num2str(Z),' F',num2str(Z_feed_rate),' (Move down)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; for road_pass_number = 1 : num_of_x_roads prev_Y = Y; if Y == min_y + Y_offset + length + Router_diameter % Zig-Zagging to fill in section. Y = min_y + Y_offset - Router_diameter; else Y = min_y + Y_offset + length + Router_diameter; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(Machining_feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; prev_X = X; X = min_x + X_offset + (road_pass_number*Router_diameter) - (0.5*Router_diameter); % Centred on road width fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(Machining_feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end X = (X_offset - (0.5*Router_diameter)); Y = (Y_offset - (2*Router_diameter)); fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move into position for Perimeter Machining)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; %end Router_diameter = Router_diameter*Overlap; % Resetting back to actual Router_diameter from overlap compensation. fprintf('(End Machining)\n\n')
115
SUB-FUNCTION Perimeter_Machining_TopDown.M
function [code_line_number, X, Y, Z, data_points, data_points_index] = Perimeter_Machining_TopDown(height_level, bottom_base, bottom_length, X, Y, Z, code_line_number, data_points, data_points_index, feed_rate, Z_feed_rate, Machining_feed_rate, X_offset, Y_offset, Z_offset, Router_diameter, prototype_height, north_angle, south_angle, east_angle, west_angle, base_height) perimeter_layer_thickness = 0.010; Perimeter_Cuts = ceil(prototype_height/perimeter_layer_thickness); Perimeter_Machining_feed_rate = 7.5; for perimeter_layer = 0 : (Perimeter_Cuts + 10) %+8 to cut the base, +2 to cut into the base. X = X - (0.5*Router_diameter); if abs(X) <= 0.001 % DeskNC can't read exponential terms. X = 0; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(Perimeter_Machining_feed_rate),' (Move Left)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; Z = Z_offset + prototype_height - (perimeter_layer*perimeter_layer_thickness); if abs(Z) <= 0.001 Z = 0; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' Z',num2str(Z),' F',num2str(Z_feed_rate),' (Move Into Perimeter_Machining Position)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; X = X + (0.5*Router_diameter); if abs(X) <= 0.001 % DeskNC can't read exponential terms. X = 0; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(Perimeter_Machining_feed_rate),' (Move Right)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; if perimeter_layer <= Perimeter_Cuts current_base = bottom_base - (Perimeter_Cuts - perimeter_layer)*perimeter_layer_thickness*( tan(west_angle) + tan(east_angle) );
MAIN CODE Pyramid_Topless_Deposition_Only.M (sub-function codes follow) clc clear all nozzle_diameter = 5/64 %input('\n\nPlease input the nozzle orafice diameter (fraction or decimal) you are using: '); tic %Inputting Vertecies and normals [top_normal, top_face_vertecies, south_normal, south_face_vertecies, north_normal, north_face_vertecies, bottom_normal, bottom_face_vertecies, west_normal, west_face_vertecies, east_normal, east_face_vertecies] = input_vertecies; clc fprintf('Please wait while the G-Code is being Generated\n') % Find distance between top and bottom plane of prototype prototype_height = top_face_vertecies(1,3) - bottom_face_vertecies(1,3); % End Find distance between top and bottom plane of prototype % Caclulating side inclination angles from vertecies % Angle is defined as vertical to surface tangent (opposite to Directed Studies Report definition) west_angle = atan( (west_face_vertecies(1,1)-west_face_vertecies(2,1)) / (west_face_vertecies(1,3)-west_face_vertecies(2,3))); west_angle_displayed = round((180/pi)*west_angle); south_angle = atan( (south_face_vertecies(1,2)-south_face_vertecies(2,2)) / (south_face_vertecies(1,3)-south_face_vertecies(2,3))); south_angle_displayed = round((180/pi)*south_angle); east_angle = atan( (east_face_vertecies(1,1)-east_face_vertecies(2,1)) / (east_face_vertecies(2,3)-east_face_vertecies(1,3))); east_angle_displayed = round((180/pi)*east_angle); north_angle = atan( (north_face_vertecies(1,2)-north_face_vertecies(2,2)) / (north_face_vertecies(2,3)-north_face_vertecies(1,3))); north_angle_displayed = round((180/pi)*north_angle); % End Caclulating side inclination angles from vertecies % Calculate Cad Model (theoretical) volume (in^3) if west_angle_displayed==15 & south_angle_displayed==30 & east_angle_displayed==45 & north_angle_displayed==60 cad_model_volume = 0.8152; %(1.44x2) end % End Calculate Cad Model (theoretical) volume bottom_base = bottom_face_vertecies(1,1)-bottom_face_vertecies(3,1); bottom_length = bottom_face_vertecies(1,2)-bottom_face_vertecies(2,2); deposition_delay = 0.75; % sec layer_thickness = 0.080; nozzle_offset_value = 1.25; %(times current layer thickness) road_width = 0.080; deposition_overlap = 0; XY_feed_rate = 6.0; Z_feed_rate = 1.5; code_line_number = 10; fittest = 1;
119
data_points = 0; % Array for datapoints to be written to a text file. data_points_index = 1; spindle_speed = 4; layer = 0; height_level = 0; X = 0; Y = 0; Z = 0.12; base_height = 0.080;%inch while height_level < prototype_height %+ base_height % Looping for every layer. %The Base is actually deposited in the negative heigh_level. %The +base_height is to deposit another layer on the top so it can be machined down to the correct height. layer = layer + 1; if height_level < prototype_height + base_height - layer_thickness %for every layer but the top. base = bottom_base - height_level*( tan(west_angle) + tan(east_angle) ); length = bottom_length - height_level*( tan(south_angle) + tan(north_angle) ); min_x = height_level*tan(west_angle); min_y = height_level*tan(south_angle); else %for the top extra deposited layer only. base = bottom_base - (height_level - layer_thickness)*( tan(west_angle) + tan(east_angle) ); length = bottom_length - (height_level - layer_thickness)*( tan(south_angle) + tan(north_angle) ); min_x = (height_level - layer_thickness)*tan(west_angle); min_y = (height_level - layer_thickness)*tan(south_angle); end nozzle_offset = nozzle_offset_value*layer_thickness; feed_rate = XY_feed_rate; % Setting to always do same feed rate as calibrated for the machine deposition_method = 2; % Setting to always do this deposition method if layer == 1 % print out setup G-Code. clc layer = layer + 1; % fprintf('O Topless_Pyramid_G_Gode - Program Name\n') % fprintf(['N',num2str(code_line_number),' G20 (Inch mode)\n']) % code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G90 (Absolute mode)\n']) % code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G54 (Set coordinate system to part)\n']) % code_line_number = code_line_number + 10; % fprintf(['N',num2str(code_line_number),' G43 H1 % (nozzle height compensation)\n']) % code_line_number = code_line_number + 10; % ************************************************************************************************************* % This code is for adding a single layer base to the pyramid. % Must set Z=0 at Z=layer_thickness. Thus the first layer (the base) will be deposited in the -Z region. height_level = height_level - layer_thickness; Z = nozzle_offset - layer_thickness; X = -1.5; Y = -0.75;
X = min_x + (road_pass_number*road_width) + deposition_radius; if road_pass_number > 1 % To skip first lower left point of the zig zag pattern (already at the correct X first time). fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end if Y == min_y + road_width + deposition_radius - Y_deposition_compensation % Zig-Zagging to fill in section. Y = min_y + length - road_width - deposition_radius; else Y = min_y + road_width + deposition_radius - Y_deposition_compensation; end if (X > (base + min_x - (1.15*road_width) - deposition_radius)) % Deposits slower if there is < 15% of a road gap. fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(0.75*feed_rate),' (Move)\n']) else % Deposit at normal speed fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) end code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end if layer == 6 %X < (base + min_x - (1.25*road_width) - deposition_radius) % Deposits another road if there is < 25% of a road gap. road_pass_number = road_pass_number + 1; X = min_x + (road_pass_number*road_width) + deposition_radius; fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z;
126
data_points_index = data_points_index +1; if Y == min_y + road_width + deposition_radius - Y_deposition_compensation % Zig-Zagging to fill in section. Y = min_y + length - road_width - deposition_radius; else Y = min_y + road_width + deposition_radius - Y_deposition_compensation; end fprintf(['N',num2str(code_line_number),' G01 X',num2str(X),' Y',num2str(Y),' F',num2str(feed_rate),' (Move)\n']) code_line_number = code_line_number + 10; fprintf(['N',num2str(code_line_number),' G04 X',num2str(deposition_delay*10),' (dwell ',num2str(deposition_delay),'sec)\n']) code_line_number = code_line_number + 10; data_points(data_points_index,1) = X; data_points(data_points_index,2) = Y; data_points(data_points_index,3) = Z; data_points_index = data_points_index +1; end
127
B3 – MasterCAM Deposition Path Generation Modified Post Processor
*The following are the modified sections of the post processor MPGEN5X.pst. The page
number indicated denotes where the code is found in the original post processor file when
opened in Microsoft Word. The note in brackets indicates the nature of the modification.
p.14 (removing Tool selection comments)
##### Custom changes allowed below #####
ptoolcomment #Comment for tool tnote = t toffnote = tloffno tlngnote = tlngno pstrtool #Comment for tool if strtool <> sblank, [ strtool = ucase(strtool) *strtool, " " ] pcomment #Comment from manual entry (must call pcomment2 if booleans) pcomment2 pcomment2 #Comment from manual entry scomm = ucase (scomm) if gcode = 1006 | gcode = 1026, scomm else, n, "(", scomm, ")" if gcode <> 1007 & gcode <> 1026, e ##### Stop custom changes ##### p.14-15 (reducing output in “else, #5-axis mode”) ##### Custom changes allowed below ##### if mill_plus, #HEXAPOD DOES NOT USE MILL_PLUS# [ if stagetool <= one, if stagetool = one, if n_tpln_mch > m_one, #Toolplane mode [ if lng3(tox_g), pbld, n, "G93", *tox_g, *toy_g, *toz_g, e
128
pbld, n, sg07, *s_out, pf_d_ang, *p_out, str_l1, e pbld, n, *sgabsinc, e pcan1, pbld, n, *sgcode, *xout, *yout, strctxt, e ] else, #5 axis mode [ plane_2 = zero pbld, n, sgplane, e pbld, n, sg07, str_l1, e pbld, n, *sgabsinc, e pcan1, pbld, n, *xout, *yout, *p_out, e ] pbld, n, *zout, e pbld, n, scoolant, e !n_tpln_mch ] else, [ if stagetool <= one, if cut_ra_head & use_g45, #Swap xout and yout based on offset axis [ tloffno2 = tlngno + g45_of_add pcan1, pbld, n, *sgcode, pwcs, *sgabsinc, *yout, *p_out, *s_out, *speed, *spindle, pgear, strctxt, e pbld, n, "G45", *tloffno2, *xout, e ] else, [ #pcan1, pbld, n, *sgcode, pwcs, *sgabsinc, *xout, *yout, *p_out, *s_out, #Stock Lines # *speed, *spindle, pgear, strctxt, e #G00 G54 G90 X.9601 Y.2771 C0. B0. S5000 M3 #Stock Lines pcan1, pbld, n, *sgcode, *xout, *yout, *p_out, *s_out, e #G00 X.9601 Y.2771 C0. B0. #First U and V line. ] if stagetool = one, pbld, n, *next_tool, e #pbld, n, "G43", *tlngno, *zout, scoolant, e #G43 H1 Z.48 #Stock Line pbld, n, *zout, e #Z.48# ] ##### Stop custom changes ##### p.15-16 (modifying 5-axis pitch and roll coordinates. Replaced entire code after main “else”) ##### Custom changes allowed below ##### if mill_plus, [ if n_tpln_mch > m_one, [ pcan1, pbld, n, pwcs, e if lng3(tox_g), pbld, n, "G93", *tox_g, *toy_g, *toz_g, e pbld, n, sg07, *s_out, pf_d_ang, *p_out, str_l1, e pbld, n, *sgabsinc, e pcan1, pbld, n, *sgcode, *xout, *yout, strctxt, e ]
129
else, [ pbld, n, pwcs, e if prv_n_tpln_mch > zero, [ plane_2 = zero pbld, n, sgplane, e pbld, n, sg07, str_l1, e pbld, n, sgabsinc, e ] pcan1, pbld, n, *sgcode, *xout, *yout, *p_out, *s_out, strctxt, e ] pbld, n, *zout, e ] #else, pbld, n, pwcs, sgabsinc, *xout, *yout, *zout, *p_out, *s_out, e #Stock Line else, if p_out = 0 & s_out = -30, [ pbld, n, *xout, *yout, *zout, "U0.", "V-30.", e ] if p_out = 90 & s_out = -45, [ pbld, n, *xout, *yout, *zout, "U-45.", "V0.", e ] if p_out = 180 & s_out = -46, [ pbld, n, *xout, *yout, *zout, "U0.", "V46.", e ] if p_out = 270 & s_out = -46, [ pbld, n, *xout, *yout, *zout, "U46.", "V0.", e ] !n_tpln_mch ##### Stop custom changes ##### p.16-17 (commenting out outputs in “if not(mill_plus)”) ##### Custom changes allowed below ##### if ntools = one, [ #skip single tool outputs, stagetool must be on stagetool = m_one !next_tool ] if progno = zero, progno = one if not(mill_plus), [ #pbld, n, *smetric, e #commented out
130
#pbld, n, "G00", *sgplane, "G40", "G80", "G90", *sgfeed, "G98", e #commented out ] sav_absinc = absinc absinc = one prefreturn #xout, p_out not output here absinc = zero p_absinc_chng ptoolcomment comment pcan ##### Stop custom changes ##### p.18 (removing outputs) ##### Custom changes allowed below ##### if not(mill_plus), sav_absinc = absinc absinc = one prefreturn #xout, p_out not output here absinc = sav_absinc ptoolcomment comment pcan sav_absinc = absinc absinc = zero p_absinc_chng ##### Stop custom changes ##### p.18-19 (replacing code after main “else” to set the feed rate). ##### Custom changes allowed below ##### pbld, n, scoolant, e pbld, n, sccomp, spindle, e pbld, n, s_plock, e pbld, n, s_slock, e absinc = one prefreturn #xout, p_out not output here absinc = sav_absinc if mill_plus, [ pbld, n, sg28, *g74zabs, "L1", e #EOF on prv_gcode = 1003 if prv_gcode = 1003, pbld, n, sg28, *g74xabs, *g74yabs, e pbld, n, sg07, str_l1, e if lng3(tox_g), pbld, n, "G93", "X0.", "Y0.", "Z0.", e if prv_gcode = 1003, frc_cinit = one protretinc if prv_gcode = 1003,
131
[ pbld, n, sg07, s_out, pf_d_ang, p_out, str_l1, e ] ] #else, pbld, n, *sg28, protretinc, e # Stock Line else, pbld, n, protretinc, e prefreturn #Refernce return if not(mill_plus), [ #pbld, n, *sgcode, *sg28, *sgabsinc, "Z0.", e #Stock Line with G28 pbld, n, *sg01, "Z2.0", "F6.0", *sgfeed, e #Modified to include G01 and Feed Rate. Line1. if toolchng = one, pbld, n, *sgcode, *sg28ref, "X0.", "Y0.", e ] ##### Stop custom changes ##### p.21 (removing feed rate output, “#” comments out code) plinout #Output to NC of linear movement - feed if mill_plus, [ pbld, n, sgplane, e pbld, n, sgabsinc, e pbld, n, sgfeed, e ] #pcan1, pbld, n, `sgcode, sgplane, sgabsinc, sgfeed, pccdia, #xout, yout, zout, p_out, s_out, p_mpls_feed, `feed, strctxt, scoolant, e #Stock Lines pcan1, pbld, n, `sgcode, xout, yout, zout, e if nc_lout <> m_one & feed = zero, psfeederror
132
References [1] Hur J. et al., Hybrid rapid prototyping system using machining and deposition. Computer-Aided Design 34 (2002) 741-754. [2] Yan, X. et al., Survey: A review of rapid prototyping technologies and systems. Computer-Aided Design, Vol, 28. No. 4, pp. 307-318, 1996. [3] Pham, D.T. et al., A comparison of rapid prototyping technologies. International Journal of Machine Tools & Manufacture 38 (1998) 1257-1287. [4] Williams, R.E. et al., Investigation of the effect of various build methods on the performance of rapid prototyping (stereolithography). Journal of Materials Processing Technology 61 (1996) 173-178. [5] Jandric, M. et al., Effect of heat sink on microstructure of three-dimensional parts built by welding-based deposition. International Journal of Machine Tools & Manufacture 44 (2004) 785-796. [6] Hongjun, L. et al., A note on rapid manufacturing process of metallic parts based on SLS plastic prototype. Journal of Materials Processing Technology 142 (2003) 710-713. [7] Karunakaran, K.P. et al., Efficient stock cutting for laminated manufacturing. Computer-Aided Design 34 (2002) 281-298. [8] Tyberg, J. et al., FDM systems and local adaptive slicing. Materials and Design 20 (1999) 77-82. [9] Grida, I. et al., Extrusion freeforming of ceramics through fine nozzles. Journal of the European Ceramic Society 23 (2003) 629-635. [10] Dimension Printing, Online Articles, http://www.dimensionprinting.com/company/company-articles.shtml (April, 2006). [11] Madahian P., Implementation and testing of a 3-D hybrid rapid prototyping system capable of deposition and machining. Ryerson University Masters Thesis Report (2003). [12] Salustri F., Design Methodologies, http://deseng.ryerson.ca/dm1016/ (April, 2006). [13] Groover, M.P., Fundamentals of Modern Manufacturing: Materials, Processes, and Systems, John Wiley & Sons, Inc, New York, 1999. [14] Zhong, W. et al., Short fiber reinforced composites for fused deposition modeling. Materials Science and Engineering A301 (2001) 125–130.
133
[15] Juvinal, R.C. et al., Fundamentals of Machine Component Design, 3rd Edition. John Wiley & Sons, Inc, New York, 2000. [16] Rosato, D.V. et al., Plastics Design Handbook. Springer-Verlag. USA, 2001. [17] Pandey, P.M. et al., Improvement of surface finish by staircase machining in fused deposition modeling. Journal of Materials Processing Technology 132 (2003) 323-331. [18] Pratt, M.J. et al., Progress towards an international standard for data transfer in rapid prototyping and layered manufacturing. Computer-Aided Design 34 (2002) 1111-1121. [19] Chen, Y.H. et al., The development of a layer based machining system. Computer-Aided Design 33 (2001) 331-342. [20] Campbell, R.I. et al., Surface roughness visualisation for rapid prototyping models. Computer-Aided Design 34 (2002) 717-725.