Current location - Education and Training Encyclopedia - Graduation thesis - Ask for a graduation thesis of numerical control major in junior college.
Ask for a graduation thesis of numerical control major in junior college.
Research on Embedded Open CNC System

In the open CNC system, μ C/OS-Ⅱ real-time operating system is transplanted to MCS-5 1, and its own tasks are created on its kernel to develop real-time operation.

Dynamic control system. Numerical control system has communication and network functions. The system is applied to the simulation of machining platform, and the feasibility of the system is verified.

Open CNC; μC/OS-ⅱ; rtos

1 open CNC system

Open CNC is the development trend of CNC technology. A few years ago, at home and abroad,

There are many discussions about the open CNC system based on PC, and some achievements have been made. Recent paragraph

In the era, due to the development of embedded technology, the openness of embedded real-time operating system was adopted.

NC type has gradually attracted the attention of the industry. The main reason is the number based on PC technology.

The control system has its inherent shortcomings in real-time. On the one hand, embedded technology

Art has just played its advantages and gradually showed its strong vitality.

At present, the research of embedded open CNC system mainly refers to real-time operation.

Become the controller of the system. In this paper, the number of real-time cores is studied by using μ C/OS-Ⅱ.

The software and hardware structure of the control system and the development of the experimental system. Has nothing to do with PC technology.

2 basic architecture and working principle

The hardware structure takes Windows 78E58(5 1 series) as the core, and expands RAM and displays.

Display and keyboard interface 8279, MAX232 serial port, 8255 parallel port and RTL 80 19 AS network.

Chip. The output of stepping motor is directly processed by 78E58. As shown in figure 1.

W inbond 78E58 kernel 32kB FlashROM, including μ C/OS-Ⅱ Real.

The system software including real-time kernel (i.e. real-time operating system) is about 25kB. involve

All numerical control functions of the experimental system are introduced, including input, decoding, interpolation and servo input.

Display, communication and other functions.

8279 in figure 1 is mainly used to manage the self-designed keypad and LED display screen.

Equipment. Parts processing program can be input from the keyboard. You can also serial from MAX232.

Mouth input. Parallel port 8255 is mainly used for the input, output and adjustment of I/O signals of machine tools.

Try using it. 80 19AS is a network interface chip, which makes this embedded system compatible.

Connect the Ethernet of TCP/IP protocol to realize the function of surfing the Internet. The 78E58 contains a

A simplified TCP/IP protocol stack.

Real-time clock is a remarkable feature of embedded system. When μ C/OS-Ⅱ needs it.

The clock cycle is 10~ 100ms, which just meets the needs of the working cycle of CNC system. basis

The experimental system adopts the working cycle of 10ms, and the complex system can be increased appropriately.

μ C/OS-Ⅱ is an open source real-time preemptive kernel that can be managed.

Of the 64 tasks, the system reserves 8 tasks, and users can use 56 tasks, each of which

The priorities of tasks must be different (for CNC systems, these 56 tasks have been

More than enough).

In GB/T 18759-2002 national standard of open CNC system, the degree of openness?

Divided into three levels. The second layer is "the control equipment is in a definite and fixed topology"

Under this structure, it is allowed to replace or add specific modules in the NC core to meet the characteristics of users.

Special requirements. "As long as different functions" hang "under μ C/OS-Ⅱ open kernel.

Tasks, such as decoding, interpolation, output and other modules can basically reach the second level.

Requirements, to achieve the goal of open CNC.

3 software realization of open CNC system

3 1 software interface

The whole software system is based on μ C/OS-Ⅱ. Among all the tasks created,

Call the corresponding application software module, combined with real-time interrupt service program, * * * to complete the same system.

Unified function. In order to realize the modularization of open CNC system and improve the application software module.

Based on interchangeability and portability, the corresponding program connection is defined for each application software module.

Mouth. As long as the software interfaces are consistent, the application software modules can be replaced and interchanged.

The following are some interface definitions of interpolation program (C language), including interpolation.

Data structure of data and some related function interfaces.

3.2 Task realization

Except μ C/OS-Ⅱ, the whole software has established 9 tasks and a system.

System initialization program. These nine tasks are.

Nine tasks are assigned in the foreground and background structure, and the foreground program is real-time.

Strong tasks, including interpolation tasks, monitoring tasks, machine tool signal input/output.

Service. The rest are background tasks, and the input tasks of parts processing programs mainly come from the keyboard.

