Abstract : This paper proposes a novel embedded four-axis CNC system design based on ARM and MCX314As. The design uses the ARM S3C2410 processor as the main CPU and the MCX314As motion control chip as the slave CPU, employing a real-time Linux operating system. This enables the system to perform multitasking effectively and ensures the real-time performance of motion control.
Keywords : ARM; MCX314As; CNC system; Linux
1. Introduction
In this solution, an ARM microprocessor serves as the core control board, coupled with the motion control chip MCX314A and the real-time operating system Linux, to construct the hardware and software platform for the CNC system. The ARM embedded platform has received widespread attention due to its powerful functions and excellent device support. It employs a 5-stage pipeline, has instruction and data caches, and supports coprocessors and on-chip debugging. It boasts advantages such as easy development and portability, small size, low power consumption, fast processing speed, and good real-time performance. The MCX314As is a 4-axis motion control dedicated DSP (Digital Single Processing) integrated circuit from NOVA Corporation of Japan. This integrated circuit can control the position, speed, and interpolation of a 4-axis system driven by stepper motor drivers or pulse-type servo motors. The Linux operating system is free and open-source software with publicly available source code. It offers advantages such as system stability, powerful functions, numerous application software, ease of use, and low operating costs. This system design achieves openness in both the software and hardware of the CNC system from the bottom layer, making it possible for the CNC system to have higher integration, higher reliability, lower cost, a more user-friendly control interface, more system resources, and larger memory. The design scheme has certain positive significance for the development of CNC systems with independent intellectual property rights.
2. CNC System Hardware Structure
The ARM processor used is the Samsung S3C2410 chip. The S3C2410 is a 32-bit RISC architecture processor based on the ARM920T core. It is small, inexpensive, low-power, and high-performance, featuring an MMU (Memory Management Unit) and a clock speed of up to 203MHz. It also employs the new AMBA (Advanced Microcontroller Bus Architecture) bus structure, supporting both Thumb (16-bit) and ARM (32-bit) instruction sets, and is highly compatible with 8-bit and 16-bit devices.
The motion control chip selected is the MCX314As. The MCX314As is a powerful DSP motion control chip. It can control four axes (X-axis, Y-axis, Z-axis, and U-axis), and can select any two axes for circular interpolation and two/three axes for linear interpolation, with an interpolation accuracy of ±0.5 LSB. The default input clock is 16 MHz, the maximum pulse output speed is 4 MPPS, and the output pulse range is 32 bits.
The MCX314As also features servo motor feedback input (encoder signal, presence signal, and alarm signal), acceleration/deceleration drive, hardware and software limit switches, automatic origin search, synchronous action, and input signal filtering.
The MCX314As interface with an 8/16-bit data bus, and all its functions are implemented by reading and writing internal command registers, data registers, status registers, and mode registers. Each axis has a 32-bit logic position counter (counting output drive pulses), an actual position counter (counting external encoder pulses), and a compare register to achieve closed-loop position control. Each axis has four general-purpose inputs (which can be used for limit and origin signal inputs) and four/eight general-purpose outputs.
The system hardware adopts a master-slave dual-CPU architecture. The master CPU is an ARM processor, used for keyboard, display, network communication, and other management tasks, while the slave CPU is the MCX314A motion control chip, specifically responsible for motion control processing. The ARM processor S3C2410 is connected to the MCX314As via a 16-bit data bus, controlling the system hardware structure, as shown in Figure 1.
The ARM external Flash memory can be used to store motion control parameters that need to be fixed (such as trajectory coordinates and motion parameters). The Flash memory uses a K9F5608U0C (64M Nand Flash) and a 1MB AMD Nor Flash manufactured by Samsung Semiconductor Co., Ltd. of South Korea. The SDRAM uses a HY57V561620BT (32M*2) manufactured by Hyundai Corporation of South Korea. The LCD module uses a 3.5-inch TFT LCD screen from NEC. To facilitate communication with the host system and other controllers, the controller is designed with RS232 and Ethernet communication functions, as well as a keyboard and USB interface. The Ethernet interface controller uses a CS8900A. The ARM controller can easily send execution commands to the MCX314A, generating control pulses to the servo driver to drive the mechanical parts to form the desired motion.
3. Software System
The S3C2410 is responsible for multiple tasks, including communication, human-machine interaction, running control algorithms to generate control commands, and reading and writing MCX314As. Embedding a real-time multi-tasking Linux operating system in the controller facilitates software system design. For technical details of the porting process, please refer to references [1] and [3]. The following discussion mainly focuses on the control of MCX314As by the S3C2410.
Operating the MCX314As in programming involves reading and writing its internal registers according to a specific timing sequence. The registers that can be "written" by the MCX314As are: command register WR0, mode registers WR1-3, output register WR4, interpolation mode register WR5, and data registers WR6-7; the registers that can be "read" are: main status register RR0, status registers RR1-5, and data registers RR6-7.
The ARM processor addresses the I/O ports and memory in a unified manner, and connects the MCX314As to the Bank2 memory group of the S3C2410. That is, CS2 is used as the chip select signal of the MCX314As. The basic address of the MCX314A register is 0x10000000. Note that 0x10000000 is obtained according to the hardware schematic design and is the physical address of the WR0 register of the MCX314As. In the Linux operating system, the applications running in user space use virtual addresses. When writing the driver, it is also necessary to use the ioremap() function to convert the physical address into a virtual address for use. Then the address of WR0 and RR0 is 0x10000000, denoted as Addr. Then the address of WR1 and RR1 is Addr+2, and so on. The address of WR7 and RR7 is Addr+0x0e. Figure 2 is a flowchart of the operation of the MCX314A by the S3C2410 [4].
4. Conclusion
The MCX314As is a powerful motion control chip with excellent four-axis control and interpolation capabilities, providing a convenient and reliable low-level control unit for CNC system development. Its rich functionality simplifies the implementation of various motion control functions within the CNC system. The ARM processor, with its powerful 32-bit RISC performance, small size, and low power consumption, is a high-performance processor. Using an ARM processor and motion control chip significantly reduces development workload and speeds up development, enabling the creation of high-speed, high-precision, high-efficiency, high-reliability, and low-cost CNC systems in a short time. The addition of the Linux real-time operating system allows for excellent multitasking and ensures system real-time performance.
References
[1] Sun Jikun, Zhang Xiaoquan, eds. Embedded Linux System Development Technology Explained - Based on ARM [M]. Beijing: Posts & Telecom Press, 2006, 8
[2] Ye Peiqing, Wang Jinsong, eds. MCX314 Motion Control Chip and CNC System Design [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002.11
[3] Zhou Ligong. ARM Embedded Systems Series Tutorial [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2005.
[4] Yu Zhangguo, Li Zhongli, Li Leimin. Embedded motion controller based on ARM and MCX314A [J]. Microcomputer Information, 2005.10