# Improved Capacitive Proximity Detection for Conductive Objects through Target Profile Estimation

Authors: Fan Xia; Umme Zakia; Carlo Menon; Behraad Bahreyni
Journal: Journal of Sensors
 (2019)

---

## Abstract

The accuracy of a capacitive proximity sensor is affected by various factors, including the geometry and composition of the nearby object. The quantitative regression models that are used to seek out the relationship between the measured capacitances and distances to objects are highly dependent on the geometrical properties of the objects. Consequently, the application of capacitive proximity sensors has been mainly limited to detection of objects rather than estimation of distances to them. This paper presents a capacitive proximity sensing system for the detection of metallic objects with improved accuracy based on target profile estimation. The presented approach alleviates large errors in distance estimation by implementing a classifier to recognize the surface profiles before using a suitable regression model to estimate the distance. The sensing system features an electrode matrix that is configured to sweep a series of inner-connection patterns and produce features for profile classification. The performance of the sensing modalities is experimentally assessed with an industrial robot. Two-term exponential regression models provide a high degree of fittings for an object whose shape is known. Recognizing the shape of the object improved the regression models and reduced the close-distance measurement error by a factor of five compared to methods that did not take the geometry into account. The breakthroughs made through this work will make capacitive sensing a viable low-cost alternative to existing technologies for proximity detection in robotics and other fields.


---

## Body

## 1. Introduction

The demand for industrial robots has accelerated considerably due to the ongoing trend toward automation and continued innovative technical improvements in industrial robots within the past decade. Despite significant advances in the field of automation, human intelligence is superior in terms of reasoning, comprehension, vision, and ingenuity. Robots and humans present complementary features for the development of manufacturing processes; therefore, the close cooperation of human and machine is highly demanded [1]. A great deal of attention has been paid to the human workers’ safety as collisions between the worker and the robotic manipulators can be extremely dangerous. The data on industrial robot-related fatalities indicate that safety remains a major concern, especially because the human operators are by necessity physically close to mechanical arms or vehicles [2]. One highlighted approach that modifies the robot’s trajectory based on safety zones or separation distances has shown its superiority in practical applications. In this technique, nonintrusive sensors for distance measurement and localization are critical.Among the different types of available proximity sensors, the capacitive sensors are appealing for industrial human-robot interaction applications due to their capability of detecting the presence of most obstacles with large coverage and accurately measuring small gaps with fast response [3]. Sensors used for safety applications should have a long detection range and high accuracy in order to secure proper response before colliding with nearby objects. A capacitive warning system developed in [4] can apply the brake and turn off the chainsaw to avoid the harmful effects at a distance up to 15 cm. The electrode field sensing method is also used in [5] to provide a sense of “pretouch” for a grasping system. In this work, multiple capacitive sensors were used so that the robotic hand could be guided from a distance up to about 12 cm. However, these systems are not able to provide an accurate distance estimation; thus, a more intelligent control of the robot cannot be achieved.Alternatively, some passive capacitive sensing systems were designed for estimating the human’s location. Platypus, proposed in [6], was claimed as the first system to localize and identify people remotely and passively. By using a 6-sensor array covering an area of 2 m by 2.5 m, their system demonstrated a localization error of 16 cm and identification accuracy of 75% for 30 users. Another passive human positioning system described in [7] was based on measuring the capacitance between multiple floor tiles and a receiving electrode. It can locate a standing person with 15 cm accuracy and track a walking human with 41 cm accuracy. Though with a large detection range and high accuracy, the large electrode areas and low speed limit the application of these systems in human-robot interaction fields.A major challenge for capacitive sensors is the nonlinear response that makes the extraction of useful information from measurements a difficult computational problem. Moreover, the geometrical parameters of an approaching object and the environmental interferences will add additional unknown contributions to the capacitive responses.Models that determine continuous properties are physically motivated. An approach for continuous 3D finger and hand localization problems with capacitive sensors was explained in [8]. Random decision forests were used in their system for regression. However, their device suffered from environmental interferences and limited detection range. In addition, the applications of proximity sensors always involve more than one detected state, so classifiers are frequently used. A Support Vector Machine (SVM) is one of the most frequently used methodologies for extracting information from sensing data as it can handle both linear tasks and more complex problems [9]. Laput et al. used SVM for touch recognition of uninstrumented, electrical, and electromechanical objects [10]. Across the 24 classes, SVM achieved an overall accuracy of 97.9% and 18 out of 24 tested objects reached the accuracy of 100%. SVM was also used in capacitive fingerprinting for user differentiation [11]. For single finger touches, the SVM yielded an all-pair average accuracy of 97.3%, while in distinguishing between users performing a variety of gestures, the achieved average accuracy was 97.8%.Explorations on the design of a tri-mode capacitive proximity sensor have been demonstrated previously in [12]. This work is aimed at improving the accuracy of distance measurements by alleviating the issue of ambiguity due to an object profile. The focus of this work is on the detection of a nearby metallic object which is a common situation in various human-robot interaction domains. This is particularly important on factory floors where such sensors are needed to improve worker safety. The proposed capacitive proximity sensing system inherently involves inferring information from measured data, either continuously (i.e., for estimating the human’s position) or discretely (i.e., for recognizing the shape of the object). We employ a classifier to identify the shape of an approaching object in conjunction with a library of regression models to improve the distance measurement accuracy.


## 2. Materials and Methods

