“Planar articulated manipulators are one of the most widely used manipulators, which can be used in actual production as well as teaching experiments and scientific research. Used in actual production, it can meet the requirements of frequent changes in the content of assembly operations; used in teaching experiments, it can enable people to intuitively understand the structure of the robot, the principle of action, etc., so the development, design and research of planar articulated manipulators has the most extensive practicality Significance and application prospects.
Authors: Liu Shiliang, Fang Jianjun
Planar articulated manipulators are one of the most widely used manipulators, which can be used in actual production as well as teaching experiments and scientific research. Used in actual production, it can meet the requirements of frequent changes in the content of assembly operations; used in teaching experiments, it can enable people to intuitively understand the structure of the robot, the principle of action, etc., so the development, design and research of planar articulated manipulators has the most extensive practicality Significance and application prospects.
LM629 is a programmable all-digital motion control chip produced by National semiconductor. It has 32-bit position, speed and acceleration registers, built-in PID algorithm, and its parameters can be modified; it supports real-time reading and setting of speed, acceleration and position, etc. Motion parameters, the built-in ladder diagram generator can automatically generate the speed curve, smoothly accelerate and decelerate; support the 4 times frequency input of the incremental photoelectric code disk; the main frequency of the chip is 6MHz and 8MHz. Therefore, this article adopts LM629 and PIC16F877 to form the servo control system of the manipulator.
1 Manipulator structure
The physical photo of the planar articulated manipulator designed in this paper is shown in Figure 1. It mainly includes three rotary joints (respectively controlling the rotation of the mechanical arm and forearm, and grasping, opening and closing) and one mobile joint (controlling the expansion and contraction of the wrist). 2 is a simplified model of the manipulator. Each joint uses a DC motor as a driving device, and an incremental photoelectric encoder is also installed on the rotary joints of the mechanical boom and forearm to provide feedback signals required for semi-closed loop control. The motion control of the DC motor adopts a self-developed multi-joint control card based on LM629 and PIC16F877, and has compiled software that can meet the requirements of motion control to realize the speed, position and 4-joint linkage control of the manipulator. Since the control systems of the four joint motors of the manipulator are basically similar, in the following, the author will take a single joint motor as an example to introduce the reader to the design process of the control system of the planar joint manipulator.
Figure 1 Physical photo of the manipulator
Note: 1—body; 2—boom motor; 3—photoelectric encoder; 4—boom; 5—small arm motor
6—synchronous belt; 7—photoelectric encoder; 8—forearm; 9—wrist lifting motor;
10—Hand grasping motor; 11—Hand grasping.
Figure 2 Simplified model of manipulator
2 Control system design
2.1 The working principle of the control system
The single-joint DC motor servo drive system based on the LM629 chip and the PIC16F877 microcontroller is shown in Figure 3.
Figure 3 Schematic diagram of the control system
PIC16F877 provides acceleration, speed and target position quantity for LM629, uses these values to calculate new command and position given value in each sampling period, regard it as the command value. The actual position of the motor is detected by the incremental photoelectric encoder, and its output signal is decoded after LM629 quadrupling the frequency to form the position feedback value. The difference between the command value and the feedback value is used as the input of the digital PID correction link. Through the digital regulator PID calculation, LM629 output pulse width modulation signal PWMM and direction signal PWMS used to control the power chip L298N, and then drive the motor to the specified position. LM629 controls the speed while controlling the position. After LM629 receives the position signal sent by the host, it generates acceleration, uniform speed, and deceleration speed curves according to the ladder diagram. The area enclosed by the curve and the horizontal axis of the coordinate is the designated position. The proportional, integral and differential coefficients in the PID algorithm sometimes need to be modified, so they are stored in the E2PROM of the microcontroller. The one-chip computer and PC carry on the serial communication through the wireless transmitting and receiving module.
2.2 The hardware design of the control system
The hardware structure of the control system of the planar articulated manipulator studied in this paper mainly includes a motion module, a power amplifier module, a position detection module and a communication module.
(1) Motion and power amplifier module
The motion and power amplification module is shown in Figure 4. The core chip of the motion module is LM629. The 8-bit data ports D0~D7 of LM629 are connected with the RD0~RD7 ports of the PIC microcontroller, and RC0~RC3 are respectively connected with the CS, RD, WR, and PS of the LM629 to control chip selection and data flow. LM629 receives the position, speed or acceleration data from the single-chip microcomputer, and outputs the pulse width modulation signal and direction signal through the operation of the internal ladder diagram generator and PID regulator, which are output by the pins PWMM and PWMS. The power amplifier module is mainly composed of L298N chip and current discharge loop. L298N is a bipolar H-bridge power amplifier circuit, which is connected to the LM629 output signal PWMM and PWMS through a logic gate circuit to control the forward, reverse and stop of the DC motor. Add photoelectric coupler 4N25 between chip LM629 and L298N to conduct electrical isolation, protect single-chip microcomputer and motion chip and reduce strong electrical interference. Since the DC motor is an inductive load, the power diode DIN5391 is selected to form a current discharge loop to protect the power chip L298N.
Figure 4 Motion and power amplifier module
(2) Position detection module
The position detection module mainly detects and obtains the position of the motor shaft of each joint by detecting the incremental photoelectric encoder connected to the motor shaft. The circuit shown in Figure 5 combines the differential signals (A+, A-, B+, B-, IN+, IN-) output by the incremental photoelectric encoder through 75175 to synthesize single-ended signals A, B, IN (only in Figure 5) Draw the synthesis of a signal). The synthesized single-ended signals A, B, and IN are respectively connected to the pins A, B, and IN of LM629. The use of differential signal transmission can effectively solve the problems of interference and long-distance transmission. In order to further eliminate interference, a filter capacitor is added to each line at the input, and a resistor for line impedance matching is connected between the two differential signal lines. After the pulse signal fed back by the incremental code disc is 4 times the frequency, the resolution is improved. Each time the logic state of A and B changes, the position register of LM629 is incremented (subtracted) by 1. When the A, B, IN of the code disc are all low, an Index signal is generated and sent to the register to record the absolute position of the motor.
Figure 5 Synthesis of single-ended differential signals
(3) Communication module
The communication module mainly solves the problem of man-machine interface. In the control system designed in this article, no Display module and keyboard input module are designed. However, in practical applications, it is often necessary to input some parameters, such as PID parameters. Use the abundant resources of the PC and a good user interface to solve the parameter input and Display of the control system through serial port communication.
2.3 Software design of the control system
The software part of the control system mainly includes an initialization module, a motion control module, a position detection module and a communication module. The single-chip microcomputer determines the speed, acceleration and position of each joint of the manipulator according to the information obtained by the position detection module, and transmits these information to the LM629, and generates a speed curve from the speed ladder diagram for position control. The PID regulator compensates the closed-loop system according to the input command and feedback information. Equation (1) represents the control signal output by LM629.
In the process of programming, the incremental PID algorithm is usually used.
The communication module establishes the communication between the MCU and PC++. On the PC side, use Visual C++ to write serial communication programs and parameter input interfaces. On the PIC16F877 side, the communication program is written in assembly language to realize the two-way communication between the PC and the microcontroller. Figure 6 shows the flow of the main program and interrupt subroutine.
Figure 6 PC and PIC16F877 communication program flow
This article introduces the design method of the position servo control board of the planar articulated manipulator. LM629 and PIC16F877 are used to form the servo system of each joint of the manipulator. Compared with the simple single-chip microcomputer to realize the manipulator control system, it has simple hardware circuit structure, high reliability, It has the advantages of low cost, small burden on the single-chip CPU, and good real-time control. This kind of self-developed control circuit board has a wide range of applications and can also achieve good application effects in mobile robots.