Anda di halaman 1dari 42

ABSTRACT

Dynamic walkers are basic mechanical gadgets, made out of strong parts associated by joints
that walk steadily down an incline. They have no engines or controllers, yet can have
amazingly humanlike movements. The multiple support phases present in a bipedal walking
cycle naturally lead to a mathematical model that consists of a set of differential equations
describing the dynamics during the single support phase, and a discrete model of the contact
event when double support is initiated. Durin0g single support, assume either that the biped
has point feet or that the biped has feet and the stance foot remains flat on the ground.
Assume furthermore that the stance leg end acts as an ideal pivot. Every bipedal robot has its
walking cycle to move without falling. The main issue is static instability of the biped during
parts of the walking cycle. Thus, this project was to investigate the dynamic walking for
three-link bipedal robot and model movement dynamic walking for three-link bipedal robot.
Then, the movement dynamic walking three-link bipedal robot will be simulated in Matlab
based on kinematic equation. The three-link bipedal robot will be walking stably based on the
kinematic equation.
ABSTRAK

Pejalan kaki yang dinamik adalah alat mekanikal asas, yang diperbuat daripada bahagian
yang kuat yang dikaitkan dengan sendi-sendi yang berjalan terus ke bawah lekukan. Mereka
tidak mempunyai enjin atau pengawal, tetapi boleh mempunyai pergerakan seperti manusia
yang luar biasa. Fasa sokongan berganda yang hadir dalam kitaran berjalan bipedal secara
semulajadi membawa kepada model matematik yang terdiri daripada satu set persamaan
kebezaan yang menerangkan dinamik semasa fasa sokongan tunggal, dan model diskrit
peristiwa hubungan apabila sokongan berganda dimulakan. Semasa sokongan tunggal,
anggap sama ada bicaranya mempunyai titik kaki atau biped mempunyai kaki dan kaki
pendirian tetap datar di atas tanah. Anggapkan lagi bahawa ujung kaki pendirian bertindak
sebagai pangsi ideal. Setiap robot bipedal mempunyai siklus berjalan untuk bergerak tanpa
jatuh. Isu utama adalah ketidakstabilan statik yang dipotong semasa bahagian kitaran
berjalan. Oleh itu, projek ini adalah untuk menyiasat berjalan pantas untuk robot bipedal tiga
pautan dan gerakan pergerakan model dinamik untuk robot bipedal tiga pautan. Kemudian,
pergerakan robot bipedal berjalan tiga langkah yang dinamik akan disimulasikan dalam
Matlab berdasarkan persamaan kinematik. Robot bipedal tiga pautan akan berjalan dengan
stabil berdasarkan persamaan kinematik.
TABLE OF CONTENTS

CHAPTER ITEM PAGE

ACKNOWLEDGEMENT IV

ABSTRACT V

ABSTRAK VII

TABLE OF CONTENTS IX

LIST OF FIGURES X

LIST OF TABLES XI

I INTRODUCTION 1

1.1 Motivation 1

1.2 Problem statement 2

1.3 Objective 2

1.4 Scope 2

II LITERATURE REVIEW 3

2.1 Introduction 3

2.2 Biped 3

2.3 Bipedal robots 4


2.4 Three-link walker 4

2.5 Dynamics walking 4-5

2.6 Impact 5

2.7 Characteristic of movement three-link bipedal robot 5

2.8 Control Strategies in Bipedal Robot 6

2.8.1 Poincare Map method in bipedal robot 6

2.8.2 Intuitive Control for bipedal robot 7-8

2.8.3 Lagrange method in bipedal robot 8-9

2.9 Summary 9

III METHODOLOGY 10

3.1 Introduction 10

3.2 Mathematical Modelling of Three-Link Bipedal Robot 10 - 14

IV RESULTS AND DISCUSSION 15

4.1 Overview 15

4.2 Simulation Setup 15 - 16

4.3 Animation picture for three-link bipedal robot 16 - 17

4.4 Result for walking by three-link bipedal robot 18 - 19

V CONCLUSIONS AND RECOMENDATION 20

5.0 Conclusion 20

5.1 Recommendation 20

VI REFERENCES 21 - 22
VII APPENDICES 23 - 28

LIST OF FIGURES

FIGURE TITLE PAGE


2.1 Biped walking trajectory using four via-points 6
2.2 A single link of an open-chain robot 7
3.1 The Three-link Bipedal Robot 9
4.1 The picture of simulation setup 14
4.2 The animation picture of three-link bipedal robot for 1st step 15
4.3 The animation picture of three-link bipedal robot for 2nd step 16
4.4 The animation picture of three-link bipedal robot for 5th step 17
4.5 The joint positions of three-link bipedal robot 18
4.6 The joint velocities of three-link bipedal robot 18
LIST OF TABLES

TABLE TITLE PAGE


1.1 The model parameters 10
CHAPTER 1

INTRODUCTION

1.1 Motivation

Since 1960s, with the creation and development of humanoid robots, bipedal robotics
has become the topic of keen interests by many researchers. Especially the introduction of
ASIM by Honda and MAHRU by Samsung Electronics have taken the topic to a new height
[18]. The need for human-like bipedal robot has been felt due to the probable extinction of
human race or for our convenience to use the robots as a supplementary assistance
mechanism. Especially the application of bipedal robots in space exploration, biomedical
science and engineering has become remarks of this century. Further introduction of such
robots in restaurants serving food has also drawn public attraction [16].

The bipedal robot is from legged robots subclass. The investigation of bipedal robot
has persuaded by its potential utilize, for example, headway in unpleasant landscape, can be
utilized as a part of danger condition and some more. The bipedal robot can be made from
multiple points of view in light of creature like ways like how they move which will make
more creation fascinating. The examination in bipedal robot specific emerges from different
sociological and business interests, going from the want to supplant people in risky
occupations and to the reclamation of movement in the handicapped.

There are numerous innovation has been created and particularly created to construct
walking models. In spite of that, theoretical control leaps forward have not kept pace with the
mechanical improvements. There are a few issues while plan bipedal robot, for example,
controller that produces close-loop movements like walking and running that are steady and
consistent [1]. There is a tremendous shortage in crucial control outline ideas in contrast with
the quantity of bipedal models.

There are many methods that can use to make bipedal robot move in steady and stable
but in this project the method of Lagrange was used to derive the equation of motion of the
three-link bipedal robot.

Further motivation of this research was caused due to the following reasons. Firstly, a
three-link bipedal robot is more human-like and can easily interact with people that a wheeled
robots cannot. Secondly, bipedal robots can access more areas than other robots such as stairs
or place filled with obstacles. Thirdly, bipedal robots causes less damage to the contact
surface or ground than wheeled and other moving robots.

1.2 Problem Statement