The general term electric field sensing is used to refer to a family of noncontact measurements that can be made with slowly varying electric fields [13]. Some of these measurements are lumped together under the rubric “capacitive sensing,” in which a low-frequency voltage signal is applied to the transmit electrode. A displacement current flows from the transmitter to receivers through the mutual capacitors between them. Optimal hardware design and sensing configurations rely on a good understanding of fundamental principles and trade-offs.A two-electrode measurement setup, as depicted in Figure1(a), is adopted as the basic architecture of this work. It is a three-terminal measurement where neither the transmitter nor the receiver is in contact with the object [14]. If the electric field distribution is mapped using N-independent electrodes, there will be NN−1 measurements resulting in 1/2NN−1-independent mutual capacitance values due to the symmetrical capacitance matrix. Moreover, single electrode-pair measurements can be combined with multiplexing methods allowing parallel access to multiple transmitters/receivers at the same time. In the context of the applications where the designed sensor should be fitted onto a piece of a working garment, the electrode matrix area is restricted to 6.5cm×6.5cm. A 4×4 electrode matrix yielding 16 independent electrodes (see Figure 1(b)) is used as it meets the functional requirements with an acceptable complexity. In addition, a grounded backplane is placed underneath the sensor substrate to avoid the undesired detection from the backside. A 4×4 electrode array is added between the ground and the top electrodes. These electrodes, whose individual dimensions are slightly larger than those on the top surface and are centred below them, are driven with the same drive signal (after a buffer) that is applied to the sense electrodes. This active shield will push the electric field from the sense electrodes to the space above them, significantly improving the detection range of the sensor [12].Figure 1
(a) Detection of an object that interferes with electric field distribution between electrodes and (b) block diagram of the sensing system.
(a)
(b)In order to implement different electrode configurations and extract the capacitive responses, the proximity sensing system composes five building blocks as depicted in Figure1(b). The 4×4 electrode matrix together with its active shielding electrode array and the grounded backplane constitute the core sensing section. Two analog switch arrays are used for physical connections within sensing and active shielding matrices. A digital controlling module is mapped on a field programmable gate array (FPGA) to create the required signals to program the switch arrays. A capacitance-to-digital converter measures the capacitive responses and digitizes the data. Finally, a personal computer (PC) is used to collect and process the data.The designed sensor has 16 independent electrodes, providing many possible configurations to generate the fringing electric fields so that multiple functionalities can be realized with the same sensing platform. The performance of the array-structured proximity sensor typically depends on the number and arrangement of electrodes that form the transmitter and receiver. In our previous work, three electrode-connecting types that result in comb-structure, adjacent two-rectangular configuration, and two-edge patterns have been investigated [12]. According to Ye et al., electrodes with a spiral shape perform well in terms of dynamic range and sensitivity distribution homogeneity compared to those with the other shapes [15]. In this work, electrodes are connected as a symmetric structure, depicted in Figure 2(a), to mimic the spiral shape. Each letter in Figure 2(a) represents the electrical destination of the electrode, i.e., “T” for transmitter, “R” for receiver, and “G” for grounded connections. Electrodes labeled by the same letter are shorted to each other.Figure 2
Electrode configuration for distance measurement. “T”: transmitter; “R”: receiver. (a) Four central electrodes are shorted to each other to form the transmitter, and all the rest electrodes are connected to work as the receiver. The generated capacitor is C0. (b) Cross-section view of the electric field formed by the electrode matrix. The larger the spatial wavelength (λ), the farther the electric field penetrates to the space and the longer the detection range can be achieved.
(a)
(b)For distance measurement, the excitation signal is applied to the transmitters, i.e., the middle four electrodes, resulting in the mutual capacitance C0. The generated electric field is demonstrated in Figure 2(b). Penetration depth is a parameter that indicates how quickly the electrical field weakens with the distance [16]. A greater penetration depth will lead to a longer detection range. The depth that the electric field penetrates to the space is roughly proportional to the spatial wavelength λ, which is defined as the distance between two consecutive electrodes of the same polarity [17]. This electrode configuration provides two different spatial wavelengths, and the capacitive response is correlated with the distance.One challenge of using capacitive sensors is that they are susceptible to shape and size of the object: a small object that is close to the sensor might result in the same response as a larger object at a further distance [18]. This confusion makes it difficult to infer high-resolution information from the measured capacitances. Therefore, surface profile recognition is required to improve the accuracy in distance evaluation.For the purpose of distinguishing different object shapes, more detailed information is required. The electrode matrix is programmed to form different distributed proximity sensors so that the nearby surroundings can be monitored by sweeping these electrode configurations.The acquired capacitance values constitute the inputs of classification tools for profile recognition. Management of electrode sweeping modes plays an essential role in determining the shape information. The key point in reconstructing the desired obstacles is to distinguish the differences in terms of sensor responses among different circumstances. Two different sweeping approaches to mesh the close surroundings are proposed and examined in this work.The first approach scans eight mutual capacitors C1 to C8 as described in Figure 3. The electric fields between adjacent columns and adjacent rows are generated by selecting one column/row of electrodes as the transmitter and a neighbouring column/row of electrodes as the receiver. That results in the first six matrices in Figure 3. Six individual capacitors are formed, and the nearby space can be well meshed along the X-Y plane. Moreover, to reduce the obscurity brought by objects with symmetrical appearance, two more capacitors between diagonal electrodes (i.e., C7 and C8 in Figure 3) are also measured. In this attempt, every single sweeping cycle of the sensor measures eight independent capacitors or features.Figure 3
Sweeping pattern I that scans eight mutual capacitors C1 to C8. Electrode fields are generated between two adjacent columns/rows (C1-C6) as well as diagonal electrodes (C7 and C8). “G”: grounded connection.The inspiration for the second approach comes from the spiral-shaped connection structure: the electric field propagates from four neighbouring electrodes in every direction and terminates on the rest electrodes. The environment around the sensor can be meshed comprehensively when employing this mode to the whole sensing matrix as demonstrated in Figure4. Each of the nine connection patterns generates multiple electric fields resulting in different spatial wavelengths and different penetration depths. By combining the capacitive responses (CI to CIX) from each sweeping cycle and using proper classifiers, the surface profile of the nearby object can be estimated.Figure 4
Sweeping pattern II that measures nine mutual capacitors CI to CIX. The generated electrode fields emit from the four neighbouring electrodes (connected as the transmitter) in every direction and fall to all the rest electrodes (collected as the receiver).


