Adaptive SNN for Anthropomorphic Finger Control

Anthropomorphic hands that mimic the smoothness of human hand motions should be controlled by artificial units of high biological plausibility. Adaptability is among the characteristics of such control units, which provides the anthropomorphic hand with the ability to learn motions. This paper presents a simple structure of an adaptive spiking neural network implemented in analogue hardware that can be trained using Hebbian learning mechanisms to rotate the metacarpophalangeal joint of a robotic finger towards targeted angle intervals. Being bioinspired, the spiking neural network drives actuators made of shape memory alloy and receives feedback from neuromorphic sensors that convert the joint rotation angle and compression force into the spiking frequency. The adaptive SNN activates independent neural paths that correspond to angle intervals and learns in which of these intervals the rotation the finger rotation is stopped by an external force. Learning occurs when angle-specific neural paths are stimulated concurrently with the supraliminar stimulus that activates all the neurons that inhibit the SNN output stopping the finger. The results showed that after learning, the finger stopped in the angle interval in which the angle-specific neural path was active, without the activation of the supraliminar stimulus. The proposed concept can be used to implement control units for anthropomorphic robots that are able to learn motions unsupervised, based on principles of high biological plausibility.


Introduction
In the biological world, information is processed using impulses or spikes that provide living creatures with the ability to be aware of the surrounding environment and to act accordingly. For most of the aspects of life, they still outperform conventional, state-of-theart, robots in terms of speed and energy efficiency [1]. Modelling the motor skills of the human hand and fingers represents a challenging task in robotics, due to the smoothness and diversity of natural motions. The design of control devices for such robotic hands should be based on modelling the behaviour of motor neural areas (MNA) and their bidirectional communication with the muscles. The natural MNA stimulates the muscles through efferent neural pathways that include the motor cortex and the central pattern generators. In the opposite direction, the MNA receives information from spindles about the muscle stretch during relaxation [2] through afferent pathways, and from the Golgi tendon organs during contraction [3]. Considering that the frequency generated by the spindles increases with the muscle stretch by an external force [4], the spindle output can be used to determine the rotation angle of articulation. However, this function cannot be applied when the muscle contracts, because the spindle response to acceleration dominates their response during a passive stretch [5]. When the muscles contract, the Golgi organs respond to the force applied to the tendons, providing information about the muscle activity [6]. Physiological evidence shows that the spindle response is stronger during adaptation tasks, implying that the spindle activity is affected during learning [7,8]. The detailed mechanisms that provide the basal ganglia with the ability to coordinate automatic movements and to adapt were presented in a recent study [9].
Starting from physiological principles and taking into account the increased interest in robotic control using adaptive spiking neural networks (SNNs) [1], in this paper, we present a biologically plausible structure of spiking neurons that is able to control the rotation of a robotic junction and adapt to custom angles of rotation. Note that the goal of this paper is to demonstrate the proposed concept using a reduced number of electronic neurons and not to reproduce the complexity of the biological neural structures in the basal ganglia [9].
The spiking neural network is based on an artificial neuron model of biological inspiration implemented in analogue hardware [10,11]. Electronic circuits represent a better alternative to model the behaviour of biological neurons because this neuromorphic hardware has the main advantages of the natural neurons, such as fully parallel operation and information transmission. Moreover, the variation of internal signals in an infinite range allows the implementation of very complex functions using a reduced number of neurons. Besides these physical similarities between the natural neurons and their electronic models, the latter benefit from very low power consumption and high reliability.
To achieve the smoothness and accuracy of natural motions, artificial muscles should mimic the behaviour of muscular fibres. Thus, in this work, the artificial muscles are implemented with shape memory alloy (SMA) wires that actuate by contraction, as do biological muscles [12][13][14], and their contraction strength can be determined directly by the frequency of the electronic spiking neurons [15,16]. The results reported previously [17] show that, despite the slowness and nonlinearity of SMA wires [18], a small SNN with a bioinspired structure [19] is able to control the rotation angle of a SMA-actuated robotic joint when the arm moves towards target positions. In that case, the spiking neural network behaves as a regulator for the rotation angle, even when the arm is slightly loaded. Moreover, a similar SNN structure can be used as a regulator for the force of SMA actuators when a force sensor (FS) replaces the angle sensor (AS) [20].

Related Works
Research done until now shows that the contraction of the SMA actuators can be controlled using programmed microcontrollers [21]. Additionally, adaptive SNNs of high biological plausibility were used to control the robotic hands and fingers which were typically actuated by motors [22,23]. The control of SMA actuators using SNNs with fixed weights (non-adaptive) was approached for the first time by our research group [15,16]. As a continuation of this research, the current work presents a new and improved adaptive SNN of high biological plausibility that uses Hebbian learning mechanisms to adapt to custom rotation angles of the robotic junctions.

