comms5: Wong Komoroski

C.5: Methods and Setup

Revised Problem Statement and Hypothesis

C.5.1) Restatement of Original Problem and Hypothesis

In formulating a problem to attack for the remainder of the semester, we decided that the topics we discussed in our C1 and C2 assignments (serpentine locomotion and flight) were not directly applicable to the legged robots like RHex. One of the overarching issues that arose when delving into serpentine locomotion was the lack of control, specifically automated control and adaptability. Automated control is a highly desired capability for non-legged and legged robots, one that has not yet been fully incorporated. Source [3] mentions that “There is currently no well-established methodology for controlling the locomotion of robots…in particular for non–steady-state locomotion in complex environments.”

We choose to focus on a very practical matter that was frequently observed in laboratory experiments: the loss of one leg during or before locomotion. The leg typically remains intact, but the motor fails to move. The tripod gait currently implemented to direct six legged motion confers stability by ensuring a steady center of mass, such that RHex does not topple over while transitioning between one tripod and the other. When one leg function is compromised, RHex wobbles back and forth, almost falling to the ground. Its path of motion becomes unpredictable. The running gait is manually terminated and started again.

We aim to incorporate the capability of directed, controlled, and purposeful movement even in the absence of a leg. RHex would be able to compensate for the complete loss of function in one leg, restoring motion to a state comparable to full legged functions. Drawing from the idea of neural plasticity, where the human brain is rewired to adapt to unexpected, obtrusive events, such as brain injury or loss of limbs, we hope to incorporate some artificial learning in RHex.

Venturing into the literature, we identified [2], a study on control of actuators in developing fault-tolerant motion. Source [2] states: "The problem of fault recovery represents a vast, important domain in its own right that is still relatively unexplored in robotics." The paper [2] is an excellent example of recent research that addresses the problem we plan to help solve. We have determined that this paper is a reliable source, since the third author, D. E. Koditschek, has an h-index of 21 according to Scopus. Also, all three authors are associated with the University of Pennsylvania. This paper has been cited twice, according to Google Scholar. The paper describes an approach to detecting the failure of a leg on the Rhex robot and adjusting the gait accordingly for the other five legs to allow it to continue moving. In this case, the robot attempts to regain stability by switching to a five-legged crawl gait.

The authors feel that neglecting this issue of recovering from disturbances would be a failure to take full advantage of the benefits that we gain from legged locomotion. They note that: "although the promise of redundancy against individual joint or limb failure ought to be one of the major advantages of legged mobility, with few exceptions [15–17] there is little legged robotics literature on gait adaptation in the face of compromised self-health."

This suggests that this capability is not only extremely useful, but is also "relatively unexplored"[2] as of the paper's publication in October of 2010.

Indeed, mathematical models such as those presented by [2] provide a foundation for the implementation of certain desired capabilities. Ultimately, biology analogs contribute the most practical implementations, as they have already been so aptly used by animals like the rats studied in [1]. Animal analogs have demonstrated uncanny ability to adapt to injuries and other sustained handicaps. Source [1] completed a study on how rats adapt to motor injuries after spinal cord injuries that compromise motion in one leg. For instance, one of the observations is the following: "First, in contrast with control animals, [injured rats demonstrated] ankle relative forward velocity peaked on the first third of the swing phase and decreased during the second third."

Rats demonstrated longer stance phases and shorter recirculation phases. Authors of [1] also observed variations in load bearing across hind-legs and forelimbs based on which leg was injured.

This provides insights on specific parameters to tune during the rotation of Rhex's legs. [1] has authors with Scopus reported h-indexes of 4, 4, and 19, respectively. It was published in Journal of Neurotrama, with an ISI reported impact score of 4.255 and 5 year impact factor of 4.281, extending back to its 2006 publication date. It has been cited 12 types according to Scopus. Therefore, it is a quite credible biology source.

Currently, RHex achieves stable gait with six functional legs through a Buehler Clock implementation with tripod sets. The goal is to create functional, directed motion with minimal functionality, expanding the Buehler Clock control such that each or a collection of legs operates on its own schedule. Modifying the control mechanisms for each leg, or set of legs is the next step towards this.

