The characteristics of TB6600 motor driver in producing optimal movement for the Nema23 stepper motor on CNC machine

This study describes the use of the TB6600 motor driver for the stepper motor on CNC machine. Based on the analysis of the performance of the TB6600 motor driver, in order to produce an optimal stepper motor of Nema23 on CNC machine, three stepper motors are needed as the CNC engine drives for the X, Y and Z axeo be connected to the TB6600 motor driver. The motor is then controlled by Raspberry Pi via Mach3 Interface Board of Breakout Board. The softness of motion and safe working temperature for the stepper motor of Nema23 on CNC machine are obtained by varying the control of the micro-step switches and controlling current switches. The results show that 32 steps of micro-step control produce smoother resonance and movement than smaller micro-steps. In addition, the current control of 1 A generates the best motor driver output with a lower temperature for all three stepper motors.


INTRODUCTION
The development of industry in the era of industrial revolution 4.0 which led to automation has penetrated the manufacturing industry. Manual machines that are often used for manufacturing such as lathes, milling machines, shaping machines, etc. have now morphed into automatic machines. Among them, Computer Numerical Control (CNC) is the type of machine automation that is most often used in the manufacturing industry.
In the past, production activities in the industry used machines that were only operated by human power or operators. However, the risk of human error and the great amount of cost have forced industry players to find more effective ways to minimize accidents caused by human error and save production costs without disrupting the production process. The amount of material used in the production process these days also requires the industry to employ more human resources to work on the process. Ultimately, current technological developments not only affect the communications and computer industry, but also the manufacturing industry. As a result, many large-scale industrial machines today are equipped with automatic systems. One of the most widely used automatic machines is the Computer Numerical Control (CNC) machine. The working principle of the CNC machine is to make tasks that are previously done manually to be automatic. This is made possible by entering workmanship data such as length, width, and shape to be processed into the computer system connected to the machine. The use of many CNC machines brings many benefits, namely its ability to minimize the occurrence of human errors, save costs, last longer than manual machines, reduce production or scrap waste, and have a higher level of accuracy. The types of CNC machines include the CNC 5 Axis milling machines, CNC lathes, CNC plasma cutting machines, CNC milling machines and indentation making machines.
Rotary motors and ball screws have been used in the construction of a CNC machine to obtain the desired motions. To produce a high-speed operating machine with a low cost, the technique employs linear motors to obtain machining assessment with composite material [1]. In a study aimed to build a machine with several motions, a CNC milling machine is supported with 5-axis and integrated with a robot consisting of 2 main components, namely human-machine interface and numerical control kernel through a multiprocessor system in a single IC of FPGA [2]. It is found that a smart controller TMS320C240 stepper motor has been used to control acceleration and deceleration for intelligent spherical camera pan and tilt institutions through an exponential curve [3]. Meanwhile, a cost-effective and modified CNC Machine system has been developed by improving the electronics controller to achieve a friendly CNC machine user that serves as learning media in the workshop for students [4]. Furthermore, an improvement was done on a conventional lathe machine that can be operated as a CNC machine through robust movement for spindle using the QFT method by controlling three stepper motors for the axis movement of X, Y, and Z, respectively [5,6].
A CNC was designed by positioning the cutting spindle and fused deposition modeling heat extruder in place of the rotary stage to overcome the misalignment through the sensors of IR [7]. Various solid-based rapid prototypes processed through fused deposition modeling with no support material were developed to verify the powder-based rapid prototyping processes in the manufacturing as the powder was able to operate with itself as supporting material [8]. In order to improve machine quality, increase productivity, save time, eliminate accidents, enable monitoring, as well as build up equipment life, a study conducted by [9] proposed the exchange standard for numerical control of product data complicant, which is necessary to open the control system for CNC milling machine. Another study analyzes the performances of motion accuracy for industrial robots by the CNC controller through studying the corner paths based on the running speed difference [10]. Current motor driver controllers are supported by CNC milling machines in real-time through the method of on-line chatting detection. Moreover, a spindle transfer function based on velocity is constructed through monitoring the parameters of control performances and reading the frequencies of responses function [11].
Furthermore, to obtain the desired quality motion of the CNC machine, a lot of techniques have been proposed by previous studies. One testing technique uses GO1 G-code to create the control of CNC motion through a test bench that can be generated by a test in concert with actual formal specification [12]. The multi-axis controller design of CNC which embedded motion achieves several fault-tolerant methods in various motions, namely parabolic, trapezoidal, exponential, and S-curve [13].
Generally, machining processes, especially CNC, generate noises from the motor rotations. In regard to this, low-frequency noises from CNC machine processes were measured, ultimately resulting in the efforts to meet the legislation for permissible noise ranges [14]. The development of a machining system normally includes the use of several sensors, especially for manufacturing systems such as CNC. For the automatic milling and cutting of lathe machines, multi-axis pressure sensor characterization profiles are used to minimize timing development and enable suitable benchmarking combined with three-axis forces and torques and three-axis translational sensors developed by [15].
To control the stepper motor as a main actuator on the CNC machine, several techniques have been proposed by previous studies. Simplifying a torque modulation through micro-stepping is a technique to achieve position control of stepper motors. A torque modulated for micro-stepping technique was implemented by simplifying the current tracking control theorem to acquire the high profiles for the current tracking that was not required for the high profiles of position tracking [16]. Relevant to assessing the challenges in controlling high-performance drives of a stepper motor, the Spatio-temporal robust control is imperative for ensuring the high precision and efficiency of micro-stepping for stepper motor [17].
To estimate a dynamic sensorless load angle, a conventional transfer function analyzer method is operated through half and full micro-stepping as presented by [18], which reveals the system's capability to track the reference of position and indicate the robustness of torque. Furthermore, it is necessary to analyze a stepper motor behavior in order to identify and develop a control system especially in CNC machine system. A technique using standing wave ultrasonic to control the stepper motor was used in order to obtain the desired position and motion by implementing the square driving source to drive the stepper motor [19].
This study analyzes the performance of the TB6600 motor driver in producing optimal movement on the stepper motor of Nema23 on CNC machines. Accuracy in setting the width of the step distance on TELKOMNIKA Telecommun Comput El Control  Characteristics of TB6600 motor driver in producing optimal movement for Nema23.... (M. Khairudin) 345 the micro-step and the amount of current entering the motor will greatly affect the pattern and softness of CNC machine movements. It is highly necessary to adjust the width of the steps on the micro-step and the amount of inflow on the motor. This study faces a number of challenges in determining the variation in controlling the micro-step switches and controlling the current switches to obtain a smooth motion and safe working temperature for the stepper motor of Nema23 on CNC machines. Compared to the smaller micro-steps, micro-step control with 32 steps produces smoother resonance and movement. Meanwhile, the current control of 1 A generates the best motor driver output with a lower temperature for all three stepper motors.
A motor driver or motion controller is a movement controller of an electronic circuit [20][21][22]. In this case, the driver adjusts the motor rotation direction and speed. There are many types of motor controller drivers with different specifications depending on the motor used [23][24][25]. The TB6600 motor driver is a TB6600HG IC-based stepper motor driver. Some of the features of the TB6600 motorbike driver are as follows: (1) single chip-based, (2) suitable for bipolar stepper motors of Nema17, Nema23, Nema34, (3) suitable for stepper motors with four cables, six cables, and eight cables, (4) available for forward and backward rotation, (5) having six micro-step regulator switches which cover 1/1, 1/2, 1/4, 1/8, 1/16 and 1/32, (6) having the minimum input voltage of 10Vdc and the maximum input voltage of 42Vdc, and (7) having a step pulse LED indicator. Many things need to be considered in operating the TB6600 motor driver, starting from setting how many step widths of the motor will rotate, to setting the current supply which will affect the motor performance.

