Design of master-slave dual CPU embedded four-axis motion controller based on ARM and DSP

Publisher:码字先生Latest update time:2020-09-14 Source: elecfansKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Motion control systems have been widely used in the field of industrial control. In recent years, industrial control has placed higher and higher demands on motion control systems. Traditional PC-based and low-end microcontrollers have increasingly exposed problems such as high cost, high 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 edge. Microprocessors based on ARM technology have the characteristics of small size, low cost, and low power consumption, which determines that they have good development prospects in the field of motion control.


PCL6045BL is a new type of dedicated DSP motion control chip. It has powerful data processing capabilities and high operating speed, and can achieve high-precision multi-axis servo control. In order to solve the urgent need for low-cost, highly portable general-purpose multi-axis CNC systems in precision manufacturing, this paper presents an embedded four-axis motion controller based on the ARM microprocessor S3C2440 and the DSP professional motion control chip PCL6045BL. The motion controller has the characteristics of high performance, low cost, small size, and independent operation, which can meet the requirements of high speed and high precision of motion control systems. It can be widely used in industrial control fields such as engraving machines, robots, embroidery machines, and CNC machining.


In order to meet the urgent demand of precision manufacturing for low-cost, highly portable general-purpose multi-axis CNC systems, an embedded four-axis motion controller based on the combination of ARM microprocessor S3C2440 and dedicated DSP motion control chip PCL65045BL is proposed. In terms of hardware, the controller adopts the master-slave dual CPU structure of ARM+DSP, combining the advantages of ARM in human-machine interface display and communication interface and the advantages of PCL6045BL in high control accuracy. In terms of software, the μC/OS-II real-time operating system is transplanted on S3C2440 to manage the motion control system. The 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 Overall system design

The embedded four-axis motion controller is mainly composed of hardware and software.

The hardware mainly includes two parts: S3C2440 embedded main control board and PCL6045BL motion control board. The S3C2440 embedded main control board and PCL6045BL motion control board are connected through the universal IDE communication interface.


In terms of software, the S3C2440 real-time embedded operating system is transplanted on the basis of the hardware platform, and the Boot Loader, peripheral drivers and motion control system applications are designed. Using the above-mentioned software and hardware platform, the embedded motion controller can meet the requirements of good open performance and high precision. The structure of this embedded four-axis motion controller is shown in Figure 1.

Figure 1 Composition of embedded four-axis motion controller

ARM has a wealth of on-chip peripheral circuits, such as USB interface, IIS interface, LCD controller, etc., and has more powerful functions in human-machine interface display, communication interface and system transplantation. PCL6045BL motion control chip has fast speed, high reliability, good performance, and has great advantages in motion control.


The real-time operating system μC/OS-II includes real-time kernel, task management, time management, inter-task communication synchronization and memory management functions, which can make each task work independently without interfering with each other, and it is easy to achieve timely and error-free execution, making the design and expansion of real-time applications easy and greatly simplifying the application design process. Applying the advantages of S3C2440 processor, PCL6045BL and μC/OS-II to this embedded four-axis motion controller can make it powerful and shorten the development time.


2 System Hardware Design

2.1 System Hardware Platform Design

In the control system, the S3C2440 processor is used as the main control core, and the PCL6045BL motion control chip is used as the slave CPU. The structure of the embedded motion controller is shown in Figure 2.

Figure 2 System hardware


S3C2440 is a 16/32-bit ARM920T RISC processor that implements MMU, AMBA bus and independent 16 KB instruction and 16 KB data Harvard structure caches, each of which is an 8-word pipeline. S3C2440 provides comprehensive and general on-chip peripherals without the need to configure additional components. PCL6045BL motion control chip, produced by NPM, is a CMOS large-scale integrated chip that receives CPU commands through the bus and generates pulses to control stepper motors or pulse-driven servo motors. It can provide a variety of output motion control functions, including continuous, fixed-length, and return-to-origin output modes. PCL6045BL can achieve 2~4-axis linear interpolation and any two-axis circular interpolation. Based on this master-slave structure framework, the main CPU S3C2440 is mainly responsible for data storage, human-machine interface display, network communication and other management tasks. The pulses output by the slave CPU PCL6045BL are sent to the servo drivers of the four axes. S3C2440 can realize various control functions by sending simple instructions to PCL6045BL.


