Design of control system for material preparation robot based on AT89C52

Publisher:喜悦的38号Latest update time:2012-11-14 Source: 现代电子技术 Keywords:AT89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
In order to meet the experimental training needs of mechatronics major, our school purchased a mechatronics automatic assembly teaching system in 2003. This system is a complete, flexible, modular and easily expandable teaching and training system, which includes a variety of mechanical and pneumatic transmission methods and simulates a flexible production system of modern assembly process. The system mainly adopts PLC control, showing the application of sensor detection, electrical control, configuration control, industrial bus control and other technologies in actual production. With the help of this system, students can learn and understand the comprehensive application of mechanical transmission, hydraulic and pneumatic, electrical transmission and PLC control, industrial field bus, sensors and various technologies. However, with the development of technology, the control system based on single-chip microcomputer is also becoming another major form of industrial field control. Therefore, on the basis of the original manipulator structure, pneumatic system, sensor and motor control circuit, another single-chip microcomputer control system is designed to realize the control of the manipulator, so as to promote students' perceptual understanding of the application of single-chip microcomputer in industrial production and cultivate their ability of design, comprehensive analysis and fault diagnosis and troubleshooting of single-chip microcomputer system.
There are many single-chip microcomputer products on the market with different functions. AT89C52 is a common single-chip microcomputer with high cost performance. It can realize online sintering programming and is easy to use. In order to maintain generality, the single-chip microcomputer control system of the manipulator takes this chip as the control core, expands the interface, designs the software, and designs the corresponding interface circuit and external circuit.

1 Material preparation manipulator unit
The mechatronics automatic assembly teaching production line simulates the operation process of a workpiece in an industrial assembly line. It is divided into 8 modules such as material preparation, capping, simulated painting, drying and ventilation, centralized detection, sorting, elevator, and multi-layer shelves. Among them, the material preparation, capping and sorting units use manipulators to achieve the action requirements. The control of the entire production line is
composed of each unit control module and a master control platform, which can realize manual and automatic operation respectively. When automatic, the Profibus bus is used to connect the communication between the master control and each substation to realize automatic assembly.
The function of the material preparation manipulator unit is to move the workpiece body placed on the workpiece platform to the hopper of the unloading unit.
The movement modes include: the up and down movement of the robot arm (using a double-acting cylinder for up and down movement); the suction and release of the workpiece (an electromagnet is installed at the top of the cylinder rod); the manipulator rotates 90° (the DC motor drives the manipulator to rotate through the gear transmission mechanism in the reduction mechanism); the lifting and lowering of the robot arm (the DC motor drives the rack and gear mechanism through the reduction mechanism to lift the workpiece through the lever mechanism); the forward and backward movement of the workpiece (right and left movement are also driven by the DC motor after the reduction mechanism to drive the gear rack to move the entire manipulator). The unit uses PLC to drive 6 relays (to achieve the forward and reverse control of 3 DC motors), drive the solenoid valve to control the double-acting cylinder and DC electromagnet to achieve the control of the above movement, and the position detection is achieved by micro switches, reed relays, and photoelectric detection switches. The console of the unit can perform manual, automatic, emergency stop and other functional controls.
The mechanized hand is equivalent to a manipulator with 5 degrees of freedom. The position control of the manipulator is achieved by adjusting the position of the limit switch or sensor.
1.1 Motion control requirements of the material preparation manipulator
(1) After the workpiece and the workpiece detection platform are placed, the material preparation detection sensor detects the workpiece. In the manual mode, press the start button and the material preparation manipulator begins to prepare for work. After a delay of 1 s, the stop cylinder moves down and the DC electromagnetic magnet is energized.
(2) After the stop cylinder moves down to the position, the magnetic induction sensor on the cylinder receives a signal, the DC electromagnetic magnet sucks up the workpiece, the stop cylinder moves up to the position (reset), and another magnetic induction sensor on the cylinder receives a signal to proceed to the next step.
(3) After the stop cylinder is reset, the forward motor rotates forward, causing the material preparation manipulator to turn to the direction of the chassis conveyor belt. The forward rotation position signal is sent by the stop block of the turntable hitting the micro switch, and the signal is transmitted to the PLC.
(4) After the forward motor rotates forward to the position, the upward motor is energized, and the manipulator lifts the workpiece and moves upward. When the collision block of the lever mechanism hits the upward position micro switch, the upward movement is completed.
(5) After the upward movement is in place, the PLC controls the right movement motor to make the manipulator move to the right. The manipulator's collision block hits the right movement in place micro switch inside and outside the chassis conveyor belt, and the right movement ends. At this time, the manipulator's electromagnet has moved the workpiece to the top of the hopper of the next workstation.
(6) The stop cylinder moves down again, accurately placing the workpiece in the toothed groove inside the hopper, and the DC electromagnetic power is cut off.
(7) The stop cylinder resets, the manipulator moves to the left, descends, rotates to the position, and finally stops the upper limit of the cylinder, rotates and resets, and moves to the left. This is the initial position of the material preparation manipulator.
(8) For some reason, the material preparation manipulator should return to the initial position after emergency stop and power-on.
1.2 Pneumatic system
Figure 1 is a schematic diagram of the pneumatic system of the teaching production line and the pneumatic branch of the material preparation unit. After the air compressor compresses the atmosphere, it is purified and dried through oil and gas separation, and then adjusted to a pressure of 0.4-0.6 MPa through the air pressure regulating valve, and then passed to each branch through the main air pipe. The air pressure from the main line of the material preparation manipulator unit passes through the branch head, is controlled by the manual stop valve, and then controlled by the two-position five-way solenoid valve. When YA1 is not energized to the left position, the one-way throttle valve adjusts the air flow control flow to reset the cylinder. When the stop cylinder descends, YA1 is energized, the solenoid valve is connected to the right position (as shown in the figure), and the cylinder is pushed down through the one-way throttle valve 4. A muffler is added to the return air circuit to prevent the noise caused by the return air of the valve.

