Actuator controller has an important application in robot control technology. Its performance is directly related to the normal operation of multi-actuator system. In order to solve the contradiction between multi-output and high precision of servo controller designed with control chip, a new servo controller is designed. The hardware adopts high performance STC15F2K60S2 single chip computer, which shortens the interruption service time to the maximum extent, and the control precision of PWM wave can reach 0.5us. The software adopts the idea of time-sharing multiplexing, and the PWM wave is 20 ms. There are as many as 32 output paths in the signal cycle. The simulation software validates that the design greatly improves the control accuracy on the premise that the number of control paths is enough, and has been successfully applied to the control of a 7-DOF mirror-holding manipulator. The design of steering gear controller is one of the key technologies of manipulator control. At present, the generation methods of PWM control signals of steering gear can be summarized into three categories: the first is based on discrete devices, whose implementation circuit is complex, and its accuracy is difficult to control, and the signal quality is not high; the second is based on programmable logic devices (PLD) generation method [2-3], which can generate multi-channel high-precision PWM, but it is designed. The third kind is based on the single-chip computer generation method [4-6], which is easy to implement, low cost and high accuracy. But the traditional servo controller based on MCU has a difficult contradiction, that is, the output of PWM multiplexer and PWM high precision can not be achieved simultaneously, such as 7-8 high-precision servo controller, 24 low-precision servo controller [9] and 74HC595 extended multi-way servo controller [10]. To solve this problem, a steering engine controller based on high performance 8-bit single-chip STC15F2K60S2 is designed. Actuator generally has three leads, which are power, ground and signal lines. The voltage required for LDX-218 steering gear manufactured by Robo-Soul Company is 6-7.
4V, in which the signal line is the PWM input line, and the steering angle can be controlled by changing the PWM pulse width. As shown in Figure 1, the PWM signal period is 20 ms, the minimum high level is 0.5 ms, the maximum is 2.5 ms, and the corresponding motor rotation angles are 0 and 180. This design adopts STC15F2K60S2 single-clock/machine cycle (1T) single-chip computer produced by Hongjing Science and Technology Company. It is a new generation of 8051 single-chip computer with high speed, low power consumption and strong anti-interference. Its instruction code is fully compatible with traditional 8051, but its speed is 7-12 times faster. Its working frequency is 5-35 MHz, which is equivalent to 60-420 MHz of ordinary 8051. Since the servo controller needs 32 PWM outputs, LQFP44 package is selected. It has five universal I/0 ports, namely, P_1, thermostatic element P_2, P_3 and P_4. Without external crystal oscillation, the internal crystal frequency can be set through program to meet the requirements of multiple I/O ports and high execution efficiency of the servo controller.
The control chip and peripheral circuit are shown in Figure 2. CH340T is chosen as the USB serial port chip. USB is used as the communication interface to receive the control signal transmitted by the host computer, and also to supply power to the single chip computer. The serial port 1 of MCU is used as communication interface, i. e. P3.0 port and P3.1 port. Its circuit diagram is shown in Figure 3. As shown in Figure 4, a 16-bit timer is used to set the internal crystal frequency of the chip to 24M, and the reference time is 0.5us for a machine cycle. The upper computer converts the angle data into the initial value of the lower computer timer. For any angle between 0 and 180 degrees, it can be converted according to (1) mode, where theta is the angle to be rotated, f is the crystal frequency of the lower machine, and 12 clock cycles (1 machine cycle) timer can be subtracted by one operation. The upper computer mainly completes data preprocessing, including converting the angle to the initial value of the lower computer timer, sorting the initial value of 32-way PWM timer, and choosing the insertion sorting algorithm [12] to arrange in ascending order on the basis of fully considering the complexity of time and space. Step1: The 32-channel PWM timer counts transmitted from the host computer are encapsulated into one structure per circuit. Step3: Update the structured array according to the following algorithm. Step4: Set all PWM output ports high and turn on timing interrupt. Step5: Close the PWM output port whose timing has reached in interrupt processing tasks, and update the next count value.
Step6: Receive PC data within the remaining 20 ms of the cycle. Step7: The cycle time is 20ms, jump to Step1 immediately. The flow chart of generating multi-channel PWM signal is divided into upper computer and lower computer. The upper computer and lower computer communicate through serial port 1, as shown in Fig.
5. The steering gear belongs to the position servo control system. It can control the angle accurately by changing the pulse width of PWM, such as controlling the angle of the steering gear rotation, when the corresponding pulse width is Pw, the pulse width can be set to increase according to the step type, as shown in Figure 6. The angular speed of the steering gear is controlled by the switching speed of the pulse width, so as to achieve the purpose of speed regulation of the steering gear. Its step value Inc is adjusted by N, e.g.
(2).
Proteus has unique advantages in the field of MCU simulation and development. It can verify the feasibility from the theoretical level, thus shortening the development cycle and reducing the development cost. In the simulation experiment, AT89C52 is selected to verify the method of 8-way PWM output. The experiment proves that the algorithm can output 8-way stable PWM waveform stably, as shown in Figure 7. In order to verify the actual control effect of the scheme, the control experiments of the 7-DOF mirror-holding manipulator [13-14] shown in Fig. 8 (a) are carried out. The 7 DOFs of the manipulator are sliding up and down as a whole, shoulder rotation, shoulder swing, elbow rotation, elbow swing, wrist rotation and wrist swing, respectively, as shown in Fig. 8 (b).
Rotation range: The PWM pulse width is set to 0.5 ms and 2.5 Ms. The rotation angle of the joint is measured and the average value is obtained 10 times. Positioning accuracy: 10 groups of joint rotation angle data with pulse width of 0.
5 ms, 0.7 ms, 0.9 ms, 1.1 ms, 1.3 ms, 1.
5 ms, 1.7 ms, 1.9 ms, 2.1 ms, 2.3 MS and 2.5 ms were measured. The positioning accuracy was the mean of 10 different position deviations. There are errors in the experimental results. These errors come from hardware, such as the inherent errors of steering gear and sensor errors, and software errors from the PWM generation algorithm itself.
This paper mainly analyses the error from the algorithm itself. The control accuracy of PWM pulse width is mainly determined by the size of three periods: interrupt entry, interrupt exit and interrupt service program processing. The time of interrupt entry and interrupt exit is relatively stable, which can be compensated and perfected by modifying the timing time. For interrupt service time, high performance chips need to shorten the interrupt service time as much as possible. Make up. The chip PWM used in this design is a low-cost high-performance single-chip computer, which does not require very high frequency. For example, 50HZ can achieve ideal results. Using STC15F2K60S2 as the control chip, it can shorten the initial value of interrupt service processing reset timer and reduce the time consumed by corresponding PWM output port program. At the same time, it also has multiple I/O ports, which is convenient to expand the demand of multi-channel PWM output. Firstly, the pulse width of multi-channel PWM is sorted, then all the output ports of PWM are set high, then the output ports are cleared according to the order of pulse width from narrow to wide.
Finally, after all the output ports of PWM are pulled down, the continuous output of multi-channel PWM can be realized by repeating the above process. This method has the characteristics of multi-output and high precision, and is suitable for multi-actuator control. In addition, only the guidance method is given for the steering gear speed regulation, and the specific implementation needs further study.