Design of pneumatic marker control system based on ATmega16

Publisher:MysticEssenceLatest update time:2020-03-09 Source: eefocusKeywords:ATmega16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction: The improved marking machine control system based on ATmegal6 and CH341T greatly relieves the workload of the 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 using TIPl22 transistors to replace DC relays, the drive circuit is simpler and cheaper.


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 the reverse output comparison. The comparison unit outputs a PWM waveform at the OClx pin, and the frequency formulavariable N of the output PWM 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, formulathen when TOP is determined, the OCRlx value is adjusted. That is, the duty cycle is adjusted to obtain the required PWM waveform. When using the fixed TOP value working mode, it is recommended to use the ICR1 register to define TOP, so that OCR1A 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 movement 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.

Working sequence


Main task data frame structure and secondary task data frame structure

Data Frame

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 adjacent steps (seconds), Vi is the final speed after feeding one step (steps/second), and a is the next step acceleration. Then use formulathe equation to calculate the time interval between two adjacent steps. Since the calculation is relatively 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 step of feeding is taken out in sequence according to the table address. The given time interval is generated through a delay program or a timer, and the corresponding step command is issued to calculate the time interval between two adjacent steps. Figure 4 shows the software flow of the tag control system.

High frequency solenoid valve drive circuit and USB to RS232 interface circuit

Mark the software flow of the control system

The reference clock of ATmegal6 adopts 11.0592 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 one PC.

Keywords:ATmega16 Reference address:Design of pneumatic marker control system based on ATmega16

Previous article:Intelligent temperature controller for dry-type transformer based on ATmega16 microcontroller
Next article:Design of electric vehicle lithium battery pack based on ATmega16

Recommended ReadingLatest update time:2024-11-16 14:52

Intelligent learning infrared air conditioner remote controller based on single chip microcomputer
    In order to solve the incompatibility problem of air conditioner remote controller, an intelligent air conditioner remote controller based on Atmega16 single chip microcomputer is designed. The remote controller uses the method of measuring pulse width to learn infrared signals, and uses run-length encoding algori
[Microcontroller]
Intelligent learning infrared air conditioner remote controller based on single chip microcomputer
AVR microcontroller (learning) - (II), ATMEGA16 interrupt system - 02
2. ATMEGA16 interrupt system 2. (02) Sleep mode interrupt wakeup of 4*4 row buttons Without further ado, the previous article has the registers used in this piece, so if you want to read this article, it is recommended to read the previous article . Of course, if you know how to do it~~~ Directly on the picture~~~
[Microcontroller]
AVR microcontroller (learning) - (II), ATMEGA16 interrupt system - 02
ATmega16 Standby Mode
Standby mode When SM2..0 is 110, the SLEEP instruction will put the MCU into Standby mode. The only difference between this mode and Power-down mode is that the oscillator continues to work. The wake-up time only takes 6 clock cycles. Extended Standby mode When SM2..0 is 111, the SLEEP instruction will put the MCU
[Microcontroller]
ATmega16 Standby Mode
AVR MCU ATMEGA16 1602 LCD driver and experience
I developed my own AVR microcontroller chip development board, and the 1602 LCD screen experiment was successful! I was very pleased. I wrote the program for a whole day, and repeated the experiment, and finally succeeded at 0:00 am.      During this process, the biggest problem was the so-called matching 1602 LCD scr
[Microcontroller]
Design of wireless temperature monitoring system based on ATmega16
With the development and progress of society, more and more occasions have increasingly stringent requirements for temperature, and the application of temperature monitoring systems has received increasing attention. In the field of agricultural development, temperature measurement technology is required in many occ
[Microcontroller]
Design of wireless temperature monitoring system based on ATmega16
Design of remote control password lock system based on ATmega16
Introduction: This paper introduces the specific design of the hardware and program implementation process of the remote control password lock based on atmega16 single-chip microcomputer. It uses AVR single-chip microcomputer ATMEGA16 as the controller. On the basis of realizing the password keyboard input opening con
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号