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.
[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.
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.
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 circuitThe 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.
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.
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
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- MakeCode driver for the magnetic field sensor LIS2MDL
- Very detailed filter basics
- EEWORLD University Hall----Live Replay: How to solve the challenge of precision timing in ADAS systems
- When will it end? ST is out of stock and it is hard to find a domestic alternative, but the domestic ones are also out of stock...
- [Mil MYC-JX8MPQ Review] 3. GPIO Application Programming
- 【Laser target detector】I2C and SPI
- The inverter outputs a sine wave, so how do we measure the harmonics and waveform distortion of the output voltage?
- Understand the MSP430F149 comparator by looking at a picture
- MOS tube knowledge
- 【GD32L233C-START Review】-I. Unboxing and Hardware Appreciation