Each bipedal robot has its walking cycle to move without falling. The primary issue is
static instability of the biped during segments of the walking cycle. For dynamic walking, the
projection of the area of the biped's centre of mass (COM) onto the walking surface is outside
the biped's support polygon and generally the area of the biped's centre of pressure (CoP) is
on the limit of the support polygon while parts of the walking cycle.

1.3 Objectives

1. To investigate the dynamic walking for three-link bipedal robot in previous work.
2. To model movement dynamic walking for three-link bipedal robot.
3. To simulate movement dynamic walking for three-link bipedal robot based on
kinematic equation.

1.4 Scope
This scope of this project will be focuses on investigate the dynamic of walking and
modelling movement dynamics for the bipedal robot in previous work. From kinematic
equation, we used Lagrange’s method to derive the equations of motion of the three-link
robot in single support. The simulation of three-link bipedal robot walking movement will be
on flat ground only. The results of simulation will be taken in graph for five steps of walking.

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

The chapter addresses and discusses relevant excerpts from relevant earlier literatures on
the field of biped robotics system. The reviews are extracted and synthesized critically to
understand the importance of the research and its background better. The reviews begin
with definition and conceptualization of biped, followed by bipedal robots, three-link
walker, dynamic walker, impact, characteristics of three-linked bipedal movement as well
as several control strategies in bipedal robots.

2.2 Biped

A biped is an open kinematic chain comprising of two sub-chains called legs and,
regularly, a sub-chain called the torso, all associated at a typical point called the hip.
Either of the legs or both the legs can be in contact with the ground or contact surface [1].
When both the legs are in contact with the ground at a standing stance, both the legs and
feet are called stance leg and stance foot respectively. However when a movement is
attempted to be made by forwarding a leg, the moved leg is called the swing foot. On the
other hand, the foot that is stepped on the ground is called the stance foot. The stance foot
carries almost the whole body weight and supports the stance foot [15]. In another word,
swing foot is completely supported by the ground. However, the end of a leg, regardless
of whether it has joins constituting a foot or not, will infrequently be alluded to as a foot
[1]. Therefore, it is represented by a pendulum system with constrained motion generated
by forward and backward movement of the limb touching the ground [16].

2.3 Bipedal robots

Bipedal robots are anthropomorphic (human-like) robots that can imitate human
expressions in terms of movement or walking [21]. Bipedal robots are those humanoid
actively or passively controlled device that moves or walks with two legs. Hence, robots
with only heads or body above and wheels at the bottom do not fall into this criteria [19].
Moreover, bipedal robots constitute a subclass of legged robots as there are multiple-
legged robots. On the handy side, the investigation of mechanical legged headway has
been propelled by its potential use for velocity in harsh territory, or conditions with
spasmodic backings, for example, the rungs of a stepping stool. It should likewise be
recognized that a significant part of the present enthusiasm for legged robots originates
from the interest of machines that work in creature like ways [1]. In [7] research into
regarding the matter of biped walking utilizing support adapting fundamentally considers
stable walking. Be that as it may, the stance of the robot is as essential as steady walking,
for instance, if considering climbing stairs or walking crosswise over finished venturing
stones. In these cases, the foot position of the robot is vital. Each foot need to be set in the
required position or the robot will fall. In [8], a biped robot is in a steady state when it
remains on the ground with two feet. At the point when a robot is walking, the robot can
without much of stretch tumble down in the event that it can't keep a dynamic balance.
Thus, some analyst has utilized a numerical model to develop a dynamic equation of a
biped. A biped robots consists of both motors and sensors which are controlled by
microcontroller, a programmable integrated circuit (PIC), or by a computer system
attached to the robot’s body [20].

In [17], it has been asserted that the bipedal robots can store energy at the foot that
strikes or touches the ground and release the energy when the foot is taken off the ground,
swung to move to another location. The advantage of bipedal robots lies in its better
degrees of mobility in community environment and places with obstacles compared to
wheeled robots [21].
2.4 Three-link walker

A three-link walker is the two-interface walker with the expansion of a torso joined
at the hip. Simply stating, a three-link planar biped walker consists of a torso, a hip and
two systematic legs. The torso is kept standing above the two legs using torsional springs.
The torque is applied only between the support and the swing legs [22]. Two actuators are
utilized to control the relative points between the torso and every leg. Since the position
of the COM can be shifted by changing the lean edge of the torso, it is less demanding to
control the walking velocity of this robot than the two-link robot. Since the robot has two
actuators, it is more illustrative of the multivariable criticism control plans utilized for
more broad robots [1]. A walker goes through a three-link phase when the system consists
of a three-link pendulum. A walker is in a three-planner phase until the knee strikes event
or one of the leg is attempted to begin a swing state [23].

Figure 2.1: Three-link robot model

Source: J. Morimoto, G. Cheng, G. G. Atkenson and G. Zeglin, 2004 [3]

2.5 Dynamics walking

Traditionally, in mimicking the human walking into a bipedal robot, trajectory-


control approach was used by controlling the ankle joints. However, the approach not
only requires high energy, but also its walking looks unnatural. Honda’s P3 robot with
130kg used to consume 2kW energy while walking which is 20 times larger than the
energy consumed in human for muscle work [24]. In order to overcome the issue, the idea
of (passive) dynamic walking was first coined by Tad McGeer in his 1990’s work [27].
He proposed that if two legs can be connected to the hip by a pin joint, the system
produces similar motion to human leg. In passive dynamics, stability of many steps
overtime is considered rather than the stability of continuous task within a step. The
approach considers each step as a unit and uses non-linear mathematics methods (such as,
limit-cycle analysis) to focus on the whole system rather than a particular joint [25].

A dynamic walking model can even walk down little inclined surface with the
absence of actuators, sensors or controllers. Dynamic walking models are powered by
impulses, springs and simple forcing functions. This very-own mechanical dynamic
properties of the dynamic walking principle determines its movement [26]. In fact, a
passive-dynamic walking does not require any control or power to walk, except only a
small amount of energy is required. This energy is gained by gravitational power while
walking down a ramp. The gravitational force can also offset the losses from impact
between ground and feet. The passive-dynamic approach tends to constantly control
actuation to force a system against its natural dynamic tendencies [27]. The advantages of
dynamic walking are simple or almost no control, human-like gait and high-energy
efficiency. However, the disadvantage is the approach currently involves less power that
only enables the robot to walk on downhill slopes. However, to walk on uphill surfaces,
higher energy can be supplied [26].

Dynamic walking is a hypothetical way to deal with legged movement which