2.2 Connection between ARM and PCL6045BL

The communication between PCL6045BL and ARM is to transmit instructions and data by reading and writing several addresses on the I/O bus. The internal register address of each axis of PCL6045BL is determined by the A0, A1 and A2 address line inputs, and its control address range is selected by input terminals A3 and A4. Therefore, in the design of this master-slave structure, the connection between ARM and PCL6045BL is shown in Figure 3.

Figure 3 Interface circuit between PCL6045BL and S3C2440


2.3 I/O Interface Circuit

The embedded four-axis motion controller and the servo motor are connected through the I/O interface circuit. The main task of the I/O interface circuit is to complete the photoelectric isolation of the input signal and drive the output pulse. In the design, a photocoupler is used to isolate the PCL6045BL chip from the servo motor driver and other control feedback lines behind it. Since the input and output of the optocoupler are isolated from each other, and the electrical signal transmission has the characteristics of unidirectionality, it has good electrical insulation and anti-interference capabilities. And because the input end of the optocoupler is a low-resistance component working in the current type, it has a strong common-mode suppression capability. The output signals (such as CP, CW, etc.) and input signals (such as alarm, limit, etc.) of the PCL6045BL are isolated from the PCL6045BL using optocouplers, which can effectively prevent interference signals from entering the main chip and damaging the PCL6045BL.


3 Software Design

The system software consists of μC/OS-II real-time embedded operating system and related application software. μC/OS-II real-time embedded operating system only provides a real-time kernel for task scheduling, so it is necessary to develop a series of device drivers, API functions and applications related to system operation to expand μC/OS-II into a complete and practical real-time operating system.


3.1 Boot Loader Design

In embedded systems, there is usually no firmware program like BIOS, so the entire system loading and startup task is completely completed by the Boot Loader. The Boot Loader is the first code that runs after the system is powered on. It is responsible for initializing the system and starting the operating system, which is equivalent to the program of a PC. The Boot Loader initializes the hardware devices, establishes a mapping of the memory space, and prepares the correct environment for the final call to the operating system kernel.


The Boot Loader is divided into two parts: Stage 1 and Stage 2. The processing work closely related to the CPU core and storage devices is usually placed in Stage 1 and can be implemented in assembly language; while Stage 2 usually uses C language to implement general processes and some board-level driver support.


Phase 1 mainly defines entry, sets interrupt vector, configures system registers, initializes registers, etc. Phase 2 mainly completes operations such as calling initialization functions, initializing flash memory devices, initializing memory allocation functions, etc. Boot Loader is the first link in embedded system software development, which closely combines the real-time operating system and the hardware platform, and is particularly important for embedded system software development.


3.2 μC/OS-II transplantation on S3132440

The embedded real-time operating system μC/OS-II is a multi-task real-time operating system kernel with open source code. It simplifies the design of application software and ensures the real-time performance of the control system. A good multi-task design helps to improve the stability and reliability of the control system. The so-called transplantation is to modify the source code of the operating system kernel and the processor-related parts so that a real-time kernel can run on a microprocessor or microcontroller. The file system structure of μC/OS-II includes the core code part, the configuration code part, and the processor-related code part, as shown in Figure 4. The processor-related code part includes three files: OS_CPU.H, OS_CPU.A.ASM, and OS_CPU.CC. To transplant μC/OS-II to S3C2440, you only need to modify the code related to the processor.

3.3 System Application Design

The design process of real-time application includes how to divide the problem into multiple subtasks. Each subtask is part of the whole system, is given a certain priority, and has its own set of CPU registers and stack space. A task, also called a thread, is a simple program that can think that the CPU belongs to itself. In this design, the tasks are divided into the design of human-machine interface, compilation and interpretation of numerical control instructions, servo unit acquisition tasks, status monitoring, etc. μC/OS-II can start each task according to priority and complete the scheduling between tasks through the kernel. The basic flow of the system is shown in Figure 5.

[1] [2]
Keywords:ARM Reference address:Design of master-slave dual CPU embedded four-axis motion controller based on ARM and DSP

Previous article:The same ARM architecture, why Apple processors are more powerful
Next article:Analysis of the overall structure and principle of S3C2410 router

Latest Microcontroller 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号