A design scheme for a mini CNC engraving machine system

Publisher:画意人生Latest update time:2014-05-06 Source: 21icKeywords:ATmega128 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction

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.

System structure diagram

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.

ATmega128 minimum system schematic

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.

LCD12864 liquid crystal display module diagram

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's function is to distribute the control pulses in a circular manner and amplify the power, so that the stepper motor windings are energized in a certain order and the motor is controlled to rotate. [page]

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.

BL-210 stepper motor driver circuit diagram

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.

Keyboard operation panel circuit diagram

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.

Program flow chart of system software design

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 using Cortex-M3 and ADXL345
Next article:Car driving recorder based on ARM design

Recommended ReadingLatest update time:2024-11-17 03:27

Design and application of 32-channel remote signaling unit based on ATmega128
0Introduction In power and industrial automation control systems, there are a large number of actuator states such as circuit breaker opening and closing, motor start and stop, solenoid valve opening and closing that need to be detected and fed back to the control unit to form a closed-loop control. In prev
[Microcontroller]
Embedded laser display handheld measuring instrument solution
introduction Laser display is a display technology that uses red, green, and blue (RGB) three-primary color lasers as light sources. It can reproduce the rich and gorgeous colors of the objective world in the most realistic way and provide more shocking expression. The ultimate goal of laser display research and dev
[Microcontroller]
Embedded laser display handheld measuring instrument solution
ATmega128 Introduction
ATmega128 is an 8-bit low-power CMOS microprocessor based on AVR RISC architecture. Due to its advanced instruction set and single-cycle instruction execution time, ATmega128 has a data throughput of up to 1 MIPS/MHz, which can alleviate the contradiction between power consumption and processing speed in the system.
[Microcontroller]
Design of high-precision digital controlled DC power supply based on hybrid optimal algorithm
1 Design Task Design and manufacture digital controlled DC current source. Input AC 200~240V, 50Hz; output DC voltage ≤10V. Requirements: Output current range: 200mA ~ 2000mA; The output current given value can be set and displayed, and the absolute value of the deviation between the output current and the
[Microcontroller]
ATmega128 (12864 with font library)
//12864 LCD display driver, simple display of Chinese characters and letters //Compilation environment AVR Studio 4.17/AVR GCC //System clock 7.3728MHZ, set fuse bit to external high frequency quartz crystal oscillator, startup time 4.1ms //***************************************************************************
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号