1 Introduction

Over the last two decades, sensors and materials relying on the surface plasmon resonance (SPR) phenomenon have been used in several application fields, i.e., refractive index sensing [1, 2], toxin and small molecule sensing [3], food monitoring [4], clinical and molecular diagnostics [5,6,7], and environmental sensing [4, 8]. The SPR is a guided electromagnetic phenomenon that relies on a precise working principle (see Fig. 1): under a critical angle of incidence, when a light beam hits the interface between two transparent materials having at the interface a thin metallic layer, a component of the incident radiation interacts with the free electrons of the metal film, by causing them to resonate and thus generating a plasmonic wave upon the thin metal layer itself, which propagates in parallel with the metal–dielectric interface. So, since the energy possessed by the photons is fully transmitted to the electrons, a dark band in plasmonic reflectance spectra is found, which is a minimum named dip, dependent on the fixed incidence angle [9, 10].

Fig. 1
figure 1

Surface plasmon resonance (SPR) working principle schematization

When we have to deal with the SPR sensor fabrication, several parameters, such as the choice of the materials, the thickness of the deposited metal film, and the surface roughness, influence their final performance, like the sensitivity [11,12,13,14]. Among all these parameters, the surface roughness is the one that has been widely investigated in literature, because it is most affecting the sensor performance [15]. Previously, some inspections proved that a corrugated surface rather than a smooth one ensures a stronger photon-plasmon coupling, thus causing a raise in the concentration of the surface plasmon surface in proximity of the metal coating [16]. In line with this principle, Braundmeier and Arakawa [17] tried to increase the excited surface plasmon by exploiting rough metallic surfaces showing a roughness due to irregularities distributed in a random way. However, many other studies assess that a significant scattering of the light from the surface, due to a high surface roughness, negatively affects the sensor performance [18,19,20,21]. Treebupachatsakul et al. [22], who recently proposed a theoretical framework for analyzing and quantifying how the surface roughness affects the sensing performance of SPR measurements, proved that high surface roughness’ height negatively affects the figure of merit for SPR sensors.

In agreement with what has been discussed so far, the studies reported in the state-of-the-art are mainly focused on the investigation of metal layer’s roughness which, according to the main used functionalization technique, i.e., the sputter coating, has a root-mean-square (RMS) of \(1.4 {\text{nm}}\) up to \(1.5\mathrm{ nm}\) [23]. This is justified by the fact that the widest manufactured and adopted SPR sensors exploit the Kretschmann (prism-coupled) configuration and consist of glass substrate, which is basically smooth, where a metal film is deposited [24]. Today, the latter configuration is the conventional one used for both commercial and bench-top SPR sensors, since it is a simple, sensitive, and robust approach. However, it also presents an important drawback: it is not suitable for miniaturization and integration. To overcome this issue, an innovative approach relying on planar optical waveguide structure is gaining ground. Saitta et al. [25, 26] have already developed micro-structured SPR sensors exploiting a planar approach, based on inkjet 3D printing and using photocurable resins with tailored refractive index, which allowed for temperature and refractive index measurements. Since the latter proposed approach relies on a SPR sensors composed of a photocured resin substrate rather than a smooth glass one, it is of crucial importance to analyze how the surface roughness of the 3D printed part (prominent with respect to the metallic layer one) affects the developed planar optical SPR sensor. Hence, starting from the state-of-the-art status argued so far, at first, this experimental work investigated the surface roughness of the 3D printed SPR sensor through a profilometry test performed using a profilometer. Secondly, to test the stability of the surface roughness as a quality performance measure for a small batch of trial production manufactured through the selected inkjet 3D printing technique, a Phase I distribution-free quality monitoring investigation based on a recursive sequential and permutation (RS/P) procedure was exploited. Indeed, when we have to deal with the 3D printing techniques, the quality of the final product, i.e., the surface roughness, depends on many process parameters, like the orientation of the part on the building platform, the gantry velocity for positioning the printhead, and the printhead movements carried out to manufacture the desired part [27,28,29,30]. Generally, analyzing the surface quality of the 3D printed item in relation to the latter parameters is a practice performed for the FFF (Fused Filament Fabrication) and FDM (Fused Deposition Modeling) techniques. Conversely, only a few studies have been run for the inkjet 3D printing technique. All of them have been carried out with the aim to investigate how several parameters are influential on 3D printed items’ surface roughness. These are (i) layer thickness [31, 32]; (ii) build orientation [31, 33,34,35,36,37]; (iii) finish type or build style [31,32,33, 35, 37]; (iv) scale of the model [32]; (v) post-processing procedure [35]. Furthermore, none of these studies related the surface roughness measurements conducted on the 3D printed parts to their functionality. In fact, they are related to an evaluation and/or optimization of the surface finish quality for rapid prototyping. Alternatively, mechanical properties have been considered, but no mention has been made regarding the optical properties correlated to the SPR phenomenon investigated in our study.