### 2.1. Operation Flow

Distance estimation, the primary task for this work, is quantitative. The desired results take on numerical values making it a regression problem. The method is to build a regression model, which is a prediction equation that enables predicting response for given inputs with small errors [19]. A series of experiments are conducted in order to gather the required data to create regression models for objects with specific shapes. The actual shape of an object is approximated by a simple geometric shape that is easier to process. A plate, sphere, and cylinder are selected as representatives for the most frequently encountered shapes in an industrial working space. The experimental process is moving the selected object continuously from 1 cm to 20 cm away from the sensor and recording the values of the capacitor C0. The regression model is then built by using the measured capacitances as inputs and the corresponding distances as outputs. Consequently, a library that contains three prediction equations corresponding to the selected geometries is created.Regression provides an effective way to deduce the distance information from measured capacitances. However, picking the proper regression model depends on the perception of the object’s shape. The task of profile recognition is qualitative: the variables being predicted (i.e., different shapes) are discrete rather than continuous. Therefore, classification tools are used to take over this job. In order to provide enough information for shape recognition, the inputs of the classifiers are the combinations of the capacitances obtained from electrode configuration sweeping. These inputs are experimentally acquired by placing the objects at different locations within the detectable range and collecting capacitive responses generated by the sweeping patterns in Figures3 and 4. The classifier output is a best estimate for the shape of the object (i.e., plate, sphere, or cylinder). The data is used for supervised training of the classifiers with the raw inputs and preknown targets.The previous two steps, namely, building the regression model library and training the classifier, are completed offline before using the sensing system in real applications. In practice, when an object enters the detection range, the sensor is programmed to work in the scanning mode to determine the most probable shape information. Then, the sensor is switched to the spiral-shaped electrode connection to measure the capacitive responses caused by the approaching object. Lastly, the distance is calculated by selecting the proper regression model according to the object’s profile. The operation flow of the presented sensing system is demonstrated in Figure5.Figure 5
Operation flow for improved distance measurement. First, create separate regression models for all the objects with experimental data (total capacitance is shown at the top, but several sweeping patterns are generated per measurement). When an object appears, use a classifier to recognize its surface profile based on one of the two sweeping patterns. Lastly, select the proper regression model depending on the classification result for advanced distance estimation.


### 2.2. Data Processing