stresses the utilization of basic dynamical models and concentrates on conduct throughout
many advances, instead of inside a solitary advance, normally trying to comprehend or
advance steadiness and vitality economy. It is helpful to start a dialog of dynamic walking
by depicting latent dynamic walking, from which the approach began [4]. The numerous
help stages display in a bipedal walking cycle fundamentally prompt a scientific model
that comprises of no less than two sections which are an arrangement of differential
conditions portraying the progression during the single help stage, and a discrete model of
the contact occasion when twofold help is started. Accept besides that the position leg end
goes about as a perfect rotate [1].

2.6 Impact
Biped locomotion consists of a system in which an upper body supported by two
legs that can be in contact with the ground. While taking a forward step to start or
continue walking, one of the leg (swing leg) touches the ground and an impact occurs.
During this state, the biped motion is interrupted and at the contact point as well as at
each joint, impulsive forces develop [28]. There are two phase of impact. When a heel-
strike occurs by the swing leg followed by a continuous motion, the first impact occurs.
The second impact occurs at the end of the collision phase when the swing foot touches
down the ground completely. Both impacts are instantaneous, rigid and dissipate part of
the energy of the robot [30].

The subsequent powers that are produced between the robot and the walking surface
rely upon whether the surface is springy, similar to a trampoline, gooey, similar to a
sloppy edge of a lake, or basically rigid, similar to a strong floor. The cases like surface
was springy have not been considered in the legged-robot group. On account of a rigid
walking surface, the length of the effect occasion is short. During an impact, the collision
loss can be reduced and energy dissipated can be restored by positive mechanical work of
the stance leg (the leg with complete contact with the ground). The impact can result in
smaller collision and lesser energy consumption, if the positive mechanical work is done
by the stance leg right before the collision of swing leg. In dynamic walking model, the
optimal horizontal velocity vector is half of the velocity change factors for both collision
and push-off. Moreover, the change in energy is directly proportional to the square of the
velocity change vector. Therefore, while the stance leg supplies push-off energy to the
swing leg before or at the point of collision, the collision loss reduces by a factor of four.
Collision losses can further be reduced by taking shorter steps [24]. The [29] found that a
bigger swing ankle angle in a reasonable range can lead to a lower initial speed for the
next step and an overall higher walking stability. However, they acknowledged that a
bigger swing ankle increases consumption of a bigger amount of energy.

In human gait, the heel pad and the Achilles tendon absorb part of the energy during
and after the impact. The energy is returned to the swing leg before the following stance
phase of the swing leg. However, in bipedal dynamic walking, the energy is dissipated.
Therefore, [30] proposed installing an elastic mechanisms on the robot structure to not
only reduce the impact, but also store part of the energy in elastic form to be returned to
the robot.
2.7 Characteristic of movement three-link bipedal robot

During movement, a three-link bipedal robot go through several phases. The first
phase is called the double support phase (DSP) when both the legs are completely in
contact with and supported by the ground or when the robot is in standing position. In this
state, both feet are stance feet. It is followed by a pre-swing phase in which the heel of the
swing foot is attempted to be lifted from the floor. However, both the legs are still in
contact with the ground and the double support phase still remains. The third phase is the
single support phase (SSP) when the swing foot is completely above the ground (in the
air), swings forward and the stance foot takes all the body weight. The final phase is
called the post-swing phase the swing foot touches the ground and tends to share the body
weight with the stance foot. This phase makes the stance foot ready to be lifted and begin
repeating the following cycle of similar steps [16].

Figure 2.2: Phases of a periodic cycle

Figure 2.3: Typical shapes of the stance leg (in grey) and swing leg (in white);
(a) DSP, (b) DSP (pre-swing phase), (c) SSP

Source: M. H. P. Dekker, 2009 [16]


Similar explanation has been given by [35] stating that in a typical three-link bipedal
walking step, (refer to the figure 2.3) while the stance leg (lighter line) just make a
contact with the ramp (the top upper left of the figure), the swing leg (darker line) begins
to swing until it heel-strikes the ramp. In the figure, θ denotes the angle of the stance leg
with normal slope, ∅ denotes the angle between the stance and the swing leg, M denotes
the mass of the hip, m denotes the mass of the foot, l denotes the slope of the ramp and g
denotes the gravitational force.

Figure 2.4: Typical three-link bipedal walking steps

Source: M. Wisse, 2004 [35]

While the single support stage, the position leg end goes about as a perfect rotate. The
double support stage is prompt and the related effect can be displayed as an inflexible
contact. At impact, the swing leg neither slips nor bounces back, while the previous
stance leg discharges without connection with the ground. In consistent express, the
movement is symmetric regarding the two legs. In each progression, the swing leg begins
from entirely behind the stance leg and is put entirely before the stance leg at affect. The
walking is from left to right and happens on a level surface [1]. Another study [31]
explain that in the single support phase, the impact of swing leg is perfectly inelastic and
the friction is sufficient to ensure that the swing leg does not slips away. Furthermore, the
support is considered to be shifted from one (swing) leg to another (stance leg). In [32], it
is acknowledged that an ankle with less power faces difficulty to control walking.
Therefore, they used a control mechanism both during standing and walking states where
in standing, the control input (displacement of the ankle joint of swing leg) decides the
bending angle of the body and the swinging leg to eliminate instability. However, only
the bending angle of the body is used during walking to ensure continuity of the control
input.

2.8 Control Strategies in Bipedal Robot

2.8.1 Poincare Map method in bipedal robot

A general procedure of studying biped robot model can be interpreted using a


Poincare map. Poincare map is used to find periodic solution (limit cycles) for the bipedal
robots. Since biped locomotion consists of periodic gaits, Poincare map is a good choice.
Once in every period, the map samples the flow of a periodic system. Referring to the
figure 2.5, if the oscillations approach the limit cycle Γ over time, the limit cycle is
¿
considered stable. The samples approach at a fixed point x . The stability of the map is
¿
determined by making P linear around the x [33].

Figure 2.5: Poincare map


Source: N. Khraief, M. K. M’Sirdi and M. W. Spong, 2003 [33]

The Poincare map of bipedal walking must be learned with a model that predicts the
condition of the biped a half cycle ahead, in light of the present state and the foot
arrangement at touch down. At that point, anticipate the area of the framework in a
Poincare segment at stage φ = 3π/2 in light of the framework's area in a Poincare segment
at stage φ = π/2. From that point onward, utilize a similar model to anticipate the area at
stage φ = π/2 in light of the area at stage φ = 3π/2 (Fig. 2.6). Since the condition of the
robot radically changes at foot touchdown (φ = 0, π), the stages φ = π/2 and φ = 3π/2 was
chosen as Poincare areas.

Figure 2.6: Biped walking trajectory using four via-points [3]

Source: J. Morimoto, G. Cheng, G. G. Atkenson and G. Zeglin, 2004 [3]

