Interactive Head Control of Embroidery Machine using Embedded Web Server

— This paper proposes the design and implementation of prototype model to control embroidery machine using single board ARM processor. Wil-com is the software largely used for embroidery design. Designs prepared using Wilcom software are printed and supplied to the machine for further process. The proposed prototype model extracts the design data from this software by avoiding the printing and/or scanning of the user design and the design data are supplied to ARM based prototype embroidery machine for printing. In proposed model, the pencil is used as printing head and A4 size paper is used for the printing. Further to control the head, Use of web server design is also proposed using ARM processor.


Introduction
This paper proposes the concept of single board computer based embedded web server design for embroidery machine control application. General web server are developed using general-purpose computer such as NT server or UNIX/Linux workstation. This web server requires large memory, fast processing multi-tasking operating system with other resources. In contrast, embedded web server is designed using embedded system with support of internet software suit as well as application code to monitor and control the system. It is system which monitors and calibrates the sensors and devices using web pages through fast Ethernet communication media. In this paper, use of embedded web server to control embroidery machine using ARM processor is proposed with implementation of prototype model.
For the decoration and branding, the embroidery design is largely utilized in every common place including houses and places work. They are widely used in textile industries. In comparison with print, embroidery is more three dimensional offering high texture effects. Today, varieties of embroidery machines are available in the market. Computer controlled embroidery machine have multiple needles whose position is fixed. This fixed multiple needle is called "Embroidery head". A framed product i.e. a garment like shirt is placed on frame holder which moves under the embroidery head. This frame holder is also known as "pantograph". Thus it is similar to graph plotter, where the pantograph moves the frame product to the defined coordinates of the design expressed by the design. The coordinates are defined based on the grids in terms of x-coordinate and y-coordinate. The embroidery machine reads these coordinates from the design to move the pantograph into the position of needle. This paper demonstrates the prototype model, where pantograph is fixed and embroidery head moves to the position defined by the coordinates from design data.
Wilcom is the software used in the textile industry to create embroidery design. It allows the designer to create, edit and output embroidery design with ease. Two methods are used to supply the design data to computer controlled embroidery machine. In first method, the design exists in printed document. This design is scanned and digitized to obtain the coordinates. Design may be enlarged according to the requirement. Alternative method is use of software supporting online drawing.In both methods, the coordinates obtained from the design are saved into internal memory of software with "emb" filenames (filenames ending with .emb). However the process is complicated because the format specified by the software is not understandable by the embroidery machines i.e. they have different file name ending. Therefore it is required to process the software file such that embroidery machine can read and understand. The conversion process is explained in the section 3. As textile industries are growing industries with up gradation in technology, the need arises for to control multiple machines using embedded web server. The following section 2 discusses the design of embedded web server using single computer and their applications. In section 3, the implementation of prototype model of Embroidery machine using ARM processor is presented. In last section 4, results are discussed summarized with future scope.

Literature Surveys
Embroidery designs are widely used on clothing and in textile industries. Wilcom is the most popular software to prepare embroidery design. These designs are supplied to the machine in a specific language where machine interprets these data to control its needle (i.e. head) to print on clothing [1]. This is vital steps for the operator of the embroidery machine. Therefore, this paper proposes an implementation which converts the design files which can be interpreted by the machine.
Effort has been placed to control the embroidery machine using ARM base processor [9, 10, and 11]. Changhua Lu [6] implemented an Embroidery machine using dual core ARM processor where host computer provides the graphical user interface (GUI) and network functionality. Functioning of embroidery machine is implemented on ARM processor. This prototype model do not support the interaction with presently available software tools. In [11], the controlling of stitching process using motion controller and Ethernet is presented. The proposed algorithm implemented using ARM embedded processor and achieves high speed of stitching (i.e. 2800 stitches/minute). To improve the mechanism of embroidery machine, a driving mechanism comprising of driving shaft is added [8]. This improved the mechanism to drive more than two needle bar movement. The processing steps required to develop embedded web server were presented in [7]. This web server can provide the remote monitoring and controlling of real time information at the user desk. They utilized ARM7 based microprocessor to develop web server. RTL8019AS Ethernet control chip is used for the data access over internet. By analyzing the various surveys, it is found that either improvement in controlling of embroidery machine is proposed or web server design for other application has been proposed. Presently, the controlling of embroidery machine remotely using embedded web server is basic requirement as it allows controlling multiple machine simultaneously. Therefore this paper proposed conceptual representation of embedded web server design for this machine and implementation of prototype model for the embroidery machine. Overall contribution in the paper is as follows: 1.
Conceptual representation of embedded web server design to control embroidery machine 2.
The Wilcom software interface to the ARM processor to control the processor based on information obtained from this software.
3. Display of the captured design from Wilcom software to the touch screen LCD for the verification.

