Translated from Indonesian to English - www.onlinedoctranslator.
com
CNC MACHINE CONTROL SYSTEM DESIGNMILLING3AXIS
USECLOSE LOOP SYSTEM
Ikhlash Syukran Harrizal1, Syafri2, Adhy Prayitno3
Department of Mechanical Engineering, University of Riau, Bina Widya Panam Campus, Pekanbaru, 28293
1ikhlash_syukran@yahoo.com ,2prie_00m022@yahoo.com ,3adhyprayitno_hadi@eng.unri.ac.id
ABSTRACT
Multi-axis CNC machines require a circuit control system that functions as the brain of the machine. The aim of
this research is to design and develop a CNC milling machine control circuit with 3-axis movement. All
machining parameters will be regulated and operated through a control system so that the machine can
operate according to design in three axes. In designing this control system, 3 stepper motors are used as the
driving force, where each motor is used to move the machine against the x, y and z axes. There are several
steps that must be taken in this design, such as selecting control element data. Next, the control elements
consisting of Breakout Board, Motor Driver, Stepper Motor, Power Supply, Limit Switch, and Emergency Stop
are assembled according to the schematic control design. The control system is connected to a PC via the
Mach3 software interface for use as an actuator driver. Before being used for the machining process, the
control system needs to be calibrated so that the machine's shear dimensions match the PC command
dimensions. The control system on CNC machines is designed using a close loop system where there is a Limit
Switch as a feedback sensor to the machine, so that if an error occurs on the machine track, the sensor will
order the spindle to return home. position.
Key Words:CNC, Control System, Elements of Control, Mach3, Close Loop
1. Introduction 2. Methodology
One of the causes of the low productivity In designing CNC machine control
of domestic small and medium enterprises systems 3axis, there are several stages that
(SMEs) is due to the lack of capital to procure must be carried out, including selecting control
modern machine tools such as enginesnumeric element data, planninginterfacesand
controls(NC), therefore some SMEs engaged in calibration as in the chart shown in Figure 2.1.
manufacturing feel unable to provide these
machine tools for the production process. As a
result, SMEs are unable to produce products
with special geometries with high accuracy, so
they cannot compete with imported products
from various countries.
In the Department of Mechanical Engineering
at the University of Riau, research has been carried
out on the design and construction of CNC machine
mechanical construction prototypesmilling3 axisfor
small scale industries at low prices (Naldy, 2016). In
this research, the shape has been designed and the
adjustments have been calculated so that it is
possible to produce it. To complete the mechanical
construction of a CNC machine, a control system is
needed which will function as the brain of the
machine. Where all machining parameters will later
besetupand operated through the control system.
So this machine will be able to behave like a modern
machine which can operate in three axes.
This research will focus on the design and
manufacture of CNC machine control systems
milling3axis. Later this research will focus on
selecting control system components and system
assemblyinterfaces, so that the mechanical
construction of the CNC machine is connected to
a microprocessor controlled by a personal
computer (PC). Figure 2. 1Control System Design Flow Diagram
JOM FTEKNIK Volume 4 No. October 2, 2017 1
In running the control system, the
computer numerical control method is used,
which is a technique used to control tools and
processes on machines using code commands
(Rajput, 2016). Numerical control controls the
use of these instructions and translates them
into two types of control signals, namely
motion signals and alternating control signals
as illustrated in Figure 2.2. The control system
on CNC machines will work to replace most of
the work that is usually done by machine
operators.
Figure 2. 3Control System Circuit
(instructables.com)
2.2HardwareControl System
Hardwarein the control system is the
hardware (equipment) used in the CNC
machine control system 3-axis. As for some
hardwareused in CNC machine control systems
arestepper motors,motorbike driver,breakout
board,power supplies,limit switches, cables
Figure 2. 2Numerical Control Computers (Krar and Gill)
and PC.
2.1 Control System Circuit Schematic CNC is a
system that basically changes the
1. Stepper Motors
programming language (G-Code) into movements
Stepper motorsis a set of electromechanical
axison the machine. In the CNC system series devices that work by converting electronic pulses
there is a computer whose function is to change into discrete mechanical movements (Islami,
the characterG-Codeinto machine language which 2010).Stepper Motorsmove
is then processed and sent to each person based on the sequence of pulses given to the
motorbike driverin signal form, both analog and motor. Therefore, to movestepper motors
digital signals. controller is requiredstepper motorswhich
If there is an error (error) on either machine generates periodic pulses such asmotorbike
from the program driver.The basic construction of a stepper
entered or from the electrical system the motor can be seen in Figure 2.4.
machine will emitalarm codeand the ongoing
process will bepaused.
The numerical control system on a CNC
machine can run because there is a set of
control system components that support
machine operations such asstepper motors,
motorbike driver,control board breakout,
power suppliesand others. All these
components are then combined in such a way
with cables to form a particular electronic
Figure 2. 4.RQVWUXNVL GDVDU 0RWRU 6WHSSHU 6XVD¶DW
device. The design of the control system on the 2015)
CNC machine that is made is shown
schematically in Figure 2.3. In selected researchstepper motorsas an
actuator or driver. Electionstepper motors This
is done because the motorbike can be
controlled quite easily and has high accuracy.
The motors that will be used in this assembly
arestepper motorsNema23 type with 178.5 oz-
inch (1.26 Nm) of torque. Suitable for
machining PCB materials,acrylic, wood, and
aluminum. Form ofstepper motors Nema23
can be seen in Figure 2.5.
JOM FTEKNIK Volume 4 No. October 2, 2017 2
3. Motorcycle Drivers
Motorcycle Driversis a component that
functions to communicatecontrollers with the
actuator and amplifies the output signal from
the controller so that it can be read by the
actuator. In designing this control element
motorbike driverthat will be used isTB6560
boards for CNC machines 3axis.
Just like BOB,stepper motor drivers also
have someportswhich will later be connected
to eachportslike BOB signal input,stepper
motors,driver switch settings, DC power supply
, tabledriver settingsas shown in Figure 2.6.
Figure 2. 5Stepper MotorsNema23 (OMC-
stepperonline.com)
2. Breakout Boards
Breakout Boards(BOB) iselectronic cards
which functions to connect data signals from a
good computerinputnoroutputto the actuator.
BOB is the main component of the control
system which functions as the brain of the Figure 2. 6Motor Driver BoardTB6560
CNC. BOB will later function as a data signal
connector from the computer to the computer 4. Power SuppliesForStepper Motor Power
relaysordrivers,or also connect signal input Supplyis a device that functions as the
from the outside so it can be read on the PC. main provider of DC voltage power forCNC
BOB usesparallel portsDB25 computer that can Controllers, Stepper Motors,And Tools/
be accessed withMach3 software interface or Spindles.Basic functions ofpower supplies is to
softwareothers similar to work with parallel change AC voltage to DC voltage. Power
portsDB25. The BOB that will be used to design generated bypower suppliesThis is maintained
this control system is CNC ST-V3 Interface constantly in order to provide optimal supply
Board. formotorcycleAndspindle.The cable
BOB has severalportswhich will later be arrangement contained inpower supply ports
connected to eachportslike to PC, stepper can be seen in Figure 2.7.
motors3axis,input devices,usb connector and
power source (power). There is a complete
description of BOB andportsthe connector is
shown in Figure 2.5.
Figure 2. 7Power Supplies
5. Spindle
Spindleis part of the machine that will
become the housecutter. Spindlethis is what
regulates rotation and movementcutteron the
Z axis.Spindlethen driven by a motor equipped
Figure 2. 5 CNCST-V3 Breakout Board with a transmission systembeltingor
JOM FTEKNIK Volume 4 No. October 2, 2017 3
clutch.Formspindleused in this research is the opposite is true, under normal circumstances
shown in Figure 2.8. e-stop connected and when the button is pressed
the electric current will be cut off. In the
application,e-stop with NC conditions it is more
widely used because it returns to the function ofe-
stopitself is to be contactemergencyThe first
function is to cut off the electricity running on the
machine when in an emergency.
Figure 2. 8Spindle Kits(Qin, 2013)
Spindleis a very important part of the
machine because this component will be in
direct contact with the workpiece. In this case
for CNC machine design thentools that will be
used isSpindle Motor + ER11 Colletwith a
rotational speed of 3,000-12,000 rpm and a
power of 500 Watts.
6. Limit SwitchesAndEmergency Stop
Limit switchesis a type of switch equipped Figure 2. 10Emergency Stop(OMC-
with a valve that functions to replace a button. stepperonline.com)
Work principlelimit switches just like a switch
Push ON/OFFthat is, it will only connect when 2.3SoftwareControl System
the valve is pressed to a certain predetermined Softwarein the control system is the
pressure limit and will be disconnected when software (computer program) used to control
the valve is not pressed.Limit switches included the CNC machine 3-axis. Softwarewill then be
in the type of mechanical sensor, namely a installon a computer device and acts as
sensor that will provide electrical changes interfaces.Interfacesis software that functions
when mechanical changes occur on the sensor. to communicate all commands fromend users
Application oflimit switchesis a sensor for the so that it can be read well by everyone
position of a moving object. Symbols and hardware. As is interfacesThe CNC machine will
shapeslimit switchescan be seen in Figure 2.9. move according to a previously designed
program.
In this research, it is used as interfacesis
softwareMach3, namely acontrol software
created by ArtSoft USA. Available in formsfree
version Andcommercial version. Both versions
are relatively the same, but in the free version
Figure 2. 9Sensor symbols and shapeslimit switches
G-Codeonly 500 lines can be entered.
(OMC-stepperonline.com) Meanwhile for the paid version we can include
G-Code in numbers exceeding 10,000,000 lines
Emergency Stopis a type of switch that when (Fernety and Prentice, 2005). As for the
pressed will be locked and to release it must be program display Mach3shown in Figure 2.11.
turned, calledemergency stopto make it easier for
users to know the function of this switch, namely
to turn off the system in an emergency.
In Figure 2.10 it can be seenE-stophas 2 conditions
namelyNormally Close(NC) andNormally Open(NO). For
the NO state, under normal circumstances an electric
current passes throughe-stopin disconnected state.
When the buttone-stoppressed, then the current will be
connected. For NC conditions applies
JOM FTEKNIK Volume 4 No. October 2, 2017 4
3.2 Circuit SchematicLimit Switch and
Emergency Stopon CNCMilling3Axis Limit
Switchesfunctions as a signal giver feedback
to the computer.Limit Switcheswill work when
subjected to touch and sound EXQ\L ³NOLŃ
'DODP KDO LQLLimit Switcheswill give a
command signal to the computer that the
machine is moving to reach the maximum
working distance limit. After the computer
receives a signal from Limit Switches, The
computer will give a command signal toStepper
Motorsto move back to the starting position of
the work, namely at the coordinate point 0,0,0. By
using sensorsLimit Switches, it is found that the
maximum working limit on the x axis is 390 mm,
Figure 2. 11Initial ViewMach3(Fernety and the y axis is 340 mm and on the z axis is 98 mm.
Prentice, 2005) WhereasE-Stopfunctions as an emergency
button when an error occurs in the work
3. Results process. When the buttonE-Stoppressed, then
3.1 CNC Control Circuit SchematicMilling 3 E-Stopwill convey information to the computer
Axis that an error has occurred in the work process.
After selecting the CNC machine control Then the computer will give orders toStepper
system componentsmilling3axis, then Motorsto stop moving. This work series is also
assemble all the control components and called a work seriesinput. As for the network
connect them to the actuator on the machine. input signalson CNC controlmilling3axis can be
In Figure 3.1, the schematic results of the seen in Figure 3.2.
control system on a CNC machine are shown.
In the schematic there are several important
components that make up a CNC machine
including, Computer,Breakout Boards, Motor
Driver,Stepper Motors,Power Supplies,Limit
Switches, AndEmergency Stop.
Figure 3. 2Network schematiclimit switches and
emergency stopon CNCMilling3Axis
3.3 ConfigurationSpindle Motor
Spindleis one of the important actuators in
this series of CNC machines.spindlefunctions to
provide rotation to the cutting edge when
Figure 3. 1CNC control circuit schematicMilling3 carrying out work.Spindleneed power supplies
Axis
as a provider of electric current, rotation
regulator, etc. In a series of control systems
spindleownpower supply portsAlone
JOM FTEKNIK Volume 4 No. October 2, 2017 5
and not incorporated into the portpower Switches, apart from being a security
supplies for motorbikessteppers.As forpower component,Limit SwitchesIt can also be used
supply ports which is connected tospindleis at as a maximum range limit for each axis on a
the back as shown in Figure 3.3. CNC machine.
4. Motor Tuning
Motor Tuningfunctions to regulate the
required motor performance. There are several
points to pay attention to in the settings Motor
Tuningamong them areSteps Per, Velocity,And
Acceleration.
3.5 CalibrationMach3asInterface Software
After the rotation of each motor is
determined onMach3 software, then calibrate
the machine movement. This is done so that the
size of the machine movement is in accordance
Figure 3. 3PortsSuiteSpindle Power Supply
with the commands on the computer, such as
the 100 mm movement commandinterfaceswill
3.4 Setting ResultsMach3 Software Mach3is
be executed with a displacement of 100 mm on
the main software used on CNC machines.
the X axis of the CNC machine. CNC machine
Mach3will help computers convey information
calibration can be done in several steps,
signals and commands to machines in the form
including the following:
ofCode. There are several important
1. On the initial screenMach3SLOLK ³Settings Alt6´
parameters that need to be consideredMach3
VHKLQJJD PXQFXO WDPSLODQ VHSHUWL
to determine engine performance.
\DQJ is shown in Figure 3.5.
1. Select Native Units
On the main menuMach3there is a menu ³
config´ \DQJ PHPLOLNL VXE PHQX ³Select Native
Unit́ 0HQX WHUVHEXW GLSLOLK XQWXN PHQJDWXU
The standard unit of measurement to be used is
as shown in Figure 3.4.
Figure 3. 5ArrangementMach3for calibration
2. 6HODQMXWQ\D SLOLK ³Axis Calibration´.
3. Machine calibration is carried out on the
three machine axes, namely X, Y and Z. On
Mach3 optionX is selected to calibrate on
the Xaxis.
Figure 3. 4MenuNative Units
2. Ports and Pins ± Motor Outputs
Motor outputson the menuports and pins
functions as a regulatorMach3 interfacein
4. The next step is to enter the desired
controlling the actuatorstepper motorswhich displacement value. For example, enter
moves on three axes. the number 50, then click OK. Please
remember before clicking OK, pay
3. Ports and Pins ± Input Signals attention and mark the initial position of
In this CNC Machine control circuit,Limit the X axis on the CNC machine. When you
SwitchesAndE-Stopconnect and provide a click OK, the X axis on the machine will
signalinputtoMach3 interface softwarewho will move and change position.
then give further orders to motor output.
Especially for componentsLimits
JOM FTEKNIK Volume 4 No. October 2, 2017 6
5. A few moments later, measure the distance movement on the CNC machine becomes
the X axis has moved in millimeters. Enter imperfect.
the measurement value obtained into the Next, the critical components contained in
calibration menuMach3. Then click OK. the CNC machine control system areBreakout
Boards(BOB). This tool is the brain of all
6. After following the steps above, control system components. This tool works
axis X has succeed calibrated. translate commands in formG-Code and then
Next, click YES if you are sure that the X conveyed to the machine actuator. Actually
axis has really been calibrated, or click No there are several types of BOB available on the
if there is still doubt about the calibration market, both based onArduino or basedMach3.
results. Next, calibration can be carried However, due to various considerations, it was
out again as in the previous steps. decided to use BOB-basedMach3as a CNC
control system. Apart from the cheaper price,
7. After the X axis has been calibrated, the same availability on the market, this choice is also
method can also be used to calibrate the due to the many tutorials on how to assemble
movement of the machine on the axis andsettingsthe BOB. However, the
Y and Z axes. disadvantages of BOB-basedMach3 is still using
printer ports, so that the CPU that can be used
5. Discussion to operate the control system is very limited.
CNC MachinemillingThis is a machine tool
that works with 3 axesaxis. CNC machines will
work as they should if the machine is equipped In the control system, the actuator that helps
with a control system. The control system on a the movement of the machine isstepper motors. This
CNC machine is a combination of several motorbike can move automaticallystepsaccording to
components that are connected using cables to the signalinputwhich are given. Movement in form
each other. Several important components stepsThis gives the machine an advantage because it
contained in a CNC machine control system is able to move with a greater level of accuracy. On
include computers,Breakout Boards, this CNC machine, it is selectedstepper motors
Motorcycle Drivers, Nema23 type. Apart from these types, there are
Stepper Motors,Power Suppliesand others. several other types that are larger and smaller.
The computer is the command center on However, considering the size of the work area and
the CNC machine, where all commands will be the machining process to be carried out, the choice
conveyed to the machine in formG-Code comes of Nema23 was deemed sufficient.
from the computer. In general, all types of
computer CPUs can be used for the control In setting up the control system software
system that has been designed, but to adapt to is used (software)Mach3who acts asinterfaces.
Breakout Boardsselected, then only computers SoftwareThis serves as a connecting bridge
that are equipped withprinter ports. betweenend userswith the machine in the form
of commands. This means without a system
For new types of CPUs, computers are interfaces, then the control system on the CNC
usually no longer equipped with themprinter machine will not work properly. Mach3is a
ports,ports has actually been replaced with ready-made program application, in this case
ports USB, so the choice of computer CPU that end usersonly required to master the menu
can be used for CNC machine control systems settingscontained inMach3. Without mastering
is relatively only an old CPU which on average how to set up this program, it is impossible to
has a Pentium 4 processor,dual coreAnd control all control components.
maximum cores2duo. With a processor that is
still relatively low, the computer's CPU BesideMach3ActuallyinterfacesCNC machines
capability is very limited when used for further can still be made with programming languages
development of CNC machines. such asMatlab,Fortranor whateverVisual Basic
Apart from that, there are actually several However, the use of programming languages is still
products sold on the market to convertprinter considered very complicated and difficult, so it is not
portsbecomeportsUSB. However, in its yet the main choice for systemsinterfacesmachine.
application the tool does not work perfectly. If Afterset upcontrol system has been
you send commands from the computer to successfully developed, the most critical step in
BOB via the conversion tool, there will be running a CNC machine is the calibration system
several command lines that will not be sent interfaceswith machine movement. This is to
properly, so ensure that commands from the computer can be
read correctly by machine movements. System
JOM FTEKNIK Volume 4 No. October 2, 2017 7
Calibration also ensures that the machine is machine movement. So that commands with certain
capable of carrying out the machining process units on the computer will be executed precisely on
carefully and precisely, so that the presence of the CNC machine.
a numerical control system will provide 5. The CNC machine is further equipped with
significant advantages compared to Limit SwitchAndEmergency Stop. These
conventional machines operated by machine two devices function to prevent the
operators. machine from dangerous movements.
To maintain the machine's security system so With the systemLimit SwitchesAndE-Stop
that it moves according to orders in the machine's then the control system on the CNC
work area, the CNC machine must be equipped with machine has implemented a closed loop
limit switchAndemergency stop. If at any time the control system.
movement of the machine goes out of control, then
the sensorlimit switcheswill send the command to 7. Bibliography
interfaces, so that the machine is commanded to Fenerty, Art and Prentice, John. 2005.Using
return to positionhomeat coordinates 0, 0, 0. Apart Mach3Mill. ArtSoft Software Incorporated.
from that, the installation of these two devices is to Instructables.com/id/My-First-CNC-Machine.
Retrieved 16 February 2016
anticipate operational errors in the machine. If the
Krar, Steve and Gill, Arthur.Computer Numerical
movement of the machine can endanger the work
Control Programming Basics.Industrial Press
object, machine, or people around the machine, then
Inc.: New York.
the buttonE-Stopcan be pressed so that the machine
can stop immediately.
Naldy, Defri. 2016.Design and Analysis
Uselimit switchesAndE-StopCNC machines Mechanical Structure of 3-Axis CNC Milling
also make this machine controlled with a Machine Prototype.JOM FTEKNIK Volume 3 No.
closed system (Close Loop System) because 2, Riau University: Pekanbaru.
with this system there is afeed back which can OMC-stepperonline.com Accessed on the 20th
be given to the control system which can be February 2016.
executed at any time according to the Pradana, Dityo Kurniawan. 2011.Design
actuator's command. CNC Milling Machinehome Made for Making
PCBs.Journal of Electrical Engineering Volume
10. No. 1, Udayana University: Bali
6. Conclusion
Design and manufacture of CNC machine Qin, Wei. 2013.Design and Analysis of a Small-
control systems 3axisThis is research carried out Scale Cost-Effective CNC Milling Machine.
to make machines that have been manufactured Mechanical Engineering in the Graduate
so that they can be operated and controlled with College of the University of Illinois: Urbana.
a computer system. In this research, several steps Rajput, Rajendra. 2016.Comparative Study of CNC
and methods have been carried out so that the Controllers used in CNC Milling Machines.
control system can work well. From the results American Journal of Engineering Research
obtained, several conclusions can be drawn, (AJER), Volume 5, Issue 4, pp 54-62,
including: 1. A schematic design of a CNC Mechanical Engineering Department,
machine control system has been obtained which NITTTR Bhopal.
is capable of moving the machine in the 6XVD¶DW 6RGLNLQ Rotation Direction Setting
direction of the three axes X, Y and Z. Motorcycle Steppers DC Using
Microcontroller 8535. Widyaiswara
2. Based on the design that has been made, a CNC MadyaP4TK BOE/VEDC: Malang.
machine control system has been assembled
which is composed of several components such
as a computer,Breakout Boards, Motor Driver,
Stepper Motors,Power Supplies, Limit Switches,
AndEmergency Stop.
3. In order for the control system to run as
it should, a system is usedinterfaces
program application basedMach3. For
adjust the existing control device, then
make the settingsportsAnd signal inputon
interfaces, so that every command coming
from the PC is read properly by the
actuator.
4. To avoid errors in machine movement, unit
calibration has been carried out between
systemsinterfaceswith
JOM FTEKNIK Volume 4 No. October 2, 2017 8