Report Project CNC
Report Project CNC
SANA'A UNIVERSITY
FACULTY OF ENGINEERING
MECHATRONICS ENGINEERING DEPARTMENT
Project name:
CNC Engraver Machine Using Microcontroller
Done by:
Ahmed Ameen Al zubaidi AC. No:202073064
Mohammed Saleh AL_Sormi AC.NO: 202073240
Abdulrahman Mohammed Al-Aghbary A.C .NO:202174018
Rian Adnan Al-Aghbary AC.NO: 202174102
Motaz Essam AL-Qershi A.C.NO:202174048
Osama AlMasry A.C.NO:202170235
Rabie sarhan mohammed alabri A.C.No. 202274313
Supervised by:
Dr. Abdulah Dhiban
Project overview:
The term “CNC” refers to the process in which a computer follows a
set of instructions to send pulses to a stepper motor, power a spindle, heat an
extruder, or pulse a laser. Whatever type of CNC machine it may be, will have
a computer driving it. This project is 3-axis Router CNC machine the purpose
of this machine is to engrave on the wood. A simple 3-axis router CNC
machine is employed in a small work area and low cost. CNC means
Computer Numerical Control of machines. This is exactly the mission of
mechatronics is to control the machines using computer, this is the reason that
makes us choosing this project. The structure of the machine composed of
acrylic plastic for the frame, MDF (Medium-density fiberboard) wood is used
for the base. The motion of the system depends on four stepper motors, the
screws and nuts will convert the rotational motion to a linear motion and in
addition to the use of stainless-steel shaft to support the system. Arduino Uno
is used to control the system instead of specialized computers for each type
of machine. Autodesk Inventor 2020 (which encompasses the whole process
of planning, testing and executing a 3D design) have been used to make the
design and convert it to G-code. Universal G-code sender to send the G-code
to the Arduino, and the Arduino used to control the motion of CNC machine.
2
Table of content
Project overview____________________________________________________ 1
2.1Introduction_____________________________________8
3.2 Software____________________________________ 22
3
3.2.2 GRBL ______________________________________________________ 23
3.2.3 Universal-G-Code-Sender______________________________________ 23
4.2Results_______________________________________________________ 39
4.2.1 The Final CNC-Machine ________________________________________ 39
4.2.2 Results of CNC-Machine Operation Tests __________________________ 41
References _______________________________________________________ 48
4
Table of Figure
Figure 1: CNC-Machine Model _______________________________________________________________ 2
Figure 2: CNC router _______________________________________________________________________ 9
Figure 3: CNC plasma ______________________________________________________________________ 9
Figure 4: CNC laser _______________________________________________________________________ 10
Figure 5: 3D printers ______________________________________________________________________ 10
Figure 6: Pick and Place CNC________________________________________________________________ 11
Figure 7:CNC-machine using steps ___________________________________________________________ 12
Figure 8: Computer Aided Design (CAD) step ___________________________________________________ 12
Figure 9: Computer Aided Manufacturing (CAM) step ____________________________________________ 13
Figure 10: G-code step ____________________________________________________________________ 14
Figure 11: Machining Stage ________________________________________________________________ 14
Figure 12: Arduino IDE ____________________________________________________________________ 15
Figure 13:Arduino UNO ____________________________________________________________________ 15
Figure 15: CNC-shield-V3 __________________________________________________________________ 16
Figure 16: Stepper Motor Driver a4988 _______________________________________________________ 16
Figure 17: Stainless Steel Shaft ______________________________________________________________ 17
Figure 18: Lead Screw with trapezoidal nut ____________________________________________________ 18
Figure 19: Linear Bearing Block _____________________________________________________________ 18
Figure 20: Shaft Support ___________________________________________________________________ 18
Figure 21: Flexible Coupling ________________________________________________________________ 19
Figure 22: Spindle Holder __________________________________________________________________ 19
Figure 23: Acrylic Plate ____________________________________________________________________ 20
Figure 24: Stepper Motor NEMA 17 __________________________________________________________ 21
Figure 25: 400W Spindle ___________________________________________________________________ 21
Figure 26: Autodesk Invertor 2020 ___________________________________________________________ 22
Figure 27: Grbl __________________________________________________________________________ 23
Figure 28: Universal G-Code Sender __________________________________________________________ 23
Figure 29: X-axis motor side ________________________________________________________________ 25
Figure 30: X-axis ball bearing side ___________________________________________________________ 25
Figure 31: Y-axis ball bearing corner _________________________________________________________ 26
Figure 32: Y-axis motor corner ______________________________________________________________ 26
Figure 33: Z-axis carriage side ______________________________________________________________ 26
Figure 34: Z-axis motor side ________________________________________________________________ 27
Figure 35: Z-axis ball bearing side ___________________________________________________________ 27
Figure 36: Spindle carriage _________________________________________________________________ 28
Figure 37: CNC-machine design isometric view. _________________________________________________ 29
5
Figure 38: CNC-machine design side view. _____________________________________________________ 29
Figure 39: CNC-machine design top view. _____________________________________________________ 30
Figure 40: CNC-machine design front view. ____________________________________________________ 30
Figure 41: Displacement Analysis result of Y-axis ________________________________________________ 32
Figure 42: Displacement Analysis result of X-axis ________________________________________________ 33
Figure 43: Von Mises Stress Analysis result of Y-axis _____________________________________________ 34
Figure 44: Von Mises Stress Analysis result of X-axis _____________________________________________ 35
Figure 45: circuit connection ________________________________________________________________
36
Figure 46: Vref terminals __________________________________________________________________ 37
Figure 47: CNC-machine isometric view _______________________________________________________ 39
Figure 48: CNC-machine front view __________________________________________________________ 40
Figure 49: CNC-machine side view ___________________________________________________________ 40
Figure 50: Firsts results of machining tests _____________________________________________________
41
Figure 51: Finale accuracy level _____________________________________________________________ 41
Figure 52: engrave on MDF ________________________________________________________________ 42
Figure 53: wood milling ___________________________________________________________________ 42
Figure 54: to 4-axes CNC machine ___________________________________________________________ 44
Figure 55: design configuration to hidden Y-axis under the work table. ______________________________ 45
Figure 56: 3-D printed linear bearing block ____________________________________________________ 47
Figure 57: Connect the screw to structure using shaft support SK10 ________________________________ 47
6
Chapter one Introduction
1.1 Preview: -
7
Chapter two Introduction to CNC machine and
Working Stages
2.1 Introduction
8
1. Router: - A CNC router can cut and engrave wood, metal, or plastic
and is a very common type of CNC machine. The user does not
manipulate the router, only enters information into the computer.
Such as milling machines, lathes machine and grinders.
2. Plasma: - CNC plasma cutters are used to cut metal and wood (2
dimensional) and do not require as much power as a CNC router. These
machines use a plasma torch to penetrate wood or sheet metal.
9
Figure 3: CNC plasma
3. Laser: - CNC laser cutters operate quite like CNC plasma cutters,
but instead, a laser is used to cut the wood or metal. Lasers can also
be used to cut plastic.
10
4. 3D Printer: - 3D printers use CNC technology and operate using
similar technology as CNC lasers, but utilize an extruder to slowly
deposit plastic in a consistent motion until the desired product is
complete.
Figure 5: 3D printers
5. Pick and Place: - Pick and Place CNC Machines consist of several
nozzles that pick up electrical components for electronic equipment
and place them in the desired location. These are very commonly
used in the construction of cell phones, computers, tablets, etc.
11
2.1.2 Applications of CNC machine:
There are four steps to using the CNC machine for the machining process,
each step has several programs to do this. This section explains those steps and
12
the program that we used for each step in this project. Figure [7] show steps
for using a CNC-machine.
2. SolidWorks.
3. Fusion 360.
13
• Checking if the model has any geometry errors that will
impact the manufacturing process.
• Creating a toolpath for the model, which is a set of
coordinates the machine will follow during the machining
process.
• Setting any required machine parameters including cutting
speed, voltage, feed rate, etc.
2.2.3 G-code:
14
preparatory codes, in a CNC program they begin with the letter
G and direct the machine. Figure [10] show G-code step. [6]
Orders are sent from the G-code to the machine, which responds to it by
performing machining process by stepping motor movement and spindle
movement. Figure [11] show Machining Stage.
15
Chapter Three Hardware and Software
3.1 Hardware
16
3.1.1.2 CNC-Shield-V3 (× 1).
Features:
17
Features:
The material properties of stainless steel shaft are shown in the table [1].
Also, the dimensions and quantiles shown in table [2].
18
3.1.2.2 Lead Screw with Trapezoidal Nut (8mm Dia.).
Flexible couplings are usually used to transmit torque from one shaft to
another when the two shafts are slightly misaligned. They can also be
used for vibration damping or noise reduction
19
3.1.2.7 Ball Bearing 608ZZ (8mm inner Dia.) (× 4).
Is are made from acrylic, and they carry the motors, spindle and other
parts. Acrylic boards are drawn and designed in Autodesk Inverter 2020
and the boards are cut with laser CNC-Machine. The material properties
for acrylic are shown in table [6].
20
3.1.3 Electrical Parts
Features
• Speed range 6000-32000 RPM with 6000 RPM step.
• Voltage 220V.
• The maximum diameter of the cartridge is 6 mm
21
Figure 24: 400W Spindle
3.2 Software
Inventor CAM is software that use to create advanced tool paths to machine
models using 2.5D, 3D and 3+2 milling applications, as well as support for
Simultaneous 4- and 5-axis features for machining complex models
including multi-axis contouring [13].
22
Figure 25: Autodesk Invertor 2020
Chapter 4
Calculations and Results
4.1 Calculations
Initially, we considered using 3D printed parts. This was our first choice
because the 3-D printer prints parts with high accuracy and with desired
design. However, 3D printing is very expensive and the resulting parts do
not have enough strength. We searched a lot to find a material with high
23
strength and can be cut with CNC machine, so we can get the design that
we desired.
We select acrylic as the material for the frame. We can get the desired
shape and size of acrylic with good price and very good precision by
cutting it with laser CNC-machine.
The machine structure consists of frame, base, supporting beam and motion
transition system.
24
one in the Y-axis. They are used to connect the parts of the
machine together, support and to guide the linear bearing. We
used 8 bearings to ensure stability and smooth motion, 4 in Y-
axis, 2 in X-axis and 2 in Z-axis. Figures [36] through [39] show
our 3-axes CNC-Machin
25
Figure 37: CNC-machine design side view.
26
4.1.2 Stress Analysis
4.1.1.2.1 Preview
Stress analysis was done using the Auto Disk Inverter 2020 program and
obtaining the results for both the Deflection in the Beam and the Von Mises
Stress, and then the safety coefficient was calculated to ensure the safety
of the design.
We assumed that the center of gravity was located at the farthest point of
the spindle from the X-axis and this gives worse conditions on the beams,
so the supposed center of gravity is 12cm from the X-axis.
The spindle mass was measured with the Z axis components, which is the
mass loaded on the X-axis. And by measuring the mass of the components
of the X-axis and adding them to the mass of the components of Z-axis, we
have the mass loaded on the Y-axis
27
The mass loaded on the X-axis = 2.45 kg
Stress analysis was performed on the case when the Z-axis is in the
middle of the X-axis, as well as the X-axis in the middle of the Y-axis.
This gives the highest stress and deflection in the axis.
28
Y-axis (length 500 mm) :
Min. limit = 0.0005 * 500 = 0.25 mm
Max. limit = 0.003 * 500 = 1.5 mm
Deflection in Y-axis = 0.5625 mm
0.25 < 0.5625 < 1 is safe.
29
4.1.1.2.3 Von Mises Stress Analysis
Yield Strength of Stainless Steel = 250 MPa
30
Von Mises Stress Analysis X-axis
31
4.1.2 Electrical Connection
Installing the CNC Shield on the Arduino and installing the stepper
motor drivers a4988 on the CNC-Shield. We enabled the micro steps by
connecting their own pins to 5V, as well as connecting the pins
responsible for copying the Y axis of CNC-shield to the A axis to get
two stepper motor that have the same movement on the Y axis. The
stepper motors are connected to the CNC-Shield. 20V power source is
connected to the CNC Shield. The circuit scheme is shown in figure [44].
32
cause rotor demagnetization. So, any design that uses micro stepping
needs current limiting, as different windings require different current
levels [17]. The stepper motor driver A4988 allows to set a target current
anywhere between some mA up to a bit less than 2A, this is
accomplished by adjusting what is called the Vref (reference voltage)
when turning the potentiometer resistance of a4988 on a clockwise
direction the Vref voltage will increase and decrease when rotating it
counterclockwise [18].
Vref = Imax * 8 * Rs
Our stepper motors have 1.2A rated current, we will operate it at 70%
of it’s rated current for safety, so:
In this section will calculate how many distance the spindle will move
when stepper motor move one step.
33
We had set stepper motor driver a4988 one 1/16 step mode. NEMA 17
stepper motor step angle is 1.8 𝑜 and number of steps per revolution is
200 steps.
Because we set a4988 on 1/16 step mode now the step angle will give
by: new step angle = 1.8/16 = 0.112𝟓 °
So, the new number of steps per revolution will become = 3,200 steps
The lead screw we used contains 2mm pitch and the fourth thread.
Therefore, the distance for each revolution will be given by:
Then:
4.2 Results
34
Tests The machine has been tested in several milling and engraving
operations on wood, and work has been done to improve accuracy until
it reaches an excellent level. The results of these tests appear in figures
[49] and [51] and it shows improvement in work.
5.1 Conclusions
35
• We had chosen this project because it combines mechanics and
electronics, controlling the machines using computer and this is
exactly the mission of mechatronics. We made a complete
mechanical design with stress analysis using Inventor program
from Autodesk.
• So that we could choose the appropriate parts for our machine.
Our project is to make a simple 3-axis router CNC machine of
small work area and low cost.
• We used acrylic (PMMA) for the frame, we designed it with an
Inverter program and cut it with a CNC laser.
• We used MDF wood for the base.
• We use drill for engraving.
• The motion system depends on four stepper motors one for x-axis,
one for z-axis and we used two for Y-axis to get higher stability.
• We used screws-nuts system to convert the rotational motion from
motors into linear motion.
• We used Arduino Uno as a controller
• Inventor CAM program to create 3D model and convert into G-
code. The motion of CNC will be controlled by GRBL program.
The goal of switching some parts is to use higher quality parts and better
capabilities, to increase accuracy and eliminate misalignment and
vibration. Noting that the required parts for the improvements are either
not available in Iraq or that are very expensive.
37
• Adding another ball bearing support for lead screw on the side of
the stepper motor, which will increase the stability of the lead
screw
5.3 problems
During our work in the project we faced many problems, the reasons of
these problems are
• The cost of the components of the machine was a big problem for
us. At first, we made a complete design to make the structure of
the machine by using 3-D printed parts. But the 3-D costs a lot, so
we made a new design and we chose acrylic plates to be our
structure. The acrylic has high strength and we can get the desired
parts by cutting it with CNC machine and it costs half of the 3-D
printed parts.
• The drills that are used in CNC machines must be of light weight
and small size, and this type of drills have very high price (+70$),
we could not buy it because of its high price. We searched in the
local markets for alternatives, then we found one that suits our
work with much lower price.
• The stepper motors that used in CNC are of bipolar type and they
must have high accuracy. This type of motors has high price
(+20$). We passed this problem by buying second hand motors
which costs us much lower price. These motors were of Unipolar
38
type and we need bipolar type. Then we could find a solution and
passed this problem by using only four wires of the unipolar motor
so it becomes bipolar.
References:
[1] https://www.tramarindustries.com/2019/05/20/5-common-types-
of-cncmachines/
[2] https://www.coadengineering.com/industrial-applications-of-
cncmachines/#:~:text=Unquestionably%2C%20there%20are%20
various%20ind
ustrial,CNC%20machines%20in%20many%20fields.&text=Plasti
39
c%2C%20
metal%2C%20computer%20parts%2C,machine%20users%2C%2
0among% 20other%20firms.
[3] http://www.technologystudent.com/cam/cncman4.htm
[4] https://en.wikipedia.org/wiki/Computer-aided_design
[5] https://www.autodesk.com/products/fusion-360/blog/computer-
aidedmanufacturing-beginners/
[6] https://en.wikipedia.org/wiki/G-code
[7] https://en.wikipedia.org/wiki/Arduino_Uno
[8] http://makerhardware.net/wiki/doku.php?id=electronics:cnc_shiel
d
[10] https://en.wikipedia.org/wiki/Linear-motion_bearing
[11] https://www.elprocus.com/stepper-motor-types-
advantagesapplications/
[12] https://en.wikipedia.org/wiki/Autodesk_Inventor
[13] https://www.graitecusa.com/cad-
software/manufacturing/inventor-hsmcam
[14] https://github.com/grbl/grbl
[15] https://github.com/winder/Universal-G-Code-Sender
40