According to what has been argued so far, the novelty of this research study consists in investigating how the surface roughness of the 3D printed sensors, which is related to their placement on the building platform of the 3D printing machine, affects theirs optical performance. More in detail, this paper aims to expand upon the outcomes of our prior work [26], in which we have proposed a new design and manufacturing strategy for a low-cost SPR sensor suitable for refractive index measurements exploiting a planar configuration. Here, we have also assessed its feasibility by using the Inkjet 3D printing technology, by achieving good performances, in terms of figure of merit (FOM), i.e., very similar to other SPR sensors made using plastic optical fibers (POFs). While, innovatively building upon our previous mentioned research, in this work we have manufactured many items through the already selected manufacturing technique. We intentionally considered different placements on the building platform with the aim to investigate the stability of the surface roughness for all sensors. This stability has been assessed by running a Phase I distribution-free quality monitoring investigation named recursive sequential and permutation (RS/P) procedure. Additionally, we have investigated how this parameter affects the fabricated SPR sensor’s performance, by leaving unchanged the previously proposed design and manufacturing approach. Thus, referring to the research [26] as the starting point, a step forward has been taken by manufacturing a small batch of trial production of planar SPR sensors on the same job by allocating them across different positions of the building platform. The purpose was to inspect how the surface roughness of the fabricated objects is affected by their position and, consecutively, by the XY-axis movements performed by the printhead machine. For our application, this kind of investigation is of paramount importance, since the inkjet 3D printing technique relies on the liquid droplet deposition on the building platform. This deposition is related to a complex physical process, because the injected droplet falls on the substrate; next, it spreads and it is subjected to retraction and oscillation phenomena [30]. Thus, it is worth investigating how the XY-axis movements of the used 3D printing machine’s printhead affect the droplet deposition process on the building platform with the intention to evaluate a possible uneven droplet distribution which, as result, causes the manufacturing of a defective device. For this reason, the fabricated SPR sensors were optically characterized to find the existing relationship between their sensitivity and the considered quality of surface finish.

The paper is organized as follows. In Sect. 2, we present the materials used to manufacture the 3D printed SPR sensor (Sub-Sect. 2.1) and the methods followed to design and manufacture the sensor (Sub-Sect. 2.2), to analyze the surface roughness of the 3D printed part through profilometry test (Sub-Sect. 2.3), and to perform quality monitoring of the 3D printed surface’s roughness using the RS/P procedure (Sub-Sect. 2.4) and the experimental setup used to test the developed SPR sensors together with the experimental campaign run to determine their performance (Sub-Sect. 2.5). The obtained results are reported in Sect. 3. In detail, the results relative to the Phase I RS/P procedure investigating quality of surface roughness are commented in Sub-Sect. 3.1, while the results regarding the optical characterization of the SPR sensors and their performance determination are discussed in Sub-Sect. 3.2. Finally, conclusions and future research directions are reported in Sect. 4.

2 Materials and methods

2.1 Materials

The SPR sensors were fabricated by using three different resins: VeroClear RGD810 (OVERMACH S.p.A., Parma, Italy), FullCure705 (OVERMACH S.p.A., Parma, Italy), and NOA88 (Edmund Optics, Nether Poppleton York, UK).

VeroClear RGD810 is an acrylic liquid photopolymer with a refractive index of \(1.531\) at \(650\mathrm{~nm}\). This resin has a heat distortion temperature (HDT) of \(45-50~^\circ {\text{C}}\), so it is stiff at room temperature. It also has a tensile modulus of \(2.5~\mathrm{ GPa}\). The Material Safety Data Sheet (SDS) shows that the resin is a complex mixture of acrylate monomers and photoactivators. The formulation was developed by Stratasys specifically for PolyJet 3D printing. The cladding of the SPR sensor was 3D printed using VeroClear RGD810 resin on a Stratasys Objet260 Connex1 3D printer (Stratasys, Los Angeles, CA, USA).

FullCure705 is the resin that was used as removable support. This resin is a mixture of acrylic liquid photopolymer; polyethylene glycol; propane-1,2-diol; and glycerol used in the printing process with the function of detachable support. Indeed, FullCure705 is simply removed by water jet after the printing process.

NOA88 is an optical clear adhesive required to fill the channels of the printed device. In fact, NOA88 serves to manufacture the optical waveguide, i.e., the core of the designed SPR sensor. NOA88 is a low-viscosity (\(250~{\text{cps}}\)) UV curing adhesive with a refractive index of \(1.56\) at \(589~\mathrm{ nm}\). The refractive index of NOA88 is precisely the key parameter that allows to obtain a POF (polymer optical fibers), as it is superior to the refractive index of the VeroClear RGD810 resin. This resin has an absorption between \(315\) and \(395~{\text{nm}}\), so it was UV cured using a universal lamp with UVA emission (\(365~{\text{nm}}\)). The Material Safety Data Sheet (SDS) for NOA88 shows a composition based on a blend of a proprietary mercapto-esters blended with triallyl isocyanurate.