The goal of data processing is to obtain desired information from raw measurement results. Such a process is inherently interactive and iterative [20]. Preparing input data and selecting the most suitable classifiers are carried out with attention to the problem domain.Data from capacitive proximity sensors is suseptible to internal and external parasitics, environmental interferences, noise, and potentially other error sources. Therefore, preprocessing of the data, including cleaning, normalization, and integration, is the foremost step before running the analysis [21].The environmental interferences add both high-frequency noise and low-frequency random walks to the capacitive response. The data cleaning process is to remove noise and correct for drift in the “dirty” raw dataset. More specifically, a DC notch filter (to eliminate slow environmental changes such as humidity and temperature variations) together with a low-pass averaging filter with the cut-off frequency of 20 Hz (to reduce high-frequency noise and interference) was used to compensate these nonideal effects. Additional details and implementation can be found in [12].One intermediate step between collecting raw measured capacitive values and applying the statistical learning tools is scaling the data. This step is important and almost required for most learning algorithms because scaling can avoid attributes in greater numeric ranges dominating those in smaller numeric ranges. In addition, it can also avoid numerical difficulties during the calculation. The applied method is linearly rescaling the range of all the input data to the range of−1,+1. Given the maximum capacitive value Cmax and the lower bound Cmin, a normalized value is calculated from CN=2×C−Cmin/Cmax−Cmin−1.The final step for preparing the input datasets is data integration that merges data from multiple measurements. Every scanned capacitor has its contribution to reconstructing the profile of a nearby object, so all the capacitances acquired by one complete sweeping cycle are combined together as one single input which can be referred to as a “feature vector.” For the first approach that measures eight mutual capacitors as depicted in Figure3, the generated feature vectors are eight-dimensional (i.e., {C1, C2, …, C8}), whereas the second scanning method, as explained in Figure 4, results in nine-dimensional feature vectors (i.e., {CI, CII, …, CIX}).Interpreting the experimental results requires the analysis of complex, multivariate, and multidimensional data. One approach that has grown popularity is the use of machine learning algorithms to train classifiers to decode behaviors and information of interest from the experimental data [22]. Thanks to the efficient pattern recognition performance for the nonlinear multiclass scenarios, Support Vector Machines (SVM), a kernel-based learning method, are adopted in this work [23].Originally developed for binary classification problems, SVM uses maximal margin hyperplanes to define decision boundaries separating data points of different classes. The equation of a linear decision surface is(1)w0Tx+b0=0,where x is the input feature vector and w0 and b0 are the optimal weight vector and bias, respectively. The discriminant function is expressed as
(2)gx=w0Tx+b0,and provides an algebraic measure of the geometric distance from any x to the optimal hyperplane [24]. The input x can be described through
(3)x=xp+rw∣w0∣,where xp is the normal projection of x onto the optimal hyperplane and r is the algebraic distance such that r is positive when xi belongs to the class of +1 and negative otherwise.Given the datasetx,l where l is the target class, parameters w0,b0 must satisfy the following constraints:
(4)w0Tx1+b0≥0,forli=+1,w0Tx1+b0≤0,forli=−1.The particular training data points for which one of the constraints is satisfied with the equality sign are the “support vectors.” Maximizing the margin of separation between classes is equivalent to minimizing the Euclidean norm of the weight vectorw. This distinct property makes the SVM an effective tool in pattern recognition applications. The previous equations describe the foundation of SVM that classifies a binary problem which can be linearly separated. For more complex tasks, Gaussian kernel [25] is a reasonable first choice. This kernel function nonlinearly maps samples into a higher dimensional space allowing it to handle the cases where the relationship between class labels and inputs is nonlinear. The linear function is a special case of the Gaussian kernel.The problem in this study requires the discrimination for more than two categories. So SVM is extended so that it can be suitable for more general cases where an arbitrary number of classes is important. Among all the proposals for modifying the SVM to theK-class case, the two most popular approaches are the “one versus one” (1V1) and “one versus rest” (1VR) [26]. The 1V1 approach is a pairwise decomposition. It evaluates all possible pairwise classes and therefore constructs KK−1/2 individual binary classifiers. Applying each classifier to a test sample will generate one vote to the winning class. The data point will be assigned to the class with the most votes. By contrast, the 1VR approach only constructs K separate binary classifiers for the K-class problem. Each time, one class is compared to all the remaining classes as a whole. The ith classifier is trained using the data from the ith class as positive examples and all the other data as negative samples. During testing, the class label is determined by the classifier that results in the maximum output value. It is noteworthy that there is no clear evidence that the 1V1 method can achieve higher accuracy compared to alternative multiclass SVM methods, but Hsu and Lin argue that 1V1 is more practical due to its faster training process [27].The core structure of the presented sensing system together with the complementary electronics is fabricated on a four-layer printed circuit board (PCB). The top three layers of the PCB serve as carriers for the4×4 electrode matrix, active shielding matrix, and backplane shielding. The analog switch array chips (AD75019 from Analog Devices) and required electronic components including bypass capacitors and resistors are fabricated on the bottom side. The FPGA board adopted in this work is the Terasic DE1 board featuring the ALTERA Cyclone II 2C20 FPGA device. In addition, an AD7746 CDC chipset is acquired to measure the capacitors, quantize the capacitances, and exhibit results in terms of both capacitive values and digital strings via a standard communication interface. The sampling rate it can achieve is 90.9 Hz.The performance and behavior of the designed capacitive sensing system were investigated with an industrial robot KUKA LBR iiwa. The robot is a lightweight robot with a 7-axis jointed arm. All drive units and current-carrying cables are installed inside the robot so that it can autonomously move and transport objects. It has the capability of orienting itself independently in its surroundings and moving into positions for automation tasks with millimeter precision [28].Ideally, the test objects would be electrically grounded during the system operation. However, to better resemble the actual working conditions during the experiments, the objects were isolated electrically from the robot or the circuitry (i.e., electrically floating).


## 2.1. Operation Flow

Distance estimation, the primary task for this work, is quantitative. The desired results take on numerical values making it a regression problem. The method is to build a regression model, which is a prediction equation that enables predicting response for given inputs with small errors [19]. A series of experiments are conducted in order to gather the required data to create regression models for objects with specific shapes. The actual shape of an object is approximated by a simple geometric shape that is easier to process. A plate, sphere, and cylinder are selected as representatives for the most frequently encountered shapes in an industrial working space. The experimental process is moving the selected object continuously from 1 cm to 20 cm away from the sensor and recording the values of the capacitor C0. The regression model is then built by using the measured capacitances as inputs and the corresponding distances as outputs. Consequently, a library that contains three prediction equations corresponding to the selected geometries is created.Regression provides an effective way to deduce the distance information from measured capacitances. However, picking the proper regression model depends on the perception of the object’s shape. The task of profile recognition is qualitative: the variables being predicted (i.e., different shapes) are discrete rather than continuous. Therefore, classification tools are used to take over this job. In order to provide enough information for shape recognition, the inputs of the classifiers are the combinations of the capacitances obtained from electrode configuration sweeping. These inputs are experimentally acquired by placing the objects at different locations within the detectable range and collecting capacitive responses generated by the sweeping patterns in Figures3 and 4. The classifier output is a best estimate for the shape of the object (i.e., plate, sphere, or cylinder). The data is used for supervised training of the classifiers with the raw inputs and preknown targets.The previous two steps, namely, building the regression model library and training the classifier, are completed offline before using the sensing system in real applications. In practice, when an object enters the detection range, the sensor is programmed to work in the scanning mode to determine the most probable shape information. Then, the sensor is switched to the spiral-shaped electrode connection to measure the capacitive responses caused by the approaching object. Lastly, the distance is calculated by selecting the proper regression model according to the object’s profile. The operation flow of the presented sensing system is demonstrated in Figure5.Figure 5
Operation flow for improved distance measurement. First, create separate regression models for all the objects with experimental data (total capacitance is shown at the top, but several sweeping patterns are generated per measurement). When an object appears, use a classifier to recognize its surface profile based on one of the two sweeping patterns. Lastly, select the proper regression model depending on the classification result for advanced distance estimation.


## 2.2. Data Processing

