Today, embedded system developers and system-on-chip designers increasingly choose specific processor cores and supporting tools, libraries, and off-the-shelf components to quickly develop new microprocessor-based products. ARM is particularly outstanding in this regard. In the past 10 years, the ARM architecture has become the world's most popular 32-bit architecture, and at the time of this book's completion, more than 2 billion ARM-based processors have been shipped. ARM processors have been embedded in a variety of products - from mobile phones to automotive braking systems. ARM partners and third-party suppliers around the world have rapidly grown in semiconductor and product design companies, including hardware engineers, system designers, and software developers. But until now, no book has been able to better meet the needs of ARM-based embedded system and software development.
CNC technology is the core technology of today's manufacturing industry and the key to the development of high-end technology and high-tech industries. CNC machine tools are regarded as strategic materials and war-readiness industries and are highly valued. The development of embedded technology is the fastest-growing technology in recent years and has been applied to all aspects of life. At present, embedded technology has begun to enter the field of industrial control extensively. Applying embedded technology to CNC machine tools and researching and applying new embedded CNC systems can be on the same starting line as foreign countries. It has a very important driving significance for the development of CNC technology in my country. This paper proposes a four-axis three-linkage open economic CNC system based on the industrial-grade ARM microprocessor S3C2440 and DSP dedicated motion control chip MCX314As. The CNC system not only has the advantages of low cost, high processing accuracy, and fast response speed, but also has good portability and tailorability. It is an exploration and research on the standards of a new generation of open economic CNC systems. Embedded CNC technology will have a good application prospect in the field of CNC and will have a positive role in improving the overall level of my country's manufacturing industry.
At present, there are two main forms of embedded CNC systems: systems that rely entirely on embedded processor control and systems that combine embedded processors and motion control chips. Compared with the former, the latter uses professional motion control chips and performs better in terms of real-time performance and accuracy, and thus becomes a future development direction. This article introduces a master-slave CNC system based on ARM controller and FPGA motion control chip, hoping to provide some reference for the application of ARM in embedded CNC systems.
1 Overall design
This system is a master-slave structure. The upper computer is based on the S3C2410 ARM9 controller, and the Linux system and QT/Embedded graphics library are transplanted to mainly realize human-machine interaction functions such as G code file processing, display of processing position, and manual control. The lower computer is based on the $3C44B0 ARM7 controller as the core, and the SM5004 FPGA chip of Smedy is the motion controller to realize machine tool control functions such as motor drive, coolant switch, and emergency stop. The upper and lower computers communicate through the CAN bus.
2 Hardware Design
2.1 CAN interface design
Since S3C2410 and S3C44B0 do not have CAN interfaces, they must be expanded. The CAN expansion interface of S3C2410 is shown in Figure 1, and the CAN interface of S3C44B0 is similar to it.
The CAN controller of the system uses the MCP2510 chip. The reset pin RESET of MCP2510 is connected to the reset pin nRESET of S3C2410, and the chip select pin CS is connected to GPH0 of S3C2410. The OSC1 and OSC2 pins are connected to a 16M crystal as the clock source. SI, SO and SCK are connected to SPI El MOSIO, MISO0 and SPICLKO of S3C2410 respectively. If the SPI port is occupied by other devices, other I/O El can be used instead, but software algorithms must be written to simulate the read and write operations of SPI. The system uses interrupt mode to read and write MCP2510, so its INT pin is connected to the external interrupt pin EINT4 of S3C2410. When the external interrupt pin resources are relatively tight, the query mode can also be used to read and write MCP2510, and INT can be left floating at this time.
The system's CAN transceiver uses the TJA105O chip, whose TXD and RXD are connected to the TXCAN and RXCAN of the MCP2510, and the slope resistor connected to the Rs pin is 1K.
TJAlOS0 outputs CANH and CANL differential signals and connects to the physical line through the J1001 socket.
2.2 Input and output interface design
The S3C44B0 ARM and SM5004 FPGA chips provide many general input and output interfaces. In order to effectively prevent interference from entering the system, optocoupler isolation is used here, as shown in Figure 2. [page]
In the low-speed switching quantity, as shown in Figure 2 (a), the low-speed optocoupler MOCD217-M is used here. It is a product of Motorola and is a dual-channel optocoupler with low input current. The reason why resistor R3 is added before connecting to the input port is that some I/O ports in ARM are open-drain, which prevents excessive current from burning out the corresponding port during the input and output process. As shown in Figure 2 (b), in the high-speed switching quantity, HC-PL0661 dual-channel optocoupler is used for expansion. It is a product of Agilent Technologies. Its switching rate can reach about 10 M and can be applied to various high-speed pulse input and output occasions.
3 Software Design
31 Human-computer interaction and G code interpretation
The human-computer interaction interface is shown in Figure 3. The interface is designed using the QT/Embedded embedded graphical library. QT Embedded is an embedded GUI development tool developed by Roltech, which has rich controls and supports virtual frame buffering. Through this interface, you can edit G code, check syntax, preview the plus 1 trajectory, and communicate with the lower computer.
The principle of G code interpretation is shown in Figure 4. Two data structures PreGCode and GCode are defined in the program to store the intermediate results after syntax checking and the G code type, node coordinates, arc radius and other data generated after data analysis for simulation and processing.
3.2 CAN communication
This system uses the CAN controller MCP2510 to complete the task of sending and receiving CAN bus frames. Communication data is divided into command frames and data frames. The communication protocol uses the 29-bit extended identifier of the CAN bus to save some necessary information in the protocol, as shown in Table 1. Since CAN supports multi-host and multi-slave modes, IDs are assigned to the source and destination device addresses to distinguish the source and destination of the data. The data frame has a large amount of data and must be transmitted in batches, so the identifier also contains the data packet group number for sorting. [page]
The system uses interrupt mode to transmit data, and a total of 4 interrupts are enabled, namely error passive interrupt, error alarm interrupt, send interrupt and receive interrupt. If it is the first two interrupts, the program will reset the MCP2510 chip. If it is a send interrupt, it means that the transmission is completed, and the program will set the send interrupt flag to notify the main program. If it is a receive interrupt, the program will check the identifier ID28-ID21 to determine the type of the frame, and then process it according to the type of frame.
3.3 Interpolation algorithm
The SM5004 chip is a high-performance motion control FPGA chip from Smedy. It can realize 4-axis linkage, with a drive pulse frequency of up to 5MPPS, an interpolation accuracy of up to 0.5ISB, a single output pulse number of up to 2G, and supports 4 interpolation modes: linear interpolation, circular interpolation, continuous interpolation and bit pattern interpolation.
For straight lines and arcs, SM5004 has its own interpolation algorithm. As long as the required parameters for interpolation such as end point coordinates and speed are provided, SM5004 can automatically complete the interpolation.
Bit-mode interpolation is to receive the interpolation data calculated by the high-order CPU in the form of a data packet, and then continuously output the interpolation pulse at the specified drive speed. The principle of bit-mode interpolation is to set the +/-direction drive pulse of 2-axis or 3-axis to 1-bit 1 pulse on each register, set it to 1 when outputting the drive pulse, and set it to 0 when not outputting the pulse. Bit-mode interpolation provides a flexible interpolation mechanism, and users can write their own interpolation algorithms for various curves such as straight lines, arcs, spline curves, function curves, etc. The program uses the method of digital integration to implement the interpolation of straight lines and quadratic curves. The principle of digital integral interpolation (also known as DDA interpolation) is shown in Figure 5. By dividing the integral interval [a, b] into a sufficiently small interval △f, the integral operation of the function y=f(t) is converted into a summation operation of variables, that is
In digital operations, At generally takes the smallest unit "1", that is, a pulse equivalent, then:
The key components of the digital integration interpolator are the accumulator and the integrand register. Each coordinate direction requires an accumulator and an integrand register. Generally, before the interpolation starts, the accumulator is cleared and the integrand register stores X and Y respectively; after the interpolation starts, each time an accumulation pulse △£ comes, the content in the integrand register is added once in the corresponding accumulator, and the overflow after the addition is used as the feed pulse Ax (or Ay) to drive the corresponding coordinate axis, and the remainder is still stored in the accumulator; when the number of accumulated pulses m emitted by the pulse source is exactly equal to the capacity of the integrand register 2, the overflow pulse number is equal to the end point coordinate with the pulse equivalent as the minimum unit, and the tool moves to the end point. The program flow chart of the digital integration method interpolation of the first quadrant straight line is shown in Figure 6, and the interpolation trajectory is shown in Figure 7.
4 Conclusion
ARM is a British company, which literally means Advanced RISC Microprocessor. ARM provides customers with 16/32-bit embedded RISC microcontroller solutions and licenses its RISC processors to electronics companies. In portable communications, handheld computing devices, consumer and digital multimedia solutions, ARM is on the way to becoming a standard.
The combination of ARM and FPGA motion control chips can not only take advantage of ARM's fast computing speed and rich hardware resources, but also take advantage of FPGA's excellent motion control functions. Compared with the traditional pure ARM-controlled CNC system, it has more advantages in real-time performance and control accuracy, and is a development direction for future embedded CNC systems.
The design of embedded CNC system using professional motion control chips and ARM processors can greatly reduce the R&D tasks, speed up the R&D process, and develop a CNC system with excellent performance in a short time. The addition of a properly "tailored" Linux system enables the CNC system to better handle multiple tasks, greatly improving the real-time performance of the system.
Previous article:Design and implementation of integrated stepper motor driver based on CAN bus
Next article:Design of Fire Monitoring System Based on GPRS
Recommended ReadingLatest update time:2024-11-16 21:28
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- A brief discussion on the role, advantages and disadvantages of portable display screens
- From Apple to Xiaomi, see the application of UWB technology in different fields
- Still about the problem of using DB9 connector for RS232 interface
- EEWORLD University Hall----Live Replay: TI Sitara? Multi-protocol Industrial Communication Optimization Solution, PLC Demo Real-time Demonstration
- [NXP Rapid IoT Review] + First Impressions and Use
- MSP430 serial write BOOTSTRAP and encryption fuse function
- Multisim Circuit System Design and Simulation Tutorial
- [NXP Rapid IoT Review] Reduce the CPU frequency (K64) to save power
- [GD32L233C-START Review] 13. CAU encryption algorithm DES/TDES
- Wireless Sensor Network Overview