Design and Implementation of Single-Axis Position Servo System

1 Overview

The current position servo system generally adopts a so-called "soft servo" system, so that the position gain is not large, so that the system is easy to stabilize, and a closed loop speed control unit is added, and the gain of the speed loop is large. Therefore, very small position deviations can produce very significant speed deviations, and the speed loop is corrected with a very high gain, resulting in a very high position resolution of the system [1]. In the development of a CNC gear planing machine, the author designed and completed a single-axis position servo system, the system uses a semi-closed-loop structure, block diagram shown in Figure 1. This text will combine this system, expatiate the composition and hardware implementation of the position servo system.

1

Figure 1 Block diagram of a single axis position control system

2 The composition of the position servo system

In Figure 1, the position controller and speed controller are programmed by 486 personal microcomputers. The motor adopts FANUC-BESK (type 15) DC servo motor from Beijing Numerical Control Equipment Factory and uses the plant's A06B-6054-H005 as a power driver module. Since the speed control unit is an analog system, a 12-bit D/A converter is used to convert the digital quantity output by the microcomputer according to the control algorithm into an appropriate analog voltage and control the motor to rotate in a direction of reducing the positional deviation. The position feedback adopts the photoelectric encoder with a resolution of 4000 lines/rev. After the frequency quadrupling circuit, the position pulse number is recorded by the programmable counter 8254. The position controller calculates the speed command voltage based on the number of pulses and the number of command pulses. Output to a 12-bit D / A converter, that is analog speed command voltage. The speed feedback also uses the same photoelectric encoder and counting circuit. The speed controller calculates the actual speed by first-order difference of the position and then outputs it to another 12-bit D/A converter. The analog voltage is fed back to the speed control. Unit speed feedback input. The actual speed ω is calculated as ω=ΔN/Ts, where ΔN is the position pulse increment in the sampling period and Ts is the sampling period. The system takes 8 milliseconds.
The CNC control program written by the author adopts the front and back office software structure. The front desk program is an interrupt service routine. The hardware implements 8 millisecond timer interrupts, mainly to complete the fine interpolation and position control functions; the background program is a circular operation program, mainly to complete the data Input, rough interpolation and other auxiliary functions.

3 The realization of the servo system

Digital-to-analog conversion using chip DAC1210, in order to not reduce the resolution, with an electronic switch CD4052 deal with the sign, so that the digital-analog conversion to bipolar 12-bit, in order to improve the drive capability and suppress interference, the output is made using integrated op amp OP07 Emitter follower form, circuit shown in Figure 2.

1

Figure 2 Bipolar 12-bit D/A conversion

3.1 Quadruplers <br> Quadruplers [2, 3] are implemented using a differential circuit, and their anti-jamming capability is poor. The author designed a quadrupler that uses an integral monostable circuit, as shown in Figure 3. The working principle of the circuit: A and B are square wave pulses with a phase difference of 90°. When the motor rotates in the forward direction, A leads B. When the motor rotates in the reverse direction, B leads the A. The circuit is connected to an inverting-A of A and A and an inverting-B of B and B respectively, and an integrating type monostable circuit [4] is respectively connected to generate a short pulse A' at the rising and falling edges of A. -A', a short pulse B' and -B' are generated at the rising and falling edges of B, respectively. When A is low, Va is high, G2 is low; when A rises, G1 is low, but because the voltage across the capacitor cannot mutate, so for a period of time Va Still above the threshold level, the G2 output is high and the circuit enters a transient state. With the discharge of the capacitor, Va continues to drop. When Va is lower than the threshold level, G2 output is low. After A returns to low level, G1 output is high, and the capacitor starts charging again, when Va returns to At high levels, the circuit reaches steady state again, ready for the next rising edge. From the above analysis we can see that the pulse width TW of A' is equal to the time from when the capacitor starts to discharge to when Va drops to the threshold level. According to the analysis of the transient process of the RC circuit, it can be seen that the discharge time of the voltage Va on the capacitor is determined by the following formula [ 4]: 1 (1)

In the formula, the resistance of the R′—RC circuit discharge loop C′—the capacitance of the RC circuit discharge loop VC(∞)—the steady state value of the capacitor voltage VC(0)—the initial value of the capacitor voltage VC(t)— — After the capacitor voltage value after the t-time discharge, set the output high level of the LSTTL circuit to VOH, the output low level to VOL, VTH to the threshold level, and R0 to the output resistance when the G1 output is low, set R′=R0+R. , C'=C, VC(∞)=VOL, VC(0)=VOH,
VC(t)=VTH is substituted into (1) The available pulse width TW is:

1 (2)

Considering the circuit recovery time, the period of the square wave pulse sequence should be 7-8 times that of TW so that the circuit can work reliably. The appropriate resistors and capacitors can be selected accordingly. The obtained four short pulse sequences A', -A', B', -B' are logically combined with NOR as shown in Fig. 3, and at the output ends of U1, U2, positive and negative rotations are generated. Quadruple frequency pulse sequence, as shown in Figure 4. This circuit has good anti-interference performance, because the capacitive reactance is very small at high frequency, and the pulse is selected by the secondary AND gate.

1

Figure 3 Integral quadrupling frequency counting circuit

1

Figure 4 Positive and negative quadrupler pulse waveform (left: right turn: reverse)

3.2 Pulse counting circuit and initial value bouncing 8254 is a programmable counter which is very convenient with the microcomputer interface. In mode 2, the counter can automatically repeat the counting, using its two counting channels to record the forward and reverse pulses, respectively, to read in the program. By entering the count value and subtracting the two, the position pulse increment in the sampling period can be obtained, and the subsequent program can be further processed. The author found in the application 8254 has a flaw: after it is initialized, the output latch has a random number, then the program reading will read this random number, so when the first count pulse arrives, the counter starts from The programming initial value is reduced by one count. When the actual position pulse does not come, the position pulse value read in the program is a random number. When the actual position pulse is input to the counter, the sampling program reads the normal position pulse value, so the sampling program is first time. The count of forward or reverse pulses is incorrect, and the count then enters the normal state. This randomness of the first reading will cause the system to jump violently, which is called "initial value jump." This jump is unacceptable for CNC machine tools and must be eliminated.
The author solves this problem through program processing. Its method is to record the initial contents of the output latch after initialization, and compare the contents of the read-in output latch with the start value in the sampling program. If the value is not Change, indicating that there is no count pulse, the position increment is zero; if the value changes, it means that the count pulse has arrived, and the first position increment is obtained through program calculation. After that, it is no longer judged "beat jump" and normal counting is performed. The procedure for solving the "initial value jump" is as follows (implemented in Turbo C language):
Real-time sampling program:
......
Unsigned char cl,ch;
Unsigned int clk0;
Outportb(P8254+3,0xd6);
Cl=inportb(P8254);
Ch=inportb(p8254);
Clk0=cl|(ch<<8);
If(clk0!=Old-clk0)first=1;
If(first)
{...
Dsp0=......;
......
}
Else
Dsp0=0;
......
Initialization procedure:
......
Unsigned char ch,cl;
Cl=inportb(P8254);
Ch=inportb(P8254);
Old-clk0=cl|(ch<<8);
......
The description of the variable:
Old-clk0: The initial value of the output latch clk0: The output latch read value first: To determine whether the first pulse comes logical variable dsp0: Position increment P8254: 8254 Chip select address 8254 The three count channels are used to generate a 8 millisecond timer interrupt to trigger the interrupt service routine.

4 Experiments and conclusions

The servo system adopts a 4000 line/rotary photoelectric encoder, and then passes a quadrupled frequency circuit. The pulse equivalent is δ=360°/(4000×4)=0.0225°/pulse. The position control algorithm adopts a forward differential control algorithm. ,Adjust the D/A conversion of speed feedback so that the output meets the requirements of speed control unit A06B-6054-H005: 3V/1000r/min, speed loop feedback coefficient is adjusted to 1.2, the motor can be stable under different constant speed command voltages Operation, linearity 2000r/min/7V.
After experiments, the position gain was adjusted to 2, and the motor positioning error was ±8 pulses, ie, ±0.18°. The measured steady-state tracking error is shown in the table below with different feedrate commands. The motor to work table has a 150:1 reduction ratio, and the above performance indicators can meet the actual processing requirements. In addition, after the software processing, the system completely eliminated the phenomenon of “initial value jump”.

Table steady-state tracking error at different speeds

Input command speed (r/min) Steady-state tracking error (angle °) 10 0.81 20 1.00 30 1.26 40 1.44 50 1.80

Posted on