A design scheme for a mini CNC engraving machine system

Publisher:Jinyu2022Latest update time:2014-05-05 Source: 互联网Keywords:ATmega128 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the rapid development of industries such as art models, mechanical processing, and tooling and molds, higher and higher requirements are placed on processing equipment. As an important part of the above industries, engraving machines have also developed rapidly.

At present, traditional engraving machines are large in size, complex to operate, and expensive. Not only do they require a dedicated computer equipped with dedicated software, but they also require professional operators to control them. In addition, traditional engraving machines are mainly used for mass production. For some engraving machine enthusiasts and mold designers who want to use engraving machines to engrave a single piece of their own design, traditional engraving machines are highly professional, expensive, and impractical. In addition, some traditional engraving machines require manual positioning of the engraving head by turning the handwheel in the three-axis direction before use, which has low accuracy and efficiency. Some high-end engraving machines use software to initially position the engraving head, but the equipment is expensive.

In view of this, a mini CNC engraving machine system is carefully designed. The system is not only simple and convenient to operate, but also has precise initial positioning accuracy and high efficiency for the engraving head.

1 Overall design of the system

In order to meet the needs of the mini CNC engraving machine system to complete the engraving of patterns and texts on non-ferrous metal materials, an engraving machine system with ATmega128 microcontroller as the main control chip was designed. The system includes a stepper motor driver module, LCD12864 liquid crystal display module, keyboard operation panel module, ATmega128 microcontroller minimum system module, ultrasonic sensor, power supply, serial communication module and other parts.

The system structure block diagram is shown in Figure 1.

In the design of this system, the ATmega128 microcontroller produced by ATMEL is used as the main control chip. This microcontroller belongs to the AVR series of microcontrollers, has a 128 kB program memory, and comes with a PWM wave generation module, which is convenient for controlling stepper motors and spindle motors. Among them, the PC is used to interpret the G code of the object to be processed using MACH3 software, realize the conversion of related data formats, and then download it to the control motherboard with the ATmega128 microcontroller as the main control chip through the serial communication module. Since the engraving head needs to be initially positioned before the engraving machine works, a key operation panel is designed in the system. The initial positioning of the engraving head can be completed by operating the six buttons on the key operation panel, such as up and down, left and right, and front and back, which improves the processing efficiency and saves materials. The system also designs an LCD12864 liquid crystal display screen to facilitate the observation of parameters such as the position coordinates of the engraving head and the processing time during the engraving machine processing. To control the stepper motors on three axes, this system uses the PWM wave generated by the PWM module of the ATmega128 microcontroller to control the stepper motor driver, thereby achieving precise control of the stepper motors on three axes.

2 Functional module selection

2.1 ATmega128 MCU Minimum System Module

ATmega128 is an 8-bit microprocessor designed by ATMEL. It has 128K bytes of in-system programmable Flash and 53 programmable I/O lines, which can meet the needs of many I/O ports in this design without further expansion. In addition, the microcontroller also has six-channel programmable resolution PWM, which is convenient for generating standard pulse signals. It also has six external interrupt ports, which can be used for anti-collision design. The minimum system schematic is shown in Figure 2.

2.2 LCD12864 Liquid Crystal Display Module

In order to observe the position coordinates of the engraving head and the processing time during the engraving machine processing, this system designed an LCD12864 liquid crystal display module. The LCD12864 liquid crystal display can display Chinese characters, uppercase and lowercase letters, and other various symbols, etc., which meets the design requirements. In this design, the ATmega128 microcontroller is used to control the LCD12864, in which the PC port is used as a parallel data port to transmit data to the LCD12864 parallel serial port. The PF port is used to control chip selection, read and write, reset, and serial-parallel data transmission mode selection. The LCD12864 liquid crystal display module is shown in Figure 3.

2.3 Stepper Motor Driver Module