a.jpg [page]

2 AT89C52 control system design
2.1 Mapping relationship between interface and memory address The mapping
relationship between the PLC-I/O interface of the material preparation unit and the parallel 8255 address and memory input/output of the AT89C52 control system is shown in Table 1.

b.jpg


2.2 AT89C52 control system circuit design
From the I/O interface table, we can see that the material preparation robot has 15 input points and 9 output points, so the system needs to expand 1 8255, and define the PA port, PB port as input, PC port as output, and use P1.0 as the output interface as the output indicator. Considering the control needs of the host computer, a serial communication circuit composed of MAX 232 is designed. The AT89C52 has an 8 KB ROM inside, and the address range is from 0000H to 1FFFH, which can meet the control needs, so the external memory is no longer expanded. The circuit is shown in Figure 2. Design the /CS and P2.7 terminals of 8255 to logic zero, and other unused address lines to logic 1, then the PA port address of 8255 is 7FFC, the PB port address of 8255 is 7FFD, the PC port address of 8255 is 7FFE, and the control register address of 8255 is 7FFF.

2.3 System I/O interface circuit design
The original system uses PLC as the controller, so its signals are all 24 V DC voltage signals. In order to meet the needs of the single-chip control system, the 24 V signal on the manipulator side needs to be converted into a TTL level that the single-chip can accept, and at the same time, the influence of sudden interference from sensors and switches can be eliminated. Therefore, a photoelectric isolation device is set to achieve level conversion and eliminate interference. The photoelectric isolation device uses TLP521-4, and the input is reflected by the LED indication circuit to detect input failure. The input interface circuit is shown in Figure 3.

c.jpg


The main function of the output interface circuit is to perform power driving, eliminate interference and level conversion. The circuit is shown in Figure 4. TLP521-4 performs photoelectric isolation to isolate the computer from the manipulator circuit side. After being driven by the power driver integrated circuit ULN2003A and the Darlington transistor, it drives the relay or indicator light respectively to realize the action control of the manipulator.

[page]