The goal of data processing is to obtain desired information from raw measurement results. Such a process is inherently interactive and iterative [20]. Preparing input data and selecting the most suitable classifiers are carried out with attention to the problem domain.Data from capacitive proximity sensors is suseptible to internal and external parasitics, environmental interferences, noise, and potentially other error sources. Therefore, preprocessing of the data, including cleaning, normalization, and integration, is the foremost step before running the analysis [21].The environmental interferences add both high-frequency noise and low-frequency random walks to the capacitive response. The data cleaning process is to remove noise and correct for drift in the “dirty” raw dataset. More specifically, a DC notch filter (to eliminate slow environmental changes such as humidity and temperature variations) together with a low-pass averaging filter with the cut-off frequency of 20 Hz (to reduce high-frequency noise and interference) was used to compensate these nonideal effects. Additional details and implementation can be found in [12].One intermediate step between collecting raw measured capacitive values and applying the statistical learning tools is scaling the data. This step is important and almost required for most learning algorithms because scaling can avoid attributes in greater numeric ranges dominating those in smaller numeric ranges. In addition, it can also avoid numerical difficulties during the calculation. The applied method is linearly rescaling the range of all the input data to the range of−1,+1. Given the maximum capacitive value Cmax and the lower bound Cmin, a normalized value is calculated from CN=2×C−Cmin/Cmax−Cmin−1.The final step for preparing the input datasets is data integration that merges data from multiple measurements. Every scanned capacitor has its contribution to reconstructing the profile of a nearby object, so all the capacitances acquired by one complete sweeping cycle are combined together as one single input which can be referred to as a “feature vector.” For the first approach that measures eight mutual capacitors as depicted in Figure3, the generated feature vectors are eight-dimensional (i.e., {C1, C2, …, C8}), whereas the second scanning method, as explained in Figure 4, results in nine-dimensional feature vectors (i.e., {CI, CII, …, CIX}).Interpreting the experimental results requires the analysis of complex, multivariate, and multidimensional data. One approach that has grown popularity is the use of machine learning algorithms to train classifiers to decode behaviors and information of interest from the experimental data [22]. Thanks to the efficient pattern recognition performance for the nonlinear multiclass scenarios, Support Vector Machines (SVM), a kernel-based learning method, are adopted in this work [23].Originally developed for binary classification problems, SVM uses maximal margin hyperplanes to define decision boundaries separating data points of different classes. The equation of a linear decision surface is(1)w0Tx+b0=0,where x is the input feature vector and w0 and b0 are the optimal weight vector and bias, respectively. The discriminant function is expressed as
(2)gx=w0Tx+b0,and provides an algebraic measure of the geometric distance from any x to the optimal hyperplane [24]. The input x can be described through
(3)x=xp+rw∣w0∣,where xp is the normal projection of x onto the optimal hyperplane and r is the algebraic distance such that r is positive when xi belongs to the class of +1 and negative otherwise.Given the datasetx,l where l is the target class, parameters w0,b0 must satisfy the following constraints:
(4)w0Tx1+b0≥0,forli=+1,w0Tx1+b0≤0,forli=−1.The particular training data points for which one of the constraints is satisfied with the equality sign are the “support vectors.” Maximizing the margin of separation between classes is equivalent to minimizing the Euclidean norm of the weight vectorw. This distinct property makes the SVM an effective tool in pattern recognition applications. The previous equations describe the foundation of SVM that classifies a binary problem which can be linearly separated. For more complex tasks, Gaussian kernel [25] is a reasonable first choice. This kernel function nonlinearly maps samples into a higher dimensional space allowing it to handle the cases where the relationship between class labels and inputs is nonlinear. The linear function is a special case of the Gaussian kernel.The problem in this study requires the discrimination for more than two categories. So SVM is extended so that it can be suitable for more general cases where an arbitrary number of classes is important. Among all the proposals for modifying the SVM to theK-class case, the two most popular approaches are the “one versus one” (1V1) and “one versus rest” (1VR) [26]. The 1V1 approach is a pairwise decomposition. It evaluates all possible pairwise classes and therefore constructs KK−1/2 individual binary classifiers. Applying each classifier to a test sample will generate one vote to the winning class. The data point will be assigned to the class with the most votes. By contrast, the 1VR approach only constructs K separate binary classifiers for the K-class problem. Each time, one class is compared to all the remaining classes as a whole. The ith classifier is trained using the data from the ith class as positive examples and all the other data as negative samples. During testing, the class label is determined by the classifier that results in the maximum output value. It is noteworthy that there is no clear evidence that the 1V1 method can achieve higher accuracy compared to alternative multiclass SVM methods, but Hsu and Lin argue that 1V1 is more practical due to its faster training process [27].The core structure of the presented sensing system together with the complementary electronics is fabricated on a four-layer printed circuit board (PCB). The top three layers of the PCB serve as carriers for the4×4 electrode matrix, active shielding matrix, and backplane shielding. The analog switch array chips (AD75019 from Analog Devices) and required electronic components including bypass capacitors and resistors are fabricated on the bottom side. The FPGA board adopted in this work is the Terasic DE1 board featuring the ALTERA Cyclone II 2C20 FPGA device. In addition, an AD7746 CDC chipset is acquired to measure the capacitors, quantize the capacitances, and exhibit results in terms of both capacitive values and digital strings via a standard communication interface. The sampling rate it can achieve is 90.9 Hz.The performance and behavior of the designed capacitive sensing system were investigated with an industrial robot KUKA LBR iiwa. The robot is a lightweight robot with a 7-axis jointed arm. All drive units and current-carrying cables are installed inside the robot so that it can autonomously move and transport objects. It has the capability of orienting itself independently in its surroundings and moving into positions for automation tasks with millimeter precision [28].Ideally, the test objects would be electrically grounded during the system operation. However, to better resemble the actual working conditions during the experiments, the objects were isolated electrically from the robot or the circuitry (i.e., electrically floating).


