Design of embedded CNC system based on ARM

Publisher:和谐共处Latest update time:2014-03-10 Source: ofweekKeywords:ARM  MCP2510 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    Traditional CNC systems are usually based on general-purpose computers or industrial computers with motion control cards installed, using Windows operating systems and expensive CNC software. Such systems are costly and power-hungry, and are not suitable for small and medium-sized applications. Embedded products have the characteristics of streamlined system structure and low power consumption, which can make up for the shortcomings of traditional CNC systems.

  Today, embedded system developers and system-on-chip designers increasingly choose specific processor cores and supporting tools, libraries, and off-the-shelf components to quickly develop new microprocessor-based products. ARM is particularly outstanding in this regard. In the past 10 years, the ARM architecture has become the world's most popular 32-bit architecture, and at the time of this book's completion, more than 2 billion ARM-based processors have been shipped. ARM processors have been embedded in a variety of products - from mobile phones to automotive braking systems. ARM partners and third-party suppliers around the world have rapidly grown in semiconductor and product design companies, including hardware engineers, system designers, and software developers. But until now, no book has been able to better meet the needs of ARM-based embedded system and software development.

  CNC technology is the core technology of today's manufacturing industry and the key to the development of high-end technology and high-tech industries. CNC machine tools are regarded as strategic materials and war-readiness industries and are highly valued. The development of embedded technology is the fastest-growing technology in recent years and has been applied to all aspects of life. At present, embedded technology has begun to enter the field of industrial control extensively. Applying embedded technology to CNC machine tools and researching and applying new embedded CNC systems can be on the same starting line as foreign countries. It has a very important driving significance for the development of CNC technology in my country. This paper proposes a four-axis three-linkage open economic CNC system based on the industrial-grade ARM microprocessor S3C2440 and DSP dedicated motion control chip MCX314As. The CNC system not only has the advantages of low cost, high processing accuracy, and fast response speed, but also has good portability and tailorability. It is an exploration and research on the standards of a new generation of open economic CNC systems. Embedded CNC technology will have a good application prospect in the field of CNC and will have a positive role in improving the overall level of my country's manufacturing industry.

  At present, there are two main forms of embedded CNC systems: systems that rely entirely on embedded processor control and systems that combine embedded processors and motion control chips. Compared with the former, the latter uses professional motion control chips and performs better in terms of real-time performance and accuracy, and thus becomes a future development direction. This article introduces a master-slave CNC system based on ARM controller and FPGA motion control chip, hoping to provide some reference for the application of ARM in embedded CNC systems.

  1 Overall design

  This system is a master-slave structure. The upper computer is based on the S3C2410 ARM9 controller, and the Linux system and QT/Embedded graphics library are transplanted to mainly realize human-machine interaction functions such as G code file processing, display of processing position, and manual control. The lower computer is based on the $3C44B0 ARM7 controller as the core, and the SM5004 FPGA chip of Smedy is the motion controller to realize machine tool control functions such as motor drive, coolant switch, and emergency stop. The upper and lower computers communicate through the CAN bus.

  2 Hardware Design

  2.1 CAN interface design

  Since S3C2410 and S3C44B0 do not have CAN interfaces, they must be expanded. The CAN expansion interface of S3C2410 is shown in Figure 1, and the CAN interface of S3C44B0 is similar to it.

  

  The CAN controller of the system uses the MCP2510 chip. The reset pin RESET of MCP2510 is connected to the reset pin nRESET of S3C2410, and the chip select pin CS is connected to GPH0 of S3C2410. The OSC1 and OSC2 pins are connected to a 16M crystal as the clock source. SI, SO and SCK are connected to SPI El MOSIO, MISO0 and SPICLKO of S3C2410 respectively. If the SPI port is occupied by other devices, other I/O El can be used instead, but software algorithms must be written to simulate the read and write operations of SPI. The system uses interrupt mode to read and write MCP2510, so its INT pin is connected to the external interrupt pin EINT4 of S3C2410. When the external interrupt pin resources are relatively tight, the query mode can also be used to read and write MCP2510, and INT can be left floating at this time.

  The system's CAN transceiver uses the TJA105O chip, whose TXD and RXD are connected to the TXCAN and RXCAN of the MCP2510, and the slope resistor connected to the Rs pin is 1K.

  TJAlOS0 outputs CANH and CANL differential signals and connects to the physical line through the J1001 socket.

  2.2 Input and output interface design

  The S3C44B0 ARM and SM5004 FPGA chips provide many general input and output interfaces. In order to effectively prevent interference from entering the system, optocoupler isolation is used here, as shown in Figure 2. [page]

  

