2.1.1. Self-made micro drill resistance instrument
The micro drill instrument we proposed in the early stage adopted a threaded screw transmission method. Although the transmission accuracy of threaded screw is high, the overall weight of the micro drilling instrument is very heavy due to the 4kg weight of the threaded screw transmission system, making it inconvenient to operate. In order to reduce the weight of the micro drill, the paper used the timing belt transmission mode to control the drill feed movement (
Figure 1).
The drill needle is connected to the rotation motor shaft through the drill needle clamp, so the rotation speed of the drill needle is the same as that of the rotation motor. The feed motor shaft is connected with the reduction gear shaft, the reduction gear shaft is connected with the timing belt driving wheel shaft. The reduction gear ratio is 1:1000, that is, when the feed motor rotates every 1000 revolutions, the driving wheel of the timing belt rotates 1 revolution. The slot on the timing belt driving wheel and the slot on the driven wheel mesh with the rack on the inside of the timing belt. The two ends of the timing belt are fixed on the rotation motor base, the rotation motor base is fixed on the ball slide, the ball slide is installed on the plastic slide, and the ball slide can do reciprocating linear movement on the plastic slide. When the feed motor rotates in the clockwise direction, the reduction gear drives the timing belt to rotate in the clockwise direction, thus pushing the rotation motor seat and the drill needle forward; When the feed motor rotates in the counterclockwise direction, the reduction gear drives the timing belt to rotate counterclockwise, thus pushing the rotation motor base and the drill needle to move backward.
Because the drill needle is thin and long, it is prone to bending when drilling into trees. In order to reduce the bending degree of the drill needle, it is necessary to design a support plate for the drill needle (
Figure 2).
The drilling needle passes through a small hole in the middle of the vertical support plate at the front of the drilling needle support plate. The support plate is installed in the support plate groove, and the support plate can perform linear reciprocating motion in the support plate groove. When the rotation motor seat is at the starting position, the vertical support plates at the end of the drilling needle support plate are stacked together, while the vertical support plates at the front of the drilling needle support plate are evenly distributed on the drilling needle shaft. When the rotation motor seat moves forward, the forward pushing component of the support plate pushes the vertical support plate at the front of the drilling needle support plate, thereby pushing the drilling needle support plate forward. The vertical support plates at the front of the drilling needle support plate are gradually overlapped. When the rotation motor base moves to the forefront of the plastic slide, all the vertical support plates at the front of the drill needle support plate are stacked together, and the vertical support plates at the end of the drill needle support plate are evenly distributed in the support plate groove. When the rotation motor seat moves backward, backward push element pushes the vertical support plate at the end of the drill needle support plate, causing the drill needle support plate to move back.
The micro drill controller is responsible for the switch control, speed control, resistance conversion and storage of the rotation motor and feed motor, as well as the drill resistance. The controller hardware includes a DSP (Digital Signal Processing) core module[
29], a rotation motor control module, a feed motor control module, and a switch control module. The control system structure is shown in
Figure 3.
Due to the symmetrical shape of the drill needle, the rotation direction of the drill needle has little effect on the resistance of the drill needle. Therefore, the rotating motor does not need to control the rotation direction of the drill needle. In order to reduce the volume of the controller, the rotating motor is controlled by only one MOS (Metal Oxide Semiconductor) transistor[
30], as shown in
Figure 4.
The rotation motor is connected to terminal CN4. When the PWM1 pin of the DSP outputs high voltage, the MOS conducts and the rotation motor starts; When the PWM1 pin outputs low voltage, the MOS is cut off and the rotation motor stops. The A and B pins of photoelectronic encoder 1 are respectively connected to the QEP1 and QEP1 pins of the DSP. So, the number of pulses sent by photoelectronic encoder 1 is recorded by the DSP’s universal timer T2.
Due to the need for forward and backward movement of the drilling needle, it is necessary to control the rotation direction of the feed motor. The feed motor driving circuit adopts an H-bridge driving circuit [
31], which is mainly composed of four MOS transistors. The specific circuit schematic is shown in
Figure 5.
The gates of the 4 MOS transistors are respectively controlled by the DSP processors PWM3~PWM6 pins. When the PWM3 and PWM6 pins output a high level, meanwhile the PWM4 and PWM5 pins output a low level, the MOS tubes Q2 and Q5 conduct, while Q3 and Q4 cut off. The feed motor rotates counterclockwise and the drill needle advances. When the PWM4 and PWM5 pins output a high level, meanwhile the PWM3 and PWM6 pins output a low level, the MOS tubes Q3 and Q4 conduct, Q2 and Q5 cut off, and the feed motor rotates clockwise, causing the drill needle to retreat. The pins A and B of photoelectronic encoder 2 are connected to the QEP3 and QEP 4 pins of the DSP, respectively, So, the number of pulses sent by photoelectronic encoder 2 is recorded by the DSP’s universal timer T4.
The switch control module mainly includes button switches and limiting switches. The button switch controls the drilling needle status of the micro drill resistance instrument, with two buttons for forward and backward movement. Limiting switch is a device that limits the movement of the screw slide within the movable range, preventing the screw slide from exceeding the movable range and damaging the equipment. There are two limiting switches: front limiting switch and rear limiting switch. When the front limiting switch is in an invalid state and the forward key is pressed, the drill needle is set to be forward state. The DSP controls the rotation motor rotating, and simultaneously controls the feed motor rotating in a counterclockwise direction. So, the drill needle moves forward. When the rear limiting switch is in an invalid state and the back button is pressed, the drill needle is set to be backward state. The DSP controls the rotation motor rotating, and controls feed motor rotating in a clockwise direction. So, the drill needle moves backward. When the drilling needle is in the forward state, if the front limiting switch becomes effective or the stop key is pressed, the drilling needle will become in the stopped state; When the drill needle is in a backward state, if the rear limiting switch becomes effective or the stop key is pressed, the drill needle will become in a stopped state.
The controller program of the micro drill resistance instrument is divided into the main program design and the timer T3 interrupt processing program design. In the main program, first call the DSP initialization module, then activate the timer T3 interrupt, and finally loop the switch control module. In the timer T3 interrupt processing program, the feed motor speed control module, rotating motor speed control module and drill needle resistance conversion and storage module are called to complete the speed control of two DC motors and drill resistance conversion processing.
The digital I/O pins of the TMS320FS128 series DSP are mostly multifunctional multiplexing pins, which can be set as universal I/O functions or as peripheral control signal functions through the function selection control register GPxMUX (x is the group number of the DSP pin). If it is set as a universal I/O function, it is also necessary to set the pin direction through the direction control register GPxDIR. According to the pin connections in
Figure 1, the pins were set the corresponding functions.
The universal timer T1 was used to control the PWM signal frequency of two DC motors. In order to periodically generate PWM control signals, timer T1 in the design was set to a continuous increasing counting mode. The counting register T1CNT starts counting from 0. After each clock cycle T1CLK, the value of T1CNT increases by 1. When the value of T1CNT equals the value of cycle register T1PR, the value of T1CNT automatically resets to 0, and then the above process is repeated. Therefore, the cycle T
PWM of the PWM signal is:
The frequency of PWM signal has a significant impact on the operating characteristics of DC motors. When the PWM signal frequency is too low, the motor speed is unstable, and the motor vibration is large. When the PWM signal frequency is too high, the inductance of the armature coil of the DC motor is large, the armature current is small, the output torque of the DC motor is small, and the load capacity is poor. After extensive experiments, when the PWM frequency of this design was set to 10KHz, the motor speed run smoothly, the motor vibration was small, and the motor had good load carrying capacity. Therefore, the PWM period TPWM=0.1ms. In this design, the clock signal of timer T1 is selected as the internal clock HSPCL=75MHz, and the clock pre-scale factor is set to 1. Therefore, the counting clock period T1CLK of timer T1 is 0.0133 μ s and the register of T1PR was set 7499.
The behavior control register ACTRA of the event manager EVA controls the level status of the PWM1~PWM6 pins. According to the function of PWM
1~PWM
6 pins, the ACTRA register was set. The 3 full comparison registers CMPR
1~CMPR
3 control the duty cycle of three channels of PWM signals, respectively. The formula for calculating the duty cycle is:
where
Di is the duty cycle of the i-th channel PWM signal, CMPR
i is the value of the full comparison register of the i-th channel.
Register CMPR1 controls the duty cycle D1 of the rotation motor, register CMPR2 controls the duty cycle D2 of the feed motor when the drill moves forward, and register CMPR3 controls the duty cycle D3 of the feed motor when the drill moves backward. The initial values of these three registers are all 0.
The universal timers T2 and T4 are used to record the pulses of the rotation motor encoder and the feed motor encoder, respectively. Both timers T2 and T4 were set with directional increase/decrease mode, and the clock source is set to the QEP circuit. The universal timer T3 was used to generate an interrupt signal, generating an interrupt request signal every 1ms. The sampling period was set to 1ms, the clock signal of timer T3 selects internal clock HSPCL is 75MHz, the clock pre-scale factor was set to 128, the timer was set to increase count mode, and the cycle register T3PR of timer T3 was set to 584.
After the DSP initialization is completed, the DSP takes turns querying the button status and limit switch status, and sets the control status of the drill needle based on the button status and limiting switch status.
The timer T3 interrupt processing program is responsible for controlling the rotation speed of the rotation motor and feed motor, as well as converting and storing the resistance of the drill needle. When the drilling needle is in a forward or backward state, the rotation motor speed control module and the feed motor speed control module are called separately.
The speed control module of rotation motor calculates the real-time speed of the rotation motor based on the count value
N2 of timer T2. In the design, the encoder grating disk of the rotation motor has 1024 gratings. For each revolution of the rotation motor, the A and B pulse signals of the optoelectrical encoder 1 send 1024 pulses to the DSP respectively. The DSP counts both the rising and falling edges of the encoder’s two pulse signals A and B. Therefore, for every revolution of the rotation motor, the count value
N2 of timer T2 is 4096. The sampling period was set to 1ms, the formula for calculating the rotational speed of the rotating motor is:
where
n1 is the real-time speed of the rotation motor, measured in r/min.
The speed control module of rotation motor uses PID control algorithm[
32,
33,
34] to calculate the value of the duty cycle register CMPR
1 based on the set speed value
n0 (r/min) and real-time speed
n1.
The speed control module of feed motor calculates the real-time speed of the rotation motor based on the count value
N4 of timer T4. In the design, the encoder grating disk of the feed motor has 1000 gratings. For each revolution of the rotation motor, the A and B pulse signals of the optoelectrical encoder 2 send 1000 pulses to the DSP respectively. The DSP counts both the rising and falling edges of the encoder’s two pulse signals A and B. Therefore, for every revolution of the feed motor, the count value
N4 of timer T4 is 4000. The sampling period was set to 1ms, the formula for calculating the rotational speed of the rotating motor is:
where
n2 is the real-time speed of the feed motor, measured in r/min.
In this design, the reduction ratio
k of the reduction gear is 1:1000, the diameter
d of the driving wheel of the timing belt is 3 cm, that is, every 1000 r of the feed motor, the driving wheel of the timing belt rotates 1 r, the drill needle moves forward or backward 3 π cm. Therefore, the formula for calculating the feed speed of the drilling needle is:
where
v is the real-time speed of the drill, measured in cm/min.
The speed control module of feed motor uses PID control algorithm to calculate the value of the duty cycle register CMPR2 or CMPR3 based on the set speed value v0 (cm/min) and real-time speed v.
When the drill needle is in a forward state, it is necessary to call the drill needle resistance conversion and storage module to save the drill needle resistance value. The resistance in the rotation direction of drilling needle is directly proportional to the control voltage of the rotation motor and inversely proportional to the speed of the rotation motor. Therefore, the resistance in the rotation direction of drilling needle can be indirectly represented by the control voltage of the rotation motor after speed correction. The calculation formula is:
where
f1 is the rotation resistance of the drill, measured in V;
U is the power voltage, measured in V.
Similarly, the calculation formula for the feed resistance of the drill needle is:
where
f2 is the feed resistance of the drill, measured in V.
After the conversion of drill needle resistance is completed, the SCI serial port sending function is used to send resistance f1 and f2 to the SD card.
After extensive test, when n0 is set to 3500 r/min and v0 is set to 20 cm/min, the of the self-made micro drill resistance instrument operates normally.