Adaptive SNNs
Recently, spiking neural networks have gained a special interest due their performance, reduced signal to noise ratio, and lower power consumption comparative to artificial neural networks (ANNs) [30]. Among the characteristics of the SNN, significant attention is given to their complex adaptability mechanisms [31][32][33][34], which rigorously model the plasticity rules of the biological synapses such as spike timing-dependent plasticity (STDP) [35][36][37][38], input timing-dependent plasticity (ITDP) [39] and homeostasis [40]. Considering that in most practical applications, ANNs show very good performance, several works focus on the conversion of ANNs to SNNs [30]. Also, high performance deep SNNs were implemented with several learning methods [41][42][43] including gradient descent [44,45]. Other learning methods were developed for the detection of spatio-temporal patterns [46,47] and for evolving SNN [48].

SNNs in Robotics
Artificial neural networks were used to describe self-organizing neural models for hand-eye coordination using endogenously generated movement commands correlated with visual, spatial, and motor information to learn internal coordinate transformation [49]. Correlation-based navigation algorithms using STDP learning mechanisms for unsupervised learning were also used to increase the behavioural capabilities of bio-inspired hybrid robots [50]. Robotic arm capability up to 4 degrees of freedom was obtained using an initial period of motor babbling using a spiking neural network architecture that learned autonomously and was simulated according to Izhikevich's model to exhibit biologically realistic behaviour [23].
In order to apply robot manipulators to a wide class of tasks, it is necessary to control the force exerted by the end-effector on the object along the position of the end-effector. The control of the robot manipulators in the task space was designed with an adaptive neural network based on the inverse dynamic model [51]. The issue of ANN performance in solving inverse kinematics was also approached by the inclusion of the feedback of the current joint angle configuration of robotic arm as well as the desired position and orientation in the input pattern of neural network [52]. There are also studies for determining the Jacobian matrix without knowledge of the forward kinematics of a robotic arm, as well as modifying the Jacobian transpose method to achieve better control stability [53]. Another workaround to avoid the complexity of calculating inverse kinematics and doing motion planning is to use a combination of motor primitives where a SNN may be used to represent motions in a hierarchy of such primitives. Correction primitives may be combined using an error signal to control a robot arm in a closed-loop scenario [54]. To achieve guaranteed tracking control and estimation, an adaptive neural control based on a radial basis function neural network (RBFNN) was also proposed for neural network (NN) weight convergence [55].

Adaptive SNN for Motion Control
A reinforced learning mechanism process was used on an artificial motor cortex based on spiking neurons [56]. Using an output that was partially driven by Poisson motor babbling, analogous to the biological dopamine system, a global reward or punishment signal was provided in response to decreasing or increasing the distance from the hand to the target. Dopamine-modulated STDP was also used in an insular cortex model able to detect tactile patterns [57][58][59]. Reinforcement learning for a target reaching task, which can be modelled as partially observable Markov decision processes, may extend the proximal policy optimization using a liquid state machine (LSM) for state representation to achieve better performance [60]. Another example of a learning mechanism based on long-term synaptic plasticity was implemented using the temporal difference learning rule to enable the robot to learn to associate the correct movement with the appropriate input conditions [61]. Another method was also approached, which consists of training a neuromorphic controller online modelled by a leaky integrate-and-fire (LIF) SNN to follow a linear quadratic regulator (LQR) controller with known performance guarantees [62]. Similar work has been accomplished by designing a hierarchical SNN with a bio-inspired architecture for representing different grasp motions. Both the hand and the finger networks were trained independently using STDP, incorporating a mechanism for tactile feedback in the finger networks to stop the motion on contact. For the encoding, values were converted into spikes using a mixture of Gaussian kernels to tune the firing rate of a population.
Conventional electrical motors were used in [22] for implementing a robotic hand. Another recent paper presents a biomimetic 2-degrees of freedom (DOF) SMA-actuated robotic arm which uses a proportional-integral-derivative (PID) controller to enable closedloop control of the joint angular positions to prove the technology's performance against existing commercial DC motor rotary joints [21].

Proposed Concept
The novelty presented in this paper is the structure of an adaptive electronic SNN that is able to learn to rotate the index finger towards the angle intervals where its rotation was blocked previously by an external force. To achieve this goal, the SNN encodes the angle intervals by balancing the excitatory and inhibitory activity and potentiates, using Hebbian learning, the neural paths that correspond to the angle at which the finger was stopped. The proposed adaptive SNN is suitable for being implemented in anthropomorphic robots that are able to learn motions unsupervised in a highly biologically plausible manner. The validation of the proposed concept was performed by physical implementation of a robotic hand with an active index finger. The finger is controlled by the SNN using the feedback from the neuromorphic sensors that convert the joint rotation angle and the compression force into spiking frequency.
The rest of the paper is organized as follows: Section 3 presents the general structure of the bioinspired system focusing on the proposed concept of the adaptive SNN that is validated by simulation in Section 4. The testbed for the evaluation of the proposed SNN architecture is presented in Section 5, which also includes the experimental results and the discussion. The paper ends with Section 6, which discusses the utility of this concept and future research directions.

