Application of 51 single chip microcomputer in glass tube heating control system

Publisher:温馨小屋Latest update time:2012-11-07 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

A stepper motor is an electromagnetic mechanical device that converts an electrical pulse signal into a corresponding angular displacement or linear displacement. It is an incremental drive element that outputs an input digital pulse and has the ability to start and stop quickly. However, most designers are accustomed to using logic circuits to implement complex stepper motor control. Although great results have been achieved, the implementation is costly and time-consuming. Moreover, once the circuit is formed, it is difficult to change it, so the controller has to be completely redesigned. The advanced technology and low price of microprocessors and microcomputers have created a new situation for the control of stepper motors [1]. People can completely control stepper motors with the help of software, thereby realizing a complex and low-cost control system. At the same time, they can flexibly change the control scheme by changing the program. To this end, we designed a stepper motor controller based on the 89C51 single-chip microcomputer for the glass tube heating system. The controller has the characteristics of simple circuit, good performance, low cost, and high reliability, and has achieved good results in practical applications.

2 Control System Hardware Design

2.1 Principle of glass tube heater

There is a fixture every 15° on the disc with a diameter of 400mm, which is used to place glass tubes with a diameter of 3mm and a length of 50mm-70mm. There is a flame nozzle above the disc to heat the glass tubes. First, install 24 glass tubes on the disc, start working after starting the machine and positioning, and the stepper motor starts to run. When it rotates 15°, it delays for T seconds (the size of T can be set to 3, 4, and 5. The default value of this system is 3. The time deviation can be less than 0.1 seconds through software control). When a glass tube is heated, the stepper motor rotates and moves to the next glass tube. The time used is 1 second. The positioning deviation can be less than 0.1mm through software, and then repeat the previous step. The main view of the mechanical transmission principle diagram is shown in Figure 1, and the top view is shown in Figure 2.

ic72 sensor control

Figure 1 Main view of mechanical transmission principle diagram

ic72 sensor control

Figure 2 Top view of mechanical transmission principle diagram [page]

2.2 MCU control system hardware design

The core of the system controller uses 89C51 single-chip microcomputer with 4K erasable program memory, which is easy to expand the system and improve the program. The four bits of P1 port are used as keyboard input control, and K1, K2, and K3 are used to control the delay state. K1 is pressed to delay for 3 seconds, K2 is pressed to delay for 4 seconds, and K3 is pressed to delay for 5 seconds. K4 controls the running direction selection and switches between clockwise and counterclockwise. The digital tube uses a serial display method to display the running status. LED1 displays the display direction selection, "-" indicates clockwise rotation, and "|" indicates counterclockwise rotation. LED2 displays the delay time, which can display three states: 3, 4, and 5. See Figure 3 for the electrical control block diagram.

ic72 sensor control

Figure 3 Electrical control block diagram

3 Control system software design

3.1 Functional analysis of software implementation

The control system can set direction selection, delay time, etc. as required, and the operator can easily observe the working status of the control system.

(1) The minimum step angle of the stepper motor is 1.5°, and the number of steps per revolution is 240 steps/revolution;

(2) There is a fixture at 15° on the disk, and a total of 24 glass tubes can be placed;

(3) The time it takes for the disk to rotate 15° is 1 second;

(4) The digital display part is the delay time (can be set to 3, 4, or 5 seconds);

(5) Keep the nozzle perpendicular to the disk to reduce errors.

3.2 Main program flow chart of the control system

According to the tasks that the system should complete, the main program flow chart is designed as shown in Figure 4:

ic72 sensor control

Figure 4 Main program flow chart

In Figure 4:

Left 1: One step delay of 10ms is used to find the positioning point, and then enter the normal operation state after finding the positioning point;

Left 2: Setting number, used to set 10 steps to stop and 240 steps to judge;

Left 3: Normal operation, 1 step delay 0.1s, 10 steps and then stop, delay T (T=3, 4, 5);

Left 4: 240 steps make one circle. After one circle, determine whether there is interference or lost steps. If so, find the positioning point again.

After the system starts, the port and display are initialized first, the display is cleared, the three-phase winding of the stepper motor is in a power-off state, and then the numeric keys and function keys are scanned. When the operation passes a set value of the numeric key, the set value is stored in the RAM unit in hexadecimal, and then displayed in decimal through the dynamic LED; after the operator confirms, press the left (or right) row function key, the stepper motor will drive the disk to rotate, and the delay time will be displayed through the static LED.

[page]

3.3 Design of the forward and reverse drive subroutine of the stepper motor

The stepper motor used in this system is 110BF3-15, which has a three-phase winding. There are three pulse input sequences for the three-phase winding, namely single three-beat, double three-beat, and three-phase six-beat. This system uses the double three-beat input method. The input method is controlled by software. The double three-beat control software is one of the simplest soft interfaces. First, the PA port of 8255A is used as the output port, and then the control information is sent to PA0~PA2. The corresponding I/O line is "1" (high level is valid), then the corresponding phase winding of the stepper motor is energized, and the stepper motor rotor rotates. If the rotor is required to rotate in different directions, the energization sequence of the three-phase winding is different, and the corresponding control word is also different. The double three-beat winding energization control information table is shown in Table 1[2].

From Table 1, we can see that the information string required for forward and reverse rotation is 03H→06H→05H→03H, and the power is turned on in the order of AB→BC→CA→AB. The information string required for reverse rotation is 05H→06H→03H→05H, and the power is turned on in the order of CA→BC→AB→CA.

Table 2 shows the control words (hexadecimal, the same below) of the asynchronous phase control mode of the stepper motor.

Table 1 Stepper motor phase winding power control information table

ic72 sensor control

Table 2 Control words for asynchronous phase control methods

ic72 sensor control

After considering the forward and reverse rotation of the stepper motor, the double three-beat control software list is as follows [3]:

DS: MOV A, #00H; Initialize PA0~PA2 to output

MOV DPTR,#0C000H;

MOVX @DPTR,A ;

MOV DPTR, #0C000H; AB phase is powered

MOV A,#03H

MOVX @DPTR,A

LCALL DELY ; adjust delay

MOV DPTR, #0C000H; BC phase is powered

MOV A,#06H

MOVX @DPTR,A

LCALL DELY ; adjust delay

MOV DPTR, #0C000H; for phase CA

MOV A,#05H

MOVX @DPTR,A

LCALL DELY ; adjust delay

DELY:MOV 0CH,#0FH ; Delay subroutine

RET[page]

The above is the forward pass electronic program of the three-phase winding of the stepper motor. The reverse pass electronic program is similar. If you want to change the motor speed, just change the value of the immediate number in the MOV 0CH, #0FH instruction. Figure 5 is the flow chart of the forward and reverse drive subroutine of the stepper motor:

ic72 sensor control

Figure 5 Forward and reverse driver flow chart

4 Conclusion

The system is easy to operate, flexible in control, high in precision and good in reliability. It has met the expected design requirements, greatly reduced the intensity of physical labor and improved working conditions. In order to improve the reliability and precision of the system, corresponding anti-interference measures have been adopted in the implementation of software and hardware.

Reference address:Application of 51 single chip microcomputer in glass tube heating control system

Previous article:Study on single chip digital tube and latch
Next article:FPGA Configuration Based on Single Chip Microcomputer P89C61X2

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号