An-Najah National University Faculty of Engineering and Information Technology Computer Engineering Department DRAWING MACHINE. written by Rafeef Hamdan supervised by Dr. asmaa afeefi In partial fulfillment of the criteria for a Bachelor’s degree in Computer Engineering, this paper is presented. Contents 1 Abstract 3 2 Introduction 4 3 Literature Review 5 4 Methodology 8 5 Conclusions and Future work 14 5.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 List of Figures 4.1 Arduino uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.2 Stepper Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.3 Stepper Motor Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.4 Servor Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.5 DRAWING MACHINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.6 UGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 Chapter 1 Abstract Technology has advanced and continues to improve since the dawn of time, especially printing and drawing machines. This technology is essential for the smooth manufacturing of items in industry. Without this technology, the industry’s production will be slow, and the quality is likely to be poor. Recent advances in printing technology will help solve this problem by making it easier for consumers to make high quality items. With minimal effort and time. The drawing machine is an artistic robot that can draw on cylindrical objects. It can print numbers, logos, production dates, expiration dates, and QR codes on special cylinder-shaped products. It speeds up the product drawing process and saves time. It can also be used in an entertaining way for children by drawing drawings on cylinders and then using them to play. In this project, we will make a machine that draws on a cylindrical surface that moves in a circular motion using the stepper motor, and the pen draws on the circular surface when moving it left and right by the stepper motor and moves up and downs using the servo motor. 3 Chapter 2 Introduction CNC Machining is a production technique that incorporates the use of computers to operate ma- chine equipment. Lathes, mills, routers, and grinders are examples of tools that may be operated in this manner. CNC-Computer Numerical Control-A computer and CAM program are used to control, automate, and monitor the motions of a machine using digital data. The CNC controller collaborates with a number of motors and drive components to move and control the machine axes while performing the preset motions.Platform for open source micro controllers The motors are controlled by Arduino, and free source software is utilized to execute the G code for machining applications. but here the machine is a drawing machine we use 2-axis one for to move the cylinder and the other to move the pin But the working principle is the same. 4 Chapter 3 Literature Review There are many types of lathes, and we have chosen the lathe that draws on a cylindrical piece, where the motor moves the cylindrical piece and another motor moves the pen regularly to form a professional drawing, but traditional lathes are a mechanism in which materials are cut by me- chanical influence when they are rotated in the coordinate system polar. We have done a lot of research on the Internet and found more than one project in which they used lathes and there are many types where from here we will review these research and take a small overview of how these lathes work. A new approach was developed in the form of a lathe-type 3D printer, utilizing a coordinate sys- tem similar to that of a lathe. Instead of subtractive material removal, this printer adds extruded material. Unlike Cartesian printers with heated printing beds, the lathe-type printer features a cylindrical rotating tube controlled by a stepper motor. By eliminating the Y axis, the printing head in lathe-type printers only moves along the X and Z directions. This reduction in degrees of freedom potentially enhances precision and eliminates the need for calibration, minimizing the chances of losing printer head position. While this polar coordinate system offers advantages, such as increased precision and optimized print paths, it does limit the range of printable shapes that can be produced, particularly straight forms. Additionally, these printers typically come with a fixed printing bed, preventing future upgrades. Furthermore, standard printer software may not be compatible with this system. However, by omitting the need for support structures, lathe-type printers allow for the creation of complex geometrical shapes that would be challenging to produce on a standard Cartesian printer. Although existing polar 3D printers offer Cartesian system usage with two axes and a heated cylindrical bed, they do not provide any significant advantages be- yond high precision. Unlike lathe-type printers, they retain the ability to print straight shapes like squares but lack the capability for material interweaving.[1] Another variant of 3D printing involves depositing materials instead of cutting them. Fused Deposition Modeling (FDM) is a popular technique known for its simplicity and affordability. This method utilizes thermoplastics like ABS, polycarbonate, and PLA. Material is melted in a heated nozzle and then deposited layer by layer on a print bed, resulting in the formation of a solid object. These printers utilize Cartesian coordinates, with the print head moving in the X and Z directions and the print bed moving in the Y direction using stepper motors. 5 The use of Cartesian coordinates imposes certain limitations on these printers’ capabilities. For example, manufacturing parts with significant overhangs can be challenging. To overcome this, a second material is often used as support, which is subsequently removed after printing. However, this approach is more complex and expensive. Additionally, traditional FDM printers struggle with producing highly accurate curved shapes due to the limitations of motor step sizes. To advance 3D printing technology, the concept of an additive lathe was introduced. Unlike a conventional lathe, this design incorporates a cylindrical print bed with precise angular control using a stepper motor. A print head moves in the X direction and deposits material on the rotating print bed. The design drew inspiration from the RepRap Mendel printer, utilizing readily available components. While the X and Z axes remained similar to the Mendel, the Y axis was modified to support a pulley-driven cylindrical print bed. Additionally, a flat print bed could be added using a bevel gear transmission to enable Cartesian printing. The cylindrical print bed was attached to a movable support, allowing it to move along the Y-axis using a threaded rod linear drive system. The print head was vertically supported and capable of movement in the Z-axis as well as lateral movement in the X-axis. The concept aimed to determine which axes could be fixed to optimize the design. The final concept incorporated the best features from the initial ideas. The entire assembly was secured by two end plates resting on a base. The print head was mounted on a carriage, enabling vertical movement along the Z-axis and lateral movement along the X-axis. The print bed remained fixed in the center of the assembly and could be replaced with different print beds as needed. To prevent sagging or axial deflection during printing, a support was added to the non-driven end of the print bed[2] The 3D-Rotoprinter is a relatively new FDM machine that takes a novel approach to 3D print- ing by employing a rotary axis. Jonas Duteloff, a 3D printing enthusiast, created the machine while studying at the Burg Giebichenstein University of Art and Design in Halle, Germany.The 3D-Rotoprinter works differently than most 3D printers, but it still employs a Cartesian coordinate system (i.e. using X-, Y-, and Z-axes). This printer’s movement is similar to that of a CNC lathe, which spins a base object against a cutting tool to create the desired part. It also uses a rotational motion, but it is additive rather than subtractive in nature. Furthermore, the Rotoprinter incor- porates a standard FDM extrusion system, in which the stringed filament is melted and pushed through a nozzle, adding material (typically thermoplastic) to a spinning cylindrical build plate.The printhead moves along an X-axis gantry (conduit sliding rails with belts were used by the designer), which can move up and down the Z-axis. The Rotoprinter’s motion style is defined by the Y-axis motion, which defines the rotational movement of the build plate.When compared to standard FDM printers, the Rotoprinter’s motion style reduces the need for post-processing. This is due to the Rotoprinter’s ability to print specific cylindrical models without the usual supports. This reduces the time required to clean up the model by eliminating the need to remove supports and sand rough overhang edges. How the printer works When the printer starts working, the printer head moves along the axes A and Z around the cylindrical base object, which acts as a design plate for the Rotoprinter.The construction surface shall be cylindrical and shall be made of the same mate- rial that will be printed with the RotoprinterA two-sided spring-compressed mechanism with two pointed prongs is included in the Rotoprinter. The springs push the two pointed prongs together, securing and stabilizing the new build surface. They can, however, be easily separated when the surface needs to be replaced.Both prongs can rotate, but one is ideal because it is connected to a bearing, and the other is connected to the Y-axis stepper motor. The motor-connected prong is in 6 charge of turning the build surface during printing.It’s important to note that, like a belt printer, the printhead, specifically the nozzle, only moves across the build plate along one line segment. Because the base prints should always be the same size, this makes bed leveling simple.[3] Capstan Mini Lathe Machine is a portable machine that measures 100 cm*25 cm*60 cm and is made of iron and aluminum. It is typically used for machining wood or iron work pieces. As a result, this is a study of the fabrication of a mini lathe machine. This machine is powered by an electric motor (for high torque) that drives the lathe chuck. The runner is made up of a plywood bed with a movable arrangement, as well as ball bearings that allow for free rotation and work support from the opposite side. It also has a handle to hold the desired tool, and this handle can slide on the bed parallel to the work’s axis of rotation.To rotate the work, we use a chuck mounted on the shaft of the drilling machine. To perform the desired operation, the machine is designed to hold the workpiece and move the tool in a sliding mechanism. The machine’s outer face is designed to hold the workpiece firmly with the tool in place so that the desired operation can be performed easily. As a result, we successfully studied the design and fabrication.[4] The Egg-bot.This is a CNC machine that will be powered by a Nema17 stepper motor and driven by an A4988 driver. The entire project is based on an Arduino Atmega328p microcontroller.this Egg-Bot machine This machine draws on the eggs using motors that move the eggs in a rotation and a motor that moves the pen from right to left and in return this machine sends a g-code to the Arduino piece that contains the settings for the drawing that will be drawn.[5] 7 Chapter 4 Methodology The goal of the project is to help small business owners who need to print at the lowest cost, time and effort, and it can also be used as entertainment for children Equipment and Components The Arduino Microcontroller platform with the Atmega328 core is employed in this project concept. It is simply interfaced with PCs, as well as simple drivers and stepper motors. • Arduino Uno Figure 4.1: Arduino uno The Arduino Uno is a microcontroller board that utilizes the ATmega328P as its core (datasheet). It features a range of functionality, including 14 digital input/output pins, of which 6 can serve as PWM outputs. Additionally, it offers 6 analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header, and a reset button. With these components, the Uno is fully equipped to support the microcontroller. To get started, you can simply connect it to a computer using a USB cable or power it up with an AC-to-DC adapter or battery. 8 The beauty of the Uno lies in its user-friendly nature, allowing you to experiment and tinker without excessive concern for mistakes. In the worst-case scenario, if something goes wrong, you have the option to replace the chip at a low cost, enabling you to start fresh and continue your exploration. • Stepper Motors Figure 4.2: Stepper Motors DC motors that move in distinct increments are called stepper motors.They have several coils that are arranged into ”phases” or collections. The motor will rotate by sequentially energizing each phase, one at a time.You can regulate speed and/or location with extreme precision using computer-controlled stepping.Stepper motors are used in many precision motion control applications because of this. • Stepper Motor Driver The A4988 Driver is a built-in translator micro stepping driver for bipolar stepper motors that makes operation simple. With just two pins from our controller, we can control the stepper motor—one for rotation direction and the other for step size.Five distinct step resolutions are offered by the Driver: full, haft, quarter, eight, and sixteenth steps.Additionally, a step pin for a low-to-high transition on the STEP and direction input (DIR) is present, along with a potentiometer for controlling the current output. This establishes the motor’s rotational direction. This input can be changed, but it won’t take effect until the next STEP rising edge. Figure 4.3: Stepper Motor Driver • Servo Motors There are three cables that exit each motor. One of which will be utilized to transmit the signal from the pwm and two of which will be used for supply positive and negative. The 9 Figure 4.4: Servor Motors control wires’ PWM signal operates the servo motor. There is a repetition rate, a minimum pulse, and a maximum pulse. The servo motor may rotate 90 degrees in any direction starting from its neutral position. The servo motor anticipates seeing a pulse every 20 milliseconds , and the length of the pulse determines how far the motor turns. 10 Design Figure 4.5: DRAWING MACHINE As shown in 4.5 This machine has two stepper motors to move the stylus and the cylindrical piece. First, we fixed the first motor with a screw to move the pen left and right on top, and put a rail on the bottom to move the pen easily. To move the pen up and down, we used a servo motor to raise and lower it when needed. We fixing the cylindrical piece on one side using a compressor to fix it and make it move smoothly, and on the other hand we fix it using the stepper motor to move it in a circular motion Implementation Arduino IDE The Arduino IDE is a cross-platform C and C++ tool that allows developers to build and pub- lish software to Arduino boards. Code • G-code Parsing: The controller receives G-code instructions that specify the required motions and actions of the drawing machine. These instructions are normally sent in the form of ASCII text. These directives are parsed by the firmware, which then retrieves pertinent information 11 including feed rates, target locations, and spindle speed. we used the inkscape to create the G-CODE and then use the UNIVERSAL G-CODE SENDER to allow to send command from it. • Motion Planning: Following the parsing of the G-code commands, the controller motion planner takes control. It determines the number of steps, acceleration rates, and speed profiles required to produce the desired motion. • Stepper Control:Stepper motor drivers receive these step pulses and translate them into the exact movements of the stepper motors. The controller is in charge of timing the step pulses and making sure that numerous axes are synchronized for seamless movements. • Servo Control:The typical method of controlling servo motors is to indicate the final position to which they should move. A value within a predetermined range is used to specify the position. This position is converted into the corresponding PWM signal by the servo motor driver,and to regulate the position of the servo motors, pulse width modulation (PWM) signals are used. The servo motor’s location is determined by how long the PWM pulse lasts. One extreme posture is represented by a shorter pulse, the other by a longer pulse, and the middle position is represented by a pulse of an intermediate duration.then A series of pulses are sent at regular intervals to create the PWM signal. The servo motor’s position is determined by the length of each pulse inside an interval. Depending on the particular servo motor and its control requirements, the timing and frequency of these pulses may change.as a result Update the PWM signal by defining a new pulse duration to shift the servo motor to a new location. The task of smoothly moving the servo motor from its current location to the new position is handled by the servo motor driver or library. 12 Figure 4.6: UGS 13 Chapter 5 Conclusions and Future work 5.1 Conclusions The project was able to meet its requirements, which is drawing on a cylindrical object through the use of steppers servo motor and a pen. 5.2 Future work • draw the image in different color. • Printing on different shapes (cube, circular figure...). • Add a beep when you finish the drawing 14 Bibliography [1] V. Vladinovskis, “Review of lathe type 3d printers and their possible improvements,” Science Advances, vol. 5, no. 19, AIEEE 2021, 2021. [2] A. K. Erwan Rolland Matthieu Burnand-Galpin and Y. Ibrahim., “Lathe-type 3d printer,” Science Advances, vol. 5, no. 19, AIEEE 2021, 2013. [3] J. O’connell., “3d-roto printer.,” Science Advances, vol. 5, no. 19, 2022. [4] M. A. A. Karim and T. N. A. R. Mamat, “Design and performance testing of mini capstan lathe machine,” Science Advances, 2022. [5] tech boys toys, “How to make an egg-bot printing machine at home,” Winning Science project, 2021. 15 Abstract Introduction Literature Review Methodology Conclusions and Future work Conclusions Future work