Bioinspired System Design
In order to investigate the performance of the adaptive spiking neural network in controlling the rotation of the robotic junctions, we implemented the robotic hand with active index finger presented in Figure 1.
robotic arm which uses a proportional-integral-derivative (PID) controller to enable closed-loop control of the joint angular positions to prove the technology's performance against existing commercial DC motor rotary joints [21].

Proposed Concept
The novelty presented in this paper is the structure of an adaptive electronic SNN that is able to learn to rotate the index finger towards the angle intervals where its rotation was blocked previously by an external force. To achieve this goal, the SNN encodes the angle intervals by balancing the excitatory and inhibitory activity and potentiates, using Hebbian learning, the neural paths that correspond to the angle at which the finger was stopped. The proposed adaptive SNN is suitable for being implemented in anthropomorphic robots that are able to learn motions unsupervised in a highly biologically plausible manner. The validation of the proposed concept was performed by physical implementation of a robotic hand with an active index finger. The finger is controlled by the SNN using the feedback from the neuromorphic sensors that convert the joint rotation angle and the compression force into spiking frequency.
The rest of the paper is organized as follows: section III presents the general structure of the bioinspired system focusing on the proposed concept of the adaptive SNN that is validated by simulation in section IV. The testbed for the evaluation of the proposed SNN architecture is presented in Section V, which also includes the experimental results and the discussion. The paper ends with section VI, which discusses the utility of this concept and future research directions.

Bioinspired System Design
In order to investigate the performance of the adaptive spiking neural network in controlling the rotation of the robotic junctions, we implemented the robotic hand with active index finger presented in Figure 1.

Artificial Finger
The metacarpophalangeal joint of the robotic finger can be flexed using a SMA actuator. The rotation angle of this joint is converted into voltage by a rotary adjustable resistor (RAR), while the pressure on the finger apex is sensed by a compression load cell (CLC) as in Figure 1. To protect the finger from heating, the SMA wire is connected near the wrist to a thread that goes towards the apex of the finger. The finger can be blocked by an external

Artificial Finger
The metacarpophalangeal joint of the robotic finger can be flexed using a SMA actuator. The rotation angle of this joint is converted into voltage by a rotary adjustable resistor (RAR), while the pressure on the finger apex is sensed by a compression load cell (CLC) as in Figure 1.
To protect the finger from heating, the SMA wire is connected near the wrist to a thread that goes towards the apex of the finger. The finger can be blocked by an external force anywhere in the rotation range that includes the angle intervals ∆α 1 , ∆α 2 , and ∆α 3 . These angle intervals are delimited by the SNN because it activates one neural path when the finger is in each interval, as we will detail below.

The Structure of the Adaptive SNN
The spiking neural network presented in Figure 2 is able to learn the intervals where the finger is blocked by an obstacle. To achieve this goal, the neural structure was designed to activate one inhibitory neuron from the inhibitory area (IA) in each of the three sub-SNNs corresponding to angle intervals ∆α 1 , ∆α 2 and ∆α 3 (see Figure 2a). When the finger reaches the obstacle, the force sensor activates the excitatory neurons E FS 1 , E FS 2 and E FS 3 that reduce the activity of motor neurons M 1 and M 2 through the inhibitory neurons I 1 , I 2 , and I 3 , respectively.
force anywhere in the rotation range that includes the angle intervals Δ , Δ , and . These angle intervals are delimited by the SNN because it activates one neural path when the finger is in each interval, as we will detail below.