2.2 SPR sensor design and manufacturing process

The design of the SPR sensor for refractive index measurements was developed starting from a previous version already proposed by the authors in another paper [26]. Hence, it consists of four assembled parts, i.e., (i) the substrate (bottom part) which contains the waveguide core: the trench filled by optical adhesive [26] (see Fig. 2a); (ii) the supports to guarantee the alignment between the input and output plastic optical fibers (POFs) with the sensor’s waveguide core (see Fig. 2b); (iii) a cover used to preserve the sensing region during the storage time (see Fig. 2c); and (iv) a customized mask properly designed to cover the waveguide core with metal nanofilms through a sputtering process (see Fig. 2d). Figure 2e shows the assembled sensor chip with its components. The process flow to manufacture the sensor and its geometry are already described in a previous paper by the authors [26].

Fig. 2
figure 2

3D-printed parts in VeroClear RGD810: substrate (a), plastic optical fiber (POF) supports (b), cover for storage (c), and mask for sputtering (d). Two different configurations, using either the mask or the cover, of the assembled SPR sensor by properly assembling all the fabricated parts (e)

Each part reported in Fig. 2 was fabricated using the PolyJet 3D printer Stratasys Objet260 Connex 1. In order to realize the waveguide core of the SPR sensor chip, a NOA88 photocurable adhesive was micro-injected within the channel shown in Fig. 2a and photocured using an universal lamp bulb with UVA emission at \(365\mathrm{ nm}\), as formerly discussed in [26].

Next, the waveguide core was properly covered by a gold nanofilm via a sputter coater machine (model CCU-010, manufactured by Safematic, Zizers, Switzerland). During the sputtering process, the mask reported in Fig. 2d was used. The deposited gold nanofilm on the core presents a thickness of \(60\, {\text{nm}}\) [26].

In this study, a step forward with respect to the aforementioned previous work [26] has been taken by 3D printing \(m=5\) different items on the same job, i.e., by allocating them across different positions of the building platform (see Fig. 3), with the aim to investigate how the surface roughness of the fabricated objects is affected by their position and, consecutively, by the XY-axis movements performed by the printhead machine, being the X-axis movements performed from left to right and vice versa, while the Y-axis ones from front to back and vice versa. Investigating the latter aspect is crucial, since the inkjet 3D printing technique relies on the liquid droplet deposition on the building platform, with a precise flow which consists of a complex physical process interesting different kinds of energies (i.e., gravitational potential, kinetic, viscous dissipation, and surface free energy) [30]. Indeed, the injected droplet falls by impacting toward the substrate, next spreads, and it is subjected to retraction and oscillation phenomena. In the-state-of-the-art, many studies have already investigated the latter behaviors for flat solid surface [38,39,40,41] because, in the field of functional additive manufacturing, the final functional device performance is strictly dependent on the final surface morphology. So, we followed this approach to investigate how the printhead’s XY-axis movements affected the droplet deposition process and to evaluate a possible uneven droplet distribution, hence causing the manufacturing of a defective device. To achieve this aim, the items were placed on the building platform in such a way to record the printhead XY-axis movements in an easy way.

Fig. 3
figure 3

Upper view schematization (a) and real picture (b) of the manufactured parts placement on the building platform

About the relationship between surface roughness and the stability of 3D printed SPR sensors for precise refractive index measurements, the SPR chip stability does not change during the RI (refractive index) measurements because the surface having the roughness of interest is coated by the sensing multilayer (optical adhesive and metal nanofilm).

2.3 Surface roughness measurements

The surface roughness for the floor of the waveguide’s channel was assessed through profilometry by using a profilometer Talyscan 150 by Taylor Hobson equipped with a direct contact probe Form Talysurf, which is an inductive meter (Fig. 4a). A scan speed of \(3000~\mathrm{\mu m}/{\text{s}}\) and \(5~\mathrm{ \mu m}\) spacing along both X and Y directions were selected to map the surfaces. The resulting profiles were analyzed with the Talymap 3D software to obtain the 3D reconstruction of the investigated surface and to estimate the roughness. In detail, due to the difficult accessibility to the sensor’s channel, an indirect measure of its floor’s roughness was carried out on the parallel upper surface of the 3D printed substrate, as indicated in Fig. 4b. It is reasonable to run such an indirect measurement of the roughness, since both the upper and floor surfaces of the waveguide’s channel are the latest layers jetted and photocured by the printhead. The coordinate observations of roughness \({y}_{jk}\) of \(m=5\) SPR sensors have been collected by splitting their upper surface into \(a=8\) different areas \({A}_{jk}\) with \(j=1,\dots ,a\) and \(k=1,\dots ,m\), as illustrated in Fig. 4c. Each investigated area has a size of \(5.5 \times 3~\mathrm{ m}{{\text{m}}}^{2}\). For each area, \(i=1\) observation has been collected.