RESEARCH METHOD
The following is an analysis of the performance testing of the TB6600 motor driver as a Nema23 stepper motor drive on a CNC machine including micro-stepping settings and current settings for the TB6600 motor driver. Micro-stepping is the step width setting of the motor when spinning. In this study, micro-step settings were done by changing three micro-step switches, namely S1, S2, and S3. The following is the step width data from the micro-step in the TB6600 motor driver, as seen in Table 1. Based on Table 1, the S1 switch was ON when the width of the micro-step step was below 4 steps, then it was OFF when the width of the micro-step step was more than 4 steps up to 32 steps. The S2 switch was ON at a certain step, but it was OFF when the step exceeded 16. Meanwhile, the S3 switch turned OFF-ON alternately.
It is necessary to pay attention to the number of output currents when operating this TB6600 motor driver. The output current must be in accordance with the specifications of motor current consumption because if the output current is greater than the specifications of motor current consumption, the motor will heat up quickly and will affect the performance of the motor itself. The setting of the number of output currents from the driver can be seen in Table 2.   Table 2 explains the schematic variation of switches S1, S2 and S3 to get the best performance conditions for stepper motors. When the number of output currents from the driver was low, the S1 switch was ON and vice versa. In S2 switch, there were variations in conditions, e.g. when the number of high output driver currents was precisely the amount of 3A, the S2 switch turned ON. Meanwhile, on S3 switch, the ON condition was only shown when the number of currents was small, and when the amount of large current was OFF.
All optical inputs were isolated to prevent the device from noise and short circuits. This input can be set via hardware cabling, not through switch settings such as micro-step. The factors affecting the input settings were the enable, direction, and pulse ports. On ports powered by 5 VDC, high and low inputs resulted in non-active and active conditions, respectively. Meanwhile, the direction of the port with 5 VDC input with high and low inputs obtain clockwise and counter clockwise directions. In order to stimulate the pulse, 5 VDC was acquired. During the installation, motor drivers were not changed or connected to the supply cable, motor cable, or other inputs when the power was on because it could cause damaged drivers. The process of TB6600 motor driver with CNC machines wiring required a long time and high accuracy. The materials needed in the process of wiring TB6600 motorbike drivers were Raspberry Pi, TB6600 motor driver, breakout board (BOB) Mach3 interface board, power supply, NEMA23 stepper motors, and connectors. The wiring scheme for stepper X, Y, and Z motors with three TB6600 motor drivers for each motor can be seen in Figure 1.  Figure 1, wiring the TB6600 motor driver was done when installing the source cable from the power supply. Blue and yellow cables were for the current and voltage, while the black cable was the ground. The Raspberry Pi was connected via the raspberry GPIO pin to pin 11 to pin 36 using the DB25 cable to the parallel port of the BOB Mach3 interface board. Then, USB BOB input was connected to the Raspberry USB port output which functioned as the 5VDC supply on the BOB. Then, the BOB Mach3 interface board was connected to the motor driver TB6600.
The next process was connecting the output 5VDC BOB to Ena (+5V), Dir (+5v), and Pul (+5V) before the P2 BOB was connected to Pul (-PUL) motor driver X. P3 BOB was then connected to Dir (-Dir) motor driver X. After wiring the X motor driver, the same process was employed to Y motor driver by connecting P4 BOB to Pul (-PUL) and P5 BOB to Dir (-Dir). A similar method should be used to install the Z motor driver by connecting P6 BOB to Pul (-PUL) Z motor driver and P7 BOB to the Dir (-Dir) motor driver Z.
The motor driver output was then connected to the Nema stepper motor23. In wiring, the motor driver output should match the coil contained in the Nema23 stepper motor. Then, B-stepper motor coil had to be connected to the B-motor driver port, as well as the B+, A-, and A+ coils, in accordance with the initialization. At last, the TB6600 motor driver input voltage source was connected to the power supply output voltage. The +12 VDC output power supply needed to be connected to the VCC port of the motor driver and the power -12VDC output to the ground port (GND) motor driver. Meanwhile, X, Y, and Z stepper motor movements were programmed on Raspberry pi. The flowchart used in the Raspberry pi process can be seen in Figure 2.