The Structure of the Adaptive SNN
The spiking neural network presented in Figure 2 is able to learn the intervals where the finger is blocked by an obstacle. To achieve this goal, the neural structure was designed to activate one inhibitory neuron from the inhibitory area (IA) in each of the three sub-SNNs corresponding to angle intervals Δ , Δ and (see Figure 2a). When the finger reaches the obstacle, the force sensor activates the excitatory neurons , and that reduce the activity of motor neurons and through the inhibitory neurons , , and , respectively. Only one of the neurons , , or is active at the same time, depending on the angle interval in which the finger is rotated. The role of these excitatory neurons is to activate one of the inhibitory neurons that stops the finger in the corresponding angle interval. Note that, if more excitatory neurons would be activated, the finger would stop at the first angle interval it reaches. According to the principles of Hebbian learning, the concurrent activation of more synapses determines their potentiation when the postsynaptic neuron is activated. In this case, the concurrent activation of the potentiated synapses , = 1,3 (activated by FS) with the corresponding un-potentiated synapses (activated when the arm is in the angle interval Δ ) determines the potentiation of because the neuron activates the postsynaptic neuron . Note that, before training, all synapses except have the maximum weights, implying that they determine the activation of the stimulated postsynaptic neurons.
An important structural characteristic of the SNN is related to how the neurons perform sub-interval encoding and decoding. Figure 2a shows the encoding layer that includes excitatory and inhibitory neurons for which the frequency increases with the joint angle . By analysing the resultant effect of these neurons on the postsynaptic neurons , we observed that are activated only when is in the corresponding angle interval . The frequency of the inhibitory neurons is set by adjusting the resistors in order to ensure the activation of before , and before when increases. Only one of the neurons E D 1 , E D 2 , or E D 3 is active at the same time, depending on the angle interval in which the finger is rotated. The role of these excitatory neurons is to activate one of the inhibitory neurons that stops the finger in the corresponding angle interval. Note that, if more excitatory neurons would be activated, the finger would stop at the first angle interval it reaches. According to the principles of Hebbian learning, the concurrent activation of more synapses determines their potentiation when the postsynaptic neuron is activated. In this case, the concurrent activation of the potentiated synapses S FS i , i = 1, 3 (activated by FS) with the corresponding un-potentiated synapses S D i (activated when the arm is in the angle interval ∆α i ) determines the potentiation of S D i because the neuron E FS i activates the postsynaptic neuron I i . Note that, before training, all synapses except S D i have the maximum weights, implying that they determine the activation of the stimulated postsynaptic neurons. An important structural characteristic of the SNN is related to how the neurons perform sub-interval encoding and decoding. Figure 2a shows the encoding layer that includes excitatory and inhibitory neurons for which the frequency increases with the joint angle α. By analysing the resultant effect of these neurons on the postsynaptic neurons E D i , we observed that E D i are activated only when α is in the corresponding angle interval ∆α i . The frequency of the inhibitory neurons I X is set by adjusting the resistors R A in order to ensure the activation of E X 1 before E X 2 , and E X 2 before E X 3 when V J increases. Similarly, a threshold value at which the inhibitory neurons I Y i start to activate is set in order to obtain the activation of I Y i between E X i and E X i+1 . Also, taking into account that E D i is inhibited when E D i+1 is activated implies that voltages V X i and V Y i set the lower and the upper limits of the angle interval ∆α i where E D i fires, respectively.

Auxiliary Electronics
The bioinspired system includes several auxiliary electronics that perform the adaptation of the analogue signals generated by the sensors to the input or output of the SNN. The electronics presented in Figure 3 include the angle sensor that generates voltage V J for the SNN input, as well as the SMA driver that is used to generate the power for the SMA actuators.
Similarly, a threshold value at which the inhibitory neurons start to activate is set in order to obtain the activation of between and . Also, taking into account that is inhibited when is activated implies that voltages and set the lower and the upper limits of the angle interval Δ where fires, respectively.

Auxiliary Electronics
The bioinspired system includes several auxiliary electronics that perform the adaptation of the analogue signals generated by the sensors to the input or output of the SNN. The electronics presented in Figure 3 include the angle sensor that generates voltage for the SNN input, as well as the SMA driver that is used to generate the power for the SMA actuators. A similar p-channel MOSFET (pMOS) circuit which is included in the SMA driver is used for output amplification of the compression load cell type FS20.

Evaluation by Simulation of the SNN Activity
The main characteristics of the proposed SNN structure (Figure 2) are the ability to encode angles of rotation by the activation of predefined neural paths and the capability to adapt using Hebbian learning mechanisms. This implies that the synaptic weights are potentiated when the untrained neural paths are activated simultaneously with the trained ones. Prior to hardware implementation of the system, we evaluated by simulation in LT Spice the SNN ability to discriminate the voltage intervals and to adapt by Hebbian learning mechanisms. Using the electronic schematic of the hardware neuron (see Figure A1 in the Appendix A), we simulated the neural network presented in Figure  2b to qualify its behaviour. Since the purpose was only to verify the network in a synthetic environment, all the input infrastructure was replaced by signals generated by voltage sources to mimic real scenarios. The voltage was linearly swept through a greater voltage interval that includeed the activation intervals of each excitatory neuron . The force sensor output was triggered for one value of in order to activate the learning mechanism. The activation of modeled the presence of an obstacle that pushed on the force sensor in an angle interval. Voltage selectivity was simulated using the potentials and that represent the output of simulated voltage generators. Figure 4 shows the results obtained during the simulation of SNN activity when the force sensor was activated concurrently with neuron , whose activity simulates the the finger positioning in the angle interval Δ . The upper signals represent the activity of A similar p-channel MOSFET (pMOS) circuit which is included in the SMA driver is used for output amplification of the compression load cell type FS20.

