# Deflection Modeling and Curvature Manipulation of a Variable-Stiffness Flexible Needle
## 3 Results
### Effect of Needle Stiffness on Puncture Trajectory  
Before the experiments, the actual distance between the pixel points in the picture needed to be determined. We took a photo with a straightedge placed vertically next to the flexible needle and processed the image in MATLAB R2021b. This allowed us to calculate the actual distance corresponding to adjacent pixel points, which was found to be 0.0172 mm. Note that the origin of the pixel coordinate system is in the upper-left corner of the original photo, which is not conveniently marked here. Punctures were performed at extension lengths of 0 mm, 2 mm, 4 mm, 6 mm, and 8 mm, respectively, at a puncture speed of 4 mm/s and an advance length of 100 mm. Extraction results of needle punctures in 20 wt% gelatin at an extension length of 2 mm are exhibited in Figure 9a-c, and the deflection extraction steps are as follows:  
Figure 8: Experimental setup of puncture system. Figure 9: Needle punctures in 20 wt% gelatin. (**a**) Interception area of the needle with an extension length of 2 mm. (**b**) Binarized image of the needle. (**c**) Curve-fitted image of the needle. (**d**) Comparison of bending deflections of needles with different extension lengths. The insertion point was captured in MATLAB R2021b and the region within 300 px \(\times\) 650 px was intercepted, as demonstrated in Figure 9a. 2. Binarization was performed with a threshold of 0.6 to extract the flexible needle, as in Figure 9b. 3. Discrete points were fitted to minimize data loss during extraction and to remove shadow interference caused by gelatin damage. The curves after second-order Fourier fitting are plotted in Figure 9c. The pixel values of the needle entry point and tip point (as marked in Figure 9a) were extracted in MATLAB R2021b to obtain the deflection of the three flexible needles. The deflection can be calculated by \((y_{entry}-y_{tip})*d_{p}\), where \(y_{entry}\) and \(y_{tip}\) are the y-coordinate of entry pixel point and tip pixel point, and \(d_{p}=0.0172\) mm is the actual distance corresponding to the adjacent pixel points. Five sets of punctures were made at each extension length. The deflections in 20 wt%, 15 wt%, and 10 wt% gelatin are listed in Tables 3-5 and plotted in Figure 10.  
In Equation (15), the deflections are in a cubic relationship with the stylet extension length. The degree of the curve-fitted polynomial is set to 3, which is the same as in the theoretical model. The fitted equations for the deflections in 10%, 15%, and 20% gelatin are \(y=0.008732x^{3}+8.152,R^{2}=0.9981;y=0.01315x^{3}+14.87,R^{2}=0.997;y=0.01648x^{3} +18.17,R^{2}=0.9908\). It can be seen that as the mass fraction increases, both the cubic term coefficient and the initial deflection in the fitted equations increase. This can be attributed to the increase in transverse force acting on the needle tip, resulting in greater needle deflection. The fitted curves exhibit a high degree of accuracy in matching the data points and effectively describe the relationship between deflection and stylet length, which aligns with the theoretical analysis. Compared to the linear relationship obtained by [PERSON] et al. [17], our cubic relationship has a better fit, offering a more accurate representation of the relationship between the deflection and the control offset. From Table 3, deflection consistency is better when the stylet is extended for a shorter length than when it is extended for a longer length. The reasons for the errors may be as follows:  
1. The increase in temperature of the gelatin affected its mechanical properties, even though the air conditioner had been set to 25 \({}^{\circ}\)C.
2. Entry points and tip points are collected manually, which inevitably leads to errors. 3. Feed errors were caused by motor vibration, motor temperature rise, low speed friction, etc. This effect is more pronounced with thin rods. This can be a key factor that leads to larger standard deviation at an extension length of 8 mm. However, these errors are acceptable.