In the low-speed switching quantity, as shown in Figure 2 (a), the low-speed optocoupler MOCD217-M is used here. It is a product of Motorola and is a dual-channel optocoupler with low input current. The reason why resistor R3 is added before connecting to the input port is that some I/O ports in ARM are open-drain, which prevents excessive current from burning out the corresponding port during the input and output process. As shown in Figure 2 (b), in the high-speed switching quantity, HC-PL0661 dual-channel optocoupler is used for expansion. It is a product of Agilent Technologies. Its switching rate can reach about 10 M and can be applied to various high-speed pulse input and output occasions.

    3 Software Design

  31 Human-computer interaction and G code interpretation

  The human-computer interaction interface is shown in Figure 3. The interface is designed using the QT/Embedded embedded graphical library. QT Embedded is an embedded GUI development tool developed by Roltech, which has rich controls and supports virtual frame buffering. Through this interface, you can edit G code, check syntax, preview the plus 1 trajectory, and communicate with the lower computer.

  

  The principle of G code interpretation is shown in Figure 4. Two data structures PreGCode and GCode are defined in the program to store the intermediate results after syntax checking and the G code type, node coordinates, arc radius and other data generated after data analysis for simulation and processing.

  3.2 CAN communication

  This system uses the CAN controller MCP2510 to complete the task of sending and receiving CAN bus frames. Communication data is divided into command frames and data frames. The communication protocol uses the 29-bit extended identifier of the CAN bus to save some necessary information in the protocol, as shown in Table 1. Since CAN supports multi-host and multi-slave modes, IDs are assigned to the source and destination device addresses to distinguish the source and destination of the data. The data frame has a large amount of data and must be transmitted in batches, so the identifier also contains the data packet group number for sorting. [page]

  

  The system uses interrupt mode to transmit data, and a total of 4 interrupts are enabled, namely error passive interrupt, error alarm interrupt, send interrupt and receive interrupt. If it is the first two interrupts, the program will reset the MCP2510 chip. If it is a send interrupt, it means that the transmission is completed, and the program will set the send interrupt flag to notify the main program. If it is a receive interrupt, the program will check the identifier ID28-ID21 to determine the type of the frame, and then process it according to the type of frame.

  3.3 Interpolation algorithm

  The SM5004 chip is a high-performance motion control FPGA chip from Smedy. It can realize 4-axis linkage, with a drive pulse frequency of up to 5MPPS, an interpolation accuracy of up to 0.5ISB, a single output pulse number of up to 2G, and supports 4 interpolation modes: linear interpolation, circular interpolation, continuous interpolation and bit pattern interpolation.

  For straight lines and arcs, SM5004 has its own interpolation algorithm. As long as the required parameters for interpolation such as end point coordinates and speed are provided, SM5004 can automatically complete the interpolation.

  Bit-mode interpolation is to receive the interpolation data calculated by the high-order CPU in the form of a data packet, and then continuously output the interpolation pulse at the specified drive speed. The principle of bit-mode interpolation is to set the +/-direction drive pulse of 2-axis or 3-axis to 1-bit 1 pulse on each register, set it to 1 when outputting the drive pulse, and set it to 0 when not outputting the pulse. Bit-mode interpolation provides a flexible interpolation mechanism, and users can write their own interpolation algorithms for various curves such as straight lines, arcs, spline curves, function curves, etc. The program uses the method of digital integration to implement the interpolation of straight lines and quadratic curves. The principle of digital integral interpolation (also known as DDA interpolation) is shown in Figure 5. By dividing the integral interval [a, b] into a sufficiently small interval △f, ​​the integral operation of the function y=f(t) is converted into a summation operation of variables, that is

  In digital operations, At generally takes the smallest unit "1", that is, a pulse equivalent, then:

 

        The key components of the digital integration interpolator are the accumulator and the integrand register. Each coordinate direction requires an accumulator and an integrand register. Generally, before the interpolation starts, the accumulator is cleared and the integrand register stores X and Y respectively; after the interpolation starts, each time an accumulation pulse △£ comes, the content in the integrand register is added once in the corresponding accumulator, and the overflow after the addition is used as the feed pulse Ax (or Ay) to drive the corresponding coordinate axis, and the remainder is still stored in the accumulator; when the number of accumulated pulses m emitted by the pulse source is exactly equal to the capacity of the integrand register 2, the overflow pulse number is equal to the end point coordinate with the pulse equivalent as the minimum unit, and the tool moves to the end point. The program flow chart of the digital integration method interpolation of the first quadrant straight line is shown in Figure 6, and the interpolation trajectory is shown in Figure 7.

  

  4 Conclusion

  ARM is a British company, which literally means Advanced RISC Microprocessor. ARM provides customers with 16/32-bit embedded RISC microcontroller solutions and licenses its RISC processors to electronics companies. In portable communications, handheld computing devices, consumer and digital multimedia solutions, ARM is on the way to becoming a standard.

  The combination of ARM and FPGA motion control chips can not only take advantage of ARM's fast computing speed and rich hardware resources, but also take advantage of FPGA's excellent motion control functions. Compared with the traditional pure ARM-controlled CNC system, it has more advantages in real-time performance and control accuracy, and is a development direction for future embedded CNC systems.

  The design of embedded CNC system using professional motion control chips and ARM processors can greatly reduce the R&D tasks, speed up the R&D process, and develop a CNC system with excellent performance in a short time. The addition of a properly "tailored" Linux system enables the CNC system to better handle multiple tasks, greatly improving the real-time performance of the system.

