Swarm-Based Optimizations in Hexapod Robot Walking István Kecskés*, Ervin Burkus*, Péter Odry*** *Obuda University, Budapest, Hungary ***Subotica Tech, Subotica, Serbia
[email protected],
[email protected],
[email protected] Abstract—During previous research [1-7] and development several hexapod walking robots and its simulation model were built by the authors. The latest model called Szabad(ka)-II is a complex, servo motor driven, multiprocessor device. In parallel with the building of this hexapod robot, a simulation model was also built in order to help optimize the robot’s structure, walking and driving [5]. The results of modeling and parameter optimizations can be used as a guideline during the design of a new and improved robot. The Particle Swarm Optimization (PSO) method was chosen because its simplicity and effectiveness [1, 2]. It has produced better and faster results compared to previously used Genetic Algorithm (GA) [3]. However, neither selected method is able to provide the global optimum in the case of one-time run. Using an optimization benchmark disclose the differences and help to get the best parameterized optimization method for a given problem.
I.
INTRODUCTION
A. Szabad(ka) Robot Series Autonomous hexapod walker robot “Szabad(ka)-I” [4] and “Szabad(ka)-II” [7] (Fig. 1) is developed for testing and developing algorithms connected to motion, robot vision, decision making and robot networking. This hexapod robot series was given the name “Szabad(ka)” because it incorporates the name of the city where it was designed as well as hinting at its main feature, namely that it can be openly (“szabad”) developing platform for user specific needs [4]. Prior to its construction a sophisticated modeling was carried out with special attention to the smallest physical, mechanical and electrical details [2].
B. Simulation Model Working with experiments instead of simulations is not a good choice for critical or complex industrial applications [8, 9]. In the phase of building a hexapod robot the aim was to simulate the robot motion and optimize the drive parameters, e.g. a Fuzzy based controller [6, 8, 9, 17]. In order to obtain optimal parameter values a proper robot model is required [17]. Our detailed simulation model was introduced in [5], which is a detailed kinematic and dynamic model of the real Szabad(ka)-II robot (see Fig. 2). The aim of this model is to simulate the walking and measure its quality in comprehensive situations. The robot model contains its dynamical description, ground contact, behavior of the gears and joints as well as the model of the motors and control electronics. Fig. 3 compares the real measurement of the angle of second link (theta1) of first leg and its simulated curve. The similarity of them is very high due to our model verification efforts which will be published shortly.
Figure 2. Simulink model of Szabad(ka)-II robot – the main blocks
Figure 1. Szabad(ka)-II hexapod walker robot with 18 DOF
Figure 3. The real (blue) and simulated (red) and the desired (green) angle of second link during walking
e) keeping the robot’s body acceleration at a minimum in all three dimensional directions. The fitness function needs to express the quality measurement of these mentioned features with a certain emphasizes. In the previous research the fitness function of hexapod walking was already defined [1, 3]. B. Optimization Task Such optimization methods have been searched and compared that are adequate for the walking and driving optimization on the Simulink model of Szabad(ka)-II as a non-differentiable black-box. The real property information of convex, concave or differentiable about the objective function is unknown due to the influence of the black-box. Therefore neither the techniques that give local solutions nor the gradient based methods is an option. Furthermore, it is an important aspect to receive the results quickly, due to the complexity of the model, one iteration takes 2-4 minutes on an Intel-i7-2600K processor. Generally the aim was to find the best effective multiparameter global optimization method, instead of the exact single timely determination of the optimum. In this research the PSO method was chosen, because of its speed, and its simple adjustability. Comparison is made with GA, because that method [1, 3] has been thoroughly experienced. Figure 4. Simulated straight-line walking of Szabad(ka)-II robot: on first graph the 3D movement of robot body (B), on second its velocity (BV), third the acceleration (BA), and fourth the consumed current (ISUM) can be seen
C. Hexapod Walking It has been assumed that in such case probably the robot goes for a farther target point, without any maneuver and other operations. Thus the most important task will be to achieve a fast and low-energy-consumption locomotion using the simplest case, which is straight-line walking on even ground. The tripod straight-line walking is the faster gait [18]. The fitness functions used in the walking optimization procedures are determined according to these principles (see section II.A). Fig. 4 show the typical tripod gait problem, which occurs in our model and robot: a) when legs changed then the robot walking-way (X direction) velocity strongly fall back; b) undesired significant sideward movement (Y direction) occurs. II.
BUILD OPTIMIZATION SYSTEM
A. Fitness Function Issue The chosen robot's walking optimality is measured by a certain fitness function. System parameters can be chosen correctly if one or more goals are defined and formulated. These goal features are defined [1, 3, 16]: a) achieving maximum speed of walking with as little electric energy as possible, b) keeping the minimal torques on the joints and gears, c) maintaining the currents of the engines discursive and spiky as little as possible, d) letting their variation be as small as possible while walking, and
C. Particle Swarm Optimization (PSO) Swarm intelligence describes the collective behavior of decentralized, self-organized systems, natural or artificial [10]. The PSO uses a simple mechanism that mimics swarm behavior in birds flocking and fish schooling to guide the particles to search for globally optimal solutions [11]. Advantages are that it is intelligent, fast, simple and robust. Has no overlapping and mutation calculation, therefore a particle is not tested multiple times [13]. Performs well in situations [14], where the objective function is complicated and not continuous. Disadvantages are that the method easily suffers from the partial optimism, which causes the loss of accuracy at the regulation of its speed and the direction. The method is unable to work out the problems indefinable in a coordinate system [13]. We used Matlab implementation of PSO from [21]. The number of generation was selected to NG=60, and the population size was NP=40, inertia weight w=0.9, cognitive attraction c1=0.5, social attraction c2=1.5, and the hybrid function as PS algorithm. These parameters were selected partly from the literature [20, 15], partly from own experience. III. OPTIMIZING TRAJECTORY AND CONTROLLER For the mentioned walking a three-dimensional ellipsebased trajectory curve was generated which defines the feet’s desired cyclic movement in relation to the robot body (see Fig. 6). More detailed description of this elliptic trajectory calculation can be found in [3, 16]. Both the trajectory curve and the driving motor controller’s behavior directly influence the real or simulated movement. Therefore the PI motor controller and the parameters of the mentioned trajectory have been chosen, this can be seen in Table I. The lower (min.) and upper (max.) bounds of these parameters were defined empirically in the most cases.
TABLE I. 1 2 3 4 5 6 7
OPTIMIZATION METHODS
Parameter PID Controller’s proportional PID Controller’s integral The cycle’s time duration Length of step – stride Height of walk trajectory Lift (A) and cycle (A+B) ration Lowpass FIR filter strength
Min. 0.05 0 0.9 0.1 0.01 0.45 4
Max. 0.5 1 1.7 0.18 0.04 0.75 300
The simulation time was selected for only three seconds in order to hasten the runtime as much as possible, but at least to let simulate one and a half walking cycle [1]. In the initial state of the chosen simulation case, the robot’s bottom point was 1mm above the ground; the legs were set to the initial points of the desired trajectories. The ground was even with 1.0 friction constant. The Table II comprises of the fitness evaluation’s [1] detailed partial results for both the compared cases. The PSO gave better results with a prominent walking velocity and the smallest electric energy consumption (see Fig. 5). The torques and the robot-body’s accelerations have similar acceptable magnitude for both cases. Fig. 5 compares the mentioned simulation results and it can be apparently observed that the better fitness value accompanied with the more linear walk-direction movement prevails, i.e. its velocity has marginal fluctuation. Herewith a typical walking problem of the Szabad(ka)-II robot can be significantly reduced. TABLE II.
RESULTS OF FITNESS FUNCTION
Fitness tags Gear torques Body acceleration Body angular acceleration Energy per meter Loss of height Mean velocity Fitness value (calculated from the above tags)
Trial 9.56 1.76 16.5 49.2
Optimized 9.12 1.80 17.2 42.5
-0.0071
-0.0073
0.139
0.152
3.78
5.17
Figure 5. Simulated walking characteristics of trial and optimized cases: on first graph the body movement in X direction (BX), second its velocity (BVX), third the body movement in Y direction (BY), fourth the aggregated motor current (ISUM)
Fig. 6 illustrates the theoretical generated trajectory for both the compared cases (trial and optimized), next shows the simulated trajectory of the leg endpoint, and the link angles in function of time can be seen as well.
Figure 6. Trajectory curves of trial and optimized cases: left the desired trajectory, middle the simulated trajectory of a leg, on right the angles of links.
IV. OPTIMIZING ROBOT STRUCTURE The simulation model was used for verifying the construction, but currently as the next step it is used for defining the construction and dimensions. The definition of the optimal parameters can be solved with optimization methods; the PSO method was chosen [2]. The most significant dimensions define the positions of the legs and the lengths of the leg parts. Developing the structure and defining its dimensions is a very broad set of problems. In the case of the previous robot its symmetrical arrangement caused some problems while it was walking using the tripod gait [4, 18]. At tripod gait different forces are applied to the legs. While on one side of the robot the front and rear legs are at the same time on the ground till on the other side only the middle foot contacts the ground. Because of this, the motors are loaded unevenly and the motors driving the femur part of the middle legs have to be much stronger. This phenomenon can be seen in the simulations results: torque distribution in trial case, in Fig. 7. The optimization – based on experimental experience – needed maximum 400 evaluations to find best solution, at which the distribution of the load are even. It can be concluded, that if the outer leg pairs are closer to each other, and if the femur parts are shorter, then the load difference between the theta2 joints is smaller. The femur part significantly affects the walking speed therefore the optimization parameters have been refined. In the new cases the femur length varied between smaller limits. The fitness function is the ratio between the sum of the average joint torques and the distance traveled by the robot. These technologies will be definitely used prior to the construction of the next robot. The presented model
cannot perform the total verification of the mechanics but, it is possible to create a detailed model which is capable of the robot’s realistic simulation. In the case of building the complete model, appropriate results can be achieved, if the optimization is fine-tuned. In [19] an interesting work is presented which may be related to our research. The authors made a robot, which can simultaneously optimize its structure and control system. This is done using an evolutionary algorithm. The main difference between this process, and the method presented in this paper is that in [19] an already constructed wheeled robot can alter the links of its mechanism on which the wheels are mounted, while in the case presented here, the robot’s structure can be changed before the manufacturing process. V. CONCLUSION During this research the authors gained experience in the field of robot walking optimization. Currently the objective function is the straight-line walking quality of Szabad(ka)-II robot in virtual simulation space using the dynamic model. The design vector of this optimization system was both the parameters of the leg trajectory and robot structure. The optimization results by PSO are better compared to the previously used GA implementation [3]. However it is not proved that the given optimum is the global optimum. When we called these optimization processes more times, the algorithm not reaches the same result. Fig. 8 show a demonstration of optimization benchmark with the same objective function. Curves illustrate the evolutions where the left top corner represent the best and fast optimum.
Figure 7. The trial and optimized case of robot leg lengths (on right size) and the distribution of joint torques during walking (on left side)
[5] [6]
[7]
[8] [9]
[10] [11] [12]
[13] Figure 8. Hexapod walking trajectory optimization with both tested methods and various parameterized instance
It can be concluded that the obtaining of the global optimum by heuristic method required more instances of running, with different parameterized runs (these parameters mentioned in section II.C). Using such an optimization benchmark can disclose the differences between algorithm instances and it can help to obtain the best parameterized optimization method for a given problem. The well-defined quality formulation and properly weighting of fitness function tags are important based on our experience. The next major research task intends to focus on issues: which simulation cases and fitness function can result in such a trajectory and robot structure that ensures similar effective working for various environmental influences. ACKNOWLEDGMENT We owe special thanks to the micro-motor factory Faulhaber for its support that has supplied the 18 motors and gears for the Szabad(ka)-II robot. Grateful acknowledgments to company Appl-DSP [1] for financing all other parts and costs of the robot. The author(s) gratefully acknowledge(s) the financial support by the Óbuda University research fund. REFERENCES [1]
[2]
[3] [4]
István Kecskés, László Székács, János C. Fodor, Péter Odry: PSO and GA Optimization Methods Comparison on Simulation Model of a Real Hexapod Robot, ICCC 2013, pp.125-130, ISBN:978-14799-0060-2 Ervin Burkus, János C. Fodor, Péter Odry: Structural and Gait Optimization of a Hexapod Robot with Particle Swarm Optimization, SISY 2013, pp: 147-152, ISBN: 978-1-4799-0305-4 Z. Pap, I. Kecskés, E. Burkus, F. Bazsó, P. Odry: Optimization of the Hexapod Robot Walking by Genetic Algorithm, SISY 2010, pp 121-126, ISBN: 978-1-4244-7394-6 Ervin Burkus, Peter Odry: Autonomous Hexapod Walker Robot “Szabad(ka)”, Acta Polytechnica Hungarica, Vol 5, No 1, 2008, pp 69-85, ISSN 1785-8860
[14]
[15]
[16]
[17]
[18]
[19]
[20] [21]
István Kecskés, Péter Odry: Full Kinematic and Dynamic Modeling of “Szabad(ka)-Duna” Hexapod, SISY 2009, pp:215219, ISBN: 978-1-4244-5348-1 István Kecskés, Péter Odry: Protective Fuzzy Control of Hexapod Walking Robot Driver in Case of Walking and Dropping, Springer, 2010, Volume 313/2010, pp 205-217, DOI:10.1007/9783-642-15220-7_17 Ervin Burkus, Dragica Radosav, Peter Odry: Autonomous Hexapod Walker Robot “Szabad(ka) II” – Software Modeling and Tools, ITRO 2011, Zrenjanin, Serbia, http://www.tfzr.uns.ac.rs/itro/ZbornikITROFinal.pdf I.J. Rudas, J. Fodor: Intelligent systems, International J. of Computers, Communications & Control, Vol. III (2008), pp. 132138, ISSN 1841-9836 R.E. Precup, R.C. David, E.M. Petriu, M.B. Radac, S. Preitl, J. C. Fodor: Evolutionary optimization-based tuning of low-cost fuzzy controllers for servo systems, 2013 Lambert M. Surhone, Miriam T. Timpledon, Susan F. Marseken: Swarm Intelligence, 2010, ISBN: 613035584X Mehdi Neshat, Mehdi Sargolzaei, Azra Masoumi, Adel Najaran: A New Kind Of PSO: Predator Particle Swarm Optimization, 2012 Magnus Erik Hvass Pedersen: SwarmOps for MatlabNumeric & Heuristic Optimization Source-Code Library for Matlab The Manual, 2010 Qinghai Bai: Analysis of Particle Swarm Optimization Algorithm, Computer and Information Science 3(1): pp 180-184, 2010 Pakize Erdogmus and Metin Toz: Heuristic Optimization Algorithms in Robotics, Serial and Parallel Robot Manipulators Kinematics, Dynamics, Control and Optimization, Dr. Serdar Kucuk (Ed.), ISBN: 978-953-51-0437-7, InTech, DOI: 10.5772/30110, 2012 J. Kennedy and R. Eberhart: Particle Swarm Optimization, Proc. of IEEE International Conf. on Neural Networks IV, pp. 1942– 1948, 1995. I. Kecskés, P. Odry: Walk Optimization for Hexapod Walking Robot, CINTI 2009, pp265-277 http://conf.uni-obuda.hu/cinti2009/25_cinti2009_submission.pdf R.E. Precup, S. Preitl, I. J. Rudas, M.L. Tomescu, J.K. Tar: Design and Experiments for a Class of Fuzzy Controlled Servo Systems, Mechatronics, IEEE/ASME Transactions on 13 (1), pp. 22-35, ISSN: 1083-4435 Ganesh Ramanathan: SCOOP for Robotics, Implementing bioinspired hexapod locomotion, http://se.inf.ethz.ch/old/projects/ganesh_ramanathan/report.pdf Masanori Sato, Kazuo Ishii: Simultaneous Optimization of Robot Structure and Control System Using Evolutionary Algorithm, Journal of Bionic Engineering 7 Suppl., pp. 185-190, 2010 Magnus Erik Hvass Pedersen: Good Parameters for Particle Swarm Optimization, Hvass Laboratories, Technical Report no. HL1001, 2010 code.google.com/p/psomatlab/