A paper produced by KodLab [2] presented a stable five-legged crawl gait, where each leg runs on its own Buehler clock, such that sweep and recirculation phases are all staggered. The parameter tuning each clock is identical across five legs. A video presentation demonstrates stable forward motion, where RHex crawls, its main platform body bobbing up and down as it proceeds forward. The execution of a five legged crawl was implemented immediately by [2] as soon as a failure was observed. Because this transition has been proven to produce stable execution of the five legged crawl, we will focus on optimizing a five-legged gait. This may not necessarily be a five legged crawl gait as implemented in [2]. Optimization will be evaluated by several metrics, namely, energy costs. We aim to locate the most energy efficient parameters that result in stable gait (stable center of mass, possibly recorded by an accelerometer), directed gait (position tracker, or ability to walk in straight path) and controlled gait (in terms of velocity, via Vicon, a motion capture system).

In order to approach this problem, we propose a mathematical and bioinspired approach. Going through the robotics literature, we noticed many successful implementations of an optimization technique called the Nelder-Mead algorithm. The authors of [6] were able to increase hand-tuned RHex parameter produced gaits of .8 m/s to 2.7 m/s with the Nelder-Mead. Nelder Mead is especially useful when dealing with a large and complicated feature space. With many tunable and interrelated parameters, RHex is characterized by a complicated feature space. Given an objective function that characterizes the system behavior (whether it be yaw, speed, energy expenditure), Nelder-Mead searches through select number of sample space points to find the parameter set that minimizes or maximizes the objective function value. Nelder-Mead does not run on any real data. The challenge lies in locating a proper objective function. We hope to implement classifiers to create a model that would serve as the objective function.

The bio-inspired approach draws off of the observations made by researchers of [1]. As rats vary load bearings on select leg, we aim to identify parameters that increase or decrease the weight placed on each leg. We will evaluate load-bearings on each leg based on energy consumption. Drawing from the observation that more energy is consumed when RHex is standing than sitting, we determine load bearing based on relative energy consumption of one leg relative to the others.

C.5.2) Revisions Resulting from Lab/Course Experience

The lab projects that we have completed in this course have provided us with useful skills and knowledge that will be relevant to our final project as well as some practical experience that will influence our approach. Since we are continuing to use the same robot from the lab tasks, much of what we've learned and accomplished will be directly applicable. Lab 0, for example, taught us how to connect to the robot, command the robot, and read data from the logger. We will find it beneficial to already have this knowledge at the start of the project. Lab 1 focused on understanding and implementing the Buehler clock and tripod gait. We plan on using the tripod gait as our method of locomotion prior to the leg failure. We will use the Buehler clock to parameterize the motion of each leg both before and after the leg failure. Having completed these tasks, we now have a better understanding of how to achieve stable locomotion with this robot and have developed a useful code base for controlling the robot's legs. Finally, both Lab 0 and Lab 3 dealt with logging, plotting, and analyzing data from the robot. This process was useful, since it gave us a better idea of what information the robot is capable of monitoring and how to use it to better understand what the robot is doing.

We have also found the practical experience of working with the robot useful in other ways. This process has taught us to debug simple problems with the robot and helped us to understand how calibration issues can affect experimental results. It has helped us to choose a project of appropriate scope given the limited time remaining in the course. We have a better idea of the time it takes get good experimental data and to tune gains carefully.

C.5.3) Scientific, Mathematical or Statistical Methods

Nelder Meads (Statistical Method):

While the Nelder-Mead algorithm is mentioned a lot in the literature, the actual implementation is not so clear. However, Dr. Koditschek is an author on [6], a paper detailing how its authors improved gait speed and resistances through some modified Nelder Mead implementation. We hope to draw from his expertise.