Fig. 4
figure 4

Surface roughness measurements run using a profilometer Talyscan 150 by Taylor Hobson (a) on the upper surface of the 3D-printed surface (b) and by analyzing \(a=8\) different areas of size \(5.5\times 3~{{\text{mm}}}^{2}\) (c)

Then, the following measures of surface roughness have been calculated for each investigated area \({A}_{jk}\):

  1. (i)

    Roughness average \({R}_{{a}_{jk}}\) (see Fig. 5a)—it is the arithmetic average of the absolute values of the roughness profile ordinates. It provides a good general description of the height variations in the surface.

  2. (ii)

    Root mean square roughness \({R}_{{q}_{jk}}\) (see Fig. 5b)—it is the root mean square average of the roughness profile ordinates.

  3. (iii)

    Roughness \({R}_{{z}_{jk}}\) (see Fig. 5c)—it is the distance between two lines parallel to the average line passing between the five highest peaks (\({Z}_{p1},{Z}_{p2}, {Z}_{p3}, {Z}_{p4},{Z}_{p5}\)) and the five lowest valleys (\({Z}_{v1},{Z}_{v2}, {Z}_{v3}, {Z}_{v4},{Z}_{v5}\)), within the limits of the base length. Next, to calculate the \({R}_{z}\) parameter, the average absolute height (\({Z}_{p}\)) of the five highest peaks and the average absolute height \(({Z}_{v})\) of the five deepest valleys, both measured from the mean line, are considered. These two values are then summed.

  4. (iv)

    Roughness \({R}_{{t}_{jk}}\) (see Fig. 5d)—it is the sum of the maximum peak height (\({Z}_{p}\)) and the maximum measurement of the deepest valley (\({Z}_{v}\)) in the evaluation length (\(5.5~{\text{mm}}\)).

Fig. 5
figure 5

Schematization of the \({R}_{a}\) (a), \({R}_{q}\) (b), \({R}_{z}\) (c), and \({R}_{t}\) (d) calculation

More insights related to the four different calculated and investigated parameters of surface roughness are reported in the sub-section S1.1. Supplementary materials: Surface Roughness Measurements.

2.4 Quality control of the 3D printed surface’s roughness

The quality of the manufactured SPR sensors is measured by their surface measures of roughness, as it significantly influences their performance. To test the stability of surface roughness for all sensors, a Phase I distribution-free quality monitoring investigation has been carried out by running a recursive sequential and permutation (RS/P) procedure proposed by Capizzi and Masarotto [42]. The advantage related to implementing this procedure is that it does not require any preliminary knowledge about the distribution of roughness observations. The RS/P procedure allows process changepoints (CPs) either in location and/or scale of the observed parameter to be detected. A changepoint in process location (scale) is an undesired shift occurring to the median (dispersion) the measures of roughness observations. All the available SPR sensors have been controlled for quality. Being a Phase I retrospective study, all the surface roughness measures collected for each manufactured SPR sensor have been investigated by accounting for each sensor location on the 3D printing build platform and the time order of production, which is defined by the movement of the printing head. In the absence of process changepoints, the RS/P procedure confirms the 3D printing process stability with respect to the sensor surface quality. A flow chart of the quality control procedure is shown in Fig. 6.

Fig. 6
figure 6

Flow chart of the implemented Phase I RS/P quality monitoring procedure