[34] reaffirms that the Poincare method has been used in evaluating local
stability of a bipedal robot’s walking. A general procedure of studying biped robot model
can be interpreted using a Poincare map. However, in this case, a ground contact model
and a dynamic biped robot must be available. Since availability of both the model at a
time is difficult, the authors of [34] used a nonparametric representation based on
sampled data from real environment to represent the map and a reinforcement learning
method (RL) to optimize the parameters of a known biped walking controller.

2.8.2 Intuitive Control for bipedal robot

Bipedal robots are hard to investigate scientifically. Be that as it may,


successful control strategies can be found utilizing straightforward physical intuition and
can be depicted in basic terms. Five things need to occur for a planar bipedal robot to
walk. Height must be balanced out. Pitch must be settled. Speed must be balanced out.
The swing leg needs to move with the goal that the feet are in areas which take into
consideration the steadiness of stature, pitch, and speed. At last, changes from support leg
to support leg must happen at fitting circumstances. On the off chance that these five
targets are accomplished, the robot will walk. Various distinctive instinctive control
methodologies can be utilized to accomplish each of these five objectives. Further, every
system can be actualized in an assortment of ways [2].

There are various techniques which can be utilized to actualize the intuitive
control strategies. These incorporate opposite kinematics, high pick up servos, encourage
forward control, impedance control, and so on. The Virtual Model Control strategy was
utilized which itself depends on instinct, to actualize the control methodologies. This
control strategy utilizes simulation of virtual mechanical segments to produce genuine
actuator torques. These joint torques make a similar impact that the virtual segments
would have made, had they existed, consequently making the fantasy that the recreated
parts are associated with the genuine robot. Such segments can incorporate straight or
non-direct springs, dampers, dashpots, masses, locks, orientation, potential and
dissipative fields, or some other conceivable part.

Stabilizing height is direct as long as we have a help leg immovably on the


ground. This will be the situation if the swing leg technique and support leg systems are
working. There are numerous ways stature can be balanced out which are keeps up a
steady tallness over the ground and a consistent position leg length. As in high
stabilization, balancing out pitch is clear as long as we have a support leg immovably on
the ground. Two systems for settling pitch were kept up level pitch and take after a pitch
direction. Most speed stabilization strategies for bipedal walking are discrete occasions
and consequently control the speed from step to step instead of all through a given step.
Indeed, for dynamic bipedal walking, it is difficult to discretionarily control the forward
speed during a step since the centre of mass projection lies outside the support foot
polygon during a significant part of the walk. Five methodologies for stabilizing speed are
change walk length with speed, change progress occasions with speed, servo speed when
the centre of mass is over the support foot or when the robot is in double support, change
the area of the body centre of mass by pitching forward or in reverse, and apply vitality at
key circumstances [2].

To walk effectively, the swing leg must swing rapidly to its next support area.
Luckily, the correct position isn't essential when walking on smooth ground. Two
conceivable methodologies for swinging the swing leg are servo the swing leg, either as a
function of time or as a component of the other leg and let the swing leg swing inactively,
ensuring it doesn't hit the ground. To constantly walk forward, the support legs must be
exchanged since a given leg can just support the body over a little range. For bipedal
walking, double support to single support and single support to double support changes
must happen at proper circumstances. Three procedures for transitioning from double
support to single support are change to single support if the body is inside a specific
separation to the following support leg, progress to single support if the body is over a
specific separation far from the past support leg, and progress to the single support leg in
the wake of being in double support for a specific measure of time.

In a latter study [36], an intuitive control scheme, namely, virtual model control has
been used for bipedal locomotion. The research emphasized on placing the virtual
components, such as, damper, springs, masses, latches, dashpots, bearings as well as
adaptive and learning elements, that requires physical intuition. Virtual model control is
used to generate expected joint torque using simulation of virtual components. Virtual
model control borrows idea from impedance control, virtual reality, stiffness control and
formulation of the operational space. The study also found that the interactions among the
components and the robots automatically generate the required force or torque at the
actuators when the placement in performed. Therefore, dynamic model is not required in
the control algorithm. The study also selected a set of gait parameters that helped
achieved a stable dynamic walking for the bipedal robot. Advantages of the control model
range from less complexity in computation to implementation ability in a distributed
manner.

2.8.3 Lagrange method in bipedal robot

Lagrangian method, also known as the Euler-Lagrange formalism, is a


