Automatic positioning system based on 80C196MC single chip microcomputer

Publisher:dst2015Latest update time:2012-02-15 Source: 工业仪表与自动化装置 Keywords:80C196MC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

The roll-type wrapping paper on the packaging machine is printed with continuous trademarks. When the machine is started, the continuous label paper is pulled into the machine by the paper feed roller, and then cut into single sheets of wrapping paper by the paper cutter roller. Every time the cutter roller rotates one circle, it cuts off a piece of wrapping paper. If the actual paper cutting line is to coincide with the theoretical paper cutting line, the diameter of the paper feed roller and the length of a single piece of wrapping paper must meet a strict mathematical relationship. Due to the tolerance of the paper feed roller processing, the radius of the roll gradually decreases during the operation of the packaging machine, the tension of the label paper changes, and other factors, there is a deviation between the wrapping paper cut by the cutter roller and the theoretical paper cutting line, even if the deviation is very small. For example, the deviation of a piece of label paper is only 0.1mm, the speed of the cutter roller is 300r/min, and the machine runs for 10min, and the cumulative deviation is 300mm. At this time, the pattern on the wrapping paper will obviously deviate from the correct position and does not meet the process requirements. However, with the development of the economy and the improvement of people's aesthetic taste, people have put forward higher requirements for the packaging effect of goods. To solve this problem, it is necessary to design an automatic trademark positioning system on the packaging machine. 

2. Automatic positioning system adjustment principle

This system is designed as an AC servo system controlled by a single-chip microcomputer, because compared with DC servo motors, AC servo motors have the advantages of small size, strong overload capacity, large output torque, no brush wear, and no need for frequent maintenance. Moreover, since there is no influence of brush voltage drop, it can reach a very low speed and has hard mechanical characteristics. The block diagram of the positioning system is shown in Figure 2-1. Its adjustment principle is: on the paper feed roller, the photoelectric device uses the color mark printed on the roll packaging paper to detect the conveying position of the label paper; the photoelectric code disk synchronized with the rotation of the knife roller can reflect the paper cutting time of the knife roller through the photoelectric device; the photoelectric pulses generated by the above photoelectric devices are all sent to the single-chip microcomputer for logical processing, and then the rotation direction of the servo motor is determined. The running time of the servo motor is controlled by the timer interrupt of the single-chip microcomputer, and the output of the servo motor is used as the compensation amount. It is synthesized through the differential gear train and the active gear train to drive the paper feed roller, thereby compensating for the deviation between the actual tangent of the knife roller and the theoretical tangent, and realizing the automatic positioning of the label paper. 

3 Hardware structure of automatic positioning system

After comparison, Intel's 80C196MC was selected as the CPU of the system. It has superior performance and powerful functions, and is designed for motor control, especially suitable for interfacing with shaft-type photoelectric encoders and servo motors. Moreover, compared with MCS-51, it not only has great advantages in main frequency and 90° phase shift counting method, but also has a waveform generator and a large amount of storage space added to the chip. Considering that the 80C196MC chip has such rich hardware resources, this system is composed of the 80C196MC single-chip microcomputer to form the simplest and most basic single-chip microcomputer system, as shown in Figure 3-1. In this way, many external hardware and control software can be greatly simplified to achieve the purpose of optimizing the system. 

3.1 Determination of storage space

The internal memory capacity of 80C196MC can reach 65536Bytes. Except for the three dedicated areas of 0000H~01FFH, 1F00H~1FFFH and 2000H~207FH and the individual units marked as "reserved" with a total of 896 Bytes, the rest can be used as program storage area, data storage area or memory-mapped peripheral area, totaling 64642 Bytes, about 64KB available. Therefore, there is no need to expand the data memory and program memory outside the chip. [page]

3.280C196MC forward channel design

The forward channel configuration of the single-chip computer 80C196MC consists of a photoelectric switch, a pulse shaping circuit, an optical coupling circuit and a buffer circuit. The photoelectric switch uses the latest product developed by the Institute of Electrical Transmission of the Ministry of Electromechanics. The light source is pulse modulated, and the GaAs infrared light-emitting diode has a strong anti-interference ability against external stray light and electrical noise. Photoelectric switches 1LS and 2LS detect the rotation position of the code disk and also reflect the rotation position of the knife roller. The photoelectric pulse signal is sent to the P1.0 and P1.1 pins for logic processing. Photoelectric switch 3LS detects the conveying position of the roll packaging paper. EXTINT is the external interrupt input terminal. The photoelectric pulse signal is sent to the counting pulse input terminal T1CLK to realize the automatic counting of the packaging machine. 

The reset uses a simple and practical power-on and manual reset circuit, which is effective at low level and is introduced by the foot. 

3.380C196MC Backward Channel Design

The backward channel of 80C196MC is composed of buffer circuit, optocoupler circuit, Darlington amplifier circuit and solid-state relay. PWM0 (P6.6) and PWM1 (P6.7) output the timing and logic processing program running results. Because the PWM module itself contains a pulse width modulation counter and an internal clock, there is no need to add additional hardware to control the running time of the servo motor. The output signal controls the forward and reverse rotation of the servo motor through solid-state relays 1SSR and 2SSR. Solid-state relays have the advantages of no mechanical noise, no jitter, fast switching speed, and long life, and are suitable for frequent forward and reverse starting of servo motors. 