Quality control of SPR sensors has been carried out as follows:

  • Step 1. Definition of the items order of production and their placement on the building platform. To check the stability of the observed roughness for each SPR sensor’s surface, the order of production of the 3D printed parts and their placement on the building platform are recorded. The XY movements of the printhead above the building platform to manufacture each 3D printed part are schematized in Fig. 7. An identification number is assigned to each part placed on the building platform, as shown in Fig. 3.

  • Step 2. Presence of outliers. The presence of one or more isolated outlier measures of roughness should be investigated and any identified outlier point should be removed to obtain a clean dataset of the collected observations: thus, the Grubb statistical test can be implemented for the purpose. The results are discussed in the sub-section S1.2. Supplementary materials: Quality Control.

  • Step 3. Recursive segmentation and permutation (RS/P) analysis. For each sensor, the measures of roughness are calculated within each area \({A}_{jk}\) with \(j=1,\dots ,a\) and \(k=1,\dots ,m\). Then, the RS/P method is implemented on each measure of roughness by means of the dfphaseI package made available on R (R Development Core Team (2012)) from Capizzi and Masarotto [42]. If the RS/P procedure does not reveal any changepoint in the process, then it is possible to get reliable estimates of each measure of surface roughness of the SPR sensors. Otherwise, further investigation is needed to understand why the process performance deteriorated. The presence of one or more process changepoints should be investigated to look for the assignable causes leading to a shift in the location and/or scale. First of all, it is necessary to identify the observation where the process changepoint has been triggered by the RS/P procedure. The shift can occur either within a sensor, i.e., among adjacent areas on the same part, or between sensors. In the first case, the root cause could be restricted locally to the area interested by the shift. In the second case, clusters of parts can be identified according to their position within the 3D printing machine working volume, thus revealing a more complex problem related to the 3D printing process.

  • Step 4. Multiple comparison test. If the number of process changepoints between parts is \({\text{CPs}} > 1\), then a multiple comparison test (if the observations are normally distributed), or a non-parametric test (if the observations are not normally distributed), is run to identify clusters of parts. This step of the proposed method is pivotal to identify the effect of each item’s location above the build plate on the surface roughness quality.

  • Step 5. Root cause identification and solution proposal. Based on quality monitoring performed above, a root cause identification is required to solve issues related to the location of the 3D printed SPR sensors during the 3D printing process.

Fig. 7
figure 7

Sequence of the printhead XY movements to manufacture items #1 and #2 (a), #3 (b), #4 and #5 (c)

The statistical analyses proposed in the procedure described so far were performed by using both the R and Minitab® software.

2.5 Polymer-based SPR sensor: experimental setup and experimental characterization

The conceived SPR sensor was tested using an experimental setup based on a spectral mode configuration: (i) a halogen lamp as white light source (model HL-2000-LL, manufactured by Ocean Optics, Dunedin, FL, USA) having an emission range between \(360\) and \(1700~\mathrm{ nm}\); (ii) two patches of plastic optical fibers (POFs) of \(1~\mathrm{ mm}\) of total diameter size (with a core of PMMA), which were used to illuminate the waveguide core of the SPR sensor chip and to collect the transmitted light at the output; and (iii) a spectrometer connected to a laptop (model FLAME-SVIS-NIR-ES, manufactured by Ocean Optics, Dunedin, FL, USA) with a detection range from \(350\) up to \(1023~{\text{nm}}\). The entire experimental setup is shown in Fig. 8.

Fig. 8
figure 8

Picture of the experimental setup for 3D printed surface plasmon resonance (SPR) sensors

To evaluate if there is any interaction between the location on the 3D printer’s building platform of the manufactured sensors and their surface’s roughness and if there is any interaction between the latter parameter (surface’s roughness) and the SPR sensor performance, expressed as bulk sensitivity, several liquids with different refractive indices are used to obtain the sensor sensitivity for each 3D-printed sensor with different surface roughness (a total of \(5\), see Sub-Sect. 2.4.).

In detail, to carry out the bulk solutions useful to test the SPR sensors, several mixtures of water-glycerine characterized by different refractive index values \((n)\), ranging between \(1.332\) and \(1.383\), were used as surrounding medium for the gold nanofilm deposited upon the polymer waveguide. For each used mixture, the exact refractive index value was previously determined with an Abbe refractometer (Model RMI, Exacta + Optech GmbH, Munich, Germany).

In the end, in order to compare the performances of the sensors with different surface roughness, the bulk sensitivity was determined (\({S}_{n}\)). The latter parameter was evaluated by considering the shift in resonance wavelength per unit change in the refractive index of the bulk (\({S}_{n}=\Delta \lambda /\Delta n\)).

3 Results and discussion

3.1 Quality control

In this section, the obtained results from the Phase I RS/P retrospective study are commented. More details for each step of the carried out analysis are provided in the sub-section S1.2. Supplementary materials: Quality Control. At first, since the measures of roughness are correlated in pairs per investigated item, i.e., \({R}_{a}\) is correlated with \({R}_{q}\) and \({R}_{z}\) is correlated with \({R}_{t}\), (see the matrix plot on Fig. 9), for the sake of brevity, the Phase I analysis has been carried out only on \({R}_{a}\) and \({R}_{z}\).

Fig. 9
figure 9

Matrix plot of the collected measures for \({R}_{a}\), \({R}_{q}\), \({R}_{z}\), and \({R}_{t}\)