Evaluation by Simulation of the SNN Activity
The main characteristics of the proposed SNN structure (Figure 2) are the ability to encode angles of rotation by the activation of predefined neural paths and the capability to adapt using Hebbian learning mechanisms. This implies that the synaptic weights are potentiated when the untrained neural paths are activated simultaneously with the trained ones. Prior to hardware implementation of the system, we evaluated by simulation in LT Spice the SNN ability to discriminate the voltage intervals and to adapt by Hebbian learning mechanisms. Using the electronic schematic of the hardware neuron (see Figure A1 in the Appendix A), we simulated the neural network presented in Figure 2b to qualify its behaviour. Since the purpose was only to verify the network in a synthetic environment, all the input infrastructure was replaced by signals generated by voltage sources to mimic real scenarios. The voltage V J was linearly swept through a greater voltage interval that includeed the activation intervals of each excitatory neuron E D i . The force sensor output V F was triggered for one value of V J in order to activate the learning mechanism. The activation of V F modeled the presence of an obstacle that pushed on the force sensor in an angle interval. Voltage selectivity was simulated using the potentials V X and V Y that represent the output of simulated voltage generators. Figure 4 shows the results obtained during the simulation of SNN activity when the force sensor was activated concurrently with neuron E D 2 , whose activity simulates the the finger positioning in the angle interval ∆α 2 . The upper signals represent the activity of the excitatory neurons E D 1 , E D 2 and E D 3 (Figure 2b) that stimulate the corresponding postsynaptic inhibitory neurons I 1 , I 2 and I 3 for which the input is shown by the lower signals.  Note that, the activation of the neurons depends on the value of , implying that the SNN can discriminate between angle intervals (Figure 4a,c). Moreover, as presented in Figure 4c, after training, the stimulation of the neuron by the neuron was significantly stronger than the stimulation of and by and , respectively. This shows that the concurrent activation of neurons and (Figure 4b) potentiates only the synapses , while the weights of and remained low.

Experimental Investigation
The simulation results illustrate that the SNN behaved as expected, allowing us to test these abilities in hardware, as well as the performance of the SNN in stopping the finger in the corresponding angle interval after training. Figure 5 shows the structure of the bioinspired system including the adaptive SNN that was able to detect the presence of the potential (generated by the angle sensor) in three different voltage intervals and to learn which neural path fired when the force sensor was active. The SNN controlled the actuators through the SMA driver and received information about the rotation of the artificial finger from the RAR amplifier and about the applied force on the finger apex from the CLC pMOS (Figure 3b). Note that, the activation of the neurons E D i depends on the value of V J , implying that the SNN can discriminate between angle intervals (Figure 4a,c). Moreover, as presented in Figure 4c, after training, the stimulation of the neuron I 2 by the neuron E D 2 was significantly stronger than the stimulation of I 1 and I 3 by E D 1 and E D 3 , respectively. This shows that the concurrent activation of neurons E D 2 and E FS 2 (Figure 4b) potentiates only the synapses S D 2 , while the weights of S D 1 and S D 3 remained low.

Experimental Investigation
The simulation results illustrate that the SNN behaved as expected, allowing us to test these abilities in hardware, as well as the performance of the SNN in stopping the finger in the corresponding angle interval after training. Figure 5 shows the structure of the bioinspired system including the adaptive SNN that was able to detect the presence of the potential V J (generated by the angle sensor) in three different voltage intervals and to learn which neural path fired when the force sensor was active. The SNN controlled the actuators through the SMA driver and received information about the rotation of the artificial finger from the RAR amplifier and about the applied force on the finger apex from the CLC pMOS (Figure 3b).

Experimental Setup
The artificial finger was flexed by an 82 cm-long SMA Flexinol 0.006"-type actuator for which the maximum load was 321 g at 410 mA and cooling time was 2 s. The reference voltages for the SNN are V EQU = 0.4 V and V REF = 5 V, the later potential being used also to power the force sensor. The supply voltage for the neurons was VDD = 1.6 V, while the SMA actuators and angle sensor were powered by VCC = 14 V. During the experiments, the room temperature was about 23 • C.

Experiments Overview
The main characteristics of the SNN that were tested in the next were angle interval selectivity and SNN adaptability by associative learning mechanisms. For the selectivity evaluation we monitored the activity of neurons , , and , included in the sub-SNN which was used to detect the finger in the angle interval ∆ . When was in the potential variation range for ∆ the sub-SNN output was activated. Also, we monitored the activity of neurons and when took several values in the corresponding intervals ∆ , ∆ and, respectively, the transition between them. SNN adaptability was evaluated by monitoring and the activity of neurons , , and when the finger was actuated. Before training, no inhibition occurred, and during training, the neuron activity showed that the finger pushed on the obstacle rhythmically. After training, activates the postsynaptic neurons in the absence of the obstacle, stopping the finger. Also, we showed that the inhibitory neurons , , and were able to independently stop the finger rotation at different angles of rotation.

Experimental Results
Considering that angle directly determines the voltage generated by the angle sensor, we evaluated the function ( ) experimentally which is plotted in Figure 6. Considering that the linearity of the function ( ) is high, we will refer below only to the voltage in order to simplify the presentation of the results. Thus, the angle intervals Δ , correspond to the voltage intervals Δ of the voltage .