3.4 System display and keyboard circuit design

Because the bidirectional I/O port of the 80C196MC microcontroller is sufficient, there is no need to expand the parallel I/O interface. The display and keyboard circuits can be directly established through the P3 and P4 ports, and a 6-bit LED common cathode display is set up. The segment selection code is provided by P3, and the bit selection code is provided by the P4 port. The keyboard and display circuit are combined, and the column input is provided by P4.1~P4.6 in sequence, and the row output is provided by P4.0. A total of 6 function keys are set: start, stop, increase timing time, decrease timing time, display timing time, and display packaging quantity.

3.5 System alarm and parking circuit design

The result of the logic processing program is output by P2.1, and then the intermediate relay KA is controlled through the buffer, optocoupler and Darlington circuit, thereby realizing the buzzer alarm and automatic parking of the packaging machine.

4 Software design of automatic positioning system

A photoelectric encoder is installed on the main transmission shaft, as shown in Figure 4-1a. It uses two light bars to determine the position and direction at the same time, and controls two photoelectric switches 1LS and 2LS respectively. When the encoder rotates, it can generate pulse signals with different timings. The encoder is divided into four control areas, corresponding to four different working conditions.

① If the conveying speed of the label paper is equal to the linear speed of the knife roller, the photoelectric pulse 3LS for detecting the conveying position of the roll packaging paper appears in area I. At this time, no compensation is required and the servo motor stops rotating.
② If the conveying speed of the label paper lags behind the linear speed of the knife roller, the photoelectric pulse appears in area II. At this time, the servo motor is required to rotate forward and increase the speed of the paper feed roller through the differential gear system, so that the conveying speed of the label paper is positively compensated.
③ If the conveying speed of the label paper exceeds the linear speed of the knife roller, the photoelectric pulse 3LS appears in area III. At this time, the servo motor is required to reverse and slow down the speed of the paper feed roller through the differential gear system, so that the conveying speed of the label paper is negatively compensated.
④ If the photoelectric pulse appears in area IV, it means that the deviation of the pattern position of the packaging paper exceeds the allowable value. At this time, the packaging machine is required to stop automatically, and the buzzer will sound an alarm, and readjust after stopping.

It should be pointed out that the EXTINT interrupt in the 80C196MC is different from the external interrupts of other 80C196 series. It is generated by the protection circuit of the waveform generator. Four external interrupt triggering modes can be selected: rising edge triggering, falling edge triggering, low level triggering and high level triggering. Compared with the edge triggering method, the level triggering interrupt is more suitable for noisy environments. This system uses the low level triggering method to generate interrupts. When there is light, the photoelectric switch inputs a low level "0" to the CPU; otherwise, it inputs "1". When the CPU outputs a low level "0", the relay is turned on; otherwise, the relay is disconnected. Based on the above control principles and input-output control rules, the input-output timing diagram (Figure 4-1b) can be obtained, and the state table (see Table 4-1) can be written. 

[page]


The MCS-96 Boolean instruction set is a powerful tool for solving logic control problems, so the procedure for solving the above state equation is very simple.

By using the pulse width modulation counter and internal clock contained in the PWM module of 80C196MC, the running time of the servo motor can be accurately controlled, thereby controlling the compensation amount of each label paper. The timing time can be easily corrected by using the buttons for increasing and decreasing the timing time. At the same time, the timer 1 of 80C196MC is used to record the production volume of the packaging machine. The main program block diagram of the system is shown in Figure 4-2.

5 Conclusion

The system design is convenient and flexible. Through the PWM programmable duty cycle and frequency or function keyboard, the operating time of the servo motor can be easily adjusted to produce accurate compensation control so that the actual paper cutting line of the knife roller is well consistent with the theoretical paper cutting line.

The system design is simple and economical, and is the most basic and simplest system of 80C196MC, leaving a large margin for future development and system modification.

The compensation automatic adjustment positioning system with 80C196MC single chip microcomputer as the central control unit has greatly improved the reliability and positioning accuracy of the automatic positioning system, reduced the product failure rate, improved product quality, reduced production costs, and improved economic benefits compared to the traditional packaging machine based on relay control circuit. It has certain economy and practicality.

[References]

[1]Sun Hanfang. Intel 16-bit single-chip microcomputer [M]. Beijing University of Aeronautics and Astronautics Press, 1999.
[2]Yuan Guogan, et al., Application of single-chip microcomputer in automatic positioning system [J]. Electrical Automation, 1998(4).
[3]Wang Jian. Principle and application technology of MCS-96 series single-chip microcomputer [M]. Huazhong University of Science and Technology Press, 1999.

Keywords:80C196MC Reference address:Automatic positioning system based on 80C196MC single chip microcomputer

Previous article:Realization of the communication test system between computer serial port and single chip microcomputer
Next article:Prevention of Program Out of Control Based on MCS-96 Single Chip Microcomputer Control System

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号