The Phase I control charts obtained by implementing the RS/P procedure are shown in Figs. 10 and 11 for the \({R}_{a}\) and \({R}_{z}\) measurements, respectively. According to the RS/P analysis outcome, two changepoints, i.e., a shift in the location (p-value \(= 0.004 < 0.05\), at point #14) and in the scale (p-value \(= 0.018 < 0.05\), at point #15), have been identified for the \({R}_{a}\) parameter (see Fig. 10). Similarly, even for the parameter \({R}_{z}\), two changepoints in location (p-value \(= 0 < 0.05\), at point #16) and scale (p-value \(= 0 < 0.05\), at point #16) have been identified 9 see Fig. 10).

Fig. 10
figure 10

Phase I RS/P procedure for the \({R}_{a}\) measurements: location chart (upper panel) and scale chart (lower panel)

Fig. 11
figure 11

Phase I RS/P procedure for the \({R}_{z}\) measurements: location chart (upper panel) and scale chart (lower panel)

The obtained results reveal a between-part instability affecting the manufacturing process, since two changepoints occur between parts #2 and #3 and between parts #4 and #5 for both \({R}_{a}\) and \({R}_{z}\) (see Figs. 10 and 11). Therefore, the 3D printed items can be clustered together in terms of surface roughness: cluster 1, including sensors #1 and #2; cluster 2, including sensors #3 and #4; and finally, cluster 3, consisting of item #5. For each cluster, the estimated mean (µ) and standard deviation (σ) values for \({R}_{a}\) and \({R}_{z}\) are reported in Table 1.

Table 1 Estimated mean value µ and standard deviation σ for Ra and Rz determined for each cluster

The obtained results show that the item position on the building platform affects the measures of roughness \({R}_{a}\) and \({R}_{z}\). Looking at the estimated means for \({R}_{a}\) and \({R}_{z}\) (dotted lines in Figs. 10 and 11), they look very similar between the cluster 1 of items #1 and #2 and cluster 3, including item #5. Therefore, two-sample hypothesis tests have been considered to decide if clusters 1 and 3 can be merged. Normality of the \({R}_{a}\) and \({R}_{z}\) observations from the two clusters has been checked by means of an Anderson–Darling test (p-value \(> 0.05\)), as shown in Figure S4 and Figure S5 in the Supplementary materials. Then, a F-test has been carried out to assume equal variances between the two considered clusters (p-value \(> 0.05\)). Finally, a t-test for the difference in the means has been performed. The obtained results for each test are shown in Tables 2 and 3 for the measures of roughness \({R}_{a}\) and \({R}_{z}\), respectively.

Table 2 F-test and the t-test between clusters 1 and 3 for the \({R}_{a}\) measure of roughness
Table 3 F-test and the t-test between clusters 1 and 3 for the \({R}_{z}\) measure of roughness

According to the results shown in Tables 2 and 3, both the cluster mean and variance of the measure of roughness \({R}_{a}\) for items #1 and #2 (cluster 1) are not statistically different from the item #5 (cluster 3), (p-values > 0.05). Thus items #1, #2, and #5 can be considered belonging to the same cluster with an estimated \({R}_{a}\) value of \(0.93\pm 0.02~\mu {\text{m}}\). Conversely, items #3 and #4 must be considered part of a different cluster, with an estimated specification \({R}_{a}\) equal to about \(1.21\pm 0.05~\mu {\text{m}}\). A similar outcome was found for the measure of roughness \({R}_{z}\). Indeed, the tests proved that items #1, #2, and #5 are part of the same cluster with a \({R}_{z}\) value of \(9.05\pm 0.33~\mu {\text{m}}\). Conversely, items #3 and #4 belong to a different cluster having an estimated \({R}_{z}\) value equal to \(19.77\pm 1.34~\mu {\text{m}}\).

An explanation to this issue can be found by making a point about the item’s placement on the building tray of the 3D printing machine, which is linked to the XY-axis movements performed by the printhead to fabricate each item. Indeed, to manufacture the first cluster of items, i.e., #1, #2, and #5, just a one-direction motion (along X-axis) is required (see Fig. 7a and c). Conversely, to build the second cluster of items, that is, #3 and #4, a combination of motions along two different directions (i.e., along X-axis and along Y-axis) is performed (see Fig. 7b and c, respectively). This means that the rate of positioning of the printhead is not fully commensurate to the rate of material jetting from the inkjet nozzle when fast movements along the two perpendicular directions (X-axis and Y-axis) are necessary to manufacture a 3D printed part. The latter situation is attributed to the fast printhead movements which cause its motors to skip steps, so bringing to a loss of accuracy. A similar issue was already pointed out for the FDM 3D printing technique. Indeed, Go et al. [27] have highlighted that when the actuators are commanded beyond their maximum speed and/or acceleration, stepper motors result to be driven without feedback, so receiving movement commands beyond their operating performance range and causing the motors to skip steps resulting in loss of accuracy in turn. The latter explanation provided for the FDM technique fits well even with the findings made in our study. Indeed, the mechatronic movement system, named gantry, which has the task to convert rotational motion into linear one to move the printhead along the toolpath imposed by the G-code to create motion X-axis and Y-axis movement, is the same both in FDM and inkjet 3D printing techniques. Basically, it relies on the use of servo motor, belts and pulleys. In detail, two belts are used, one for each axis (X and Y), as shown in Fig. 12 for the Stratasys Objet260 Connex1 3D printer used in our study.

Fig. 12
figure 12

X-axis (a) and Y-axis  (b) belts of the Stratasys Objet260 Connerx1 3D printer’s gantry system

The explanation proposed here is justified by the 3D surface reconstruction for both the two clusters, which are shown in Fig. 13, respectively. It is evident from panels (a), (b), and (e) that the distribution of both the peaks and valleys is more uniform when only a one-direction movement along the X-axis is required to realize the 3D printed part. Indeed, while for the cluster of items #1, #2, and #5 the reconstructed morphology follows and confirms the deposition of droplets by the printhead injection (see Fig. 13a, b, and e), a surface characterized by uneven droplet distribution with thin irregular spikes is revealed for items #3 and #4 (Fig. 13c and d), which in the end causes a higher surface roughness.

Fig. 13
figure 13

3D surface reconstruction for the investigated areas: \({A}_{17}\), item #1 (a); \({A}_{22}\) item #2 (b); \({A}_{22}\) item #3 (c); \({A}_{22}\) item #4 (d); \({A}_{53}\) item #5 (e)

3.2 Optical characterization of SPR sensors

The obtained results from the experimental characterization of the SPR sensors belonging to each identified cluster of production are reported in this section.

Figure 14a shows the experimentally determined SPR spectra for the 3D printed item #1. The SPR spectra are obtained by normalizing the transmitted spectra acquired with different solutions to the reference spectrum (acquired with air as the surrounding external medium). It must be highlighted that the higher the refractive index of the water-glycerine solution, the higher the SPR wavelength. By using the spectra reported in Fig. 14a and b reports for the 3D printed item #1 the wavelength resonance variations (\(\Delta \lambda\)), calculated with respect to water (\(n=1.332\)), versus the refractive index along with the linear fitting of the experimental data.

Fig. 14
figure 14

Experimentally determined SPR spectra for the 3D printed item #1: (a) SPR spectra at different refractive index value. (b) Resonance wavelength variation (\(\Delta \lambda\)), calculated with respect to water (\(n = 1.332\)), along with the linear fitting of the experimental data

The functional relationship existing between \(\Delta \lambda\) and the refractive index (\(n\)), which was experimentally determined for the item #1, is reported below:

$$\Delta {\lambda }^{(1)}= {\beta }_{0}^{(1)}+{\beta }_{1}^{(1)}{n}^{(1)}$$
(1)

being each term expressed in Table 4 both in terms of estimated value and standard error.

Table 4 Experimentally determined coefficients of Eq. (1): estimated values and standard errors

In a similar way, for the 3D printed item #4, Fig. 15a shows the experimentally determined SPR spectra obtained at different refractive index values, whereas the resonance wavelength variation (\(\Delta \lambda\)) versus the refractive index is reported in Fig. 15b along with the linear fitting of the experimental data.

Fig. 15
figure 15

Experimentally determined SPR spectra for the 3D printed item #4: (a) SPR spectra at different refractive index values. (b) Resonance wavelength variation (Δλ), calculated with respect to water (n = 1.332), along with the linear fitting of the experimental data

The functional relationship existing between \(\Delta \lambda\) and the refractive index (\(n\)), which was experimentally determined for the item #4, is reported below:

$$\Delta {\lambda }^{(4)}= {\beta }_{0}^{(4)}+{\beta }_{1}^{(4)}{n}^{(4)}$$
(2)

being each term expressed in Table 5 both in terms of estimated value and standard error.

Table 5 Experimentally determined coefficients of Eq. (2): estimated values and standard errors

The sensors’ sensitivities (\({S}_{n}\)) can be estimated by evaluating the first derivative of the obtained linear fittings for both tested items #1 and #4; thus, they correspond to the slopes of the fitted lines.

According to the obtained results, it must be highlighted that the SPR sensor characterized by a higher value of roughness (item #4) presented a sensitivity equal to \(779~{\text{nm}}/{\text{RIU}}\) within the investigated refractive index interval (ranging between \(1.33\) and \(1.38\)). Conversely, the SPR sensor characterized by a lower value of roughness (item #1) presented a sensitivity of \(712~\mathrm{ nm}/{\text{RIU}}\) within the investigated refractive index interval (ranging between \(1.33\) and \(1.38\)). The comparison between the linear responses of the SPR sensors items #1 and #4 (fitted lines reported in Figs. 14b and 15b) is also reported in Fig. 16.

Fig. 16
figure 16

Comparison between linear responses of items #1 and #4 in terms of the resonance wavelength variation (Δλ), calculated with respect to water (n = 1.332), versus refractive index value (linear fittings of the experimental data Fig. 14b and Fig. 15b)

In the case of SPR sensors based on multimodal optical waveguides, like the one presented in this work, the propagated light produces several angles/wavelengths that excite the SPR phenomena. Therefore, the SPR dips at different bulk solutions (\(1.33-1.38\)) are a convolution of several peaks, each for one specific propagated mode in the waveguide (thus, to a specific angle of incidence) [37]. More specifically, the angles associated with higher-order modes are the most sensitive to the SPR phenomena. Hence, by opportunely exciting a high number of modes by exploiting the scattering of the roughness, the SPR bulk sensitivity (in terms of bulk refractive index variation) results increased at the expense of a worsening of the signal-to-noise ratio [37]. So, when the surface roughness changes, the guided light is differently scattered by changing the number of modes in the guided light and the SPR phenomena. In particular, when the roughness increases, the scattering of the guided light increases, and the SPR sensitivity improves. This aspect in the bulk sensitivity (the enhancement due to the higher-order modes) is evident when the bulk presents high refractive indices (in an RI range between \(1.35\) and \(1.38\)) [30], as shown also in Fig. 16.

The obtained results allowed to find a way to optimize the performance of the developed SPR sensor (i.e., its sensitivity) within a precise operative range of refractive index values to be measured by properly arranging the placement of the 3D printed parts on the building platform with the aim to modulate its surface roughness.

4 Conclusions

In this work, a polymer-based SPR sensor was designed and manufactured via an inkjet 3D printing technique, in line with a manufacturing approach already proposed by the authors [26]. Next, with the aim to understand how the surface roughness of the 3D printed sensor affects its performance, a surface finish quality assessment was performed through a profilometry test. A Phase I distribution-free quality monitoring investigation based on a recursive segmentation and permutation RS/P procedure revealed that the surface quality (i.e., the surface roughness expressed by measures \({R}_{a}\) and \({R}_{z}\)) for a pilot production run of sensors strictly depends on the placement of the 3D printed parts on the building platform. In fact, according to the RS/P analysis outcome, different changepoints, i.e., shifts in the location and in the dispersion (p-value \(< 0.05\)), have been found for both the investigated \({R}_{a}\) and \({R}_{z}\) parameters. The identified root cause to these results is related to the fact that the distribution of the peaks and valleys in the parts’ surface is more uniform when only a one-direction movement of the printhead along X-axis is necessary to build them. Conversely, XY-axis movements during the fabrication process lead to a surface characterized by uneven droplet distribution with thin irregular spikes. Thus, two different clusters of items were identified based on their surface quality. In particular, \({R}_{a}\) was equal to \(0.93\pm 0.02~\mu {\text{m}}\) and \({R}_{z}\) was equal to \(9.05\pm 0.33~\mathrm{\mu m}\) for the first identified cluster of items (sensors #1, #2, and #5). While, \({R}_{a}\) was equal to about \(1.21\pm 0.05~\mu {\text{m}}\) and \({R}_{z}\) was equal to \(19.77\pm 1.34~\mu {\text{m}}\) for the second cluster of items (sensors #3 and #4).

Next, the optical characterization of SPR sensors showing different surface roughness properties was carried out by using several liquids with different refractive index values (ranging between \(1.332\) to \(1.383\)) as the surrounding medium for the gold nanofilm deposited upon the polymer waveguide. The aim was to relate the optical performances expressed as bulk sensitivity (\({S}_{n}=\Delta \lambda /\Delta n\)) to the surface roughness of the 3D printed sensors. The obtained results unveiled that a higher bulk sensitivity \(({S}_{n})\), equal to \(779~{\text{nm}}/{\text{RIU}}\), is achieved when they are characterized by a higher surface roughness, i.e., for the second identified cluster of items, for the investigated interval of refractive index values. Conversely, a lower bulk sensitivity \(({S}_{n})\), equal to \(712~n{\text{m}}/{\text{RIU}}\), is obtained for lower values of surface roughness. So, a higher bulk sensitivity \(({S}_{n})\) for the developed SPR sensor is attained when higher values of surface roughness are achieved, in a similar way to the SPR sensors based on light-diffusing fibers [30]. Based on these findings, it is suggested to arrange the 3D printed parts’ placement on the building platform with the aim of properly controlling the surface roughness by setting up sacrificial items in precise positions of the building platform. In this way, the needed performance to achieve precise operative condition will be guaranteed. Furthermore, the findings of this paper are encouraging to investigate the development of new strategies within the field of functional additive manufacturing to improve the surface roughness of SPR sensors by exploiting tailoring procedure on a micro- and nanoscale. In detail, the control on the micro-scale can be achieved through the 3D printing process itself, while at the nanoscale, it can be attained by using a proper functionalization processes by growing nanostructures suitable for the purpose.