## 3. Results and Discussion

To verify the distance measurement capability and the shape classification feature, a series of prototypical experiments are conducted. The established apparatus and the experimental setup are illustrated in Figure6. The robot is programmed to perform predefined movements on the attached object, and the value d which represents the distance from the object to the sensor can be controlled with high accuracy. Three metallic objects, namely, a plate, a ball, and a cylinder, are used as actual instances of the three shapes of interest. The size of the plate is 16cm×13cm, the diameter of the ball is 6.5 cm, and the radius and the length of the cylinder are 1.5 cm and 10 cm, respectively. During the experiments, the plate was brought towards the electrode at different inclination angels. The ball and cylinder were positioned at different lateral and vertical positions above the electrode array. The cylinder was brought in at different in-plane angles (parallel to the electrode array). With all these variations in positioning and relative angles, the objective was to improve the accuracy of distance estimation from the electrode array to the closest point on the object by taking into account the object geometry regardless of approaching angles or lateral position of the object relative to the electrode array.Figure 6
Experimental setup with an industrial robot. The electrode matrix is controlled by the FPGA to accomplish desired configurations, the robot is programmed to move the attached object based on predefined trajectories, and the capacitances are measured and quantified by the CDC. Three aluminum objects are a plate, a ball, and a cylinder.


### 3.1. Shape Recognition

The shape recognition is achieved by performing a series of dynamic experiments and using SVM as the classifier [29]. The classification accuracy is examined with respect to the electrode sweeping pattern.The dynamic experiment is about automatically sweeping the inner electrode configurations while moving one of the objects to nine different locations. At each location, the object is held by the robot for a short period of time allowing 100 times of the complete sweeping cycle. For the first scan pattern, each sweeping cycle measures eight mutual capacitors as described in Figure3, and the capacitive responses from one complete cycle can be fused to one eight-dimensional feature vector {C1, C2, …, C8}. Similarly, the second sweeping method results in nine-dimensional feature vectors {CI, CII, …, CIX} as shown in Figure 4. Consequently, two datasets, each containing 27×100 feature vectors, are acquired for classification. Dataset I, obtained with the first scan pattern, is composed of eight-dimensional feature vectors. Whereas the feature vectors in Dataset II are nine-dimensional. Each dataset is further split into two parts: one contains 18×100 feature vectors to train the SVM classifier and the rest 9×100 feature vectors are used for testing.The test accuracy is determined by two kernel function parameters: cost parameter (β) and gamma (γ). It is not known beforehand which combination of the two parameters will lead to the best result for a specific problem. Consequently, a parameter search procedure is done separately on both datasets. Growing sequences of β and γ are tried for training the model, and the identified most efficient parameter pair is the one that leads to the highest testing accuracy. The involved values of β and γ for the grid search are the same: 0.5, 1, 2, 3, 4, and 5. The classification accuracies with respect to the cost parameter and gamma are summarized in Table 1. For both datasets, the testing accuracy starts from 66.67% when β and γ are both small. With the increase in the parameters, Dataset I shows its superiority: the classification accuracy reaches 100% when the value of either β or γ extends 2. That indicates for this specific task, and using Dataset I as the input for SVM is able to classify the capacitive responses to desired shape categories. After performing this classification step, the determined shape information is used for selecting the proper regression model.Table 1
SVM testing accuracy with a grid search for cost parameter and gamma (%).
β
γ
0.5
1
2
3
4
5
Dataset I: inputs are 8-dimensional based on sweeping mode I (Figure3)
0.5
66.67
66.67
66.67
66.67
82.33
96.22
1
66.67
66.67
82.33
100
100
100
2
66.67
82.33
100
100
100
100
3
66.67
100
100
100
100
100
4
82.33
100
100
100
100
100
5
82.33
100
100
100
100
100
Dataset II: inputs are 9-dimensional based on sweeping mode II (Figure4)
0.5
66.67
66.67
66.67
66.67
66.67
69.67
1
66.67
66.67
66.67
75.56
82.67
82.67
2
66.67
66.67
82.67
82.67
82.67
82.67
3
66.67
75.56
82.67
82.67
82.67
82.89
4
66.67
82.67
82.67
82.67
82.67
82.67
5
69.67
82.67
82.67
82.89
82.67
82.67


### 3.2. Distance Estimation