Enter the processing program and store it in memory. Serial communication is to input parts processing from outside.

Program. The task of network is to exchange information with LAN. Show in idle tasks.

Medium.

System initialization runs only once at startup to start multitasking OSStart ().

End, as shown in figure 2.

μ C/OS-II provides communication and data sharing between tasks.

This paper introduces three methods: semaphore, mailbox and message queue. Let's take semaphore as an example to illustrate.

Methods of inter-task communication. The user task form is as follows:

In this way, the task is an infinite loop C language function. Task in function

Wait for the arrival of the corresponding semaphore through the OSSemPend () function to trigger the execution of the task.

ok; And the system delay function OSTimeDly () is used for delay. As shown in fig. 2, the system

The initialization work is μ C/OS-II initialization, semaphore creation and task creation.

Interface initialization, etc. Osstart () at the start of multitasking; Then in μ C/OS-II.

Run according to the schedule of. First of all, the system is waiting before the keyboard command is issued.

State, every user task is waiting for the arrival of semaphore. During this period, the system executes

It is the lowest priority task, OSTask Idle, which does some display and other work. solid

Interrupts occur regularly, but there are no keyboard commands, only some abnormal monitoring and so on.

There will be no machining state such as interpolation. First-class processing keyboard command press, after the key

Disk analysis task key analysis task analysis task, and decode task conversion.

The later task sends out a semaphore and enters the decoding process, and the decoding task is taken out of the memory.

Compile and process the part machining program, and at the same time send semaphores to the interpolation program until

After the real-time interrupt occurs, the interpolation task starts interpolation processing after receiving the semaphore.

This experiment adopts stepper motor servo system, which can interpolate and output at the same time.

Get out. Continue compiling until the decoding task encounters M02 and M30.

Until the end of the part processing program. The input task of the part machining program is the input task.

In the non-machining state, the KeyAnalyse task will be specified after the key command is issued.

Transaction resolution, sending semaphore to InputTask InputTask. Input tasks are getting more and more

After the semaphore, the part processing program is input into the memory from the keyboard. Serial pass

Xinhe network communication is also designed to be performed in a non-processing state.

In the hardware design of Ethernet communication, RTL80 19AS is adopted, which is a kind of

10Mbps Ethernet card control chip is widely used in ISA interface of PC.

In the Ethernet card. Although the mainstream products in the computer network card market are already

10M/ 100M adaptive PCI interface of Ethernet card, but RTL80 19AS.

The production line still hasn't stopped. Because RTL80 19AS supports 8-bit data bus, it is skipped.

It is very convenient to connect single chip microcomputer in online working mode, so in the field of embedded system

It still has great application value. Fig. 3 is a hardware connection diagram.

In addition to the hardware connection, the corresponding driver should be written in the software. content

There are three types of chip initialization: sending Ethernet frame packets and receiving Ethernet frame packets.

Realization and verification of open CNC system

According to the above architecture, we have established a small open system.

Put into the numerical control experimental platform. On the basis of figure 1, X-Y experiment is carried out by P 1.

Worktable. Input the machining program of parts through the keyboard, press the start button, and then enter.

Line decoding, interpolation, servo output. The x-axis and y-axis of the workbench are driven by two stepping motors.

The most commonly used point-by-point comparison method is used in dynamic and interpolation algorithms, and the demonstration results have achieved the expected results.

Effect. The correctness of the control idea of open CNC system is proved.

5 concluding remarks

The workbench of open CNC system based on μ C/OS-Ⅱ is stable, reliable and open.

Strong, although only the basic functions of CNC system have been initially realized at present, it can be

At any time, according to the needs, use the software and hardware resources of embedded system to expand the function.

It is convenient for secondary development and meets different functional requirements. Is to realize open CNC and

An effective way to "individualize" numerical control system.

Take the exam and contribute.

[1] Tan Feng, et al. Research on open CNC system based on μ C/OS-Ⅱ. Mechanical and electronic,

2004, 12.

[2] Li Chengren et al. Embedded System and Single Chip Microcomputer Application. Beijing: Tsinghua University Publishing House,

2005.

Tan Feng, et al. Research and development of embedded CNC system based on Ethernet. Northwestern Polytechnical University.

Master thesis, March 2005.

Li Chengren, et al. Modern electromechanical control system. Xi 'an: Northwestern Polytechnical University Press, 1999.

[5] GB/T18759.1-2002, Open CNC System Standard Part I: General.