Precision PCB Fabrication, High-Frequency PCB, High-Speed PCB, Standard PCB, Multilayer PCB and PCB Assembly.
The most reliable PCB & PCBA custom service factory.
PCB Blog

PCB Blog - Design of PCB Board Drilling Machine Controller for I²C and Dual ARM

PCB Blog

PCB Blog - Design of PCB Board Drilling Machine Controller for I²C and Dual ARM

Design of PCB Board Drilling Machine Controller for I²C and Dual ARM

2022-04-18
View:632
Author:pcb

This article presents printed circuit boards drill press controller based on an I²C bus and dual ARM microcontrollers. The controller consists of two parts: human-computer interaction system and motion control system, which are connected through I²C bus. This paper discusses the hardware structure and related key technologies of the controller system, and introduces the software design of the human-computer interaction system based on μC/OS-II real-time operating system and the software design of the time-triggered machine tool motion control system.

Printed circuit boards

1 Introduction
The printed circuit boards drilling machine is an important equipment in the production of printed circuit boards. With the improvement of the processing requirements of electronic products, the low-end microcontroller-based PCB drilling machine controller has been difficult to meet the requirements. ARM7TDMI is a 32-bit RISC microcontroller structure proposed by ARM Corporation at the end of the 20th century. The chips based on this core are rich in variety and have the characteristics of high running speed, low power consumption and low price. This paper introduces a PCB drilling machine controller based on dual ARM structure, which not only solves the shortcomings of low performance of traditional low-grade drilling machine control systems, but also has high economy. It is an ideal controller for PCB drilling machines. Numerical control system is divided according to the structure, generally there are single CPU and multi-CPU points [5]. A single CPU generally uses a centralized control time-sharing process to complete various tasks of the CNC system. It has the characteristics of compact structure, but the function is relatively simple. The CNC system with multi-CPU structure adopts multi-CPU parallel processing, which can make the system achieve higher performance. Multiple CPUs generally use a shared bus or shared memory to communicate. The control object of the drilling machine controller is more complicated: it needs to control 4 sets of Panasonic MINAS AC servo systems, 4 spindle motors, 9 switch inputs and 11 relay outputs. If the controller adopts a single CPU structure, the controller needs to expand more hardware, which increases the system cost and reduces the system reliability; if the controller adopts a dual CPU structure, the controller can be designed hierarchically according to functions: The tasks of the human-computer interaction system are handed over to one CPU, while the motion control of the machine tool is handed over to another CPU. In this way, the quantity of external expansion hardware is reduced, the cost is lowered, and the reliability is improved.

2. The hardware design of the controller
The controller consists of a system board and an interface board: the system board is composed of LPC2214 and S3C44B0X and their related peripheral circuits, and is the controller; the interface board is mainly responsible for the drive and level matching between the system board and the machine tool electrical appliances.

2.1 Hardware Design of Controller System Board
The controller system board consists of two subsystems: human-computer interaction system and machine tool motion control system. The human-computer interaction system and the machine tool motion control system exchange data through the I²C bus. The I²C bus is a serial bus proposed by Philips, which has the characteristics of high speed and simple hardware connection, without adding hardware.

2.1.1 Hardware design of controller human-computer interaction system
The human-computer interaction system of the controller adopts S3C44B0X as an extension of a series of hardware to form a system with perfect human-computer interaction function. The system expands a NOR type Flash memory chip SST39VF1601 with 16-bit data width and 2MB storage space as system program memory. In order to improve the execution speed of the system program, we expanded a HY57V641620 SDRAM with 1M*4Bank*16I/O. Once the system is powered on, the system initialization program copies the system program stored in SST39VF1601 to HY57V641620, and at the same time, the data storage area of the system program is also in HY57V641620, so that the system program can run completely in SDRAM. In order to ensure that the drilling files of the machine tool can still be saved after the machine tool is powered off, the system expands a 16MB NandFlash chip K9F2808 as the electronic hard disk of the system. Since S3C44B0X has its own LCD controller, the system selects STN type 256-color 640x480 pixel EDMGRB8KHF LCD module without LCD controller produced by Mitsubishi as the output of machine tool information. The input of system operation information adopts PS/2 keyboard. The system drills the file from the PC through the RS232 serial port. In order to facilitate the system debugging program, the human-computer interaction system has designed a JTAG port. Some important parameters of the machine tool, such as the screw pitch of the machine tool feed axis, the pulse equivalent of the AC servo system, etc. need to be saved, so the system expands a 512B EEPROM chip AT24C04 based on I²C bus.