We believe it is difficult to fully comprehend all the parameters that affect RHex's locomotion behavior, and even more difficult to capture this behavior in one objective function. Taking heed from neural plasticity, we looked into machine learning classifiers. We collect real time data from RHex, by varying sweep angles, duty factors, and other parameters. After recording say, yaw, as an indication of positional alignment, we input the parameters and observed yaw readings into a classifier, which forms a model. Classes could be assigned based on ranges of yaw (close to original yaw reading, one standard deviation away from yaw reading, etc.). In this way, the classifier formulates a model for us, which we use as the objective function.

I have used several machine learning classifiers before and am prepared to implement them in this context. However, we hope to consult first with Dr. Koditschek on alternative ways to determine an appropriate objective function. Using a classifier would require collecting a substantial amount of test data, which we might not have time for.

Varying Load Bearing

The research done by source [12] presents one practical, mechanical way of varying load bearing on legs. Source [12] states:

"For dynamic tasks with significant impacts of unpredictable timing, such as running, the inherent power limitations, and bandwidth delays in motor control have led to the development and adoption of passive compliant legs."

This suggests that varying elasticity of legs can impact the resulting load bore by that leg. In [12], the authors placed a sleeve on each leg. The stiffness of the legs can be represented as a torsional spring, or series of springs. Varying the location of the slider on each leg effectively shifts the location and magnitude of the torsional spring constant. We could implement a 'slider' to effectively vary leg stiffness in a simple and observable way. The alternative is blindly changing parameter values to figure out which one results in the most optimal change in load bearing. Again, this might require some feature reduction and optimization techniques. As Dr. Koditschek is again an author listed in this paper [12], we hope he can offer insights on how to proceed.

Experimental Methods

C.5.4) Details of Setup

The setup will be very similar to whatever is currently implemented in lab. We simply need a robot with dynamism, a network connection, floor space, tape to map out a path, a ruler, and of course, Deniz and Prof. Kodistchek.

C.5.5) Sources of Means

We have everything we need. However, if we decide we need a motion capture system, we could go to the GRASP lab for the Viacon system. Otherwise, we formulated our project with feasibility in mind and do not need much more outside of what is provided in lab. If we choose to implement a 'slider' to vary leg stiffness, we would need to locate the necessary material; this may already be available through the KodLab, who published the paper [12] on use of the 'slider'.

C.5.6) Operational Plan

See 5.9 below

Data Analysis

C.5.7) Resulting Data Base

In all of our experiments for this project, we plan to collect data from the robot in python arrays. This includes motor current, motor voltage, leg position, yaw angle, and acceleration data over time. All of this data can be pulled directly from the robot and should be sufficient for achieving the desired behaviors and evaluating the results. Once collected, we have decided that the best way to store this data is to export it into MATLAB and save it as a .mat file. This format makes the data easily accessible and will be useful in the data processing and analysis stage.

C.5.8) Data Processing

The measurements necessary for the completion of our project can almost all be taken directly from sensors on the robot and exported into MATLAB for processing. The remainder of the measurements will be simple distance and time measurements that will help us determine how quickly and accurately the robot is able to traverse the desired path. These other measurements will be taken using a tape measure and a stop watch. Much of our data will be used in the Nelder-Mead process to optimize our five-legged gait. Since a significant part of our project will be learning and understanding this method, the specifics of how this data will be used will come after this task. We expect that our objective function will deal with some combination of acceleration, yaw rate, and/or energy consumption. As a result, this is the data that we will be looking at in our analysis.

C.5.9) Operational Plan

We plan to meet every weekend to go through what we have done and what we plan to do. If class time is not sufficient to complete desired task, we plan to come in Tuesdays, after 3.

Week 1: 3/28 - 4/3
Task 1a - Task 1b
Week 2: 4/4 - 4/10
Task 1c - 1e
Week 3: 4/11 - 4/17
Task 1f
Task 2a
Week 4: 4/18 - 4/24
Task 2b - 2d

Task 1: Optimizing five-legged gait