The distance is measured with respect to the three objects so that the regression model library can be built. The distance range of interest in this work is 1 cm to 20 cm.The implementation of the measurement can be divided into three steps: Configure the inner connection of the electrode matrix to be spiral-shaped by programming the FPGA board. Then, the robot moves one of the objects from 1 cm to 20 cm away from the surface of the sensor at a constant speed. The capacitive responses are recorded at the same time. Lastly, the acquired capacitances and their corresponding distance values are used to generate the desired regression model. This procedure is repeated for the other two objects so that three regression models are created.The raw experimental capacitive samples for the three objects are plotted with black dots in Figures7(a)–7(c). Note that the capacitance measured between the electrode groups decreases as the objects approached the electrode array. This is due to the fact that at closer distances some of the current from the driven electrodes will flow to the grounded metal object that was used. Fitted curves that stand for the mathematical formulas describing the relationship between a capacitance and its corresponding distance are denoted by the red lines. In this case, two-term exponential regression models are adopted to provide a high degree of fittings. “High degree” indicates the model has a small random error component and takes as much proportion of variance into account so that it is more useful for prediction. From the statistical point of view, the sum of squared errors of prediction (SSE) that measures the total deviation of the response values from fit values should be close to 0 and the coefficient of determination (R-squared or R2) be close to 1 [30]. The regression model expressions together with corresponding coefficients and goodness indices (i.e., SSE and R2) are also denoted in the figures.Figure 7
(a) Measured raw capacitive responses and the fitting curve for the plate. (b) Measured raw capacitive responses and the fitting curve for the sphere. (c) Measured raw capacitive responses and the fitting curve for the cylinder. (d) A comparison of capacitive responses for the three objects. An example of the calculation of the absolute and relative errors caused by using the wrong regression model is demonstrated.
(a)
(b)
(c)
(d)Based on the analysis of the regression models, they can provide predictions on the distance with high confidence under the condition that the shape of the approaching object is preknown. However, when comparing the data acquired by different objects, it can be discovered that both the absolute capacitive values and the changing rates are different. To eliminate the error caused by drift, an offset cancelling procedure is performed: the plate’s asymptotic capacitance, measured when the plate is put infinitely far from the sensor (50 cm in this work as the capacitances stop changing), is taken as a reference. Then, shift the capacitance vs. distance curves of the other two objects to the same ending point by adding or subtracting a constant. The experimental capacitances after offset cancelling as functions of distances for the three objects are summarized in Figure7(d). From which, it can be observed that the same capacitance value can result in very different distance values without knowledge of the object’s shape. This fact will lead to a decreased distance evaluation accuracy or even a wrong detection.A more precise analysis of the distance errorsed is demonstrated in Figure 7(d). Use the capacitive responses measured with the plate as references, and feed the capacitances to the three regression models to predict the distances d′P for the plate, d′Sp for the sphere, and d′Cy for the cylinder. At a certain distance, the estimation of the distance error ed can be calculated as the absolute difference between the predicted distance d′ and the actual distance d. To get a clearer vision on how the distance error would affect the measurement accuracy, the relative error with respect to the distance ed/d is also calculated. The relative errors at few different discrete distances are plotted with the bars in Figure 8, and the numerical absolute errors in millimeters are also provided. For the plate, the proper regression model has been selected so that the estimation errors are small: ed is less than 1 cm when the distance is below 10 cm. The increase in error with the distance is due to the worsening of the signal-to-noise ratio for the measurements and is limited to 25%. However, the same model would result in significantly larger errors when applied to the other objects, especially in short distances (i.e., less than 5 cm) such that the uncertainty in the measurements is comparable to the actual distances (i.e., the relative errors are around 100%). However, at short ranges, a higher detection accuracy is in fact needed in most applications, hence necessitating profile recognition.Figure 8
Relative errors for the three objects using the regression model for the plate as the reference. Bar labels are the numerical absolute error at that point.


## 3.1. Shape Recognition

The shape recognition is achieved by performing a series of dynamic experiments and using SVM as the classifier [29]. The classification accuracy is examined with respect to the electrode sweeping pattern.The dynamic experiment is about automatically sweeping the inner electrode configurations while moving one of the objects to nine different locations. At each location, the object is held by the robot for a short period of time allowing 100 times of the complete sweeping cycle. For the first scan pattern, each sweeping cycle measures eight mutual capacitors as described in Figure3, and the capacitive responses from one complete cycle can be fused to one eight-dimensional feature vector {C1, C2, …, C8}. Similarly, the second sweeping method results in nine-dimensional feature vectors {CI, CII, …, CIX} as shown in Figure 4. Consequently, two datasets, each containing 27×100 feature vectors, are acquired for classification. Dataset I, obtained with the first scan pattern, is composed of eight-dimensional feature vectors. Whereas the feature vectors in Dataset II are nine-dimensional. Each dataset is further split into two parts: one contains 18×100 feature vectors to train the SVM classifier and the rest 9×100 feature vectors are used for testing.The test accuracy is determined by two kernel function parameters: cost parameter (β) and gamma (γ). It is not known beforehand which combination of the two parameters will lead to the best result for a specific problem. Consequently, a parameter search procedure is done separately on both datasets. Growing sequences of β and γ are tried for training the model, and the identified most efficient parameter pair is the one that leads to the highest testing accuracy. The involved values of β and γ for the grid search are the same: 0.5, 1, 2, 3, 4, and 5. The classification accuracies with respect to the cost parameter and gamma are summarized in Table 1. For both datasets, the testing accuracy starts from 66.67% when β and γ are both small. With the increase in the parameters, Dataset I shows its superiority: the classification accuracy reaches 100% when the value of either β or γ extends 2. That indicates for this specific task, and using Dataset I as the input for SVM is able to classify the capacitive responses to desired shape categories. After performing this classification step, the determined shape information is used for selecting the proper regression model.Table 1
SVM testing accuracy with a grid search for cost parameter and gamma (%).
β
γ
0.5
1
2
3
4
5
Dataset I: inputs are 8-dimensional based on sweeping mode I (Figure3)
0.5
66.67
66.67
66.67
66.67
82.33
96.22
1
66.67
66.67
82.33
100
100
100
2
66.67
82.33
100
100
100
100
3
66.67
100
100
100
100
100
4
82.33
100
100
100
100
100
5
82.33
100
100
100
100
100
Dataset II: inputs are 9-dimensional based on sweeping mode II (Figure4)
0.5
66.67
66.67
66.67
66.67
66.67
69.67
1
66.67
66.67
66.67
75.56
82.67
82.67
2
66.67
66.67
82.67
82.67
82.67
82.67
3
66.67
75.56
82.67
82.67
82.67
82.89
4
66.67
82.67
82.67
82.67
82.67
82.67
5
69.67
82.67
82.67
82.89
82.67
82.67


