1 Introduction
Pneumatic marking machines are widely used in nameplates, various parts and automobile beams, but as demand changes, higher requirements are placed on the stability, portability and multi-tasking of marking machines. The marking software has been upgraded from the previous DOS system to Win98, Win2000, WinXP and other versions, and the functions are becoming more and more complex, however, the hardware design has hardly changed.
Since the marking software of the ordinary marking machine control system converts the graphic information into pulse information, it needs to be output to the drive control board through the I/O interface (ISA, PC expansion card or parallel port), and then the drive circuit actuator works. However, most personal PCs and laptops currently cancel the expansion I/O card configured with parallel and serial ports, and use the IJSB interface. The PWM signal of the ordinary marking machine uses a 555 oscillator and multiple resistors and capacitors to form a non-steady-state multivibrator with adjustable duty cycle and frequency. When adjusting the PWM signal, open the control box, and adjust the frequency and duty cycle of the PWM signal by adjusting two adjustable resistors. In order to solve the shortcomings of the above-mentioned marking machine control system, the single-chip microcomputer ATmegal6 and the USB to RS232 interface device CH341T are used to form a communication interface, and the marking control system is upgraded to the USB interface: the phase-frequency correction PWM of ATmegal6 is used to replace the 555 oscillation circuit, and the frequency and duty cycle of the PWM signal can be directly corrected through the PC software, making the PWM signal adjustment convenient.
2 ATmegal6 Phase and Frequency Correction PWM Mode
ATmegal6 phase and frequency correction PWM mode is a PWM signal with accurate frequency and duty cycle. It adopts a fixed TOP value working mode, that is, mode 8 of the 16 PWM waveform generation modes, referred to as phase and frequency correction PWM mode.
The phase-frequency correction PWM mode is based on dual slope operation, and its working sequence is shown in Figure 1. TCNTn repeatedly counts from BOTTOM to TOP, and then returns from TOP to BOTTOM. In the general comparison output mode, when TCNTn counts to TOP, if TCNTn matches OCRlx, OClx is cleared and set to a low level; when TCNTn counts to BOTTOM, if TCNTn matches OCRlx, OC1x is set to a high level, which is exactly the opposite when working in reverse output comparison. The comparison unit outputs a PWM waveform at the OClx pin, and the frequency of its output PWM is
The variable N is the frequency division factor (1, 8, 64, 256 or 1024); the variable fclk is the CPU clock; the variable TOP is the maximum value of the counter. If the PWM operating frequency is known,
[page]
Then when TOP is determined, adjust the OCRlx value. That is, adjust the duty cycle to obtain the required PWM waveform. When using the fixed TOP value working mode, it is recommended to use the ICRl register to define TOP, so that OCRlA can use the PWM output by OC1A (sharing the same 4 Pneumatic marking machine control system software design The software design of the improved marking machine control system is divided into a human-computer interaction interface installed on the PC and a real-time control software burned into ATmegal6. The former is responsible for converting graphic information into pulse information and setting marking machine motion-related parameters, such as speed, PWM frequency and duty cycle; the latter is responsible for receiving information sent by the PC, performing relevant processing, and then returning the current hardware information to the PC. Transmission The information is divided into two categories: one is a normal data frame with a fixed information header and a fixed information tail; the other is a pulse data frame signal without an information header and an information tail. This can greatly reduce the amount of data sent during the marking process, reduce the number of times ATmegal6 interrupts the pulse output task processing to receive serial port data during the real-time marking process, and make the actuator move more smoothly. The data frame structure with information header and information tail is: the main task data frame structure shown in Table 1 and the sub-task data frame structure shown in Table 2. The number of bytes of the parameter information in Table 2 is the number of characters that distinguish whether it has parameters or not based on the sub-task identification information.
The stepping interval of the stepper motor is discrete. The speed control is essentially to control the stepping interval of the stepper motor so that the stepper motor works at a given speed. If Ti is the time interval between two consecutive steps (seconds), Vi is the final speed after one step (steps/second), and a is the acceleration of the next step.
Equation, calculate the time interval between two adjacent steps. Because the calculation is cumbersome, online calculation is generally not used to control the speed. Instead, offline calculation is used to obtain each Ti, and Ti is programmed into the program through a delay time table. Then, the value of the next feed is taken out in sequence according to the table address. The given time interval is generated by the delay program or timer, and the corresponding walking command is issued to calculate the time interval between two adjacent steps. Figure 4 shows the software flow of the tag control system.
The reference clock of ATmegal6 uses 11.059 2 MHz passive crystal oscillator. The serial communication protocol is baud rate 19 200 bit/s, 8 data bits, 1 stop bit, no parity bit. The driver uses M542 type (64 subdivisions), 57BYG stepper motor. The maximum marking format meets 260 mm×260 mm, and the writing speed of numbers/letters (4 mm high) is 3-6 per second. The system is suitable for plane, rotation, and plane-rotation mixed marking.
5 Conclusion
The improved marking machine control system based on ATmegal6 and CH341T greatly relieves the workload of PC; the phase-frequency correction PWM mode based on ATmegal6 can be used to adjust the PWM signal required by the high-frequency solenoid valve through software; after replacing the DC relay with TIPl22 transistor, the drive circuit is simpler and cheaper. The marking control software has been upgraded from the commonly used parallel port mode or expansion card mode to USB mode, which is suitable for desktop PCs and laptops. Now it has realized the asynchronous operation of multiple marking heads under the control of a PC.
Previous article:Design of self-adaptive electric water boiler based on single chip microcomputer
Next article:Application design method based on PLC in beverage filling machine control system
Recommended ReadingLatest update time:2024-11-16 20:22
- Popular Resources
- Popular amplifiers
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
- MSP430 Simulation & Programming
- [Atria Development Board AT32F421 Review] - Getting Started Tutorial
- [RISC-V MCU CH32V103 Review] - 6: SD card (SPI)
- 210,000 chips worth 10,000,000 yuan were stolen from an electronics factory in Shenzhen
- 【RPi PICO】CircuitPython MIDI Project
- Sharing DIY experience | [Portable multi-functional electrician's bench] selection process, leave comments and win gifts!
- Raise your hands, our sensor section has always been here~
- Introducing the control algorithms of common motors
- TI Embedded Theme Live Month - Video playback summary to help design efficient, intelligent and low-power systems!
- Bear Pie Huawei IoT Operating System LiteOS Kernel Tutorial 06-Memory Management