Experiments Overview
The main characteristics of the SNN that were tested in the next were angle interval selectivity and SNN adaptability by associative learning mechanisms. For the selectivity evaluation we monitored the activity of neurons E X 1 , I Y 1 , and I X 2 , included in the sub-SNN which was used to detect the finger in the angle interval ∆α 1 . When V J was in the potential variation range for ∆α 1 the sub-SNN output was activated. Also, we monitored the activity of neurons E D 2 and E D 3 when V J took several values in the corresponding intervals ∆α 2 , ∆α 3 and, respectively, the transition between them. SNN adaptability was evaluated by monitoring V J and the activity of neurons E D , I, and E FS when the finger was actuated. Before training, no inhibition occurred, and during training, the neuron activity showed that the finger pushed on the obstacle rhythmically. After training, E D activates the postsynaptic neurons I in the absence of the obstacle, stopping the finger. Also, we showed that the inhibitory neurons I 1 , I 2 , and I 3 were able to independently stop the finger rotation at different angles of rotation.

Experimental Results
Considering that angle α directly determines the voltage V J generated by the angle sensor, we evaluated the function V J (α) experimentally which is plotted in Figure 6.

Experiments Overview
The main characteristics of the SNN that were tested in the next were angle interval selectivity and SNN adaptability by associative learning mechanisms. For the selectivity evaluation we monitored the activity of neurons , , and , included in the sub-SNN which was used to detect the finger in the angle interval ∆ . When was in the potential variation range for ∆ the sub-SNN output was activated. Also, we monitored the activity of neurons and when took several values in the corresponding intervals ∆ , ∆ and, respectively, the transition between them. SNN adaptability was evaluated by monitoring and the activity of neurons , , and when the finger was actuated. Before training, no inhibition occurred, and during training, the neuron activity showed that the finger pushed on the obstacle rhythmically. After training, activates the postsynaptic neurons in the absence of the obstacle, stopping the finger. Also, we showed that the inhibitory neurons , , and were able to independently stop the finger rotation at different angles of rotation.

Experimental Results
Considering that angle directly determines the voltage generated by the angle sensor, we evaluated the function ( ) experimentally which is plotted in Figure 6. Considering that the linearity of the function ( ) is high, we will refer below only to the voltage in order to simplify the presentation of the results. Thus, the angle intervals Δ , correspond to the voltage intervals Δ of the voltage . Considering that the linearity of the function V J (α) is high, we will refer below only to the voltage V J in order to simplify the presentation of the results. Thus, the angle intervals ∆α 1−3 , correspond to the voltage intervals ∆V 1−3 of the voltage V J .

Voltage Interval Selectivity
To evaluate the response of the neurons to V J , the variation of the finger was positioned by an external force in ∆V 1 . Figure 7 presents the electronic neuron activity for several values of V J which were chosen to highlight the SNN ability to detect that V J was in ∆V 1 . Note that the spikes on the diagrams represent electronic neuron activations and the signals represent the potential V M recorded using a TDS2024 oscilloscope in node (M) of the neuron's schematic (see Appendix A). In Figure 7a, the excitatory neuron E X 1 determines the activation of E D 1 in the absence of inhibition produced by the neurons I Y 1 and I X 2 . As the inhibitory activity becomes stronger, the frequency of E D 1 reduces (Figure 7b) until it is fully inhibited, as in Figure 7c. signals represent the potential recorded using a TDS2024 oscilloscope in node (M) of the neuron's schematic (see Appendix). In Figure 7a, the excitatory neuron determines the activation of in the absence of inhibition produced by the neurons and . As the inhibitory activity becomes stronger, the frequency of reduces (Figure 7b) until it is fully inhibited, as in Figure 7c.
The ability of the SNN to activate neural paths that are specific to the values of the input voltage is highlighted by the signals shown in Figure 8. The full activation of neurons, and occurs when = 6.5 ( Figure 8a) and = 11.1 (Figure 8c), respectively.
(a) (b) (c) Taking into account that is generated by the angle sensor, the activation of and signal the presence of the finger in the angle intervals Δ and Δ , respectively. The ability of the SNN to activate neural paths that are specific to the values of the input voltage is highlighted by the signals shown in Figure 8. The full activation of neurons, E D 2 and E D 3 occurs when V J = 6.5 V (Figure 8a) and V J = 11.1 V (Figure 8c), respectively.
To evaluate the response of the neurons to , the variation of the finger was positioned by an external force in Δ . Figure 7 presents the electronic neuron activity for several values of which were chosen to highlight the SNN ability to detect that was in ∆ . Note that the spikes on the diagrams represent electronic neuron activations and the signals represent the potential recorded using a TDS2024 oscilloscope in node (M) of the neuron's schematic (see Appendix). In Figure 7a, the excitatory neuron determines the activation of in the absence of inhibition produced by the neurons and . As the inhibitory activity becomes stronger, the frequency of reduces (Figure 7b) until it is fully inhibited, as in Figure 7c.
The ability of the SNN to activate neural paths that are specific to the values of the input voltage is highlighted by the signals shown in Figure 8. The full activation of neurons, and occurs when = 6.5 ( Figure 8a) and = 11.1 (Figure 8c), respectively.
(a) (b) (c) Taking into account that is generated by the angle sensor, the activation of and signal the presence of the finger in the angle intervals Δ and Δ , respectively. Taking into account that V J is generated by the angle sensor, the activation of E D 2 and E D 3 signal the presence of the finger in the angle intervals ∆α 2 and ∆α 3 , respectively. When signal V J crosses between thevintervals ∆V 2 and ∆V 3, both E D 2 and E D 3 are activated at a lower frequency.

