Jtam-A4.dvi JOURNAL OF THEORETICAL AND APPLIED MECHANICS 51, 3, pp. 711-718, Warsaw 2013 MODELING OF SHAPE MEMORY ALLOY SPRINGS USING A RECURRENT NEURAL NETWORK Iman Kardan, Reza Abiri, Mansour Kabganian, Meisam Vahabi Amirkabir University of Technology, Mechanical Engineering Departmrnt, Tehran, Iran e-mail: i.kardan@aut.ac.ir In this paper, a recurrent neural network structure is proposed for the modeling of the behavior of shapememory alloy springs. Numerousmathematical modeling and experimen- tal evaluations show that the force exerted by SMAs, aside from their length and applied voltages, depends on the loading path. Therefore, in addition to the applied voltage and deformation, a feedback of the voltage applied to, and the force exerted by the SMA spring in the previous time step is included in the inputs to this neural network to represent the loading path. Fed by adequate inputs, the NN estimates the output force of the spring. The results of some thermal loadings of the spring at various fixed lengths andmechanical loadings at various constant voltages are used to train the NN. The performance of the NN model is then evaluated for some constant weight loadings which are not learnt by the NN. Simulation results indicate that compared to other neural network structures, the propo- sed structure learns the behavior of the SMA spring faster (in less iteration). Moreover, it provides amore generalmodel, i.e. this NNmodel effectively estimates the output force for almost all possible loadings. Key words: artificial neural networks, smart materials, shape memory alloy springs 1. Introduction ShapeMemoryAlloys have the unique capability ofmemorizing their shapes in such away that at low temperatures they can be easily deformedwith even small forces.When the temperature is increased above a limit, they recover their memorized shape. If their shape recovering is hindered by an external object, they will apply comparatively large forces on the object which indicates that shape memory alloys can be used as actuators. Possessing advantages like the possibility of being used in small dimensions (a fewmicrons in wire form), a comparatively high force to volume ratio, and smooth and silent operation havemade SMAs suitable candidates for actuators especially in tiny systems. Although different types of these actuators are available, they are commonly used in the form of wires and springs.Wire actuators are most suitable for systems in which large forces and small displacements are needed such asmicrogrippers (Lan et al., 2011). Spring actuators are preferred when large forces and large deflections are required at the same time as in micro-robots (Kim et al., 2006). Lots ofworks have beendoneby researchers to describe the behavior of shapememory alloys. It is known that the shape memory property of SMAs mainly results from a reversible phase transformation from the martensite phase, in low temperatures, to the austenite phase, in high temperatures. Tanaka (1986) derived a constitutive relation for SMAs using thermodynamical principles. He also defined the phase transformation kinetics by introducing an internal variable which describes the portion of each phase in the current crystal structure of the SMA. Fur- ther studies revealed that themartensite phasemay exist in two separate configurations.When the alloy cools down freely from the austenite phase, the produced martensite phase will have multiple variants and twins will be present in the structure. All the variants are crystallogra- phically equivalent but their orientation is different. This configuration of martensite phase is 712 I. Kardan et al. commonly called “twinned martensite”. If a load is applied to the specimen and increased over the critical stress, the different variants will begin to reorient in the direction of the applied load. This process is called detwinning and the produced configuration is commonly called “detwin- ned martensite”. Brinson (1993) and Gao et al. (2007) changed Tanaka’s constitutive relation in order to capture the behavior of SMAs when the phase changes from austenite or twinned martensite to detwinnedmartensite and vice versa. In theirmodel, they also considered the fact that thematerial properties are different for each phase. There are also many other works done tomodel the nonlinear behavior of SMAs as in Sun andHwang (1993) and Zhang et al. (1997). Most of theproposedmodels for SMAsareonedimensional anddescribe the relation between axial load and longitudinal displacement which makes them well-suited for SMA wires. From the basicmechanical principals it is known that the prominent stresses and strains in springs are the shear ones. Therefore, one-dimensional models are not directly applicable to SMA springs. By introducing equivalent stresses and strains, Liang and Rogers (1997) developed a multi- dimensional constitutive relation for SMAs and proposed a simple SMA spring model. Aguiar et al. (2010) employed Fremond’s one-dimensional model to derive a model to describe the behavior of SMA springs while Hadi et al. (2010) used the Brinson model and followed the Liang procedure. The aforementioned models use some mathematical relations to describe the behavior of SMA springs. Due to intense hysteresis and nonlinearities in SMA response, it is so difficult to find a mathematical model which can exactly predict the SMA behavior in general. On the other hand, these models often need some parameters which are very hard to be determined practically (Lee and Lee, 2000). These roadblocks have motivated researchers to seek for new modelingmethods such as artificial neural networks. The NN’s great ability to learn nonlinear relations has made it one of the first choices in modeling complicated systems where analytical expressions cannot be found or could take a long time to be simulated. NN modeling can be classified under black box modeling methods since regardless of the system type it only needs the inputs to the system and the corresponding outputs to provide a model of the system. When responses of a system are presented to an appropriately adjusted neural network, theNNextracts the relation between the data and stores it as the network weights. However, the training data need to be chosen suitably, i.e. contain sufficient information about the system for the NN model to be as close to the true system as possible. The input-output set of the NN should be chosen carefully according to the type of the system. In a simple system like a single-input function, the suitable input and output for the network can be easily recognized. However, formore complicated systems like an SMA-actuated system, finding an appropriate set is not a trivial task anddifferent neural networkswith diverse input-output sets and various structures are to be designed. Lee and Lee (2000) used neural networks to evaluate the characteristics of an SMA spring actuator for an active catheter. They employed a multilayer perceptron with an error back- -propagation algorithm consisting of two input neurons, two hidden layers with four neurons in each layer, andoneoutputneuron.Theproposednetwork takes the initial deflection of the spring and its current temperature as the inputs and predicts the shape recovery force in the output. Using some experimental data, they evaluated the network in fixed-length thermal loadings and showed that the NNworks very well in prediction of the constrained shape recovery force, even better than Liang’smodel. Regarding the input-output set of this NN, it seems obvious that the application of this model is limited to fixed-length tests because it takes in the initial deflection and not the current length of the spring.Moreover, measuring the temperature of the spring (as an input to the network) is not easy in practice. Song et al. (2003) trained a neural network with a representative inverse hysteresis loop and obtained an inverse model of an SMAwire. Then they used the network in combination with a Modeling of shape memory alloy springs ... 713 sliding-mode based robust compensator for precision tracking control of the length of an SMA wire. In addition to the deflection of the SMAwire, a tag input is also provided for the network to determine which branch of the hysteresis loop the training data belongs to. The adopted network has two hidden layers with four neurons in the first layer and five neurons in the second one. Asua et al. (2008) employed NN to learn an inverse model of the hysteresis in an SMA wire. Then they controlled the length of the wire combining the NN compensator with a PI controller. The hysteresis in an SMA wire depends on the amplitude, speed and frequency of the deflection. So the length of thewire at the current time and the two previous signal samples yi, yi−1 and yi−2 are taken as the inputs to the network, while the electrical current through the wire is the output. The proposed input-output set obviates the requirement for a tag input since the hysteresis branch can be recognized by comparing the successive inputs. In addition to the input and the output layer, the network includes one hidden layer with 80 neurons and uses Levenberg-Marquardt algorithm to learn offline the dynamics of the SMA wire. As they have stated, this network yields good results in obtaining an inverse model of the hysteresis in some constant weight tests. Nevertheless, as previously mentioned, the general behavior of the SMAs cannot be predicted bymeasuring a single quantity. Thus, it seems this network will not be able to performwell under various circumstances. In this paper, a new neural network is presented for the modeling of an SMA spring. The input-output set is chosen in such away that the obtained globalmodel is capable of appropria- tely predicting the behavior of the SMA spring in almost all conditions. The results of several experiments in the case of constant length as well as constant voltage are utilized to train the network. Then the network capability is evaluated in some unlearned fixed-stress tests. Section 2 describes the structure of the proposed neural network. The setupwhich is utilized to carry out the experimental tests is described in Section 3. The results of training and eva- luation of the neural network are provided in Section 4. Finally, Section 5 concludes the paper and lists up future works. 2. Neural network model In this paper, a newneural networkmodel of SMAspringswill be introduced.Themodel should be able to predict the force exerted by the SMA spring. Since the responses of a SMA spring largely depend on the loading history, to obtain a global NN model, it is necessary to provide the network with some information about the loading path. Therefore, the applied voltage and the force exerted by the SMA spring at a previous time step are included in the input set as well as the current voltage and deflection. It is noteworthy that here the voltage is taken as a representative of the temperature in order to get rid of the difficulties related to practical measurement of the temperature. TheSMAbehavior is also rate dependent, so the deflection of the spring at the previous time step is added to the input set. Comparing the two successive inputs, the network will be able to recognize the rate of change of the applied voltage and the spring length. When two successive signals of a quantity, say Si−1 and Si, received by theNN, the signal speed can be approximated by (Si−Si−1)/∆t, where ∆t is the sampling time.AsAsua et al. (2008)mentioned, the sampling time should be suitably chosen so that the NN receives accurate information. If the sampling time is too short the signal will be noisy, while a slow sampling rate may lead to information loss. Considering the input-output set, it can be seen that a feedback of the SMA force is included in the NN input which leads to a recursive structure for the network. An illustration of the NN model is provided in Fig. 1. 714 I. Kardan et al. Fig. 1. Structure of the proposed neural networkmodel 3. Experimental setup As illustrated in Figs. 2 and 3, an experimental test bed is prepared to obtain the required data for training and evaluating the NNmodel. The setup is designed in a way that can afford different fixed-stress, fixed-strain, fixed-voltage and some arbitrary tests. A NiTi spring with 6mm inside diameter, 0.65mm wire diameter, and 20mm undeformed length is used to perform tests. A low rpm DC motor is employed to pull the SMA spring at different speeds. The deflection of the spring is measured by a rotational potentiometer and a load cell is used to measure the force exerted by the spring. Themeasured data are transferred to a PC via a data acquisition board. The voltage is applied to the spring through the DAQ board and a current amplifier. In fixed-voltage tests, in order to unify the initial condition of the SMA spring, after each test the spring is freely heated to return to its original shape and then cooled down. Therefore, at the beginning of all the fixed-voltage tests, the spring is at its original length. After applying a constant voltage Vc to the spring, it is stretched up to a definite length with a constant speed while the load cellmeasures the spring force. Finally, by reversing themotor rotation, the length of the SMA spring is decreased with a constant speed until no force is exerted on the load cell. Fig. 2. SMA spring test bed During fixed-length tests, the SMA spring is hold at some definite lengths Lc. The applied voltage to the spring is increased up to a specific value (2V) and then decreased to zero with a constant slope while the force of the spring is measured by the load cell. Modeling of shape memory alloy springs ... 715 Fig. 3. Schematic overview of the setup; (a) top view with electronic circuit (fixed-voltage and fixed-length tests), (b) side view (fixed-stress tests) In fixed-stress tests, the DCmotor is excluded from the test bed and some specific weights, Wc, are hung from the spring. The applied voltage to the SMA spring is increased up to a definite value (2V) and then decreased to zero while the deflection of the spring is measured by the potentiometer. It is noteworthy that despite the term “fixed-stress”, during these tests the spring does not apply a constant force because of accelerated motion of the hanging weight. 4. Results and discussion Some samples of experimental fixed-voltage and fixed-length tests are depicted in Fig. 4 and Fig. 5a, respectively.These results areused in the trainingof theneuralnetworkmodel.Figure 5b illustrates some instances of fixed-stress tests which are utilized to evaluate the performance of the NNmodel. Fig. 4. Some samples of fixed-voltage tests results; (a) V c =0.3V, (b) V c =0.9V, (c) V c =1.2V 716 I. Kardan et al. Fig. 5. Some samples of fixed-length and fixed-stress tests results; (a) fixed-length, (b) fixed-stress As previouslymentioned, the SMA response is a function of the loading path. So, in order to preserve the loading information, the training points belonging to each individual test curve are presented to the NN in the order they are obtained. On the other hand, the tests are arranged randomly to decrease the sensitivity of the NN to the order of the tests. All the designing, training, and evaluating processes of the NN are done in Matlab software using theNeural NetworkToolbox. After some trial and error, a networkwith twohidden layers is adopted to learn the SMAspringbehavior. Similar to the input layer, each hidden layer contains 5 neurons with tansig activation functions. The output layer consists of a single neuron which predicts the force exerted by the SMA spring using a linear activation function. The proposed network uses Levenberg-Marquardt back-propagation algorithm for off-line le- arning of the SMA springmodel. This algorithm is designed to approach second-order training speed and implemented inMatlab as function trainlm. Based on the descriptions provided in Demuth and Beale (2002), the Levenberg-Marquardt algorithm approximates the Hessian matrix as H=JT(xk)J(xk) (4.1) computes the gradient vector as gk =J T e (4.2) and updates the network weights in the following way xk+1 =xk− [J T J+µI]−1JTe (4.3) In these relations J(xk) is the Jacobianmatrix that contains first-order partial derivatives of the network errors ewith respect to the networkweights xk. The value of the scalar parameter µ is decreased after each successful iteration to shift toward Newton’s method because of its better speed and accuracy near the error minimum (Demuth and Beale, 2002). Presenting the training data to the designed network, after 45 iterations the error becomes small enough and the training process is stopped. To demonstrate how well the network has learned the training data, the actual force of the spring is compared to the network output for some training tests. As shown in Figs. 6a and 6b, the network output is in a good agreement with the test results indicating that the network has successfully stored the information of the training data. As the next step, the generalization ability of theNNmodel should be evaluated. Therefore, somenew input sets are built uponfixed-stress tests. Thenewunlearned input sets are presented to the NN and the experimental results are compared to the NN model output as shown in Fig. 6c. It can be seen that the NN model has successfully predicted the spring force which in turn indicates that the NN has stored an almost exact and general model of the SMA spring. Modeling of shape memory alloy springs ... 717 Fig. 6. Some samples of evaluating the NNmodel performance: (a), (b) remembering the learned data for some samples of fixed-length and fixed-voltage tests respectively, (c) generalization ability of the NN model for some samples of unlearned fixed-stress test results It is noteworthy that for the sake of comparison some previously proposed neural networks are trained using the same training data sets. Besides the much more number of the iterations required by thesemodels to learn the training data (comparing to our newly proposedmodel), it was observed thatwhen the loading path is different from those in the training data, theNNwill largely fail in predicting the SMA spring output force. Because of large differences between the output of these networks and the experimental data, these results are not shown here. Although it should be also noted that when the presented unlearned data have a loading path similar to the training data, the networks perform almost well. This observation could be explained regarding the aforementioned fact that the loading path is not considered by the previous NN models. 5. Conclusion In this paper, a recursive neural network structure is proposed for themodeling of the behavior of shapememory alloy springs. TheNNmodel takes in the current voltage and deflection of the spring in addition to the deflection, the applied voltage, and the spring force at the previous time step. The current force of the spring is predicted as the output of the network. The input set is chosen in a way that provides the network with sufficient information about the loading path. Comparing the successive inputs, the network is able to recognize the rate of changes in input signals as well. The results indicate that the presentedNNmodel can effectively extract the relation between the experimental trainingdata and store a comprehensivemodel of theSMAspring.Thenetwork suitably works with almost all the possible tests even if the loading path is not included in the training set. In addition to more comprehensiveness, the proposed NN model learns the SMA spring behavior faster compared to its predecessors. Even though the input set to the network is chosen such that the proposed NN model can deal with the rate dependency effect, this capability is not considered in this paper and all the 718 I. Kardan et al. tests are conducted at a constant speed. The assessment of this capability of the model will be in focus of our future works. References 1. Aguiar R.A.A., Savi M.A., Pacheco P.M.C.L., 2010, Experimental and numerical investiga- tions of shape memory alloy helical springs, Smart Materials and Structures, 19, 025008 2. Asua E., Etxebarria V., Garcia-Arribas A., 2008, Neural network-based micropositioning control of smart shapememory alloy actuators,Engineering Applications of Artificial Intelligence, 21, 5, 796-804 3. Brinson L.C., 1993, One-dimensional constitutive behavior of shape memory alloys: thermome- chanical derivationwithnon-constantmaterial functions and redefinedmartensite internal variable, Journal of Intelligent Material Systems and Structures, 4, 2, 229-242 4. Demuth H., Beale M., 2002, Neural Network Toolbox for Use with MATLAB, User’s Guide Version 6.5, TheMathWorks, Inc., Natick, MA 5. GaoX.,QiaoR.,BrinsonL.C., 2007,Phase diagramkinetics for shapememory alloys: a robust finite element implementation, Smart Materials and Structures, 16, 6, 2102-2115 6. Hadi A.R., Yousefi-Koma A., Moghaddam M.M., Elahinia M., Ghazavi A., 2010, Deve- loping a novel SMA-actuated robotic module, Sensors and Actuators A: Physical, 162, 1, 72-81 7. Kim B., Lee M.G., Lee Y.P., Kim Y., Lee G., 2006, An earthworm-like micro robot using shape memory alloy actuator, Sensors and Actuators A: Physical, 125, 2, 429-437 8. Lan C.C., Lin C.M., Fan C.H., 2011, A self-sensing microgripper module with wide handling ranges, IEEE/ASME Transactions On Mechatronics, 16, 1, 141-150 9. Lee H.J., Lee J.J., 2000, Evaluation of the characteristics of a shapememory alloy spring actu- ator, Smart Materials and Structures, 9, 6, 817-823 10. Liang C., Rogers C.A., 1997, Design of shapememory alloy springs with applications in vibra- tion control, Journal of Intelligent Material Systems and Structures, 8, 4, 314-322 11. Song G., Chaudhry V., Batur C., 2003, Precision tracking control of shape memory alloy actuators using neural networks and a sliding-mode based robust controller, Smart Materials and Structures, 12, 2, 223-231 12. Sun Q.P., Hwang K.C., 1993, Micromechanics modelling for the constitutive behavior of poly- crystalline shape memory alloys, part I: Derivation of general relations, Journal of the Mechanics and Physics of Solids, 41, 1, 1-17 13. SunQ.P.,HwangK.C., 1993,Micromechanicsmodelling for the constitutivebehavior of polycry- stalline shapememory alloys, part II: Study of the individual phenomena,Journal of theMechanics and Physics of Solids, 41, 1,19-33 14. Tanaka K., 1986, A thermomechanical sketch of shape memory effect: One-dimensional tensile behavior,Res Mechanica, 18, 3, 251-263 15. Zhang X.D., Rogers C.A. Liang C., 1997, Modelling of the two-way shape memory effect, Journal of Intelligent Material Systems and Structures, 8, 4, 353-362 Manuscript received June 11, 2012; accepted for print December 5, 2012