Implementation of Prototype Model
To implement prototype model of embroidery machine with embedded web server, the ARM processor based single board computer i.e. AT91SAM9G45 is utilized. Further features of AT91SAM9G45 can be obtained from the company website [3]. The ARM processor SAM9G45 allows integration of multiple communication interfaces and it also provides a resistive touch screen controller. This touch screen is utilized to display the design read from the Wilcom software and also to draw design by the user. The design drawn on touch screen is utilized by the embroidery head to stitch. The key functionality of the embroidery machine is displacement of head. This displacement in x-and y-direction is obtained by the stepper motor which is controlled by the ARM SAM9G45 processor. Overall block diagram is shown in figure 1, where the design is obtained from the Wilcom software. The coordinates of displacement are obtained from the emb file. Using these coordinates, the ARM processor controls the displacement of stepper motor and in turn the displacement of embroidery head.
To obtain fast displacement of head, it is required to transfer the extracted coordinates to the processor from the Wilcom design file. The most convenient way to transfer the file is with the use of trivial file transfer protocol (TFTP). In the proposed implementation, file is transferred manually through flash drive or SD card. The design file received at the SBC board is converted to byte array to get each hex data in separate form. Array of the data consists of functions, X-displacement and Ydisplacement consecutively. Only two information among these i.e. X-and Ydisplacements are needed to control the placement of embroidery head. In Wilcom software generated file, there are positive and negative displacements in both X-and Y-directions of 2D Plan. The separation of these coordinates is required to control the stepper motor which moves the embroidery head to X and/or Y-direction. For the user interaction, the LCD touch screen is also interfaced where the design obtained from the Wilcom software is also displayed on this LCD screen. Thus in the proposed algorithm, the ARM processor has been programmed to perform dual task simultaneously. To make process fast for displacement of embroidery head and to display the design on LCD screen, the five stage pipelining and flexible task scheduling algorithm is proposed in the design.
To create the web page GUI and to reduce the complexity of software architecture, QT embedded tool is used.It is an open source GUI programming tool based on C/C++. QT server offers several advantages like it does not require X-server or X-Lib support to write frame buffer and hence save memory and improves speed of applications [2]. Over all implementation of prototype model is divided into two parts: Software architecture and system hardware design.

Software Architecture
The web page for the embedded server is designed in software using QT embedded tool and it is interfaced with the ARM processor to control the displacement of embroidery head. The supply the embroidery design, two alternatives is implemented in this prototype model. User can input the embroidery design using Wilcom software which generates corresponding emb file. In the proposed design, a touch screen LCD is also interfaced which performs dual task i.e.to display the design from the Wilcom software and to allow drawing on that screen. To display the design on LCD screen, the emb file is decoded and scaled down. The painting tool of QT Embedded tool is used to display it on LCD screen. Thus coordinates extracted from emb file are used simultaneously by the QT embedded tool to display on LCD screen and by the ARM processor to control the head displacement.
The simplest embroidery design is the design consists of either horizontal or vertical line. Therefore for the demonstration of implementation of prototype model, here horizontal line, vertical line and triangle design is utilized as a designer input. This design which is drawn using Wilcom or touch LCD screen is utilized by the embedded processor to get corresponding displacement of embedded head. These displacement coordinates are extracted from the emb file.The structure of this emb file generated by the Wilcom software for the horizontal line is shown in figure 2. The emb file is consists of header information, displacement coordinates and footer information. The displacement coordinates are starting from the hex location 100H with three consecutive hex location including X-displacement, Y-displacement and 00. As shown in figure 2, the first X-and Y-coordinates are stored at 100H location and 101H respectively. Second X-and Y-coordinates are stored at 103H and 105H respectively. This information continues upto the last displacement of recorded stich inWilcom software. To display the design on LCD screen, the functions like draw line and move are used considering central pixel location as an origin of the design. The simulation results for the simplest design of horizontal and vertical lines are presented in Figure 3 where single displacement in either X-or Y-direction is required. Similarly, for complex design i.e. triangle design needs displacement in both directions simultaneously which is challenging and basic requirement for any complex design. The simulation result for the triangle is demonstrated in Figure 4.