Associative Learning
The main feature of the SNN is the ability to adapt to activate the corresponding neuron I i , i = 1, 3, which inhibits motor neurons M 1,2 , stopping the finger's rotation (Figure 2b neurons E D i to the inhibitory neurons I D i . The weights of S D i increase when the force sensor is activated if the finger is in the corresponding angle interval. An example of the neuron activity when the force sensor is activated by an obstacle in the interval ∆α 1 is shown in Figure 9. Before the training, neuron E D 1 detected that the finger crosses the corresponding angle interval without stopping it (Figure 9a). As shown in Figure 9b, during training, the neuron I 1 is activated only by E FS 1 and not by E D 1 , which fires continuously because the finger is stopped in ∆α 1 . The activity of neuron E FS 1 alternates with silent periods, showing that the SNN has a regulatory behaviour consisting of trying to push on the obstacle. the neurons to the inhibitory neurons . The weights of increase when the force sensor is activated if the finger is in the corresponding angle interval. An example of the neuron activity when the force sensor is activated by an obstacle in the interval ∆ is shown in Figure 9. Before the training, neuron detected that the finger crosses the corresponding angle interval without stopping it ( Figure 9a). As shown in Figure 9b, during training, the neuron is activated only by and not by , which fires continuously because the finger is stopped in ∆ . The activity of neuron alternates with silent periods, showing that the SNN has a regulatory behaviour consisting of trying to push on the obstacle.
After training, the force sensor remained inactive because the obstacle was removed implying that the neuron was silent, as presented in Figure 9c. The neuron was activated only by the neuron through the potentiated synapses . Denoting the potential where the finger was stopped by the external force as , and the value where the finger stops due to inhibition after training as , one can observe that ≠ .
(a) (b) (c) This occurs because the finger can be stopped by an obstacle anywhere in the angle interval, but the SNN will stop the finger where the inhibitory activity of compensates for the excitatory output of neurons , (Figure 2b). After training, the force sensor remained inactive because the obstacle was removed implying that the neuron E FS 1 was silent, as presented in Figure 9c. The neuron I 1 was activated only by the neuron E D 1 through the potentiated synapses S D 1 . Denoting the potential where the finger was stopped by the external force as V EF J , and the value where the finger stops due to inhibition after training as V I NH J , one can observe that V EF This occurs because the finger can be stopped by an obstacle anywhere in the angle interval, but the SNN will stop the finger where the inhibitory activity of I 1 compensates for the excitatory output of neurons E ES 1,2 (Figure 2b).

Finger Operation
To test the behaviour of the SNN when the finger was rotated, we focused on the independent activity of the inhibitory neurons I 1−3 . when only one of these neurons fires. First, we tested if the SNN was able to discriminate the angle intervals ∆α 1−3 when the finger was actuated by an external force, as presented in Figure 10a. Second, the weights were set to their minimum values when the inhibitory neurons were not sensitive to the finger rotation as in Figure 10b. Figure 11 presents the activity of the inhibitory neurons when only the synapses S D i were trained.
First, we tested if the SNN was able to discriminate the angle intervals ∆ when the finger was actuated by an external force, as presented in Figure 10a. Second, the weights were set to their minimum values when the inhibitory neurons were not sensitive to the finger rotation as in Figure 10b. Figure 11 presents the activity of the inhibitory neurons when only the synapses were trained. Note that the potential remains stable shortly after activation of , implying that the finger stopped in the interval ∆ , where the force sensor was activated during training. The values where remained constant depended on which inhibitory neuron was activated. Considering that was constant when the rotation was stopped, implies that the corresponding angle depended on the activated neurons , as expected. Also, there is was a ∆ delay between the activation of the inhibitory neurons and the moment finger was actuated by an external force, as presented in Figure 10a. Second, the weights were set to their minimum values when the inhibitory neurons were not sensitive to the finger rotation as in Figure 10b. Figure 11 presents the activity of the inhibitory neurons when only the synapses were trained. Note that the potential remains stable shortly after activation of , implying that the finger stopped in the interval ∆ , where the force sensor was activated during training. The values where remained constant depended on which inhibitory neuron was activated. Considering that was constant when the rotation was stopped, implies that the corresponding angle depended on the activated neurons , as expected. Also, there is was a ∆ delay between the activation of the inhibitory neurons and the moment Note that the potential V J remains stable shortly after activation of I i , implying that the finger stopped in the interval ∆α i , where the force sensor was activated during training. The values where V J remained constant depended on which inhibitory neuron was activated. Considering that V J was constant when the rotation was stopped, implies that the corresponding angle α i depended on the activated neurons I i , as expected. Also, there is was a ∆t S delay between the activation of the inhibitory neurons and the moment at which the rotation stopped which was determined by the cooling time of the SMA actuator.