2.1.2 Hardware Design of Machine Tool Motion Control System
The motion control system of the machine tool is the LPC2214 microcontroller. LPC2214 has 256KB of flash memory and 16KB of SRAM inside, no need to expand program memory and data memory. The system designs an RS232 serial port, which is used for the ISP of the LPC2214 system program. In order to facilitate the debugging of the program, the motion control system has designed a JTAG port. The circuit structure of the machine tool motion control system is shown in Figure 1. The hardware structure centered on LPC2214 in the controller system board. Machine tool electrical appliances are directly connected with LPC2214 through the interface circuit.

2.1.3 Communication between human-computer interaction system and machine tool motion control system
After processing by S3C44B0X, the machining instructions of CNC system should be sent to LPC2214 for execution, and the result of LPC2214 execution should be returned to S3C44B0X for processing and display. The system communicates using the I²C bus. S3C44B0X works in master mode, while AT24C04 and LPC2214 work in slave mode. The slave address of AT24C04 is 0xa0, the slave address of LPC2214 is 0x50, and the rate of I²C is 400KHz. S3C44B0X and LPC2214 each establish a 24-byte global array for communication.

3. Software Design
The software part is mainly composed of human-computer interaction system software and machine tool motion control system software. Human-computer interaction system software structure is more complex, so the software transplants μC/OS-II operating system. The software structure of the machine tool motion control system is relatively simple, but this part of the software has strong real-time requirements, so the software does not transplant the operating system, but is written in a time-triggered mode.

3.1 Human-computer interaction system software design
Human-computer interaction system software is written in a layered manner. The software is divided into system layer and application layer. The main task of system layer design is to transplant the embedded operating system μC/OS-II first, and then expand the operating system kernel to form a simple and efficient platform. The application layer design is based on this platform to realize the operation of the processing file, the manual processing of the machine tool, the automatic processing of the machine tool, the setting of the machine tool parameters and other tasks. The system layer is transplanted and extended based on μC/OS-II operating system kernel. The so-called porting means that the operating system can run on a specific processor platform by writing a certain code. According to the description of μC/OS-II, porting includes porting the codes in three files related to the processor: OS_CPU.H, OS_CPU_A..ASM, OS_CPU_C.C [4]. On the basis of the kernel provided by μC/OS-II, the operating system kernel is extended by designing driver modules, system tasks, operating system API functions and task scheduling modules. Through the design and realization of interface functions such as LCD, keyboard, K9F2808, I²C bus and serial communication, etc., a driver module is established to separate the operating system API functions from the underlying hardware. The system task part designs three basic tasks: LCD refresh task, keyboard read task, I²C bus read and write task, and run with the startup of the operating system. Based on the API functions provided by the system layer, the application layer designs the main tasks and tasks such as manual machining, automatic machining, file transfer, and parameter setting of the machine tool.

3.2.LPC2214 programming
The control program structure of the machine tool motion control system is relatively simple, and the program modules are relatively independent, but the real-time requirements are very high. Because the embedded real-time operating system will occupy part of the system resources, affect the real-time performance of the system, and increase the difficulty of system design, we do not transplant the embedded real-time operating system, but use a simple time scheduling method. Using this scheduling method can make the program have better robustness and stability. The system uses the timer to generate the rhythm of the system scheduling, and uses the timer to interrupt the program for scheduling. The system uses timer 0 to generate the beat of the system, and the timing period is 1ms. The system uses the interrupt of the PWM controller and four comparison registers to control the generation of the feed pulse of the AC servo system. We divide tasks into two categories: one is periodic and the other is aperiodic. Each task has a task control block. The data structure of the task control block is as follows: The task control block contains important information about the task being scheduled: whether the task is a periodic task or a non-periodic task, and when the task is running, and the task is ready. logo etc. The main tasks of the control system are: X feed axis pulse sending task, Y feed axis control task, Z1 feed axis control task, Z2 feed axis control task, spindle motor control task, tool change task, etc.

4 Conclusion
In the controller scheme consideration and design, we fully consider the sensitivity of the embedded system to power consumption, cost and size. The I2C-based dual ARM structure drilling controller has the characteristics of excellent performance, high system integration, reliable performance, friendly human-computer interaction and good scalability. Compared with the traditional single-chip-based drilling controller, it has great performance. improvement. This design provides a new idea for the application of the embedded system in the printed circuit boards controller, and has good application value.