Motion control systems have been widely used in industrial control. In recent years, industrial control has placed increasingly higher demands on motion control systems. Traditional PC-based and low-end microcontrollers have increasingly revealed problems such as high cost, high power consumption, and low reliability, and can no longer meet the requirements of modern manufacturing. With the increasing maturity of embedded technology, embedded motion controllers have begun to show their potential. ARM-based microprocessors, with their small size, low cost, and low power consumption, determine their promising development prospects in the field of motion control.
The PCL6045BL is a new type of dedicated DSP motion control chip with powerful data processing capabilities and high operating speed, enabling high-precision multi-axis servo control. To address the urgent need in precision manufacturing for low-cost, highly portable, and general-purpose multi-axis CNC systems, this paper presents an embedded four-axis motion controller based on the ARM microprocessor S3C2440 and the PCL6045BL DSP motion control chip. This motion controller features high performance, low cost, small size, and independent operation, meeting the high-speed and high-precision requirements of motion control systems.
It can be widely used in industrial control fields such as engraving machines, robots, embroidery machines, and CNC machining.
To address the urgent need for low-cost, highly portable, and general-purpose multi-axis CNC systems in precision manufacturing, an embedded four-axis motion controller based on the ARM microprocessor S3C2440 and the dedicated DSP motion control chip PCL65045BL is presented. In terms of hardware, the controller adopts a master-slave dual-CPU structure of ARM+DSP, combining the advantages of ARM in human-machine interface display and communication interface with the high control precision of the PCL6045BL. In terms of software, the μC/OS-II real-time operating system is ported to the S3C2440 to manage the motion control system. This control system has strong versatility and can be widely used in industrial control fields such as engraving machines, robots, embroidery machines, and CNC machining.
1 System Overall Design
An embedded four-axis motion controller mainly consists of hardware and software components.
The hardware mainly consists of two parts: the S3C2440 embedded main control board and the PCL6045BL motion control board. The S3C2440 embedded main control board and the PCL6045BL motion control board are connected via a common IDE communication interface.
On the software side, the S3C2440 real-time embedded operating system was ported to the hardware platform, and the BootLoader, peripheral drivers, and motion control system application were designed. Using the aforementioned hardware and software platform, the embedded motion controller can achieve the requirements of good openness and high precision.
ARM processors offer a rich set of on-chip peripheral circuits, such as USB interfaces, IIS interfaces, and LCD controllers, providing greater capabilities in human-machine interface display, communication interfaces, and system porting. The PCL6045BL motion control chip boasts high speed, high reliability, and excellent performance, offering significant advantages in motion control.
The real-time operating system μC/OS-II includes a real-time kernel, task management, time management, inter-task communication and synchronization, and memory management. It allows each task to work independently without interference, easily achieving timely and error-free execution. This simplifies the design and expansion of real-time applications, greatly reducing the application design process. Applying the advantages of the S3C2440 processor, PCL6045BL, and μC/OS-II to this embedded four-axis motion controller enables it to possess powerful functionality while shortening development time.
This embedded four-axis motion controller uses the S3C2440 as the main control platform. The μC/OS-II real-time operating system is ported to the ARM architecture for human-machine interface display, I/O management, inter-task communication, and instruction compilation. The PCL6045BL motion control module is primarily responsible for position control, interpolation drive, and speed control. User commands are compiled using the S3C2440 instruction compiler and communicate with the PCL6045BL via a dedicated communication interface to control the DSP motion control chip to send pulses, thereby enabling the servo motor to run at high speed.
2 System Hardware Design
2.1 System Hardware Platform Design
In the control system, the S3C2440 processor is the main control core, and the PCL6045BL motion control chip is the slave CPU. The S3C2440 is a 16/32-bit ARM920TRISC processor that implements an MMU, AMBA bus, and independent 16KB instruction and 16KB data Harvard caches, each with an 8-word pipeline. The S3C2440 provides comprehensive and general-purpose on-chip peripherals, eliminating the need for additional components. The PCL6045BL motion control chip, manufactured by NPM, is a CMOS large-scale integrated chip that receives CPU commands via a bus and generates pulses to control stepper motors or pulse-driven servo motors. It provides various output motion control functions, including continuous, fixed-length, and homing output modes.
The PCL6045BL can perform 2-4 axis linear interpolation and any two-axis circular interpolation. Based on this master-slave architecture, the master CPU S3C2440 is primarily responsible for data storage, HMI display, network communication, and other management tasks. Pulses output from the CPU PCL6045BL are sent to the servo drives of the four axes. The S3C2440 can achieve various control functions simply by sending simple commands to the PCL6045BL.
2.2 Connection between ARM and PCL6045BL
Communication between the PCL6045BL and the ARM processor is achieved through reading and writing several addresses on the I/O bus for instruction and data transfer. The internal register address of each axis of the PCL6045BL is determined by the A0, A1, and A2 address lines, while its control address range is selected by input terminals A3 and A4. Therefore, in this master-slave architecture design, the connection between the ARM and the PCL6045BL...
2.3 I/O Interface Circuit
The embedded four-axis motion controller is connected to the servo motor via an I/O interface circuit. The main tasks of the I/O interface circuit are to perform opto-isolation of the input signals and drive the output pulses. In this design, optocouplers are used to isolate the PCL6045BL chip from the subsequent servo motor driver and other control feedback circuits. Because the input and output of the optocoupler are mutually isolated, and the electrical signal transmission is unidirectional, it has good electrical insulation and anti-interference capabilities. Furthermore, since the input of the optocoupler is a current-driven low-impedance component, it has strong common-mode rejection capability. Isolating both the output signals (such as CP, CW, etc.) and input signals (such as alarms, limit switches, etc.) of the PCL6045BL from the PCL6045BL using optocouplers effectively prevents interference signals from entering the main chip and damaging the PCL6045BL.
3 Software Design
The system software consists of the μC/OS-II real-time embedded operating system and related application software. The μC/OS-II real-time embedded operating system only provides a real-time kernel for task scheduling. Therefore, a series of device drivers, API functions, and applications related to system operation need to be developed independently to extend μC/OS-II into a complete and practical real-time operating system.
3.1 BootLoader Design
In embedded systems, there is typically no firmware program like the BIOS. Therefore, the entire system loading and booting task is handled entirely by the BootLoader. The BootLoader is the first piece of code to run after the system is powered on. It is responsible for initializing the system and starting the operating system, much like a program on a PC. The BootLoader initializes hardware devices, establishes a memory space mapping, and prepares the correct environment for the final call to the operating system kernel.
The BootLoader is divided into two parts: Phase 1 and Phase 2. Processing tasks closely related to the CPU core and storage devices are usually placed in Phase 1 and can be implemented using assembly language; while Phase 2 is usually implemented using C language to implement general processes and some driver support for the board level.
Phase 1 primarily involves defining the entry point, setting interrupt vectors, configuring system registers, and initializing registers. Phase 2 mainly involves calling initialization functions, initializing flash memory devices, and initializing memory allocation functions. The BootLoader is the first step in embedded system software development, tightly integrating the real-time operating system and hardware platform, making it particularly important for embedded system software development.