Discussions
The results show that the SNN was able to rigorously discriminate several voltage intervals of the input by balancing the activity of the excitatory and inhibitory neurons despite the oscillations of the finger speed. Also, using few neurons, the SNN learned to activate the inhibitory neurons according to the angle interval where the finger was stopped by the external force. In this work, we did not focus on the precision and accuracy of the finger positioning because these parameters were analysed previously using a similar system based on SNN and SMA actuators [17]. Also, the SNN was not able to stop the finger exactly at the same angle at which it was blocked by the obstacle because the angle intervals considered were wide. The performance of the finger positioning can be increased by narrowing the angle intervals that can be obtained using more neurons. Theoretically, the minimum width of the angle intervals ∆α min increases with the rotation speed of the finger joint, implying that lower speeds allow better resolution. As an example, when the rotation speed is 40 • /s, the maximum rotation range of α range = 120 • is covered by the finger in 3 s. By increasing the number of inhibitory neurons and by significantly reducing the cooling time of the SMA actuator (using water with glycol), the finger can stop when the inhibitory neurons fire once. The simulations of the SNN activity show that the minimum variation of V J that activates the inhibitory neurons once is ∆V min = 0.25 V, which corresponds to ∆α min = 5.8 • . This implies that the maximum number of intervals that cover α range is about n max = 20.
The SNN performance was evaluated when the finger was flexed. Knowing that the inhibitory neurons fire when the finger is positioned in the corresponding angle interval independent of the previous one, we can consider that associative learning and inhibition also occur when the finger is rotated in the opposite direction.
Another observation is related to the position of the obstacle at the edge of the angle intervals. In this setup, the intervals ∆α 1−3 are disjunctive, implying that both neurons E D i and E D i+1 fire at a lower frequency when the finger crosses from ∆α i to ∆α i+1 (Figure 8b). This behaviour of the SNN reduces the learning rate, implying that in this uncertainty case, the synapses potentiation is insignificant. However, the intersection of the intervals ∆α i and ∆α i+1 can be obtained by making the activation of the neurons E X i and I X i independent (see Figure 2a) and by setting accordingly the intervals limits. When the obstacle is placed at the intersection of ∆α i and ∆α i+1 , both E D i and E D i+1 activate, potentiating S D i , and S D i+1 will stop the arm in the first interval that is reached, reducing the positioning resolution to half.

Conclusions
The experiments demonstrate that a bioinspired control system based on an adaptive neural structure of biological inspiration and contractile SMA actuators is sensitive to the rotation angle of an anthropomorphic finger. This is achieved by the activation of different neural paths for different values of the input potential that correspond to several angle intervals. When a supraliminar stimulus activates all neurons that inhibit the output, and thus stopping the rotation, the SNN learns to determine which angle detection neural path (ADNP) was active. This adaptation mechanism connects the ADNP to one inhibitory neuron that stops the rotation in the absence of the supraliminar stimulus. Taking into account the high level of bioinspiration given by the spiking neural structures that control the contractile actuators, this concept can be used to understand how the automatic motions are gained in the basal ganglia. Also, anthropomorphic robots that learn motions based on biological principles could benefit from this concept. Another advantage of this system is the implementation of a spiking neural network in analogue hardware that allows for the control of multiple actuators in parallel without affecting the real-time response of the system.
As a short-term goal, we will comparatively evaluate the performance of SNN and microcontrollers in controlling in parallel the SMA actuated junctions of an anthropomorphic hand for showing in which conditions SNN represents a more advantageous control method. Another future direction is to design a neuron model with an improved learning mechanism in terms of biological rigor and to implement it on an FPGA, which simplifies the prototyping of the future SNN structures.

Conflicts of Interest:
The authors declare no conflict of interest. Figure A1 presents the schematic circuit of the electronic neuron that is implemented in PCB hardware [10,11]. The neuron includes one electronic soma (SOMA) and one or more electronic synapses (SYN). The SOMA detects neuron activation threshold using the transistor T 1 and activates the SYNs. As presented in Figure A1a the SOMA of the input neurons which are connected directly to the analogue signals (V X 1−3 , V Y 1−3 , V F , V J and V ES in Figure 3) includes the pair R E -D E that determine the oscillation of the neuron with frequency f that depends on the input potential. The SOMA of the postsynaptic neurons which are stimulated by the excitatory or inhibitory synapses includes the pair C I -R I which integrates the input activity. When the SOMA activates the connected SYNs, S OUT generates pulses at their output N OUT , whose energy depends on the charge stored in the weight capacitor C L . Note that the potential V M was monitored using the oscilloscope in node (M) for visualization of the neuron activations, which are represented by the spikes. Depending on the position of switch S, the generated pulses can be excitatory with maximum amplitude VDD, or inhibitory with minimum amplitude GND (see Figure A1b).

Appendix A
The parameters of the electronic neuron (SOMA and SYN) that were used in the experiments are given in the Tables A1 and A2.    10k Ω