Task 1a: Observe tripod gait with disabled leg
Task 1b: Look at and implement [2]'s five-legged crawl gait
- figure out what parameters to use
- observe behavior - (ie: positional alignment (straight path), velocity)
Task 1c: Learn Nelder Mead
- Consult with Prof.
- What objective function to use - necessary to use classifiers?
- what to optimize? : energy, yaw displacements, etc.
Task 1d: Use Nelder Mead with optimal function
- Find out what optimal parameters are
Task 1e: Implement those 'optimal' parameters
- observe RHex behavior
- analyze data
Task 1f: Go back, fine tune objective function?

Task 2: Vary load bearing

Task 2a: Compare different metrics to measure load bearing
- current, energy expenditure, etc?
- Have RHex stand on select legs, which legs have more bearing?
Task 2b: Increase stance phase, decrease recirculation phase (from rat paper [1])
- Change clock timings
Task 2c: Change leg to leg synchronization
- Legs offset
- change the 'pacing' of buehler clocks relative to each other
Task 2d: Vary elasticity of legs
- slider on leg

Final Presentation - 4/26


1. Collazos-Castro, J. E., López-Dolado, E., & Nieto-Sampedro, M. (2006). "Locomotor deficits and adaptive mechanisms after thoracic spinal cord contusion in the adult rat." Journal of Neurotrauma, 23(1), 1-17. Retrieved from
2. Johnson, A.M., G.C. Haynes and D.E. Koditschek. "Disturbance Detection, Identification, and Recovery by Gait Transition in Legged Robots". 2010 IEEE/RSJ International Conference on Intelligent Robots and Systems October 18-22, 2010, Taipei, Taiwan. pp. 5347-5353
3. Ijspeert, A. J. (2008). "Central pattern generators for locomotion control in animals and robots: A review". Neural Networks, 21(4), 642-653.
4. Sfakiotakis, M., & Tsakiris, D. P. (2007). "Neuromuscular control of reactive behaviors for undulatory robots". Neurocomputing, 70(10-12), 1907-1913.
5. Yang, J. -. (2005). "Gait synthesis for hexapod robots with a locked joint failure." Robotica, 23(6), 701-708. Retrieved from
6. Weingarten, J. D., Groff, R. E., & Koditschek, D. E. “A framework for the coordination of legged robot gaits”. 2004 IEEE Conference on Robotics, Automation and Mechatronics. December 1, 2004. pp. 679-686.
7. Weingarten, J. D., Lopes, G. A. D., Buehler, M., Groff, R. E., & Koditschek, D. E. “Automated gait adaptation for legged robots”. 2004 IEEE International Conference on Robotics and Automation. April 26, 2004. New Orleans, LA. 2004(3) 2153-2158.
8. Haldun Komsuoglu, Anirudha Majumdar, Yasemin Ozkan Aydin, and Daniel E. Koditschek. “Characterization of Dynamic Behaviors in a Hexapod Robot”. International Symposium on Experimental Robotics, Delhi, India, December 2010.
9. Benjamin S. Boyd, Christian Puttlitz, Linda J. Noble-Haeusslein, Constance M. John, Alpa Trivedi, Kimberly S. Topp "Deviations in gait pattern in experimental models of hindlimb paresis shown by a novel pressure mapping system". Journal of Neuroscience Research, vol. 85 issue 10, pp. 2272-2283, August 2007.
10. Wanda J. Gordon-Evans, Richard B. Evans "Accuracy of Spatiotemporal Variables in Gait Analysis of Neurologic Dogs". Journal of Neurotrauma, vol. 26 issue 7, pp. 1055-1060, July 2009.
11. Gillis G.B., Biewener A.A. "Hindlimb muscle function in relation to speed and gait: In vivo patterns of strain and activation in a hip and knee extensor of the rat (Rattus norvegicus)". Journal of Experimental Biology, vol. 204 issue 15, pp. 2717-2731, Aug 2001.
12. Galloway, K. C., Clark, J. E., & Koditschek, D. E. (2008). "Design of a multi-directional variable stiffness leg for dynamic running." Paper presented at the ASME International Mechanical Engineering Congress and Exposition, Proceedings, , 10 PART A 73-80. Retrieved from