1 Introduction
CNC technology is a high-tech technology that uses computers to perform digital calculations on various control information in the machining process and automatically controls mechanical actuators through high-performance drive units. Modern mechanical processing industry is gradually developing towards flexibility, integration, and intelligence. Therefore, the new generation of CNC technology must emphasize the characteristics of openness, intelligence, and networking [1]. This paper uses a new microprocessor and high-performance integrated circuit to research and develop an intelligent stepper motor control card.
2. System overall structure design
By analyzing, studying and comparing the key technologies of stepper motor controllers, and integrating the development trend of intelligent, integrated and open motion controller products at home and abroad, the overall structure of the stepper motor motion controller we proposed is shown in Figure 1.
Figure 1 System overall structure
3 System Hardware Circuit Design
3.1 Pulse frequency division circuit design
The main control object of this system is the stepper motor. The stepper motor is an actuator that converts electrical pulses into angular displacement. Therefore, generating stepper motor drive pulses that meet the system requirements is the key to the entire system design. The pulse frequency division circuit of this system is shown in Figure 2. The entire circuit uses 3 8254s to generate drive pulse signals for the X, Y, and Z axes. Since the circuits for the Y and Z axes are the same as those for the X axis, the figure only shows the circuit principle of the X axis pulse number output.
Inte18254 is a programmable timer/counter. It contains 3 independent channels. Each channel is a 16-bit counter with the same function. The working mode and counting length of each counter are selected by software programming. 8254 is an improved version of 8253. Its operation mode and pins are exactly the same as 8253. The counting frequency of 8253 is 2.6MHz, while the counting frequency of 8254 is higher, reaching 6MHz. This system selects 8254 as the main control chip of the pulse frequency division circuit.
Figure 2 Pulse frequency division circuit diagram
3.2 RS-232 communication interface circuit design
In the communication of single-chip microcomputer system, RS-232 and RS-485 standard buses are the most mature. In order to make the application scope of motion controller wider, in conjunction with the existing interface of PC, we choose RS-232 standard bus to realize the communication between controller and PC, and its interface circuit is shown in Figure 3. In Figure 3, MAX232 is selected as the communication interface chip of the system. MAX232 is a low-power, single-power dual RS-232 transmitter/receiver produced by MAXIM, which is suitable for various EIA-232E and V.28/V.24 communication interfaces. The MAX232 chip can convert the input +5V power supply into the ±10V voltage required for RS-232 output level, so the serial communication system using this chip interface only needs a single +5V power supply.
Figure 3 Communication interface circuit
MAX232 requires four electrolytic capacitors C1, C2, C3, and C4 for internal power conversion. Their values are all 0.1μF/25V. C44 is a 0.1μF decoupling capacitor. MAX232's pins T1IN, T2IN, R1OUT, and R2OUT are TTL/CMOS level pins.
Pins T1OUT, T2OUT, R1IN, and R2IN are pins connected to RS-232C levels. Therefore, the TTL/CMOS level T1IN and T2IN pins should be connected to the serial transmission pin TXD of MCS-51; R1OUT and R2OUT should be connected to the serial reception pin RxD of MCS-51. Correspondingly, the RS-232C level T1OUT and T2OUT should be connected to the receiving end RD of the PC; R1IN and R2IN should be connected to the transmitting end of the PC.
3.3 D/A conversion and V/I conversion circuit design
This motion controller needs to control the speed of the electric spindle, and the control of the electric spindle is achieved through its driver. The electric spindle driver determines the speed of the spindle according to the input voltage or current. Therefore, the system needs to output a voltage of 0 to 5V or a current of 0 to 20mA. The digital quantity processed by the system must be converted into an analog output through D/A conversion. The D/A conversion of this controller is mainly realized by the DAC0832 chip. DAC0832 is an 8-bit microprocessor-compatible digital/analog converter chip, which is a type of DAC0830 series. DAC0832 is easy to interface with a microcomputer and can make full use of the control capability of the microprocessor to realize the control of D/A conversion. Therefore, it has been widely used in practice.
Different electric spindle drivers have different requirements for input signals. Some require a voltage signal of 0 to 5V, and some require a current signal of 0 to 20mV. Therefore, we also designed a V/I conversion circuit to enable the system to have the output of current signals, thereby enhancing the adaptability of the system.
3.4 Switch signal input circuit design
During the movement of the stepper motor, mechanical switches and photoelectric switches are often used to form a switch signal input circuit. The closing or opening of the switch reflects the working condition of the stepper motor in the form of a level. This includes X, Y, and Z axis limit; tool setting during processing, X, Y, and Z axis motor zero return operation, etc. [2-3].
Due to the mechanical design of the switch, there is mechanical jitter when the contacts are closed or opened, which will cause the output signal waveform to oscillate. If the signal is input into the counter of the microcontroller, it will cause an erroneous count and lead to chaotic system control. The input interference of the switch quantity is an objective problem in system design. Therefore, after obtaining the switch signal, we must process the switch signal and make it a digital signal that can be recognized by the microcontroller before making a corresponding response. The system provides a total of 12 switch signal interfaces, and the limit switch signal processing is shown in Figure 4.
Figure 4 Schematic diagram of limit switch signal processing circuit
Before the switch signal is input into the CPU, it is first filtered by a capacitor to suppress the high-frequency components in the signal. TPL optocoupler isolation realizes the level conversion between the photoelectric switch, limit switch signal and controller, and realizes the isolation between two different circuits, ensuring that the controller circuit is not interfered by the switch signal circuit.
3.5 Hardware Anti-interference Technology
In order to overcome various possible interferences and ensure the reliable operation of the system, existing anti-interference technologies take the following measures in hardware [4]:
① Suppress power supply interference. Conducted interference is usually introduced into the system from the AC power supply. In order to suppress this interference, the system usually connects a low-pass LC filter in series at the AC input end. This method has achieved obvious results in practice, but in order to suppress the impact of power surge voltage, the system must also install varistors between the power lines and between the power lines and the ground.
② Suppress transmission line interference. For lines with longer transmission distances in the system, shielded cables are usually used to connect the various parts of the system to achieve the purpose of anti-interference. In some systems with harsh application environments, in order to further suppress interference, photoelectric isolation can be used to separate the system control part from the I/O port part, and dual power supply can be used.
③Try to minimize the impact of interference. Common practices include: 1) Add a hardware watchdog circuit. 2) Add a voltage monitoring circuit. 3) Select a microcontroller series with strong anti-interference capabilities. 4) Use the internal program memory and internal data memory of the microcontroller as much as possible instead of using an external bus to connect these devices. 5) Coordinate the level matching of different types of ICs in the circuit. 6) When the data bus and the control bus form a board-to-board connection, a bus driver should be added.
4 System Software Design
The main program of the system consists of a message loop and an initialization program, and its flow is shown in Figure 5. In the main program of the system, the function of the initialization program is to complete the setting of each special function register of the microcontroller, the initialization of each data area, the setting of external hardware devices, etc. after the system is reset; the system message loop is used to realize the judgment of the legitimacy of the message and the call of the message processing function module.
Figure 5 System main program flow chart
In order to be able to judge the legitimacy of the message, we define a corresponding legitimacy judgment flag for each message in the message group. If the legitimacy judgment flag corresponding to a message is "1", it means that the message is a legal message, and the system should call the corresponding message processing function module to process the message; if it is "0", it means that the message is an illegal message and the system should ignore it. In order to implement the "watchdog" function, we also added a dog feeding output operation to the message loop. It is worth noting that in the serial communication processing module of the system, the flag bits in the message sequence are set according to the received data to determine whether it is automatic processing, manual processing, or parameter setting, so as to ensure that the main program can correctly implement the call of each processing module.
5 Innovations of this paper
This system uses MCS51 series single chip microcomputer to process data and control the motion state, and the 8254 programmable timer/counter realizes the frequency division output of pulses, ensuring the real-time requirements of motion control. In order to enable the motion controller to work reliably in harsh environments, we use X5045 integrated chip as the main component to form a low-cost, high-reliability anti-interference circuit to realize automatic protection of the stepper motor motion control card. Since the system was put into use, it has generated direct economic benefits of more than 500,000 yuan.
Previous article:Design of wireless transmission system for well site instrument parameters based on single chip microcomputer
Next article:Stepper Motor Control System Based on PIC16F873 Single Chip Microcomputer
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
- Ask questions about DAF equipment
- VS1053b cannot play music
- HyperLynx High-Speed Circuit Design and Simulation (VIII) High-Speed Board-Level Simulation
- I would like to ask, for NPN tube, does the leakage current ICEO refer to the flow from C to E or from E to C?
- EE Mobile Station Development Board Introduction: DA14580DEVKT-B Evaluation Board
- No doubt! Real-time measurement can also be done with low power consumption
- Read the good book "Electronic Engineer Self-study Handbook" + Advanced Edition
- See the circuit and eat the circuit to verify the circuit
- How to multithread?
- Software and hardware design of Mitsubishi PLC based on STM32