differential method used to interpret the evolution of a system in relation to time. This is
used for bipedal walking robots due to its capability of handling highly unstable
dynamics. The method explains the relationship between the system’s motion and its
accelerations. This method used the kinetic and potential energy of a rigid body to derive
the evolution of motion for a kinematic chain (a set of links where each link with the
length l acts as a particle and the mass m is located at the centre of the each link. Since
the method includes numerous discrete and continuous equations, a tool, namely, Acumen
has been used to express the mathematical terms in a convenient form and combine the
process of modelling and simulation. In order to define the generalized coordinates, one
of the ways is to use the absolute angles of the links with the original frame and the other
ways is to use the angles between the links as a kinematic approach [37].

The Lagrange for a N-interface, inflexible body open-chain robot with N one-
DOF revolute joints is a practical following up on focuses in the state space, x = (q; ˙ q) ∈
X = TQ, where Q is a just associated, open subset of TN+3 × R3. The summed up arrange q
∈ Q give the robot's shape, introduction, and position in three dimensional space. The
Lagrange is characterized to be the difference between the kinetic and potential energies.

Figure 2.7: A single link of an open-chain robot [1]

Figure 2.7 shows a single link of an open-chain robot used to explain the method of
Lagrange. A is an inertial coordinate frame and B is a body coordinate frame, i.e., it is affixed
to the link. The vector r is from the origin of B to the centre of mass of the link. The vector rA
(resp. rB) is from the origin of A (resp. B) to an arbitrary point in the link. The vector pAB is
from the origin of A to the origin of B.

2.9 Summary

Bipedal robots are robots with two legs that can mimic human walking using a
dynamic walking approach [1], [7], [8], [19], [20], [21]. Bipedal robots can have multiple
linked planar. However, three-link planar has been used by [1], [3], [22]. [23]. When bipedal
robots begin to walk, the stance leg remains in contact with the ground and supports the
swing leg which moves forward to make a step. The cycle continues; when both the leg are in
contact with the ground, the system is in double support phase and when one of the leg
swings above and forward, the system is in single support phase. In order to control the
walking of bipedal robot various researchers used distinctive method. For example, [3], [33]
and [34] used Poincare map to evaluate stability of the robot’s walking. [2] and [36] used
intuitive control method to generate desired torque at the joints of the hip. However, this
study uses the Lagrangian method in modelling and simulating the walking of the desired
bipedal robot that has also been used by [1] and [37]. The dynamic model is effectively
obtained with the method for Lagrange, which comprises of first processing the kinetic
energy and potential energy of each connection, and after that summing terms to total kinetic
energy, Ks, and the total potential energy, Vs. The technique for Lagrange was utilized to
derive the condition of movement of the three-link bipedal robot.

CHAPTER 3

METHODOLOGY

3.1 Introduction

In this chapter, the method and tools used to modelling movement dynamics is
explained in detail.
3.2 Mathematical Modelling of Three-Link Bipedal Robot

A three-link walker is the robot which has no knees. It is known to have stable
walking movements when walking down an enough sensitive steady incline, this robot
display does not have any steady walking developments without control. The three-link
walker gives the minimum troublesome representation where torso stabillization is critical..
The model is given in two sets of coordinates. Please referred Figure 3.1.

Figure 3.1: The Three-link Bipedal Robot [1]

Figure 3.1 demonstrates schematic sign the meaning of the generalized coordinates and
the mechanical information of a three-link bipedal robot. All masses are same. The legs are
symmetric, with length r, and the mass of every leg is same which at r/2. The distance from
the hips to the centre of mass of the torso is indicated by l.

Based on (a), the model is appeared in a set of absolute coordinates, that is θ1, θ2, and θ3
are each referenced with respect to the inertial frame. The label −θ2 indicates that the angle is
negative as labelled. In (b), the model is appeared in body (likewise called shape)
coordinates, where q1 and q2 are estimated with respect to the body and only q3 is referenced
to the inertial frame.

Table 1.1: The model parameters [1]


Parameter Units Value
Torso length, l m 0.5
Leg length, r m 1.0
Torso mass, MT kg 10
Hip mass, MH kg 15
Leg mass, m kg 5
Acceleration due to gravity, m/s2 9.81
g0

The standard robot equations apply in this project resulting in

Ds ( q s ) q̈ s +C s ( qs , q̇ s ) q̇ s+G s ( q s )=Bs ( q s ) u (1)

Where q is a set of generalized coordinates and u denotes the vector of actuator


torques.

Equation (1) can be solved according to the below equations of D s , C s ,Gs and Bs .

The equations Ds represent for inertia matrix, C s represent for Coriolis matrix, Gs represent
for gravitation force matrix and Bs represent for input matrix.

Notation for equation below:


Δ: Impact function of biped model
( q , q̇ ) = x: Coordinates of position
u: Control signal
θ1: Angle of swing leg
θ2: Angle of stance leg
θ3: Angle of torso
den: Denominator

Applying the method of Lagrange yields the following data for the model [1]:
( 5
( D s ( q ) )1,1= 4 m+ M H + M T r 2 )
−1 2
( D s ( q ) )1,2= 2 mr cos ( θ1−θ 2 )

( D s ( q ) )1,3 =M T rlcos ( θ1−θ3 )

1 2
( D s ( q ) )2,2= 4 mr

( D s ( q ) )2,3 =0

( D s ( q ) )3,3 =M T l2 (2)

The remaining entries of inertia matrix are completed by symmetry. The nonzero entries of Cs
are:

−1
( C s ( q , q̇ )) 1,2= 2 m r 2 sin ( θ 1−θ2 ) q̇2

( C s ( q , q̇ )) 1,3=M T rl sin ( θ1−θ 3 ) q̇3

1 2
( C s ( q , q̇ )) 2,1= 2 m r sin ( θ 1−θ2 ) q̇1

( C s ( q , q̇ )) 3,1=−M T rl sin ( θ1−θ 3 ) q̇1 (3)

The vector Gs and the input matrix Bs are given by:


[ ]
−1
g ( 2 M H +3 m+2 M T ) r sin ( θ1 )
2 0
Gs = 1 (4)
g mr sin ( θ2 )
2 0
−g0 M T lsin ( θ 3)

And

[ ]
−1 0
Bs = 0 −1 (5)
1 1

The impact model is shown below:

[ ]
0 1 0
∆q= R = 1 0 0 (6)
0 0 1

1
( ∆ q̇ )1,1=
den
[ 2 M T cos ( −θ1 +2θ 3−θ2 ) −( 2 m+ 4 M H +2 M T ) cos ( θ 1−θ2 ) ]
m
( ∆ q̇ )1,2=
den
( ∆ q̇ )1,3=0
1
den [
( ∆ q̇ )2,1= m−( 4 m+4 M H + 2 M T ) cos ( 2θ 1−2θ 2 ) +2 M T cos ( 2θ 1−2θ 3 ) ]

1
( ∆ q̇ )2,2= 2m cos ( θ1 −θ2 )
den
( ∆ q̇ )2,3=0
r
( ∆ q̇ )3,1=
lden
[ ( 2 m+ 2 M H +2 M T ) cos ( θ 3+ θ1−2 θ2 )−( 2m+2 M H +2 MT ) cos (−θ1 +θ 3 )+ mcos ( −3θ 1+ 2θ 2−θ3 ) ]
−r
( ∆ q̇ )3,2= mcos ( −θ2 +θ3 )
lden
( ∆ q̇ )3,3=1
den=−3 m−4 M H −2 M T +2 m cos ( 2θ 1−2 θ2 ) +2 M T cos (−2 θ2+ 2θ 3 ) (7)
CHAPTER 4

RESULTS AND DISCUSSION

4.1 Overview
This chapter highlights the results obtained from software simulations together with its
analysis and discussion. The data obtained from the simulation software is tabulated and
presented in the graph. The detailed discussion is described based on how does the input data
varies the output results.

4.2 Simulation setup

Figure 4.1: The picture of simulation setup

Figure 4.1 shows that the simulation setup for dynamic walking of three-link bipedal robot.
The Matlab software was used to simulate movement dynamic walking for the bipedal robot
using Lagrange.

4.3 Animation picture for three-link bipedal robot


Figure 4.2: The animation picture of three-link bipedal robot for 1st step

Figure 4.3: The


animation picture of three-link bipedal robot for 2 step
nd
Figure 4.4: The animation picture of three-link bipedal robot for 5th step

Figure 4.2, 4.3 and 4.4 shows that the animation picture of three-link bipedal robot for
1st, 2nd and 5th step respectively. The green swing leg present in θ1, the red stance leg present
in θ2, and the blue torso present in θ3. When the swing leg start move to the front the colour
still green until it touch ground the colour will switch to red become the stance leg. It happen
same with the stance leg when the position of the stance leg at back after the swing leg move
to the front, it will switch colour to green become swing leg.

4.4 Result for walking by three-link bipedal robot


Figure 4.5: The joint positions of three-link bipedal robot

Figure 4.5 shows that the joint position of three-link bipedal robot when it walking in stable
for 5 steps.

Figure 4.6: The joint velocities of three-link bipedal robot

Figure 4.6 shows that the joint velocities of three-link bipedal robot when it walking in stable
for 5 steps.

Based on figure 4.5 and 4.6, we can see the pattern of the graph repeated 5 times shows
that 5 steps walking of the robot. As we can see in figure 4.5, joint positions for θ1 increases
for step 1 and decreases for θ2 because while step 1 joint positions θ1 only move while joint
positions θ2 will stay. The graph will be same for every step because when the transition
happen between leg 1 and leg 2 the animation will switch back the colour of leg and the
process still same for the other step like step 1. The same things happen for joint velocities θ1
and θ2. Figure 4.6 shows that the joint velocities θ1 increases against time while joint
velocities θ2 decreases against time because θ1 only move and θ2 will stay.
CHAPTER 5

CONCLUSION & RECOMMENDATION

5.1 Conclusion

For the conclusion, the first objective has been already achieved which to investigate
the dynamic walking for three-link bipedal robot. The second objective which to model
movement dynamic walking for three-link bipedal robot also has already achieved. The
simulation was success because the three-link bipedal robot can walk in stable in animation
that running by Matlab software. The simulation was based on kinematic equation which is
Lagrange. The Lagrange was suitable used for simulate three-link bipedal robot.

5.2 Recommendation

For the recommendation, to demonstrate the effectiveness of the proposed method,


not just simulations but experiments also need to be conduct.
REFERENCES

[1] Westervelt, Eric R., Jessy W. Grizzle, Christine Chevallereau, Jun Ho Choi, and
Benjamin Morris. "Feedback control of dynamic bipedal robot locomotion," Vol. 28,
CRC press, 2007.

[2] J. Pratt, and G. Pratt. "Intuitive control of a planar bipedal walking robot." in Proc.
1998 IEEE International Conference on Robotics and Automation, Vol. 3, pp. 2014-
2021, IEEE, 1998.

[3] Morimoto, Jun, Gordon Cheng, Christopher G. Atkeson, and Garth Zeglin. "A simple
reinforcement learning algorithm for biped walking." in Proc. 2004 IEEE
International Conference on Robotics and Automation (ICRA ’04), Vol. 3, pp. 3030-
3035, IEEE, 2004.

[4] Collins, Steven H. "Dynamic walking principles applied to human gait." PhD diss.,
University of Michigan, 2008.

[5] Morimoto, Jun, and Christopher G. Atkeson. "Learning biped locomotion." IEEE


Robotics & Automation Magazine, Vol. 14, No. 2 (2007) 41-51.

[6] Jagodnik, Kathleen M., Philip S. Thomas, Antonie J. van den Bogert, Michael S.
Branicky, and Robert F. Kirsch. "Human-Like Rewards to Train a Reinforcement
Learning Controller for Planar Arm Movement." IEEE Transaction on Human-
Machine Systems, Vol. 46, No. 5, 2016.

[7] Lee, Jungho, and Jun Ho Oh. "Biped walking pattern generation using reinforcement
learning." Int. Journal of Humanoid Robotics, Vol. 6, No. 01 (2009) 1-21.

[8] K.-S. Hwang, K.S., Lin, J.L. and Li, J.S., 2016. "Biped Balance Control by
Reinforcement Learning." J. Inf. Sci. Eng., Vol. 32, No. 4, pp. 1041-1060.

[9] K. Hirai, M. Hirose, and T. Takenaka, “The Development of Honda Humanoid


Robot,” in Proc. 1998 IEEE Int. Conf. Robotics Automation, 1998, pp. 160–165.

[10] K. Nagasaka, M. Inaba, and H. Inoue, “Stabilization of dynamic walk on a humanoid


using torso position compliance control,” in Proc. 17th Annu. Conf. Robotics Society,
Japan, 1999, pp. 1193–1194.

[11] L, Jin-Ling, K-S, Hwang, W-C, Jiang, and Y-J, Chen. "Gait Balance and
Acceleration of a Biped Robot Based on Q-Learning," IEEE Access 4 (2016): 2439-
2449.
[12] Smart, D. William, and L. Pack Kaelbling, "Effective reinforcement learning for
mobile robots," in Proc. 2002 IEEE International Conference on Robotics and
Automation, Vol. 4, pp. 3404-3410. IEEE, 2002.

[13] K, Hajime, T. Yamashita, and S. Kobayashi. "Reinforcement learning of walking


behavior for a four-legged robot," in Proc. the 40th IEEE Conference on Decision and
Control, Vol. 1, pp. 411-416. IEEE, 2001.

[14] R. Khusainov, A. Klimchik, and E. Magid. "Comparison of kinematic and dynamic


leg trajectory optimization techniques for biped robot locomotion," in Journal of
Physics: Conference Series, vol. 803, no. 1, p. 012069. IOP Publishing, 2017.

[15] M. H. P. Dekker, “Zero-moment point method for stable biped walking,” Eindhoven
University of Technology, the Netherlands, 2009.

[16] Y. Hurmuzlu, F. Genot and B. Brogliato, “Modeling, stability and control of biped
robots – a general framewok,” Automatika, Vol. 40, (2004) 1647-1664.

[17] A. G. D. Alba and T. Zielinska, ‘Postural equilibrium criteria concerning feet properties
for biped robots,” Journal of Automation, Mobile Robotics & Intelligent Systems, Vol. 6, No.
1, (2012) 22-27.

[18] S. Kajita and B. Espiau, “Legged robots.” Springer Handbook of Robotics, 2008: 361-
389.

[19] M. Wahde and J. Pettersson, “A brief review of bipedal robotics research,” in Proc. 8th
Mechatronics Forum International Conference, 2002.

[20] A. Senior and S. Tosunoglu, “Design of a biped robot,” in 2006 Florida Conf. on Recent
Advances in Robotics, Florida, May 25-26, 2006.

[21] A. Gupta and A. Shamra, “Modeling and analysis of walking pattern for biped robot.”
Cornell University Library, 2015.

[22] P. X. L. Hera, A. S. Shiriaev, L. B. Freidovich and U. Mettin, “Gait synthesis for a three-
link planar biped walker with one actuator,“ in 2010 IEEE Int. Conf. on Robotics and
Animation, Alaska, USA, May 3-8 (2010) 1715-1720.

[23] C. Honeycutt, J. Sushko & K. B. Reed, “Asymmetric passive dynamic walker,” in 2011
IEEE Int. Conf. on Rehabilitation Robotics, Switzerland, June 29 – July 1 (2011) 852-857.

[24] S. H. Collins, “Dynamic walking principles applied to human gait,” Ph.D. Dissert, 2008.

[25] Q. Wu and N. Sabet, “An experimental study of passive dynamic walking,” Robotica,
Vol. 22, pp. 251-262, 2004.
[26] K. Trifonov, G. Enriquez and S. Hashimoto, “Design issues and applications for a
passive-dynamic walker,” Int. Journal of Multimedia and Ubiquitous Engineering, Vol. 4,
No. 3 (2009) 57-71.

[27] S. H. Collins, M. Wisse and A. Ruina, “A three dimensional passive-dynamic walking


robot with two legs and knees,” The Int. Journal of Robotics Research, pp. 607-615, 2001.

[28] X. Mu and Q. Wu. “On impact dynamics and contact events for biped robots via impact
effects,” IEEE Transactions on Systems, Man and Cybernatics, Part B: Cybernatics, Vol. 36,
No. 36, 2006.

[29] X. Zang, X. Liu and Y. Liu, “Influence of the swing ankle angle on walking stability for
a passive dynamic walking robot with flat feet,” SAGE Journals, 2016

[30] R. Ghorbani, “On controllable stiffness bipedal walking,” Ph.D. Thesis, Department of
Mechanical and Manufacturing Engineering, The University of Manitoba, 2008.

[31] F. M. T. P. D. Silva and J. A. T. Machado. “Kinematic analysis and modeling of biped


locomotion systems.” Journal of the Brazilian Society of Mechanical Sciences, Vol. 21, No.
3, 1999.

[32] K. Y. Yi and Y. F. Zheng, “Biped locomotion by reduced ankle power,” Autonomous


Robots, Vol. 4, No. 3, (1997) 307-314.

[33] N. Khraief, N. K. M’Sirdi and M. W. Spong, “Nearly passive dynamic walking of a


biped robot,” in European Control Conference (ECC), IEEE, 2003.

[34] J. Murimoto and C. G. Atkeson, “Nonparametric representation of an approximate


Poincare map for learning biped locomotion,” Autonomous Robots, Vol. 27, No. 2 (2009)
131-144.

[35] M. Wisse, “Essentials of dynamic walking: analysis and design of two-legged robots,”
2004.

[36] J. Pratt, C-M. Chew, A. Torres, P. Dilworth, and G. Pratt, “Virtual model control: an
intuitive approach for bipedal locomotion,” The Int. Journal of Robotics Research, pp. 129-
143, 2001.

[37] F. Joachimbauer. [2017]. “Concise modeling of humanoid dynamics,” Master Thesis,


Halmstad University, 2017.
APPENDICES

A MATLAB script to simulate a three-link bipedal robot

function varargout = walker_main(t,x,flag,opt_param)

if nargin == 0
flag = 'demo';
end

switch flag
case '' % Return dx/dt = dynamics(t,x).
varargout{1} = f(t,x,opt_param);
case 'events' % Return
[value,isterminal,direction].
[varargout{1:3}] = events(t,x);
case 'demo' % Run a demo.+6]l
demo;
otherwise
error(['Unknown flag ''' flag '''.']);
end
%%
--------------------------------------------------------------------------
%% This is the system dynamics function

function dx = f(t,x,a)

global t_2 torque y force

[D,C,G,B,K,dV,dVl,Al,Bl,H,LfH,dLfH] = dynamics_three_link(x(1:6),a);
Fx = inv(D)*(-C*x(4:6)-G);
Gx = inv(D)*B;

% Bernstein-Bhat controller (uses feedback linearization)


v = control_three_link(H,LfH);

% Used for controller that use feedback linearization


u = inv(dLfH*[zeros(3,2);Gx])*(v-dLfH*[x(4:6);Fx]);

dx(1:3) = x(4:6);
dx(4:6) = Fx+Gx*u;
dx = dx';

torque = [torque ; u.'];


t_2 = [t_2 ; t];
y = [y ; H.'];
[f_tan,f_norm] = stance_force_three_link(x(1:6),dx(1:6),u);
force = [force ; f_tan f_norm];

%%
--------------------------------------------------------------------------
%% Locate the time when critical angle of stance leg minus stance leg angle
%% passes through zero in a decreasing direction and stop integration.

function [value,isterminal,direction] = events(t,x)

persistent control_call_cnt
if isempty(control_call_cnt) || (t == 0)
control_call_cnt = 0;
else
control_call_cnt = control_call_cnt + 1;
end

%% th1d -- is the switching angle


%
if 1
[th3d,th1d,alpha,epsilon] = control_params_three_link;
[r,m,Mh,Mt,L,g] = model_params_three_link;
value(1) = th1d-x(1); % when stance leg attains angle of th1d
value(2) = r*cos(x(1))-0.5*r; % hips get too close to ground--kill
simulation
isterminal = [1,1]; % stop when this event occurs
direction = [-1,-1]; % decreasing direction detection
else % no events, just watch him fall!!
value=1;
isterminal=1;
direction=1;
end
%%
--------------------------------------------------------------------------
%% a demo function

function demo

global t_2 torque y force

torque = [];
t_2 = [];
y = [];
force = [];

tstart = 0;
tfinal = 13;

%% The optimization parameters


%
a = [0.512 0.073 0.035 -0.819 -2.27 3.26 3.11 1.89];

omega_1 = 1.55;
x0 = sigma_three_link(omega_1,a);
x0 = transition_three_link(x0).';
x0 = x0(1:6);

options = odeset('Events','on','Refine',4,'RelTol',10^-5,'AbsTol',10^-6);

tout = tstart;
xout = x0.';
teout = []; xeout = []; ieout = [];

disp('(impact ratio is the ratio of tangential to normal');


disp('forces of the tip of the swing leg at impact)');

for i = 1:5 % run five steps


% Solve until the first terminal event.
[t,x,te,xe,ie] = ode45('walker_main',[tstart tfinal],x0,options,a);

% Accumulate output. tout and xout are passed out as output arguments
nt = length(t);
tout = [tout; t(2:nt)];
xout = [xout;x(2:nt,:)];
teout = [teout; te]; % Events at tstart are never reported.
xeout = [xeout; xe];
ieout = [ieout; ie];

% Set the new initial conditions (after impact).


x0=transition_three_link(x(nt,:));

% display some useful information to the user


disp(['step: ',num2str(i),', impact ratio: ',num2str(x0(7)/x0(8))])

% Only positions and velocities needed as initial conditions


x0=x0(1:6);

tstart = t(nt);
if tstart>=tfinal
break
end
end

%% Draw some useful graphs


%
fig_hl=figure(2);
set(fig_hl,'Position', [200 100 400 450]);
set(fig_hl,'PaperPosition',[1.25 1.5 6 8])
subplot(2,1,1)
plot(tout,xout(:,1),'-',tout,xout(:,2),'--',tout,xout(:,3),'-.')
legend('\theta_1','\theta_2','\theta_3',-1)
grid
title('Joint Positions')
subplot(2,1,2)
plot(tout,xout(:,4),'-',tout,xout(:,5),'--',tout,xout(:,6),'-.')
legend('\theta_1 (dot)','\theta_2 (dot)','\theta_3 (dot)',-1);
xlabel('time (sec)')
grid
title('Joint Velocities')

% Run the animation


anim(tout,xout,1/30,1);

%%
--------------------------------------------------------------------------
%% the animation function

function anim(t,x,ts,speed)

[n,m]=size(x);
[vV,vH]=hip_vel(x); % convert angles to horizontal position of hips
pH_horiz = zeros(n,1);

% Estimate hip horizontal position by estimating integral of hip velocity


for j=2:n
pH_horiz(j)=pH_horiz(j-1)+(t(j)-t(j-1))*vH(j-1,1);
end

[te,pH_horiz]=even_sample(t,pH_horiz,1/ts);
[te,xe]=even_sample(t,x,1/ts);
[n,m]=size(xe);

k=0;

q=xe(1,1:3);
[pFoot1,pFoot2,pH,pT]=limb_position(q,pH_horiz(1));

fig_hl=figure(1);
set(fig_hl,'Position', [280 180 400 350]);
set(fig_hl,'PaperPosition',[0 0 6 5]);
clf
anim_axis=[-2.2 2.2 -2.2 2.2];
axis off
axis(anim_axis)
grid

% Use actual relations between masses in animation


[r,m,Mh,Mt,L,g]=model_params_three_link;
scl=0.04; % factor to scale masses
mr_legs=m^(1/3)*scl; % radius of mass for legs
mr_torso=Mt^(1/3)*scl; % radius of mass for torso
leg1_color='g';
leg2_color='r';
torso_color='b';
ground_color='k'; % a.k.a. black

% Approximate circular shape of mass


param=linspace(0,2*pi+2*pi/50,50);
xmass_legs=mr_legs*cos(param);
ymass_legs=mr_legs*sin(param);

xmass_torso=mr_torso*cos(param);
ymass_torso=mr_torso*sin(param);

% Draw ground
buffer=5;
ground=line([-buffer pH_horiz(n)+buffer],[0 0]);
set(ground,'Color',ground_color,'LineWidth',2);
for k=-buffer:floor(pH_horiz(n)+buffer)
ref_tick(k+buffer+1)=line([k k],[-0.1 0]);
set(ref_tick(k+buffer+1),'Color',ground_color);
ref_label(k+buffer+1)=text(-0.03+k,-0.2,num2str(k));
end

% Draw leg one


leg1=line([pFoot1(1) pH(1)],[pFoot1(2) pH(2)]);
mass1=patch(xmass_legs+(pH(1)-pFoot1(1))/2,...
ymass_legs+(pH(2)-pFoot1(2))/2,leg1_color);
set(mass1,'EdgeColor',leg1_color)
set(leg1,'LineWidth',2,'Color',leg1_color);

% Draw leg two


leg2=line([pFoot2(1) pH(1)],[pFoot2(2) pH(2)]);
mass2=patch(xmass_legs+pH(1)-(pH(1)-pFoot2(1))/2,...
ymass_legs+pH(2)-(pH(2)-pFoot2(2))/2,leg2_color);
set(mass2,'EdgeColor',leg2_color)
set(leg2,'LineWidth',2,'Color',leg2_color);

% Draw torso
torso=line([pH(1) pT(1)],[pH(2)*2 pT(2)*2]);
torso_mass=patch(xmass_torso+pT(1),ymass_torso+pT(2),torso_color);
set(torso_mass,'EdgeColor',torso_color)
set(torso,'LineWidth',2,'Color',torso_color);

for k=2:n
q=xe(k,1:3);
[pFoot1,pFoot2,pH,pT]=limb_position(q,pH_horiz(k));

set(leg1,'XData',[pFoot1(1) pH(1)],'YData',[pFoot1(2) pH(2)]);

set(mass1,'XData',xmass_legs+(pH(1)-pFoot1(1))/2+pH_horiz(k),...
'YData',ymass_legs+(pH(2)-pFoot1(2))/2);

set(leg2,'XData',[pFoot2(1) pH(1)],'YData',[pFoot2(2) pH(2)]);

set(mass2,'XData',xmass_legs+pH(1)-(pH(1)-pFoot2(1))/2,...
'YData',ymass_legs+pH(2)-(pH(2)-pFoot2(2))/2);

set(torso,'XData',[pH(1) pT(1)+(pT(1)-pH(1))],...
'YData',[pH(2) pT(2)+(pT(2)-pH(2))]);

set(torso_mass,'XData',xmass_torso+pT(1),'YData',ymass_torso+pT(2));

title(['T_{est} = ',num2str(te(k),'%.1f')])

new_axis=anim_axis+[pH(1) pH(1) 0 0];


axis(new_axis);

for j=1:length(ref_label)
if (j-buffer-1.05<new_axis(1)) || (j-buffer-1>new_axis(2))
set(ref_label(j),'Visible','off')
set(ref_tick(j),'Visible','off')
else
set(ref_label(j),'Visible','on');
set(ref_tick(j),'Visible','on')
end
end

drawnow;
pause(ts*speed);
end

%%
--------------------------------------------------------------------------
%% a function to calculate hip velocity

function [vV,vH] = hip_vel(x)

vV=zeros(length(x),1);
vH=cos(x(:,1)).*x(:,4); % estimate of horizontal velocity of hips

%%
--------------------------------------------------------------------------
%% a function to calculate the limb position

function [pFoot1,pFoot2,pH,pT] = limb_position(q,pH_horiz)

% Use position of hips as location of stance leg foot.


[r,m,Mh,Mt,L,g]=model_params_three_link;

pFoot1=[pH_horiz; 0];
pH=[pFoot1(1)+r*sin(q(1)); pFoot1(2)+r*cos(q(1))];
pFoot2=[pH(1)-r*sin(q(2)); pH(2)-r*cos(q(2))];
pT=[pH(1)+L*sin(q(3)); pH(2)+L*cos(q(3))];
%%
--------------------------------------------------------------------------
%% CONVERTS A RANDOMLY SAMPLED SIGNAL SET INTO AN EVENLY SAMPLED SIGNAL SET
%% (by interpolation)
%%
%% written by Haldun Komsuoglu, 7/23/1999

function [Et, Ex] = even_sample(t, x, Fs)

% Obtain the process related parameters


N = size(x, 2); % number of signals to be interpolated
M = size(t, 1); % Number of samples provided
t0 = t(1,1); % Initial time
tf = t(M,1); % Final time
EM = (tf-t0)*Fs; % Number of samples in the evenly sampled case with
% the specified sampling frequency
Et = linspace(t0, tf, EM)';

% Using linear interpolation (used to be cubic spline interpolation)


% and re-sample each signal to obtain the evenly sampled forms
for s = 1:N,
Ex(:,s) = interp1(t(:,1), x(:,s), Et(:,1));
end

Anda mungkin juga menyukai