comms6: C.6) Draft of Technical Report

C.6 Assignment
Carol Wong
Adam Komorski

C.6.1) Revised Problem Statement

We choose to focus on a very practical matter that is 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. 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. This provides insights on specific parameters to tune during the rotation of Rhex's legs. More information on this will be presented in literature review section below.

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.

We will focus on implementing a five-legged gait. This may not necessarily be a five legged crawl gait as implemented in [2]. The resulting five-legged gait will then be optimized. Successful implementation is determined by whether our five-legged gait performs better than the currently used tripod gait implementation with one leg missing. We begin with the null hypothesis that the five legged tripod gait does not produce stable forward motion. We hypothesize that our newly implemented vie legged gait will perform better than the tripod gait. 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.

C.6.2) Revised Literature Review

There have been several studies documenting the adaptability of animals to the loss of the use of a leg. These studies show us how an animal can adjust to a change in its physical structure and learn a new means of reasonably optimal locomotion within the constraints of the physical disability. It is this plasticity that we aim to replicate and explore with this experiment.

Source [9] tells us about the effects of varying degrees of paresis on the gaits of adult, male rats using pressure sensors to record gait measurements.

This paper is published in the Journal of Neuroscience Research which has an impact factor of 2.986 according to ISI Web of Knowledge Journal citation Reports which places it 104th out of 231 journals in the neuroscience category.

The paper tells us:

Predictable data emerged such as decreased weight bearing in the affected limb(s) … compensatory changes in the gait cycle, particularly in forelimb dynamics were detected … documented longer stance time and shorter swing time of the right hindlimb during gait … Hindlimb paresis was accompanied by compensatory changes in forelimb movement as evidenced by shorter and more frequent forelimb strides…

Thus confirming that animals do alter their gait when injured.

[1] further confirms that examples of animals adapting to injuries incorporate certain variations in leg swing and stance phases, verifying information presented by [9]. Previously mentioned, source [1] observes how rats adapt to motor injuries that affect motions in a hindleg or foreleg. Source [1] presents keen observations that can be adapted to the Junior platform, such as 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.

Source [2] provided insight on how to tune a five-legged gait. Authors of [2] successfully implemented a five-legged crawl gait after loss of a leg. Looking at acceleration, pitch and roll metrics, authors ascertained that on five legs, the tripod gait loses stability and impacts the ground with substantial force in the vertical plane. This re-iterates observations in lab, in which the five legged tripod gait caused Junior to pummel into the ground. Data collected by the authors of [2] further verifies that the five legged tripod gait is not stable and there is need for improvement.

Source [2] 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.

C.6.3) Revised Methods and Setup

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.

Hypothesis Testing

As we mentioned before, 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, as recorded by an IMU), directed gait (position tracker, or ability to walk in straight path) and controlled gait (in terms of velocity, via Vicon, a motion capture system).

Therefore the data collected will be IMU angles (radians), energy costs, and Vicon outputs. An ANOVA statistical model will be used to ensure statistical significant conclusions. The ANOVA test is an expanded version of the t-test, in which more than 2 variables attributable to variance are compared between two sets. The base set represents Junior executing a tripod gait with one leg missing (the middle leg on either side). The other set represents our newly implemented five legged gait.

Setup Details

We plan to use a simple setup that consists of the Junior robot, a network connection, floor space, and the Vicon motion capture system. We will mark the path that we want the robot to follow with a tape line on the floor. We will remove one of the “middle” legs (leg 1 or 4) from the robot in order to attempt our five-legged gait. The majority of our data will be collected directly from the robot (e.g. yaw angle, motor current), and the path length and deviation from the path can be measured with a tape measure. We can further evaluate our gaits by incorporating measurements from the Vicon. We will need to attach several reflective markers to the robot in order to track its motion. This will allow us to record the position and orientation of the robot over time to a very high degree of accuracy. The maximum pitch and roll angles over the course of each trial will be of particular interest.

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 will be used 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. We also plan to collect position and orientation data from the Vicon motion capture system over the course of each trial. This information can be read into MATLAB and stored in a .mat file as well. In particular, we plan to record the maximum roll and pitch angles for each trial. The Vicon will also provide us with more accurate measurements of the path length and the deviation from the path.

Data Processing

The measurements necessary for the completion of our project can mostly be taken directly from sensors on the robot and exported into MATLAB for processing. Several of our measurements will be recorded by the Vicon motion capture system and read into MATLAB. 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. The Vicon data also allows us to include the maximum pitch and roll angles in our evaluation of gaits. As a result, this is the data that we will be looking at in our analysis.

C.6.4) Status Report of Progress

We have already completed the majority of the steps necessary to set up our experiments. We have shown that we are able to connect to the the robot and command leg positions and velocities through our previous lab experiments. We have implemented the Buehler clock in Python, which will be the foundation for all of the gaits that we test in our experiments. We have implemented a tripod gait which will be used to test our hypothesis that we are able to improve upon both the tripod gait (minus one leg) and the five-legged crawl gait. We have already shown that we are able to read, record, and plot data from the robot over the course of an experiment from previous lab exercises. This includes motor current, motor voltage, leg position, yaw angle, and acceleration data. We also have a team member with previous experience working with the Vicon. This includes creating new objects and reading position and orientation information into MATLAB. As was previously mentioned, our data collection and storage methods are already in place and have been tested.

Plan for upcoming weeks

Week of 4/11/11

- Explore possible five legged gaits
- Write up code to record metrics (listed below)

Adam and Carol:
- Work with the Junior platform
- Observe the five legged tripod gait
- Actively record imu readings like yaw, roll, pitch
- Record acceleration of body
- Record current dissipated in leg (as measure of energy consumption); either through logger or actively extracting the values.

4/17/11: Meet with each other to collaborate results and prepare action plan for the next week.

Week of 4/18/11

- Implement one of the five legged gaits successfully

Schedule meeting with each other once a viable five legged gait is found. Then we proceed as follows:

- Adam is familiar with and has access to a Vicon system
- Use Vicon system to capture velocity and positional orientation

- Collect and compile imu values, acceleration, energy consumption

  • Actively record imu readings like yaw, roll, pitch
  • Record acceleration of body
  • Record current dissipated in leg (as measure of energy consumption); either through logger or actively extracting the values.

4/24/11: Meet with each other.
- Discuss data collected
- Produce figures/data tables summarizing results

Week of 4/25/11

Adam and Carol: (early in the week)
If time allows, speak with Dr. Koditschek regarding Nelder - Mead optimization. However, if finding an appropriate objective function proves more difficult, or if learning to navigate the technique proves too time consuming, we hope to implement some other optimization functions, or simply optimize based on a energy values.

Meet with each other mid-week:

Adam and Carol:
- Analyze
- Perform statistical tests (ANOVA) on data collected
- Produce final draft

C.6.5) Draft Results Section of Technical Report

Outline of Results

- Results:

  • Data collected from five legged tripod gait in tables/figures
  • Data collected from an alternate five legged gait (possibly the crawl gait) in tables/figures
  • Statistical analysis comparing metrics (roll, pitch, energy consumption, yaw) through series of t-tests for each of the five legged gaits
  • Conclusion refuting or verifying hypothesis
Gait Name Acceleration Yaw Pitch Roll Energy Consumption Positional Deviation
Five Legged Tripod Gait
Time (0 s)
Time (15 s)
Alternative Five Legged Gait
Time (0s)

The image above is taken from source [2]. We hope to plot a few metrics to provide a simplified representation of the two tripod gaits we are comparing.


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