## 3.2. Distance Estimation

The distance is measured with respect to the three objects so that the regression model library can be built. The distance range of interest in this work is 1 cm to 20 cm.The implementation of the measurement can be divided into three steps: Configure the inner connection of the electrode matrix to be spiral-shaped by programming the FPGA board. Then, the robot moves one of the objects from 1 cm to 20 cm away from the surface of the sensor at a constant speed. The capacitive responses are recorded at the same time. Lastly, the acquired capacitances and their corresponding distance values are used to generate the desired regression model. This procedure is repeated for the other two objects so that three regression models are created.The raw experimental capacitive samples for the three objects are plotted with black dots in Figures7(a)–7(c). Note that the capacitance measured between the electrode groups decreases as the objects approached the electrode array. This is due to the fact that at closer distances some of the current from the driven electrodes will flow to the grounded metal object that was used. Fitted curves that stand for the mathematical formulas describing the relationship between a capacitance and its corresponding distance are denoted by the red lines. In this case, two-term exponential regression models are adopted to provide a high degree of fittings. “High degree” indicates the model has a small random error component and takes as much proportion of variance into account so that it is more useful for prediction. From the statistical point of view, the sum of squared errors of prediction (SSE) that measures the total deviation of the response values from fit values should be close to 0 and the coefficient of determination (R-squared or R2) be close to 1 [30]. The regression model expressions together with corresponding coefficients and goodness indices (i.e., SSE and R2) are also denoted in the figures.Figure 7
(a) Measured raw capacitive responses and the fitting curve for the plate. (b) Measured raw capacitive responses and the fitting curve for the sphere. (c) Measured raw capacitive responses and the fitting curve for the cylinder. (d) A comparison of capacitive responses for the three objects. An example of the calculation of the absolute and relative errors caused by using the wrong regression model is demonstrated.
(a)
(b)
(c)
(d)Based on the analysis of the regression models, they can provide predictions on the distance with high confidence under the condition that the shape of the approaching object is preknown. However, when comparing the data acquired by different objects, it can be discovered that both the absolute capacitive values and the changing rates are different. To eliminate the error caused by drift, an offset cancelling procedure is performed: the plate’s asymptotic capacitance, measured when the plate is put infinitely far from the sensor (50 cm in this work as the capacitances stop changing), is taken as a reference. Then, shift the capacitance vs. distance curves of the other two objects to the same ending point by adding or subtracting a constant. The experimental capacitances after offset cancelling as functions of distances for the three objects are summarized in Figure7(d). From which, it can be observed that the same capacitance value can result in very different distance values without knowledge of the object’s shape. This fact will lead to a decreased distance evaluation accuracy or even a wrong detection.A more precise analysis of the distance errorsed is demonstrated in Figure 7(d). Use the capacitive responses measured with the plate as references, and feed the capacitances to the three regression models to predict the distances d′P for the plate, d′Sp for the sphere, and d′Cy for the cylinder. At a certain distance, the estimation of the distance error ed can be calculated as the absolute difference between the predicted distance d′ and the actual distance d. To get a clearer vision on how the distance error would affect the measurement accuracy, the relative error with respect to the distance ed/d is also calculated. The relative errors at few different discrete distances are plotted with the bars in Figure 8, and the numerical absolute errors in millimeters are also provided. For the plate, the proper regression model has been selected so that the estimation errors are small: ed is less than 1 cm when the distance is below 10 cm. The increase in error with the distance is due to the worsening of the signal-to-noise ratio for the measurements and is limited to 25%. However, the same model would result in significantly larger errors when applied to the other objects, especially in short distances (i.e., less than 5 cm) such that the uncertainty in the measurements is comparable to the actual distances (i.e., the relative errors are around 100%). However, at short ranges, a higher detection accuracy is in fact needed in most applications, hence necessitating profile recognition.Figure 8
Relative errors for the three objects using the regression model for the plate as the reference. Bar labels are the numerical absolute error at that point.


## 4. Conclusions

In this paper, a capacitive proximity sensing system with improved distance measurement accuracy is presented. Shunt detecting mode is used in combination with the4×4 electrode matrix to provide more informative and flexible measurements. Statistical tools are employed for interpreting the experimental capacitive responses: quantitative regression models are built to seek out relationships between capacitances and distances while the SVM classifier is trained to recognize the surface profile of the approaching object. Different electrode sweeping patterns are implemented and compared in terms of classification accuracy.The performance of the sensing modalities is experimentally assessed with an industrial robot and three objects with different shapes. The relative distance estimation error is limited to 25% under the condition that the proper regression model is selected. Otherwise, the errors can be competitive to the actual distance. The SVM classifier recognized the shape of an object with high accuracy. The classification result is used to choose the most suitable regression model with high confidence. The next step will be involving more objects to enrich the regression model library and collecting data with random locations to generalize the training dataset.It is possible to expand the capabilities of the system so that one may obtain additional information regarding the nearby objects. For instance, if impedances over a range of frequencies are measured instead of capacitance values at a single frequency, it will be possible to deduce permittivity and conductance information for a nearby object. This additional information, however, would require new hardware with phase-sensitive measurements at different frequencies and collection of suitable training data from different objects and materials.The sensor system operated robustly against slow environmental disturbances with tests producing reliable results over a span of several weeks after the collection of training data. This was in part done through removal of the contributions of slow changes by filtering out near DC signals. However, if the operating environment is significantly different from the test setup (e.g., all objects are grounded), the system can be retrained using data collected from the environment.



---

*Source: 3891350-2019-09-08.xml*