System hardware design
To demonstrate the hardware based controlling of embroidery head, here pencil is used as an embroidery head in prototype model. The displacement of head is controlled by the two stepper motors which in controlled by the ARM processor SAM9G45. The screen shot of mechanical hardware used in industry based on nutbolt mechanism for the X-displacement is shown in figure 5. Similarly for Ydisplacement circular to linear conversion process is used. As the stepper motor rotates the screw clockwise or anticlockwise, then nut slides left to right or right to left. The head (i.e. pencil in the proposed design)is connected with the nut in the design.Similar design has been proposed in the prototype model by using solid pipe of metal and patterned the screw with 3-16-18 sized die. Same way nut is designed with same sized tub to match the nut-bolt mechanism. This proposed design is shown in figure 6(a). To obtain Y displacement, the circular motion is converted in linear motion by means of robotics tire mechanism as shown in below figure 6(b). Now to interface the software generated data to this proposed hardware, the displacement data obtained from the emb file of Wilcom software is decoded in form of pulses which would be given to the stepper motor for the rotation. In the prototype model, bipolar permanent magnet stepper motors are used. The displacements are either positive or negative from current position of the stitch; hence corresponding pulses are given to the motor to rotate either in clock wise or anticlockwise direction. The pulses to the stepper motor are transmitted by processor general purpose input/output (GPIO).The SBC-SAM9G45 has a 2 x 5Pin 2.54mm spaced GPIO interface, i.e. J1 [3]. Further specification can be obtained from the reference Guide available in [3]. From the 10 pins, first eight pins are interfaced to stepper motor i.e. PA25 to PA28 are interfaced to stepper motor providing X-displacement and PA29 to PA31 and PA27_ADC are interfaced to the stepper motor providing Y-displacement. Thus four bit pattern coding is used to control the both motors. The driving circuit for the stepper motor using TIP122 driver circuit is shown in figure 7 where the TIP122 is a switching transistor with high power capabilities and can drive the stepper motors with high torque up 5Kgcm [4]. TIP122 driver circuit provides faster response in case of weak signal from the processor to pulse the motor is selected in comparison to other available driver circuit i.e. ULN2003 [5]. Here the most important task is sync between X and Y displacement when design has both the displacement simultaneously. For this the pulses should be transmitted to the stepper motors such that design is drawn with minimum error. To get the clockwise and anti clockwise rotation with high torque stepping two coins of motor are turn ON at the same time using following logical data are required from the GPIO pins.
Clockwise rotation: CH-9H-3H-6H Anti-clockwise rotation: 6H-3H-9H-CH In the proposed design, 48 pulses are required to complete one revolution and each pulse moves rotor by 1.8 degree. The pulse sequence to be given to the stepper motor is presented in Table 1 as follow: Based on the data taken from design file the above sequence of pulses needs to be applied or repeated as required. The stepper motor is working on 24V operating potential. And hence an extra supply needs to be provided to driver circuitry. Because the SAM9G45 board output is only 3.3V which is not sufficient to drive the motor.
Before doing so, we tested the GPIO by sending the bit pattern manually. The actual circuit design is shown in Figure 8. As the logical signal is supplied from the SBC's GPIO pins which do not required clipping operation, the diodes 1N4007 at other side are omitted in the proposed design which was suggested in the circuit shown in figure  7.

Conclusion and Future Work
This paper proposed the concept of embedded web server design using ARM based single board computer. An embedded web server design needs a GUI implementation for the user interface and controlling of several applications from that GUI. The supportive futures of SAM9G45 ARM processor with QT enabled software makes it suitable choice for such web server design applications. Using this concept, this paper proposed the controlling of Embroidery machines using GUI design. Use of Wilcom software is proposed as a GUI. The prototype model of embroidery machine has been implemented and Wilcom software based controlling of this machine is presented in the paper. LCD is also interfaced to see the embroidery design drawn in Wilcom software. In the proposed model, single embroidery head has been controlled to draw the design hence only single color thread can be controlled according to the user's design. The model can be extended where multiple embroidery heads can be controlled or multiple embroidery machines can be controlled based on use selection in Wilcom software. The hardware can also be interfaced with other devices through fast Ethernet using master-slave concept. With the tremendous capability of this SBC board in GUI, this system will provide easy and fast data acquisition and remote login when connected with the internetwork.