2.4 Design of DC motor drive circuit
The working current of DC motor is relatively large, and the output interface circuit cannot drive it directly. It needs to use relays for power amplification, that is, first drive the relay coil, and then use the relay contacts to realize the 24 V power supply of the motor. For permanent magnet DC motors, the current direction of the armature winding can be changed to realize the control of the motor's forward, reverse and stop. For example, when the manipulator rises, KA0 is energized and KA1 is de-energized. At this time, 24 V passes through the upper and lower limit switches through KA0 normally open (closed) to the motor armature winding, and returns to the 24 V ground from the other pair of normally open. When the manipulator descends, KA0 is de-energized and KA1 is energized. The process is similar to the manipulator rising. The DC motor drive circuit is shown in Figure 5. The armature circuit is connected in series with two direction overtravel limit switches. When the limit switch is activated due to software or other faults, the armature circuit power supply will be cut off, the motor stops, and electrical protection is achieved.

e.jpg


2.5 Software Design
Using serial communication, the current state of the robot (the contents of 26H, 27H, and 28H in the microcontroller memory) is sent to the host computer, and after receiving the command from the host computer, it is stored in the 25H unit.
Initialize the asynchronous and duplex serial communication, 8255 initializes PA, PB, and P1.0 to 0, and the robot is in a stopped state.
The working mode of the robot is divided into manual or automatic state. Manual is controlled by the control button of this workstation, and automatic uses serial communication to receive the command of the host computer and control the action of the robot in this position. If the robot is not in the initial position after starting, the robot should return to the initial position first. The system initialization is shown in Figure 6. Subsequently, the system accepts instructions and runs according to the instructions. The program flow is shown in Figure 7.
Because the program needs to call the input and output programs continuously, the input sampling and output of 8255 are written into special subroutines:
8255INPUT: MOV DPTR#7FFCH;
MOVX A, @DPTR;
MOV 20H, A
INC DPTR
MOVX A, @DPTR;
MOV 21H, A
RET
8255OUT: MOV DPTR#7FFEH
MOV A, 23H
MOVX@DPTR, A
MOOV P1.0, 24.0
RET
The forward and reverse rotation of the motor driving the manipulator are interlocked to avoid short circuit of the power supply. The sequential action program is omitted.

3 Debugging
To ensure the safe operation of the manipulator, the state signal of the manipulator is simulated by the switch during debugging, and the analog input is controlled according to the action of the manipulator. The state indication of the input interface board and the relay action of the output interface board are observed. When the control function is consistent with the control requirements of the manipulator, the actual input and output signals of the manipulator are connected. Equipped with a switching type voltage regulator power supply output 24 V/20 A, 5 V/2 A. The emergency stop signal needs to control the power supply. Design a special adapter board to separate the input and output signals on the manipulator and the local operating table, and then input/output to the input interface and output interface board to facilitate the switching of PLC and single-chip control.

4 Conclusion
Through experimental inspection, the single-chip control system operates reliably and realizes the two-way communication function, which provides great convenience for using the configuration control of the host computer and realizing on-site reproduction. The system reflects the control ability of the single-chip microcomputer in industrial production, demonstrates the comprehensive application of the single-chip microcomputer in industrial control systems, and establishes a new platform for carrying out the control experiment of the manipulator and the comprehensive experimental training of students majoring in mechatronics and electrical automation.

Keywords:AT89C52 Reference address:Design of control system for material preparation robot based on AT89C52

Previous article:Design of Digital Controlled DC Current Source Based on AT89C52
Next article:Single chip microcomputer control traffic light c51 program

Recommended ReadingLatest update time:2024-11-16 15:53

Design of wind tunnel wind speed and model attitude control system based on AT89C52 and FB900C angle transmitter
1 Introduction A wind tunnel is a pipeline test equipment that can artificially generate and control airflow to simulate the flow of gas around an aircraft or object, measure the effect of the airflow on the object, and observe the phenomena of the object. Wind tunnel plays a very important role in aerodynamic researc
[Microcontroller]
Design of wind tunnel wind speed and model attitude control system based on AT89C52 and FB900C angle transmitter
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号