OPTIMISATION METHODS FOR COMPRESSION, EXTENSION AND TORSION SPRING DESIGN Emmanuel Rodriguez Laboratoire de Génie Mécanique de Toulouse, INSA, F-31077 Toulouse, France, phone: 33 5 61 55 97 18, fax: 33 5 61 55 97 00, emmanuel.rodriguez@insa-tlse.fr Manuel Paredes Laboratoire de Génie Mécanique de Toulouse, INSA, F-31077 Toulouse, France, phone: 33 5 61 55 97 15, fax: 33 5 61 55 97 00, manuel.paredes@insa-tlse.fr Marc Sartor Laboratoire de Génie Mécanique de Toulouse, INSA, F-31077 Toulouse, France, phone: 33 5 61 55 97 06, fax: 33 5 61 55 97 00, marc.sartor@insa-tlse.fr Abstract: This paper describes three methods for optimising compression, extension and torsion spring design. With these, the designer can obtain the spring which is closest his specifications. Thanks to a detailed and flexible spreadsheet, a spring is optimally designed from a very few broad specifications, or from precise descriptions of the required data, corresponding to the appropriate design stage. These methods automatically convert designer requirements into the associated theoretical optimisation problem. To solve these problems, it can be advantageous to use commercial software that include a solver. Such solvers mostly use the Generalised Reduced Gradient (GRG, e.g. in Excel) or Sequential Quadratic Programming (SQP, e.g. in Matlab) algorithms. These two optimisation algorithms are both tested and compared to solve the spring design problems. Several numerical difficulties (equality constraints, discrete variables and non-convex acceptable domain for a variable) are encountered and resolved using different strategies (margins on equality constraints, branch and bound method, coil to coil calculation). GRG and SQP algorithms prove to be almost as fast and efficient for solving these kinds of problems. The methods presented here can thus be implemented in any commercial software to build efficient assistance tools for designers. Key words: spring design, optimisation algorithms, GRG, SQP 1 Introduction Spring manufacturers and designers working on mechanical systems using springs need quick and efficient methods to choose the spring that best matches their requirements. Certain numerical tools are available to help them choose the best spring. So far checking tools mainly apply to springs already defined by the user [1], [2]. Some of them propose an optimising spring design procedure: with only one available objective (to minimize mass) over only one variable (the wire diameter) [3] or three variables [4], [5]. In each case, the user must provide several precise spring parameters (lengths, loads, etc) which have not necessarily been defined yet. This severely limits design investigations, and computer capacity is never fully used. For instance, Paredes [6] proved (i) that it is possible to create an optimisation problem from wide range of user spring design specifications and (ii) that spring design problems can be optimised using 6 variables (for compression and extension springs), or even 7 (torsion springs), and with more than 40 constraints. 1
Generalised Reduced Gradient (GRG) and Sequential Quadratic Programming (SQP) methods are both algorithms, frequently incorporated in commercial software, that are assumed to solve such constrained optimisation problems. Lozzi et al. have already used GRG to solve a problem of optimal design by finding a pair of concentric compression springs of minimum outside diameter but of fixed inside diameter, total spring rate and preloaded length [7]. To test GRG and SQP capacities to solve optimisation problems of compression, extension and torsion spring design, numerical methods based on GRG and SQP have been developed, and their results analysed. This should provide information about the potential capacities of software using GRG or SQP such as Excel and Matlab, to solve this kind of problems. 2 Compression, extension and torsion spring design optimisation problems 2.1 Defining requirements To enable a wide range of spring design problems to be considered and to fit designer needs, the requirements are defined in a specification sheet where each design parameter can be defined by a lower and/or an upper limit. Figure 1 presents the most often used parameters for compression, extension and torsion spring design. Figure 1. Compression, extension and torsion spring parameters 2
Using this specification sheet (Figure 2), the user has a wide range of parameters to define the required spring. He is also able to choose weather to fix a precise value, or just an upper or lower limit, or both, to each parameter. He can equally decide to leave out any precise information. Figure 2. Compression spring specification sheet 2.2 Building the optimisation problem automatically Once the requirements are defined, the results have to be automatically calculated. The first step consists in building the problem linked to the specifications. The problem can be expressed as an optimisation problem: Minimise or Maximise F(X) Subjected to constraints The objective function F is selected by the designer from within the specification sheet. It can be the fatigue life factor, the mass or any other parameter that is considered in the specification sheet. The vector of variables X is chosen in order to define the spring (design variables) and its practical application (operating variables). A lower limit A L and an upper limit A U are linked to each parameter A used in the specification sheet. This implies two constraints for each parameter in the optimisation problem: Constraint related to an upper limit: g i (X): ( A - A U ) / A 0 Constraint related to a lower limit: g i+1 (X): ( A L - A ) / A 0 In order to build the optimisation problem whatever the specifications, each limit not defined in the user specification sheet is automatically set to a default value: 0 for a lower limit and 10 7 for an upper limit. The capability limits of the spring manufacturer and the requirements from standards also imply numerous constraints that are automatically added to the optimisation problem. Many of the constraints are highly non-linear (spring rate, buckling length, natural frequency, fatigue life, etc). 3
2.3 Solving the optimisation problems using GRG and SQP methods All the functions of the optimisation problem (objective and constraints) are supposed to be continuous and differentiable, and thus be solved by using Mathematical Programming (MP). Several methods exist in MP, GRG and SQP that are the most often used are tested and their efficiencies are compared. The GRG optimisation algorithm modifies the initial problem in order to obtain only equality constraints [8]. To achieve this, an offset variable s i is associated to each of m inequality constraints g i : Minimise F(Y) with Y R n+m and F(Y) R Subjected to g i (Y) + s i = 0 i = 1..m With s i 0 ; s i R Then, initial problem with n variables becomes a problem with n+m variables, with Y: Y = [x 1, x 2, x n, s 1, s m ] T The Excel solver has been used to test the GRG method. SQP is an extension of Sequential Linear Programming (SLP) method [9]. SLP algorithm replaces the resolution of an original non-linear problem, by the resolution of an associated series of linear problems that approximate the original one. Every linear problem may be solved with the simplex method, for example. SQP approximates the objective function with one which is quadratic. 3 Development and results of optimum spring design methods with GRG and SQP 3.1 Defining a satisfactory calculation starting point Direct methods, such as GRG and SQP, require the variables to be correctly initialised, i.e. the calculation starting point has to be an acceptable solution. For this reason, Paredes developed another algorithm to initialise the variables [6]. Limits derived from standards, manufacturer constraints and the most usual data from the specification sheet are exploited using interval arithmetic [10] in order to construct a virtual catalogue for each problem. It enables springs which respect the majority of the problem constraints to be defined. Once the virtual catalogue is built, the algorithm developed by Paredes et al. [11] is used to select the best spring and determine the associated operating lengths. This algorithm tests all the springs from the catalogue. For each one, it determines the optimum operating lengths by solving an optimisation problem with 2 variables and 7 linear constraints using the method proposed by Johnson [12]. Each solution (spring characteristics and operating lengths) is then compared to the requirements and the best of these is extracted to initialise the variables for the Mathematical Programming process. This process then improves the variable values in order to find the optimal solution. 3.2 Compression spring design 3.2.1 A specific numerical difficulty: equality constraints The major numerical difficulty for resolving compression spring optimisation problem is dealing with equality constraints. To fix a design parameter, e.g. the wire diameter or a working length, the designer only needs to put the required value in both the lower and upper limits associated with this parameter in the specification sheet. By so doing, an equality constraint is created even if the optimisation problem is only formulated with inequality 4
no margin 1/10th 1/100 1/1000 1/10000 1/100000 1/1000000 factor F IDMME 2004 Bath, UK, April 5-7, 2004 constraints as shown in paragraph 2.2. Depending on the information printed in the blanks and on the associated values, an optimisation problem can contain several equality constraints which resolution algorithms have to process. GRG has proved reliable in dealing with this problem, while SQP sometimes gives a nonoptimal result or does not even move from the starting point. A solution is proposed to solve this difficulty with regards to SQP: a narrow margin is set on every fixed parameter of the problem. The idea is to allow micro-moves around the equality constraint value within a small allowable domain, the optimisation calculations should then prove easier and SQP should reach the optimal solution. The initial constraints of the problem for a fixed parameter A (cf. paragraph 2.2) are replaced by: g i (X) = (A - (1 + ma) A U ) / A 0 g i+1 (X) = (A L - A) / A 0 Where ma represents the size of the margin, and A U and A L are the expected value for parameter A. The ma value has to be selected carefully. If ma is too large, the algorithm is more likely to converge, but the proposed result can be far from the optimum. If ma is too small, the algorithm may not move from the starting point. Several values for ma have been tested on twelve examples inducing equality constraints to determine its best value. Table 1 and Figure 3 show one of these examples. In the specification table, every fixed parameter inducing equality constraint is underscored. Problem 1 Do 22 mm d = 3 mm 4 R 10 (N/mm) L2 64 mm fe 200 Hz Sh = 15 mm F2 = 200 N N = 10000000 cycles steel shot penned factor = 0.5 rupture at solid length Objective: maximum fatigue life factor F Table 1. Problem 1 specifications (compression spring) 1,65 1.65 Objective: maximum F 1,60 1.60 1,55 1.55 SQP GRG (no margin) Figure 3. Margin value effect on SQP results (Problem 1) The whole tested examples show that a 1/1000 th margin allows SQP not only to start its optimisation process but also to find a result which is very close to the optimal solution (maximum error introduced by this margin is only 0.1% from original specifications). This enables a 1/1000 th margin to be set for every equality constraint on parameters (from user specifications) when using SQP. 3.2.2 GRG and SQP efficiencies compression spring GRG and SQP efficiencies are then compared by analysing their results from four optimisation problems. 5
These tests show that results of GRG (without margin) and SQP (with a 1/1000 th margin) are very close: the differences in objective function and variable values never exceed 0.4% and are usually around 0.1-0.2%. One of the advantages of these methods is their rapidity: on a 1.5 GHz computer, GRG takes less than 2 seconds to complete the calculations, and SQP is even faster (by two or three times). To conclude, the optimisation method for compression springs using SQP is as efficient as when using GRG, and even a bit faster. 3.3 Extension spring design 3.3.1 A specific numerical difficulty: discrete variables The difficulties encountered by GRG and SQP in optimising extension spring design are now analysed. Extension spring design problems can contain the same kind of equality constraints as compression spring design problems. Moreover, depending on the specifications, a mixed-integer/continuous variables optimisation problem can be obtained. When designing an extension spring, a specific angle between end loops may be required, as shown in Figure 4. This requirement makes the number of coils (variable n) change from a continuous variable to a discrete variable. Figure 4. Angles between end loops (extension springs) For instance, if the designer s specification is 90 (e.g.) for the angle between end loops, the allowable values for n are simply 2.25, 3.25, 4.25, 5.25, etc. In other words, the optimisation problem is solved by introducing n = n i + n 0 where n i is an integer variable and n 0 depends on the required angle between end loops, as detailed in Figure 4. Optimisation methods must therefore manage both continuous and integer variables. This is quite difficult for mathematical programming algorithms, which have to jump from an allowable value to one which is separated by an unacceptable domain. A Branch and bound method [13] has been chosen to solve the new optimisation problem. This method consists of four steps and is illustrated in Figure 5. 2+n 0 step #1 step #3 step #2 6+n 0 3+n 0 4+n 0 5+n 0 Integer(n opti -n 0 )+n 0 n opti 7+n 0 8+n 0 9+n 0 Integer(n opti -n 0 )+n 0 +1 Figure 5. Branch and bound method n - Step #1: obtaining spring #1 The optimisation problem is solved without any specification for the angle between end loops. n is considered as a continuous variable, n i and n 0 are ignored. In this way, the optimal spring with a decimal number of coils n opti is obtained. 6
- Step #2: obtaining spring #2 Here, the angle between end loops is taken into consideration. n remains a continuous variable but must be greater than or equal to the first allowable (with reference to n 0 ) value of n greater than n opti. That is to say: n i = Integer(n opti - n 0 ) + 1 and n i + n 0 n A new starting point is then calculated, the optimal spring #2 is obtained and its corresponding value of objective function is obj +. - Step #3: obtaining spring #3 n 0 is still being considered. n remains a continuous variable but it must be less than or equal to the first allowable (with reference to n 0 ) value of n less than n opti. That is to say: n i = Integer(n opti - n 0 ) and 0 n n i + n 0 Another new starting point is then calculated, the optimal spring #3 is obtained and its corresponding value of objective function is obj -. - Step #4: selecting the optimal spring from springs #2 and #3 Three possibilities can occur: o Both springs respect the whole constraints. In which case, the spring with the best objective value is selected. o Only one spring respects the whole constraints. In which case, this spring is selected. o Both springs violate one or more constraint(s). The following criterion is created to make a decision: P(X) = {Max[0 ; g i (X)]} The spring with the least P(X) value is chosen as the best spring. A violated constraint induces a positive value for the associated g i (X), whereas a negative one is obtained when the constraint is respected. Moreover, every constraint is adimensionalised and the further a positive constraint is from zero, the more it is violated. P(X) for spring #2 (respectively spring #3) is obtained by adding all positive g i (X) values of the optimisation problem corresponding to spring #2 (respectively spring #3). So it is possible to compare the range of violation of each spring through their own P(X) value. 3.3.2 GRG and SQP efficiencies extension spring GRG and SQP efficiencies are then tested and compared in the case of two problems. For the first one (designated Problem 2 ), Table 2 shows optimal spring design (i.e. values of the six design variables Do, d, T0, n, L1 and L2, and of the associated objective function) proposed by both GRG and SQP. In addition, the relative difference between both methods for each characteristic is presented. These tests show that the results obtained using GRG (without margin) and SQP (with a 1/1000 th margin) are very close. In Table 2, GRG and SQP produce very similar optimal springs, except for n (number of coils). In fact, for this problem, specifications imply that n is a discrete variable (n acceptable values are {n i + 0.5} where n i is an integer). Thus, a slight difference in the variables between GRG and SQP (e.g. due to some internal numerical settings) can lead to a one-coil step for n. As in the case of compression spring optimisation, GRG and SQP are very fast (less than 2 seconds), and SQP is even faster than GRG. To conclude, the optimisation method using SQP for extension springs is as efficient as that using GRG. 7
Problem 2 L0 200 mm F1 = 200 N L1 = 245 mm L2 = 345 mm steel german loops at 180 Do DIN norm for limits calculation Objective: minimum mass Variables of the optimisation problem - Characteristics of the spring d T0 (%) n (coils) L1 L2 Objective function Mass (g) GRGextension 44.739 4.337 4.507 24.500 245.000 345.000 390.110 SQPextension 45.810 4.355 4.430 23.500 245.245 345.000 388.269 Relative difference (%) 2.394 0.415 1.708 4.082 0.100 0.000 0.472 Table 2. Results of Problem 2 (extension spring), comparison GRG/SQP 3.4 Torsion spring design 3.4.1 A specific numerical difficulty: the non-convex acceptable domain for a variable Now, the difficulties encountered by GRG and SQP in optimising torsion spring design are analysed. A specific difficulty in dealing with problems of torsion spring optimisation is linked to the possibly non-convex acceptable domain for variable n (the number of coils). This case can occur when there is a specification for a design or operating angle, which is a very common situation for torsion springs. An example is presented on Table 3. Problem 3 Do = 10 mm d 1 mm Lk0 50 mm 150 0 155 Ra = 15 mm Rb = 15 mm steel Objective: maximum angle 2 Table 3. Problem 3 specifications (torsion spring) Designer specifications require that angle 0 must be between 150 and 155. This constraint leads to a non-convex acceptable domain for n, as shown in Figure 6. 360 0 Constraint: 150 0 155 155 150 180 0 n = N n = N+1 n = N+1 N+2 : valid domains for n Figure 6. The acceptable values of n can define a non-convex domain n This kind of problem is quite difficult for mathematical programming algorithms because they have to be able to jump from an acceptable domain to another separated by an unacceptable domain. 8
To solve this difficulty, a method that can be called coil to coil calculation is proposed. It consists in carry out optimisation process one interval after another (2 n 3, 3 n 4, etc as shown in Figure 7). In each sub-domain, only one valid domain appears, a new starting point is calculated and the optimisation algorithm can converge through the local optimum. Thus, every one-coil interval corresponds to one step of the optimisation process, with one local optimal spring. This results in there being as many calculated springs as intervals. Finally, the optimal spring selected is the one that respects all the constraints and offers the best objective function value. 2 3 4 5 6 7 8 9 79 80 step #1 #3 #5 #7 #2 #4 #6 n Figure 7. Coil to coil calculation method The calculation limits applied here (2 coils to 80 coils) are wide enough apart to collect nearly all the torsion springs that could be designed. 3.4.2 GRG and SQP efficiencies torsion spring GRG and SQP efficiencies are compared by analysing their results from two optimisation problems. Table 4 shows optimal springs (i.e. values of the seven design variables Do, d, n, Ra, Rb, M1 and M2, and of the associated objective function) proposed by both GRG and SQP, for Problem 3. Moreover, the relative difference between both methods for each characteristic is presented. Figure 8 provides numerical details of coil to coil calculation used by GRG and SQP methods for this problem. Variables of the optimisation problem - Characteristics of the spring Objective function Do d n (coils) Ra Rb M1 (N.mm) M2 (N.mm) GRGtorsion 10.000 1.000 48.040 15.000 15.000 139.330 139.400 1235.0 SQPtorsion 10.000 1.000 48.039 15.015 15.015 137.627 139.424 1235.3 Relative difference (%) 0.000 0.000 0.002 0.100 0.100 1.222 0.017 0.024 Table 4. Results of Problem 3, comparison GRG/SQP 2 ( ) 2 referred to n interval 1240 1220 1200 2 ( ) 1180 1160 1140 44 n 45 45 n 46 46 n 47 47 n 48 48 n 49 49 n 50 n (coils) GRG Série1 SQP Série2 Figure 8. Details of coil to coil calculation for Problem 3 9
Once again, these tests show that the results of GRG (without margin) and SQP (with a 1/1000 th margin) are very close. As for compression and extension spring optimisation, GRG and SQP are very fast (less than 2 seconds), and SQP is faster than GRG. 4 Conclusion Spring design optimisation problems contain several numerical difficulties for mathematical programming algorithms: equality constraints, discrete variables, non-convex valid domains for a variable. Optimisation methods for compression, extension and torsion spring design are proposed to solve these difficulties. GRG and SQP algorithms are successfully tested to solve spring design optimisation problems and their efficiencies are compared: SQP seems to be a little faster than GRG, nevertheless GRG is a more efficient manager of equality constraints than SQP. Commercial software that include a solver based on GRG or SQP can thus be used to build assistance tools for designers. These positive results lead us to be optimistic about developing such optimal design methods for conic compression springs that have non-linear characteristics, and other mechanical components. References [1] Institute of Spring Technology, Henry Street, Sheffield, S3 TEQ, United-Kingdom, www.istec.demon.co.uk. [2] Hexagon, GmbH, Stiegelstrasse 8, D-73230 Kirchheim/Teck, Deutschland, www.hexagon.de. [3] Spring Manufacturer Institute, Midwest Road, Suite 106, Oak Brook, Illinois 60523-1335, USA, www.smihq.org, 2001. [4] S. M. METWALLI, M. A. RADWAN, A. ELMELIGY. MCAD and Optimization of helical torsion springs, Computers in Engineering, ASME, Vol.2, 1994, pp. 767-773. [5] S. N. SHOME, J. BASU. Optimal design of helical coal compression spring, Mechanical Engineering Bulletin, N 1-2, Vol.18, 1987, pp. 12-18. [6] M. PAREDES, M. SARTOR, J-C WAHL. Optimisation techniques for industrial spring design, 2002. [7] A. LOZZI, P. BRIOZZO. The Practical Optimisation of Machine Components, The International Journal of Engineering Education, N 1, Vol.16, 2000, pp. 39-49. [8] Frontline System Inc. www.frontsys.com. [9] LOH, H. T. and PAPALAMBROS P. Y. "A Sequential Linearization Approach for Solving Mixed-Discrete Nonlinear Design optimization Problems", Journal of Mechanical Design, ASME, Vol. 113, pp. 325-334, 1991. [10] R. E. MOORE. Methods and applications of interval analysis, SIAM Studies in Applied Mathematics, 1979. [11] M. PAREDES, M. SARTOR, J.-C. FAUROUX. Stock spring selection tool, Springs, official publication of the Spring Manufacturer Institute, Vol.39, 2000, pp. 53-67. [12] R. C. JOHNSON. Optimum design of mechanical elements, Second Edition, Wiley- Interscience Publication, ISBN 0-471-03894-6, 1980. [13] K. O. GUPTA, A. RAVINDRA. Non linear Integer Programming and Discrete Optimisation, Journal of Mechanisms, Transmissions and Automation in Design, ASME, Vol.105, 1983, pp. 160-164. 10