A stepper motor is an electromagnetic mechanical device that converts electrical pulse signals into angular displacement. It is a commonly used drive actuator in CNC systems. A stepper motor must have a driver and a controller to work properly. The driver distributes the control pulses in a circular manner and amplifies the power, so that the stepper motor windings are energized in a certain order and the motor rotates.

In this system design, BL-210 is used as the driver of the stepper motor. The driver realizes high-frequency chopping and constant current drive. It has strong anti-interference, good high-frequency performance, high starting frequency, photoelectric isolation between control signals and internal signals, optional current, simple structure, stable operation, good reliability, low noise, and can drive all stepper motors below 1.0 A. In addition, the number of subdivisions can be selected (1/2, 1/4, 1/8), and the corresponding micro-step angles are (0.9°/STEP, 0.45°/STEP, 0.225°/STEP). The circuit diagram of the BL-210 stepper motor driver is shown in Figure 4. A+ and A- are connected to the A phase of the stepper motor. B+ and B- are connected to the B phase of the stepper motor. The CW- signal is transmitted, otherwise it is turned. The CP- signal controls the speed of the stepper motor. The PWM wave generated by the ATmega128 microcontroller is input from this port. When the PWM wave frequency is high, the stepper motor speed is faster, otherwise it is slower. CP+ and CW+ are the common positive terminals of the input control signals and are both connected to a high level.

2.4 Keyboard Operation Panel Module

Before engraving, we need to preliminarily position the engraving head of the engraving machine so that the engraving head is in an ideal initial processing position. The main purpose of doing this is to save raw materials and improve processing efficiency. In this design system, 6 buttons such as up and down, left and right, front and back are designed. These 6 buttons are connected to the PA port of the microcontroller. We can complete the forward and reverse rotation of the three-axis stepper motor by operating these 6 buttons, thereby completing the preliminary positioning of the engraving head of the engraving machine. The circuit diagram of the keyboard operation board is shown in Figure 5.

3 Software Design

In the software design of this system, AVR Studio is selected as the embedded development environment and C is used as the writing language. The AVR Studio integrated development environment includes the AVR Assembler compiler, AVR Studio debugging function, AVRProg serial, parallel download function and JTAG ICE simulation. With these functions, we can edit the source code online and run it on the AVR device, which is convenient for AVR microcontroller developers to develop. As a high-level language, C language is efficient and easy to understand in writing programs. In writing programs, modular writing ideas are adopted. The entire software system consists of serial communication module, PWM wave module, LCD12864 liquid crystal display module, keyboard scanning module, ultrasonic sensor interruption and other parts. The program flow chart of the system software design is shown in Figure 6. 

4. Anti-collision design

Practical production shows that collision accidents often occur in engraving machines during work. There are many reasons for collision accidents, such as incorrect G code generated by the host computer, improper operation during the initial positioning of the engraving head, incorrect parameter settings, etc. Once the engraving machine collides, the engraving knife may break at the least, the stepper motor may burn out, and even the control motherboard may be damaged. Such accidents will not only cause unnecessary economic losses, but also delay work and production. Therefore, it is also necessary to design a device in the control system to avoid such collision accidents.

In order to solve the above problems, in this design, an ultrasonic sensor is installed at both ends of each ball screw. When the mobile platform in the three-axis direction moves quickly to the edge, the ultrasonic sensor will generate a signal and transmit this signal to the control motherboard, which will then stop generating pulse signals and the stepper motor will stop working.

5 Conclusion

As a typical mechatronics equipment, the engraving machine requires high precision and stable system. This solution uses ATmega128 from the AVR series as the main control chip of the system, which has stable performance and is easy to use. The key operation panel designed in this solution performs preliminary positioning of the engraving head, which is convenient and efficient. Through experiments on the homemade mini CNC engraving machine, the control effect is stable and meets the needs of the solution design.

Keywords:ATmega128 Reference address:A design scheme for a mini CNC engraving machine system

Previous article:Make a gravity sensing remote control with Cortex-M3 and ADXL345
Next article:A simple and practical design scheme of STC89C52RC programmer

Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号