Keywords:ARM  MCP2510 Reference address:Design of embedded CNC system based on ARM

Previous article:Design and implementation of integrated stepper motor driver based on CAN bus
Next article:Design of Fire Monitoring System Based on GPRS

Recommended ReadingLatest update time:2024-11-16 21:28

Which is more practical, MCU or ARM?
Generally speaking, there is a difference in the level of embedded systems between 8-bit MCU and ARM. ARM is suitable for advanced products with greater system complexity, such as PDA, mobile phones, etc., while 8-bit MCU is suitable for general industrial control, consumer appliances, etc. due to its simple architect
[Microcontroller]
Which is more practical, MCU or ARM?
ARM Notes: MMU Unit Controller
.text .global _start _start:     ldr sp,=4096 @Set the stack pointer. The following are all C functions. You need to set the stack before calling them.     bl disable_watch_dog @Turn off WATCHDOG, otherwise the CPU will restart continuously.     bl memsetup @Set up the memory controller to use SDRAM     bl copy_2th_to
[Microcontroller]
When TDC-GP22 meets ARM CortexM3
While smart meters are developing rapidly in the power system, water meters are also developing rapidly in the direction of intelligence and full electronicization. On the one hand, the global water shortage forces the government to pay attention to water conservation and water volume control, and on the other hand, t
[Industrial Control]
When TDC-GP22 meets ARM CortexM3
arm linux boot process to enter the kernel
Let's look at the process of compiling and linking to generate vmlinux. It is linked by a lot of .o files. The first one is kernel/arch/arm/kernel/head-armv.o , and we also saw the lds link file kernel/arch/arm/vmlinux.lds, let's analyze it first ENTRY(stext) //The entry point is stext, which should be in head-armv.
[Microcontroller]
arm linux boot process to enter the kernel
ARM assembly instruction debugging method
When learning ARM assembly, debugging ARM assembly instructions is indispensable. As a debugger that supports multiple languages, gdb is naturally a better choice. When the debugger is working, it generally constructs a trap soft interrupt instruction by modifying the content of the code segment to achieve program paus
[Microcontroller]
Solutions to communication problems between MCU and ARM series processors
  1 System Hardware Design   1.1 Host hardware system structure   1) Power supply circuit AT91RM9200 requires 1.8 V and 3.3 V power supplies. In addition, most peripheral devices require 3.3 V power supplies, and a small number of peripheral devices also require 5 V power supplies. Here, the SPX1117M3-3.3 low-dro
[Microcontroller]
Solutions to communication problems between MCU and ARM series processors
Connect 16x2 LCD with ARM7-LPC2148 and display text
In this tutorial, we will see how to interface a 16x2 LCD with ARM7-LPC2148 microcontroller and display a simple welcome message. If you are new to ARM7, start with the basics of the ARM7 LPC2148 and learn how to program it using Keil uVision materials needed hardware ARM7-LPC2148 Microcontroller Board LCD screen (1
[Microcontroller]
Connect 16x2 LCD with ARM7-LPC2148 and display text
Design of serial communication between ARM and MCU under Linux
0 Introduction In the data acquisition system, since the single-chip microcomputer focuses on control and has weak data processing capabilities, it is cumbersome to operate the collected data. If the communication with the host computer is carried out through the serial port, the design efficiency can be improved by
[Microcontroller]
Design of serial communication between ARM and MCU under Linux
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号