RESULTS AND ANALYSIS
TB6600 motor driver components may work if the width of the micro-step and the amount of motor driver output current are set in accordance with the specifications of the stepper motor used. In order to get the effective TB6600 motor driver variable switch setting, it is necessary to adjust the width of the micro-stepping step and the amount of input current in the TB6600 motor driver.

Micro-step setting
Micro-step is a step width controller that will be carried out by a stepper motor. If the step width is set larger (1 step), the motor rotation step will be greater; whereas, if the step width is set smaller (32 steps), the motor rotation step will be smaller. This micro-step setting will affect the smoothness of the motor rotation when spinning. Thus, if the width in the step is set small (32 steps), the vibrations caused by the motor rotation will be smaller in number.
Influencing the smoothness of motor rotation, micro-step setting will also affect the length of time the motor rotates. As an illustration, if there are two objects walk at the same distance (one meter), they may differ in the number of steps. One object takes one step, but the other one may take 32 steps. It will definitely be faster to use one step. Based on this analogy, this study tries to find a good arrangement that makes CNC machines work optimally later. Several measurements and analyses are presented in Table 3.
Based on Figure 3, it can be indicated that in case 1, the micro-step wide-degree scheme is arranged based on the variations on the X motor driver with a number of variations and 6 kinds of rare micro-step widths. Meanwhile, the width of the micro-step in the Y motor driver is designed similar to the Z motor driver with one variation in the width of the micro-step (1 step). Case 1 shows that it takes the longest when the the micro-step step is 8 or 16 in width. Meanwhile, it takes the shortest, when the micro-step for the X motor driver is 32 in width while the Y and Z motor drivers still use micro-step 1. The difference between the longest and fastest time in case 1 is 0.11 s.  Meanwhile, in case 2, the arrangement of the wide-degree of micro-step scheme in the X motor driver is the same as in case 1, but the width of the micro-step in the Y motor driver is the same (2a). The width of the Z motor driver stays in one wide variety of micro-step steps, namely 1. Case 2 shows that the long process occurs when the micro-step degree is 4 in width. Meanwhile, the shortest time takes place when using a micro-step (2a) for X motor driver and Y motor driver, while the Z motor driver still uses micro-step 1. The difference between the longest and shortest time in case 2 is 0.16 s.
In Case 3, the micro-step width scheme is set in 6 variations of the micro-step degree width for X, Y, and Z motor drivers. The results show that each degree of width in the micro-step increases in the amount of working time in X, Y, and Z motors. Therefore, the longest time is reached by using small steps (32 steps). The difference between the longest and shortest time in case 3 is 0.42 s. The longer the processing time is, the smoother the X, Y, and Z motors are in forming the circle. The increase in time spent is not very significant, because it only increases in the range of milliseconds. Thus, it does not matter if small steps (32 steps) are used since there is still an impact on the smoothness in the circle making process. Figure 3 shows that when the step width on the micro-step is set smaller (32 steps), it will make the motor takes longer to spin. This can be seen in the latest data, in which data 13 to data 18 increase in time. Although the difference in the duration of spinning is not too significant, only in milliseconds, in this study, the authors suggest using the 32 step-width because the time difference between step settings is not too much. Moreover, when viewed from the resonance aspect of motor vibration when spinning, the drivers will be smoother if they are 32 steps in width. Table 3 contains the data of the durations of the motorbike in successfully making a circle with a diameter of 10 cms. The visualization of the machine while working through the application can be seen in Figure 4.

Current settings
Similar to the micro-step, if TB6600 motor driver is used, the amount of output current can be adjusted to the amount of current consumption of the stepper motor used. There are three switches, from ON to OFF, that can be adjusted until they form a combination described in Table 2. This current switch setting has an impact on the amount of torque produced by the motor. If the current consumed by the motor is enough, the torque produced by the motor will be optimum. Meanwhile, if the current consumed by the motor is smaller than the specifications, the torque produced by the motor will be less than the maximum.
In addition to the amount of torque influenced, setting the current will also have an impact on the temperature of the motor while working. If the motor driver output current is set to exceed the motor TELKOMNIKA Telecommun Comput El Control  Characteristics of TB6600 motor driver in producing optimal movement for Nema23.... (M. Khairudin) 349 current consumption specification, the temperature will rise faster; whereas, if the motor driver output current is set smaller than the motor current consumption specification, the motor temperature tends to be stable. This can be seen in Table 4.  Table 4 presents the data of the rising temperature that occurs because of the motor driver output current in making a circle with a diameter of 1 cm. Meanwhile, Figure 5 shows the increasing number of motor driver output currents and the increase of motor temperature. The figure also shows that the temperature of the X, Y and Z motors has increased. The temperature drastically changes in X and Y, 21.4% and 21.9%, respectively, due to the maximum current consumption of X and Y stepper motors (1.5 amperes).
In addition, the maximum motor current consumption for the Z stepper motor is up to 4 amperes. As shown in Figure 5, most changes in the temperature of the motorbike are small, only at 4.5 percent. Therefore, it is assumed that the best setting of the motor driver output current is around 1 ampere because the temperature changes in motor X, Y and Z are 1.7%, 1.4%, and 0.9%. With a relatively small temperature change, it is expected that the engine will last longer.

CONCLUSION
The study on TB6600 motor driver performance as a Nema23 stepper motor controller on a CNC machine has shown good performance results with the selection of step widths and the amount of current input into the motor driver. Switch settings on the TB6600 motor driver affect the effectiveness of the performance of three installed stepper motors namely X, Y and Z as they move towards the X, Y and Z axes on CNC machines. The micro-step switch settings will affect the time and smoothness of the stepper motor while working. Moreover, the setting of the current switch will affect the temperature of the stepper motor while spinning.