AALBORG
UNIVERSITY
8th Semester Section of Automation and Control Department of Electronic Systems Faculty of Engineering, Science and Medicine Fredrik Bajers Vej 7 C3 DK-9220 Aalborg st Denmark Telephone +45 96 35 87 02 Fax +45 98 15 17 39 http://www.control.aau.dk/
Synopsis: Title:
Modelling and Control of a Biped Robot Modelling and Control
Aalborg University is currently working on a full-scale humanoid biped robot. To gain insight into modelling and controlling a biped robot, this project explores the possibility of obtaining static and dynamic walk of a small-scale biped robot. The project continues a previous project regarding the same robot, where static walk was obtained. The hardware on the robot is changed considerably. The foot and sensor design is changed enabling more accurate center of pressure measurements. Furthermore, batteries and a microcontroller is mounted on the robot to enable autonomy. Models of the robot are derived using kinematics, inverse kinematics, Newton-Euler iterations and Lagrangian mechanics. These models are used o-line for generating gait trajectories for the robot to follow. The gait trajectory generation uses a genetic algorithm to minimize a performance function. By tuning parameters in the performance function, it is possible to control i.e. the range of motion of the limbs, the torque used by the actuators and the speed of the robot. The Lagrangian model is simplied, and is thus less computationally intensive than the Newton-Euler model. Hence, it could be used on-line for a modelbased controller, but due to time constraints, this has not been achieved. Instead, a classic control approach is used consisting of a mid-range controller to stabilize the robot during gait using the center of pressure sensor feedback. The acceptance test shows that the trajectories generated using the static and dynamic models enables the robot to walk. Furthermore the principle of the controller was veried but further tuning is needed in order to achieve substantial improvements to the stability.
Theme: Period:
Project group:
07gr830
Group members:
Rolf Christensen Nikolaj Fogh Rico Hjerm Hansen Heine Hansen Asger Malte Iversen Mads Schmidt Jensen Louis Schultz Lantow
Jan Helbo
AALBORG
UNIVERSITY
8. Semester Sektion for Automation og kontrol Institut for Elektroniske Systemer Det Ingenir-, Natur-, og Sundhedsvidenskabelige Fakultet Fredrik Bajers Vej 7 C3 DK-9220 Aalborg st Danmark Telefon +45 96 35 87 02 Fax +45 98 15 17 39 http://www.control.aau.dk/
Synopsis: Titel:
Modelling and Control of a Biped Robot Modellering og kontrol
Denne rapport omhandler modellering og kontrol af en tobenet robot. Projektet er en videreudvikling af et foregende projekt p samme robot, og resultaterne skal ses i et strre perspektiv i forbindelse med Aalborg Universitets udvikling af en tobenet robot i menneske strrelse. Isenkrammet som var tilgngelig p robotten ved projekt start er blevet markant ndret. En microcontroller og batterier er blevet implementeret hvilket muliggr fuldstndig autonomitet. Der er ogs konstrueret nye fdder til robotten for at f en mere prcis mling af robottens trykcenter. I dette projekt er robotten beskrevet matematisk ved at udvikle en kinematisk, invers kinematisk, NewtonEuler samt en Lagrange model. Disse modeller er begrnset til at beskrive robotten nr den sttter p en fod. Modellerne er blevet vericeret og har en prcision der gr dem brugbare til trajektoriedannelse. Trajektoriedannelsen er baseret p en genetisk algoritme som minimerer en performance funktion. Ved at justere parametre i denne performance funktion er det muligt at bestemme f.eks. skridt lngde, gang hastighed og moment leveret af servomotorerne. Dette trajektorie er fremadkoblingsdelen af kontrolleren. En simpliceret Lagrange model skulle gre det muligt at implementere en modelbaseret on-line regulator men grundet tidspres er dette ikke implementeret. I stedet for er der benyttet klassisk regulering ved at implementere en mid-range tilbagekoblingsregulator, hvor denne regulator bruger trykcentret som input. Accepttesten viste at robotten var i stand til at flge de udviklede trajektorier. Princippet i tilbagekoblingsregulatoren virker efter hensigten, men yderligere tuning er ndvendig for at opn betydelig forbedring af stabiliteten.
Tema:
Periode:
Projektgruppe:
07gr830
Gruppemedlemmer:
Rolf Christensen Nikolaj Fogh Rico Hjerm Hansen Heine Hansen Asger Malte Iversen Mads Schmidt Jensen Louis Schultz Lantow
Vejleder:
Jan Helbo
Kopier: 9 Sider: 276 Bilag: Vedlagt CD-ROM Frdiggjort: 31. Maj 2007
Preface
This report is written by group 07gr830 and documents a project concerning the modelling and control of a biped robot. The project originates in the project proposal, Modelling, Simulation and Control of a Biped Robot proposed by associate professor Jan Helbo at Aalborg University. The report and project is made at the Section of Automation and Control under the Department of Electronic Systems at Aalborg University, and is composed during the period from the 1st of February to the 31st of May 2007 under the theme Modelling and Control. For a complete understanding of the report a technical and scientic level corresponding to that of 8th semester students at the Section of Automation and Control is required. Literature references are written according to the Harvard-method: [Last name of author, year of publication]. If a literary work has more than two authors the rst author's last name is written followed by et al.: [Last name of author et al., year of publication]. A complete bibliography is found at page 153. References to appendices are enumerated as: App. A, B, etc., while attachments are referred to with a number [1], [2], [3], etc. A list of the attachments can be found in the section Appended Documents. The enclosed CD-ROM contains the attachments of this report, including video clips of the biped robot. Throughout the project, Matlab has been used for data processing, large symbolic computations, and for presenting the results. Simulink has been used for implementing and simulating the developed models, and for building the interface to the biped robot. The version of Matlab used is 7.3.0.247 (R2006b) and the Simulink version is 6.5 (R2006b). To help visualizing and verifying the developed models of the biped robot, and to aid the design of control for the robot, the 3D CAD programs, Rhinoceros 4.0 and Autodesk 3ds Max 9.0, have been utilized. The ServoPodTM microcontroller mounted on the biped robot is programmed using the language IsoMax, version 0.82. The report consists of 20 chapters and 10 appendices, which are structured into the six following parts: Part I is an introduction to the project. An overview is given of the context in which the project should be viewed and contains a detailed description of the scope of this project. It introduces the reader to some basic terminology and denitions regarding the area of biped robots. Also, the specication of requirements is set up and the limitations are specied. Part II of the report will focus on a system description and the hardware conguration of the biped robot. This part will describe the changes made to the hardware and the reason why these changes have been made. Part III concerns the mathematical modelling of the biped robot. This includes modelling the servomotors, as well as making static and dynamic models for the biped robot. Part IV of the report contains the development of a controller for the biped robot.
After an introductory analysis of controllers an inverse kinematic model of the robot is developed and gait trajectories are generated. To improve the stability of the robot, a feedback controller is also designed. Part V is the closing part where the result from the acceptance test is discussed and the conclusion of the project is made. Future improvements are also presented. Part VI contains the appendices of the report, which contains further documentation of the project. This includes a human gait analysis, documentation of the conducted tests on the robot and hardware, information about the hardware installed on the biped robot, documentation of the developed software; and lastly, the detailed calculations done in the modelling part. For easy reference, a nomenclature is appended as the second last appendix. This briey describes the meaning of the used abbreviations and symbols, and contains the values of the dierent constant. The general typographic convention of the report is also described in this appendix. The last appendix (last page) is a fold out page, which contains essential illustrations of the robot, including the dierent coordinate systems used in the report. The page is useful to have folded out for easy reference when reading the report. Each part starts with a brief intro, describing the contents of the part, and each part and every major chapter is concluded with a brief summary. The report is copyrighted by the members of the group and Aalborg University. It may be used freely provided that a distinct reference is made.
Rolf Christensen
Nikolaj Fogh
Heine Hansen
Contents
I Introduction
1 The Context and Purpose of the Project
1.1 1.2 1.3 1.4 State of the Art in Biped Robotics . . . . . The AAUBOT Project . . . . . . . . . . . . Studies to support the AAUBOT-1 Project The Purpose of This Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
2
2 3 4 4
2 Biped Terminology
2.1 2.2
5 7
Review and Summary of the Work of Group 06gr833 . . . . . . . . . Continuing the Work of Group 06gr833 . . . . . . . . . . . . . . . . . Requirement Specication . . . . . . . . . . . . . . . . . . . . . . . .
11
11 13 16
II
19
20 22
23 26 28
Part Summary
31
III
Modelling
33
34 36
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
38 42 47 47 49
The Modelling Approach . . . . . . . . . . . . . . . . . . . . . . . . . Deriving the Newtonian Model . . . . . . . . . . . . . . . . . . . . . Verication of the Newton-Euler Model . . . . . . . . . . . . . . . .
51
51 52 59
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
66
67 67 71 72 80
Part Summary
86
IV Control
11 Introductory Analysis 12 Inverse Kinematics
12.1 Calculating the Inverse Kinematic Model . . . . . . . . . . . . . . . . 12.2 Verication of the Inverse Kinematic Model . . . . . . . . . . . . . . 13.1 13.2 13.3 13.4 13.5 13.6 Trajectory Criterias . . . . . . . . . Parameters Dening a Trajectory Set Interpolation . . . . . . . . . . . . . Minimizing Performance Function . . Tuning . . . . . . . . . . . . . . . . . Final Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
87
88 92
93 97
13 Trajectories
100
14.1 The CoP Position based on Pressure Measurements . . . . . . . . . . 117 14.2 The CoP Position in DSP Phase . . . . . . . . . . . . . . . . . . . . 118 14.3 Verication of the CoP Mapping . . . . . . . . . . . . . . . . . . . . 120 15.1 Dening the Error Signal for the Controller . . . . . . . . . . . . . . 123 15.2 Controller Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 15.3 Testing the Designed Controllers . . . . . . . . . . . . . . . . . . . . 131
117
15 ZMP Controller
122
134 137
139
140 146 148 151 153 155
VI Appendix
A Human Gait B Test Scenario Description C CoP Measurement Test D Hardware and Robot Interfacing
D.1 Microcomputer Pin Assignment . . . . . . . . . D.2 IsoMax . . . . . . . . . . . . . . . . . . . . . . . D.3 Programming the ServoPodTM . . . . . . . . . D.4 Interfacing With An External Computer . . . . D.5 Servomotor Calibration . . . . . . . . . . . . . D.6 Servomotor Performance Under Various Loads . D.7 Robot Autonomy Hardware . . . . . . . . . . . D.8 Accelerometer Test . . . . . . . . . . . . . . . . D.9 Strain Gauge Measurements . . . . . . . . . . . D.10 Print Layout . . . . . . . . . . . . . . . . . . . D.11 Simulink Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
157
158 164 169 174
174 176 178 179 183 187 189 192 196 197 198
262 264
264 265 266 268
276
Part I
Introduction
This part denes the scope of the project and explains important concepts and terminology surrounding biped robots. The rst chapter describes the context of the report in order to specify the area, in which the purpose of this project lies. In the second chapter, the basic terminology regarding human anatomy and biped mechanics are described as these terms will be used extensively to describe the biped robot throughout the report. The terms are also required to describe the scope of the project. Finally, the scope of the project is given in the third chapter, where the work already done on the biped robot is described. This leads to a discussion on how this work is to be continued. Finally, a number of accept test criteria are specied to test the robot and to evaluate the project.
Chapter
Figure 1.3: The 29 cm tall small-scale biped robot used as the subject for an 8th
semester project in 2006. The robot is in this report named pre-AAUBOT.
Four members of group 06gr833 began their master thesis in autumn 2006, dealing with the construction, modelling and control of another small-scale robot based on their experiences from the former semester. This new and enhanced robot is called Roberto. The project will be completed in the summer of 2007.
Chapter
Biped Terminology
This chapter introduces the basic terminology used in the area of biped robotics. To use intuitive terms, the terminology is based on human anatomy which is connected to the description of biped robots. Afterwards the denitions of other key terms related to biped robots are given.
Frontal plane:
The plane parallel to the yz -plane is called the frontal plane. The plane parallel to the xz -plane and through the Center of Mass (CoM) is called the median plane. All planes parallel to the median plane are called sagittal planes. The plane parallel to the xy -plane is called the horizontal plane.
Median plane:
Horizontal plane:
6
z
Median plane
Frontal plane
Figure 2.1: The three planes of motion for a human being. The depicted person is
standing in anatomical position.
2.1.2 Joints
Dierent types of joints are located inside the human body where two bones are connected. These joints can be modelled by mechanical joints. Only three joints are needed to model the motion of human joints. These are illustrated in Fig. 2.2 and have the following Degrees of Freedoms (DoF):
Hinge joints: These joints have one DoF and allow motion in one plane. The knee
joint is a example of a hinge joint. joint.
Pivot joints: The pivot joints also have one DoF. The forearm is a example of a pivot Ball-and-socket joints: The ball-and-socket joints have three DoF. These joints allow
rotation in three dimensions. The hip is a example of a ball-and-socket joint.
Figure 2.2: A sketch of the three joints necessary to describe the human joints.
From the left: the hinge joints, the pivot joint, and the ball-and-socket joint.
Double Support: This term is used for situations where a body has two isolated
contact surfaces with the ground. In human gait this situation occurs when the person is supported by both feet.
Single Support: This term is used for situations where a body only has one contact
surface with the ground. In human gait this situation occurs when a person is supporting on only one foot. Both double and single support situations are also valid for biped robots.
Trajectory: A trajectory is the path of a moving point in the three dimensional space.
In gait analysis, trajectories are used to describe the movement of a joint frame, relative to the global frame, which is usually attached to the ground.
Gait Phases: The gait phases of normal dynamic walk consists of eight steps but
only four of them are dierent as the right and left leg executes the exact same motion mirrored in the median plane delayed by half a gait cycle. 1. Release Phase: The innitesimal period of time when the toes of the rear foot breaks contact with the ground. 2. Single Support Phase (SSP): The phase where only one foot has contact with the ground and the other foot swings. Also the SSP is divided into two phases one where the right foot is in contact with the ground (SSP-R) and one where the left foot is in contact with the ground (SSP-L). 3. Impact Phase: The innitesimal period of time when the heel of the swinging foot strikes the ground. 4. Double Support Phase (DSP): The phase where both feet have contact with the ground. The DSP is divided in two phases, one where the weight is shifted from the left to the right foot (DSP-L) and one where the weight is shifted from the right to the left foot (DSP-R). Thus, human walk can be described as a heel-strike-toe-o gait cycle. The four phases are depicted in Fig. 2.3. The average walking speed for a human is about 5 km/h with a average step length of approximately 0.72 m these values are however heavily dependent on the height, weight, age and sex of the human.
Zero position: The zero position of the biped robot can be seen in Fig. 2.4. It diers
a little from the anatomical position as the palms are facing into the sides of the torso.
Joint: A joint is a mechanical construction where two connected parts are able to
rotate relative to each other. There exist one mechanical joints which can model most of the human joints, this is described in the following:
Left leg
Right leg
SSP-L
Revolute joint:
A revolute joint is a joint, where two connected parts rotate around a common axis. One revolute joint can be used to construct both a hinge joint and a pivot joint. The revolute joint has one DoF. A ball-and-socket joint and can be constructed from three revolute joints thereby giving it three DoF.
Link: A link is a mechanical construction between two joints. When the biped robot
is in zero position the axis of rotation of each joint is parallel to the axes of the body frame. This fact can be used to describe the joint rotations in the following way, where the coordinate system refers to Fig. 2.1:
Roll:
A rotation around any axis parallel to the x-axis, when the biped is in zero position, i.e. a rotation in the frontal plane. A rotation around any axis parallel to the y -axis, when the biped is in zero position,
Pitch:
Yaw:
A rotation around any axis parallel to the z -axis, when the biped is in zero position, i.e. a rotation in the horizontal plane.
These descriptions of rotation in the zero position allows all joint motions to be described uniquely, no matter what position the biped robot is in.
Polygon of Support (PoS) The PoS is the contact surface between the feet and
the ground. In the DSP the surface is the convex area spanned by the contact surfaces, called the convex hull, which can be found by drawing straight lines from the outer rims of each contact surface. In the SSP phase the PoS is equal to the contact surface of the supporting foot. This is illustrated in Fig. 2.5.
right foot
(a)
(b)
Figure 2.5: Figure (a) illustrates the PoS in the SSP, and gure (b) the PoS in the
DSP.
Center of Pressure (CoP): The CoP is the point on the supporting surface of the
body where the total sum of the contact forces acts, causing a force but no moment. When standing, the part of the body exerted by contact forces is the feet, where the components of the contact forces acting normal to the sole of the supporting foot or feet are called pressure forces [Sardin and Bessonnet, 2004]. An example of the CoP location in SSP phase is seen in Fig. 2.6a.
body body
Figure 2.6: In (a) the resulting force is equal to the sum of the pressure forces F p,1 and F p,2 acting at the CoP. The CoP is the point on the sole of the foot, where the net torque caused by pressure forces is equal to zero. In (b) the ZMP is the point on the sole, where the forces acting on the body F body,1 and F body,2 results in zero net torque.
10
Zero Moment Point (ZMP): The ZMP is the point on the surface where the sum
of all tipping moments due to gravitational and actuators generated forces are equal to zero, where tipping moments are dened as the moments acting tangential to the contact surface. If the supporting surface is horizontal, tipping moment are the moments causing pitch and roll movement, but no yaw movement [Sardin and Bessonnet, 2004]. This is illustrated in Fig. 2.6b.
Coincidence of the CoP and ZMP Location: As long as the contact forces appear
in a single planar surface the ZMP and CoP coincides [Sardin and Bessonnet, 2004]. This result is due to the fact that the vertical component of the resulting force caused by gravitation and actuators acts at the ZMP. Thus, the ZMP must be the same point as the CoP for the supporting foot to remain in equilibrium. Otherwise, the resulting pressure force and the resulting vertical component of the gravitational and actuator forces would apply moment to the foot, i.e. it would rotate, which is not the case.
Static walk: Static walk assumes that a biped robot is always statically stable. This
means that if the motion is stopped the biped robot will stay in a stable position. The static walk speed is low meaning that the dynamics of the system can be ignored. When this is done, the projection of the CoM on the horizontal plane is equal to the CoP and in order to maintain static stability the CoM and CoP should lie within the PoS.
Dynamic walk: Dynamic walk is faster compared to static walk. In dynamic walk
the CoM is allowed to be outside the PoS for a limited time which means that the biped robot will be statically unstable in the swinging phase just before the impact phase. According to [Popovic and Sinkjaer, 2000], for a gait cycle to be called dynamic, it requires the use of the heel-strike-toe-o technique described in Sec. 2.1. Human gait is dynamic.
Pseudo-Dynamic walk: Due to the mechanical construction of the pre-AAUBOT biped robot, i.e. large solid at feet and anatomically incorrect ankle joints, it cannot use the heel-strike-toe-o gait technique, and thus it cannot realize real dynamic walk.
As a result, a pseudo-dynamic walk is dened in this project. The pseudo-dynamic takes into account the dynamics of the robot as the CoM is allowed to be outside the PoS for a limited time, making the biped robot statically unstable in the swinging phase just before the impact phase. No requirements are made concerning the heel-strike-toe-o technique. There is not an absolute criterion that determines whether the pseudo-dynamic walk is stable or not. However, if the biped robot has active ankle joints and always at least one foot on the ground the ZMP can be used as a stability criterion [Cuevas et al., 2005]. As long as the ZMP is inside the PoS, the pseudo-dynamic walk is considered dynamically stable as the foot can control the posture of the biped robot. If the ZMP is outside the PoS there is no resulting contact force acting on its foot, thus leaving the foot with no control of the posture of the robot. As opposed to static walk, a biped robot using pseudo-dynamic walk will not be static when all motions are stopped but rotate around the ZMP. Note that, henceforth, when using the term dynamic walk in the context of the biped robot later in the report, it refers to pseudo-dynamic walk.
Chapter
The report, Modelling and Control of a Biped Robot, referred to as [rts et al., 2006]. The pre-AAUBOT, see Fig. 1.3. A working hardware interface to the biped robot.
The group chose and bought the pre-AAUBOT robot from the company, Lynxmotion, and did the project based on the problem: How is it possible to make a two legged robot walk? By reviewing their work it has been chosen to summarize it by dividing it into ve parts and depict the parts in a owchart as seen in Fig. 3.1. A description of the parts is given below:
1: Description and Conguration of Robot: Hardware: The group choose the robot, along with the actuators (servomotors) to
control the joints, and assembled it. Five accelerometers were mounted on the robot, along with four pressure sensors on each foot. To control the servomotors, servo drivers were mounted on the biped. No computer was mounted on the robot, so control signals were sent to the drivers from an external PC using a serial cable. Likewise, analogue data signals from sensors were sent to the PC through a cable, where the signals were sampled and converted. 11
12
Modelling
Trajectory Generation
Controller Design and Implementation Fuzzy logic based small disturbance CoM controller
Acceptance Test
Kinematic model Inverse kinematic model Human gait experiment Newtonian model SolidWorks model of the robot Hardware Assembling the robot Sensors Servo control Interfacing with the Robot Implementation of trajectories Servo motor model Lagrangian model Verification of models Static gait design
Heavy disturbance controller Measurements for feedback: - CoP - Acceleration of torso Implementation of controller
Figure 3.1: A owchart to summarize the work done in [rts et al., 2006].
SolidWorks Model: A complete 3D model of the biped robot (without wires, servo
drivers and sensors) was implemented in the 3D CAD program, SolidWorks. Using this model, the dimensions, center of masses and inertia tensors of the robot were calculated. These were used in the models of the robot. The SolidWorks model was based on SolidWorks models of the individual parts of the robot, which were available from the Lynxmotion web site. ment was conducted, where the gait of a human, one of the group members, was lmed from eight dierent angles. The recordings were converted into trajectories of the toes, ankles, knees, hips, shoulders, elbows and wrists.
2: Modelling Kinematic Model: A SSP complete kinematic model of the robot was created for
use in trajectory generation. It is based on the dimensions from the SolidWorks model.
Inverse Kinematic Model: A SSP inverse kinematic model of the robot was created
for use in trajectory design. in the project.
Servo Motor Model: A servomotor model was developed, but was not used or veried Newtonian Model: A SSP newtonian model of the robot's mechanics was created. It
was only partly veried and were not used further in the project.
Lagranian Model: A reduced SSP Lagranian model of the mechanics of the robot,
including only the legs was created and suggestions to a DSP Lagranian model was given. The reduced SSP model was only partly veried and were not used further in the project.
13
3: Trajectory Generation Static gait design: A desired CoP trajectory was found, and at ve stances in a step,
the leg joint angles were manually adjusted to roughly t a gait phase yielding the desired CoP position. The arms were used afterwards to ne tune the CoP position. Given these ve postures in the gait cycle, trajectories for the robot through the entire gait cycle were found by interpolation. Finally, the trajectories were translated to joint angles using inverse kinematics.
4: Controller Design and Implementation Fuzzy logic controller: A fuzzy logic controller was implemented to suppress small
disturbances, i.e. tuning the CoP position during walk and stand. The fuzzy logic controller decided how the dierent limbs should react in dierent stages of the walk. The feedback was based on CoP measurements. i.e. to avoid falling, e.g. when the robot is given a push. The controller works by playing a dierent trajectory when it register a push that would otherwise result in the robot falling over, for example taking a step backwards. The feedback was based on acceleration measurements in the torso.
5: Acceptance Test Stable stand with small disturbance controller: The robot was seemingly able to
stand and stretch the arms in the right direction when pushed to keep balance.
Stable stand with heavy disturbance controller: The robot was sometimes able
to avoid falling by taking a step, when pushed hard. The problem was a delay before the step was taken. correct place. But the robot had a problem with lifting the non-supporting leg, so at least one corner of the non-supporting foot always toughed the ground. stretch the arms in the right direction to keep balance when walking.
Static walk: The robot was able to walk statically and maintaining its CoM in the
Static walk with small disturbance controller: The robot was seemingly able to Static walk with heavy disturbance controller: The robot was sometimes able to
avoid falling when pushed hard while walking. The problem was found in a delay from the push to the controller actually reacted.
14
Design and implementation of both static and pseudo-dynamic walk on a biped robot using a genetic algorithm for trajectory generation based on a kinematic, an inverse kinematic and a dynamic model.
As a result, the objective in this project is to obtain the necessary models and create the required hardware to implement and test the genetic algorithm. A simplied owchart describing the contents of the project is given in Fig. 3.2. The boxes in bold are results taken directly from [rts et al., 2006]. Boxes in dashed bold lines are subjects inspired by [rts et al., 2006], but modied or redone. Boxes in thin line are subjects done from the beginning and boxes in dashed line are subjects not covered due to time constraints.
Description and configuration of robot Modelling Genetic trajectory generation Controller design and implenetation CoM controller design Acceptance test Static walk test with controller Dynamic walk test with controller Static walk test Simulation model Model based controller Measurements for feedback, i.e. ZMP Implementation of controller Dynamic walk test
Kinematic model SolidWorks model Mechanical description Human gait experiment Human gait analysis Hardware Sensors Servomotor control Hardware modifications Interfacing with the robot Implementation of trajectories Inverse kinematic model Newtonian model Servomotor model Simplified Lagrangian model Verification of Models Static walk design Dynamic walk design
Figure 3.2: A owchart describing the ow of this project, giving the connecting
thread. The boxes in bold are results taken directly from [rts et al., 2006]. Boxes in dashed bold lines are subjects inspired by [rts et al., 2006], but modied or redone. Boxes in thin line are subjects done from the beginning and boxes in dashed line are subjects not covered due to time constraints.
As seen in Fig. 3.2 only two things are used directly as described in [rts et al., 2006]. These are the SolidWorks models and the data from human gait experiment. The data
15
Errors in the kinematics of the Lagrangian model have been found. To make sure these does not originate from the kinematic model, this is re-developed. An error has been 1 discovered in the transformation matrix RA RA2T which seems to originate in an incorrect calculation of cos( 90 ) and sin( 90 ).
The derivation of the Newtonian model is carried out correctly. The model was however not implemented correctly in Simulink . The transformation from the supporting leg to the free limbs is done using incorrect rotation matrices for the arms. Also, wrong center of mass position constants were used for the supporting leg.
The problem in the development of this model originates from describing the kinematics of the legs incorrectly. Joint angles are added directly, even though the joint axis are not always parallel, resulting in a substantial errors.
The errors in this model originate from a faulty approach. Consequently, most equations in this model yields wrong angles. The problem is that the calculations are carried out concerning two dimensions where it should have been carried out in three dimensions. This leads to an increasing error as the posture of the robot moves away from the zero position. Further, a dierent approach is taken concerning the Lagrangian model, which is based on simplifying the kinematics of the biped using the human gait analysis. Concerning trajectory design, a genetic trajectory generation algorithm is designed and implemented as already mentioned. The algorithm uses the kinematic model, the Newtonian model, Lagrangian model and the inverse kinematic model. Lastly, a controller is designed. It was intented, that the Lagrangian model should be used to create a model-based controller, but this was not realized due to time constraints. Instead, a controller is designed based on using the arms and legs in a mid-range controller conguration. The controller is based on moving the CoM of the robot. The controller uses the CoP measurement as the feedback signal. It was intented to test the designed controller on an simulation model of the biped robot, but due to in-adequate servo motor models, this could not be realized.
16
Minimum speed of 0.2 km/h 5.6 cm/s. Minimum step length of 11.6 cm. The swing foot must leave the ground completely. The projection of the CoM onto the supporting plane must be within the PoS during the whole gait cycle.
3. Walk pseudo-dynamically with no external disturbance and with the controller disabled.
Minimum speed of 0.8 km/h 22.4 cm/s. Minimum step length of 11.6 cm. The swing foot must leave the ground completely. The ZMP must be within the PoS during the whole gait cycle.
The CoP must be within 0.3 cm of the CoP specied for the trajectory.
17
The CoP must be within 0.3 cm of the CoP specied for the trajectory.
The robot must have a reasonable response when a step is given in the ZMP reference. The projection of the CoM onto the supporting plane must be within PoS for disturbances up to 4 N.
7. Walk statically with external disturbance and with the controller enabled.
The CoP must be within 0.5 cm of the CoP specied for the trajectory.
8. Walk pseudo-dynamically with external disturbance and with the controller enabled.
The CoP must be within 0.5 cm of the CoP specied for the trajectory.
3.3.1 Delimitation
The models only concerns the SSP, as a model of the DSP is comprehensive and too time consuming to develop. It is assumed that the DSP can be approximated by the SSP as the DSP only lasts for approximately 8% of the walking cycle cf. App. A. Therefore the transitional phase from one single support phase to another single support phase is disregarded in the models as it seems reasonable that these can still describe the dynamic gait of the biped robot with such a relative short transition phase. The validity of this assumption was veried in the Newton-Euler model described in Ch. 9. Therefore, the DSP is not considered as a modelling problem. This entails that no controllers based on a model for the double support phase are designed. In [rts et al., 2006] a large disturbance controller were designed. The large disturbance controller should make the robot choose an alternative trajectory during gait, if it was given a large push, i.e. taking an extra step to avoid tumbling. The main scope of this project is to improve the gait of the robot. As a result, only a small disturbance controller is explored, thus implementation controllers that make the robot able to withstanding pushes is not the main scope of the project. Further this project is limited to modelling and control of the robot on a planar surface with the gravitational acceleration as a normal.
Part II
In this part a description of the biped robot is presented. The rst chapter contain a description of the robot. This include an introduction to the size, construction, materials and limitations of the robot. This should give an overview of the physical capability of the biped robot. The second chapter introduces a list of suggested improvements proposed by the previous group which worked on the robot. This list mainly contains problems related to the physical design of the robot. This part will describe how this project will solve these problems by improving the robot with new servomotors, a better construction and new sensors. The new hardware mounted on the biped robot in order to achieve better performance and add new possibilities that are available is also described in this part.
Chapter
System Description
The biped robot used in this project is seen in Fig. 4.1. The legs and arms are an assembly set of aluminum servomotor brackets. The body is made from Lexan. It measures approximately 29 cm in height and has a mass of 2240 g. The actuators consist of 20 servomotors resulting in 20 DoF. This chapter will list the most important data describing the biped robot. A complete list is found in App. I. The construction of the biped robot should resemble the human body in order to achieve anthropomorphism and be able to perform human gait. But the design of the biped robot dier in several ways from the human body. First of all the feet of the robot is much larger than human feet compared to the size of the robot. This makes the robot very stable but decreases its ability of perform a human like dynamic gait with heelstrike-toe-o. All of the joints are comprised of servomotors that are revolute joints with one DoF, as standard RC servomotors are used. This means that in order to describe e.g. a hip which has three DoF, three joints are needed. The design of the robot results in legs which do not have the ability to yaw as either the ankle nor either hip is capable of yawing. This means that the robot is only capable of walking straight forward. Moreover the design of the leg diers from that of a human in the fact that the ankle has the same length as the shin. As the servomotors have a 180 range, only one limb on the robot have insucient freedom of movement to resemble a human joint. As the shoulder on a human being is able to move more than 180 this link is limited by the construction of the robot. All other links one the robot have a larger range of motion than that of a human.
20
21
Height: 29.0 cm
Height: 29.0 cm
Length feet: 12.6 cm
Figure 4.1: Figure of the biped robot used in this project. An illustration showing
the joints of the robot is superimposed on the picture in the frontal view. This illustration is used throughout the report to represent the robot.
Chapter
Hardware
The assembly of the biped robot and the initial sensor conguration is documented in [rts et al., 2006]. The initial sensor conguration consisted of ve accelerometers - one in each wrist, one in each foot and one in the torso. Additionally, four force sensing resistors were equipped on each foot. The actuators consisted of RC servomotors. The robot was controlled by an external computer interfacing with Simulink via the xPC toolbox and a National Instruments PCI-6024E data acquisition board. Preliminary tests performed on the biped robot and [rts et al., 2006] identies several problems with the hardware. The table below shows which of these have been solved. Improved X X X X X X X Problem 1. The xPC target experiences CPU overloads. 2. The ankle servomotors are too weak. 3. The servomotors have no angular position feedback. 4. The refresh-rate of the servomotors are too slow. 5. The robot begins wobbling after prolonged use due to poor connection between servomotors and brackets. 6. The feet of the robot slides over the surface because of the low friction. 7. The pressure sensors are too inaccurate to properly determine the CoP and the characteristics experience much drift. 8. The feet are too big to easily perform dynamic walk. X X 9. A gyro could be added to measure angular acceleration of the torso. 10. The interface board could be made smaller by using a PCB.
This chapter will focus on the new hardware installed on the robot and the changes done to existing hardware. In the rst part of this chapter, a discussion is given about possible hardware changes to solve some of the problems stated in [rts et al., 2006]. Afterwards, a description of the new hardware installed and the reasons why is given.
22
23
Solution
In [rts et al., 2006] it is suggested that an outer control loop could be implemented to add integral control to the servomotors. However, adding a PI controller to the loop will make the servo slower. This can be overcome by using a PID controller. All of these solutions will require a tuning of the controller which will take time. As the fundamental problem is due to the lack of torque given by the servomotors, the problem is instead solved mechanically by replacing the weaker servomotors with a stronger type. The old servomotors has a stall torque of 9.57 kg cm equal to around 0.9 Nm and in [rts et al., 2006] it has been determined that the ankle servomotors experienced as much as 2 Nm. A new stronger servomotor is available from HiTec. The HS-5955TG has a stall torque of 24 kg cm which is equal to 2.35 Nm. Additionally these new servomotors are faster than the old ones as they rotate with 400 /s whereas the old ones rotate with 333 /s. They also have a smaller dead band at 0.45 where the old ones have a dead band at 0.9 . The dead band is a small angle in which the servomotor does not correct an angle error which means that a smaller dead band is equal to less slack in the whole system.
24
CHAPTER 5. HARDWARE
Solution
Several possibilities are available for measuring the angular position of the servomotors. Some of the possibilities are to attach rotary encoders, tachometers or potentiometers to the shaft of the servomotors. As it is of great importance to keep everything as small as possible, it would be less desirable to mount extra equipment on the robot. Another possibility is to use the potentiometer already mounted internally in the RC servomotors to measure the position of the servomotor. The feedback circuit in the servomotor consists of a potentiometer connected to the shaft which changes resistance according to the angle of the shaft. The circuit can be seen in Fig. 5.1. RC servomotors does not give angular position feedback out of the box but this can be implemented by adding a wire to measure the voltage over the potentiometer. The dashed line in Fig. 5.1 shows where an external ADC measures the position of the servomotor. The solution using the internal potentiometers is chosen, as it enables precise feedback from the servomotors using only an ADC.
To ADC 4.7k To external ADC Vcc 100
Gnd
Solution
A standard RC servomotor is driven by a PWM signal at 50 Hz with a varying duty cycle. However, it is tested that the update frequency can be set to 76 Hz or even higher. Hence, the ServopodTM is congured to drive the servomotors with a PWM signal of 76 Hz, which makes it possible to update the servomotor at 76 Hz. This should result in a smoother walk
Solution
Instead of plastic rivets the servomotors are bolted to the robot with metal bolts, a metal washer and a self-tightening metal nut. This has two advantages: First o all the servomotors are tightly fastened to the robot and secondly it should not become any looser with time. Furthermore the plastic horns have been replaced with a metal horns which is also tightened with a metal screw. This should all in all reduce the slack in the robot.
25
Solution
Alternatives to FSR include strain gauges and load cells. A load cell based force sensor is dismissed because of the large size. Compared with a strain gauge, the FSR has a much wider dynamic range: typically over a 0-3 kg force range. This large dynamic range is not needed in this project, as the weight of the robot is low. Additionally, FSRs have a much lower accuracy (typically 10%) [Fraden, 2004]. This lack in precision makes them less than ideal for determining the CoP. Strain gauges will be used instead of the FSR that were mounted from the beginning. Strain gauges are used to measure stretch in materials. These devices are accurate (typically 2%) and can measure small bending in the material it is mounted on [Fraden, 2004]. The strain gauge is less than a millimetre thin and can easily be mounted on the feet of the robot without giving any constraints to the movement of the robot. The sensor consists of a thin metal wire that is enclosed in a ll layer. When the strain gauge is extended, the wire will become longer and therefore the resistance in the wire will change. This change can be measured and maps to the amount the material is bent or stretched. The use of strain gauges instead of FSR have resulted in a new foot design that can be found in App. H. This design also makes it possible to determine a more precise attack point of the force measured by each sensor compared with the old design. The problem with sliding is also resolved, as the new feet has a larger static friction. The strain gauges are mounted in a set-up called a Wheatstone bridge, See gure 5.2 on the following page for schematic of the bridge. This set-up overcomes two problems arising with using strain gauges. One problem is that the output of a strain gauge drifts if the temperature changes. This will normally happen because of the current that run through the strain gauges. In this set-up each strain gauge is equally inuenced by the temperature drift and thus reduce this problem. Furthermore this set-up also overcomes drift caused by the expansion and contraction of the metal, due to changing temperatures, to which the strain gauge is adhered to. The Wheatstone bridge measures the dierence in resistance between the strain gauge pair, i.e. how much the upper side of the metal is longer than the lower side. This conguration eectively doubles the output of the circuit and eliminates temperature drift [Fraden, 2004]. Furthermore the signal from the Wheatstone bridge is converted into a digital signal at the foot and transferred via a serial bus (SPI) to the microcontroller attached at the torso. This should reduce the noise from other PWM and power lines running alongside the strain gauge signals, and result in a more accurate measurement.
26
+ a Strain gauges
R1
CHAPTER 5. HARDWARE
+ R2
a
b
ADC
R3
R4
(a)
(b)
Figure 5.2: Figure (a) shows the placement of the paired strain gauges where it is
seen that strain gauge `a' is lengthened whilst strain gauge `b' is shortened when the beam is bended down. In gure (b) the electrical curcuit of the Wheatstone bridge is showed.
(5.1)
Fortunately, it is very unlikely that all servomotors stall at the same time. Testing has shown that, on average, the robot draws around 5 A when walking. Currents of more than 10 A has only been experienced when the HS-5995TG servomotors have been stuck, and thus stalled. To avoid that a stuck servomotor permanently damages the robot, but sucient current is available to the servomotors during normal operation, it has been chosen to make the power supply system capable of supplying a continuous current up to 10 A, but not more than that. The power supply schematic is seen in Fig. 5.3. The fuse ensures that the current draw does not exceed 10 A.
Battery or external source 8.4V6V Fuse MCU Power Switch Vcc 5.8V Decoupling diode Unused 5V Regulator Regulator Decoupling Capacitor Vdd 3.3V Microcontroller + Auxiliary supply Vservo 6V Regulator Servo Power Switch Servo supply
Figure 5.3: Power supply circuit at the biped robot which regulate the unregulated
supply voltage to 6V to the servomotors and 3.3V to the microcontroller.
In order to keep the weight as low as possible the electrical system is constructed so only one battery is necessary. The battery used is a Lithium-Ion type, supplying 7.4 V and
27
I=C
dV dt
[ A ] (5.2)
The voltage drop of the diode at a current draw of 0.5 A is 0.3 V. This gives the maximal permissible voltage drop as 6 V 0.3 V 4.5 V = 1.2 V. The duration of voltage drops that have been measured have all been within 25 ms. Assuming that voltage drops does not have a duration of more than this, the minimal capacitance needed is:
28
CHAPTER 5. HARDWARE
C=
(5.3)
10
Voltage [V]
Voltage drop with battery 10 8 Voltage [V] 6 4 2 0 0 5 10 15 20 Time [ms] 25 30 35 40 X: 17.32 Y: 5.217
Figure 5.4: A voltage drop caused by the sudden current draw from the servomotors.
The solid line is the voltage at the power source while the dashed line is Vcc . The tooltips in the topmost graph, show the times at which the voltage supplied by the external power supply drops below the permissible level. The tooltip in the bottommost graph shows the minimum voltage experienced with battery supplied power.
A capacitor of this size would be too large to be mounted on the robot, so it is decided to have a separate supply for the microcontroller when the robot is running from an external power supply. The robot can be powered using the power supply from [rts et al., 2006] when the robot does not need to be fully autonomous. This supply can deliver 4.5 A. This is insucient for delivering enough current for the walking phase, but is sucient for testing purposes. A supply capable of delivering more current can be used instead of batteries during gait cycles lasting more than 5 minutes.
29
D1 D0 X X X X
0 B11B10 B9 B8
B7 B6 B5 B4 B3 B2 B1 B0
Figure 5.5:
This gure shows the three bytes needed to be sent from the ServoPodTM in order to get the twelve bit ADC value via SPI. SGL/DIFF chooses between Single Ended or Dierential operation of the ADC. D0 to D2 is the bit choosing between the eight channels on the ADC and B0 to B11 is the twelve bit ADC value from the ADC.
30
CHAPTER 5. HARDWARE
cable. The function of the ServoPodTM in this situation is to gather sensor signals from the numerous sensors on the robot and send this data to the Simulink controller running on the xPC target PC. This PC is running a controller and sends back the actuator signals to the ServoPodTM which nally sends the actuator signals to the respective servomotors. A ow chart of the program is seen in Fig. 5.6.
380Hz 76Hz
Figure 5.6: Flow chart of the program when the ServoPodTM is congured with
the second conguration.
As seen in Fig. 5.6 two state-machines are created in this routine. One state-machine gathers sensor signals at 380 Hz. This sampling frequency is due to the anti-aliasing lter implemented which has a cut o frequency of 156 Hz. This means that the sample frequency should be at least 312 Hz. As the servomotors is updated at 76 Hz and due to the way Isomax is structured the sample frequency is chosen as ve times 76 Hz equal to 380 Hz. The second state-machine performs several tasks. It means the ve samples from the sensors, sends this data to the Simulink controller running on the PC, receive the new actuator signals from the Simulink and send this to the respective servomotors. This routine is executed at 76 Hz as mentioned earlier as this is the maximum update frequency.
Part Summary
This part describes the construction and dimensions of the biped robot and the hardware changes which have been carried out on the robot. The rst chapter gives an description of the physical aspects of the robot. The second chapter describes the suggestions made in [rts et al., 2006] to hardware improvements and document which improvements have been realized in this project. One result is a new design of the feet, including new sensors which enable a more precise calculation of the CoP. This is done by replacing the force sensitive resistors from the original design with strain gauges. To make the robot fully autonomous, and to reduce the noise in sensor signals, a microcontroller has been placed on the robot to gather and process signals before they are sent to on-line processing on an external pc. Noise reduction is achieved using SPI interface on the microcontroller to communicate with ADC's distributed on the robot body. The result of this solution is that every signals which have a long signal path is converted into a digital signal thus reducing noise from other analogue signals. In order to keep the weight, as well as the physical size, as small as possible all boards on the robot are made with SMD components on PCB boards. Furthermore, the interface to the servomotors has been changed, so they are controlled directly by PWM generators on the microcontroller. The addition of the microcontroller also enables different congurations of the robot. It can be congured as stand-alone where it simply plays back some predened trajectory, or it can be congured to be connected to a host computer via a serial cable and the host computer is then used to process the received signals. A computer running the Matlab environment xPC is used as a host computer in order to have an easy interface to Simulink. The reason for using Simulink is the easy implementation of controllers, compared to implementing the controller on the microcontroller. Additionally, a gyroscope is added in the torso for measuring angular velocities. The four servomotors in the ankle have been changed to a new type which can deliver a higher torque. The refresh rate of the servomotors has been increased from 20 Hz to 76 Hz which will enable a more smooth gait and ensure a better basis for the development of a controller.
31
Part III
Modelling
In this part a mathematical model of the biped robot is developed. By splitting the model into several sub-models, which are modelled independently, the complexity of the modelling procedure is reduced. An actuator model is created, i.e. a model of the servomotors powering the robot, which describe their kinematics and thereby giving the option of designing control for the actuators. Tests are conducted on the servomotors to identify their parameters. A forward kinematic model of the mechanics of robot is developed rigorously, including a model to determine the CoM of the robot. The kinematic model also creates the necessary framework for developing the rest of the models and discussing the mechanics of the robot. The kinematic model lead to the development of two dynamic models of the biped robot. These are developed by the means of the method of First Principle, where the principles and laws of physics are used to determine the dynamics of the system. The rst dynamic model, the Newton-Euler, is based on a Newtonian approach, i.e. by computing forces and torque, whereas the second is a Lagrangian model, based on energy considerations. Both models calculate the CoP location, which is essential for enabling control design, i.e. stabilizing the robot. These two models are developed to enable design of pseudo-dynamic gaits in the control part. The parameters for all the mechanic models are obtained from a SolidWorks model of the robot, which were created by [rts et al., 2006]. All models are discussed, tested and veried. The kinematic model is veried using 3D software, and the verication of the dynamic models consists of physical tests conducted on the robot.
Chapter
Modelling Strategy
This chapter explains the strategy used for modelling the biped robot, and which aspects of biped modelling which are not considered. The modelling procedure is split into several sub-models which are composed into the full model. The procedure is seen in Fig. 6.1.
p, v, a Newton-Euler based dynamic model CoP
ref
Servomotor model
, ,
35
model. This model should be able to determine the torques in the joints accurately. The other approach is a Lagrangian mechanics model, where a weighing between precision and computational complexity is made. The Newton-Euler based model determines the torques and forces aecting each link on the biped robot. This is done using Newton-Euler iterations where rst the angular velocity and acceleration, and the linear acceleration are found by starting from the supporting leg moving outward through the torso to the end of each free limb. Then the forces and torques aecting the limbs are found by beginning from the free limbs and then moving inward through the torso to the supporting leg. As mentioned in the previous chapter, the physical robot is able to output the CoP using measurements from the strain gauges placed in the feet. Hence, to verify the models, they must also output this value. This is done using a model based on Newton's second law of motion. This enable a comparison of the model output with output from the physical biped robot. The Lagrange mechanics based model derives the torques from considerations made on the changes in both kinetic- and potential energy. Two constraints are taken into the model to keep the torso of the biped robot in upright position both in the frontal and sagittal plane. As the two torques in the ankle of the supporting leg are the only torques of interest in control purposes, only these are derived in order to keep the model as simple as possible. The models in this project are only considering the SSP phase. Development of a model for the DSP phase is a very comprehensive task compared to development of a SSP model, and it is therefore time consuming to derive. The SSP phase constitutes 92% of a gait cycle, and it is assumed that it is most dicult to maintain balance in a SSP phase as the CoP must be placed within one foot. In a DSP phase the biped robot is more stable and hence a model for this phase is assumed to be a suciently approximated by the SSP phase model. The following chapters will describe the details about the modelling of the sub-models presented in Fig. 6.1. The order of the chapters will follow the order presented in the gure starting with the servomotor model.
Chapter
Servomotor Model
This chapter discusses the development of a model of the actuators in the robot, ie. the servomotors. For reasons that are explained in the latter part of this chapter, the model is not used further in this project, so for brevity the modelling procedure and the obtained results are presented in App. E and only summarized here. It was chosen to extend the servomotor model used in [rts et al., 2006] to include deadzones and a time delay. The parameters was determined experimentally using a systemidentication approach, actuating the servomotors with step and pulse responses. The results of the model with tted parameters is seen in Fig. 7.1.
Hitec HS645MG Servo Response vs. Model Position [rad] 0.6 0.5 0.4 2 Position [rad] 0.04 0 0.04 2 Position [rad] 3 4 5 6 7 8 Hitec HSR5995TG Servo Response vs. Model 9 3 4 5 6 7 8 9
0.8 0.7 0.6 2 3 4 5 6 7 8 Hitec HSR5995TG Servo Response vs. Model Error 9
Position [rad]
Figure 7.1: Test data showing the response from the model vs the response from
the servomotor. The solid lines are the measured values and the dashed lines are the model output.
36
37
As seen in the gure, the model approximates the responses from the servomotors well. However, the data gathered from the servomotors are with very limited load. As the load on the servomotors change during a gait cycle, so will the dynamics of the servomotor. This is seen in the test documented in Appendix D.6. Consequently, apart from the internal inertia of the motor, this servomotor model is only a kinematic model, as it does not take the inertia of the load into consideration. Looking at the results obtained in the test it is clear that this will lead to signicant deviations between the model output to a real servomotor output when a large load is applied. The model will not see the load, and the acceleration and maximum velocity will be unchanged, whereas the real servomotor will have deteriorating performance as the load is increased. In [rts et al., 2006] it is shown that during their gait cycle, the maximum torque exerted on the servomotors were 2 Nm. The maximum torque delivered by the HSR5995TG servomotors are 2.3 Nm, so it will be expected that the performance will be signicantly changed during peak loads, and hence the accuracy of the model will also be deteriorated. To make an actuator model which includes the load torque will require feedback from the dynamic models, making the whole model very complex and calculationally intensive to simulate. It will also require extensive testing to nd the relationship between load torque and servomotor performance. Due to time constraints, this has not been done. The lack of a proper actuator model will not hinder the use of the other models for trajectory generation. It will, however, make a complete simulation model of the robot inaccurate and unsuited for controller testing. With the actuator model complete, the kinematic model will be derived in the next chapter.
Chapter
Kinematic Model
In this section, the forward kinematics of the robot is developed. The kinematics of the robot has also been developed in [rts et al., 2006], but given the fundamental importance of this task, it is also treated and derived in this project. The fundamental importance is due to the fact, that the frames of the robot and the orientation of the joint and servomotor angles are dened here, as is the rotation matrices used in both the Lagrangian and the Newtonian model. Thus, the structure and results of the dynamic models are dependent on the correctness of the kinematics, and the implementation of controllers rely on the denition of these angles and frames. Errors in the kinematics of the dynamic models in [rts et al., 2006] has also been discovered, which furtherly justies a thorough treatment of the kinematics, as the errors may originate from here. The results of the kinematics obtained in this report are compared with those obtained in [rts et al., 2006]. As the frame axment in [rts et al., 2006] seems reasonable, and to ease the comparison, these are reused in this project. The derivation of the kinematics is composed of four sections. First, a brief description of kinematics and the method used to describe kinematics is presented. This includes how positions and orientations of the robot's links can be represented in space. DenavitHartenberg notation and conventions are used for describing links and attachment of frames. In the second section, the methods are applied to the biped to describe its kinematics. In the third section, the kinematics are veried. In the fourth and last section, an expression of the center of mass of the entire biped in any possible posture is derived based on the kinematics. This is used to evaluate static stability in the controller part.
39
R:AB
B p=A BR p
(8.1)
Where Bp is the link vector p seen from frame {B } and Ap is the link vector p seen from frame {A}.
1 , b 2 If the three principal axes of {B } is described by a set of orthonormal vectors b A and b3 , then the rotation matrix BR can be written as:
A B B T B 1 Note that A . BR = AR = AR
R=
b1
b2
b3
(8.2)
When using a rotation matrix as in Eq. (8.1), the origin of frame {A} and {B } coincides as illustrated in Fig. 8.1a, where frame {A} and {B } is attached to the same link. To attach a frame {B } to another link than {A}, two pieces of informations are required to dene it relative to the frame {A}. These are the rotation matrix A BR and the vector A pB,org pointing to the origin of {B } from frame {A}[Craig, 2003]:
A B A p=A BR p + pB,org
(8.3)
Figure 8.1b shows how this transformation can be applied to several frames.
a2 b2 a2 a1 a3 b3 a1 , b1 (a) (b) a1
A
b2 pB,org c2 b3 b1
B
pC,org c3
c1
Figure 8.1: In (a) the origin of {A} and {B } coincides as they are dened relative
to each other by a rotation matrix. In (b) both a rotation matrix and an oset vector is required to dene {B }. The frame {B } is dened relative to {A}, while frame {C } is dened relative to {B }.
40
p = 1
0 0 0
A B
pB,org 1
p 1
(8.4)
The 4 4 matrix in Eq. (8.4) is called a homogeneous transform. This transformation matrix T includes all the necessary information about the position and orientation of a reference frame with respect to another frame. Eq. (8.4) will also be written as,
A B p=A BT p
(8.5)
i point along link length ai in the direction from joint i to i +1. 3. The rst axis x i is formed by the right-hand rule to complete a right-handed 4. The second axis y coordinate system.
41
i-1 zi ai xi
yi
xi+1 ai+1
(a)
Joint axis i
i-1 ai qi
Link (b)
ai-1 i
Figure 8.2: Figure (a) is an illustration of the link length and link displacement pa-
rameters. In (a) the frames are attached using the convention dened in [Craig, 2003]. In (b) the link twist parameter is illustrated for link i 1. In (c) the joint angle for joint i is illustrated.
i . A chain of links with attached The angle i is measured in right-hand sense about x frames is seen in Fig. 8.2a. Also note that the frame attachment is not unique, one of may be chosen. two possible directions of z
The rst link of a chain is the base of the robot, called link 0. The attached frame is called frame {0} and is stationary. Thus, all other link positions may be described in terms of this frame. The coordinate system is attached so it coincides with frame {1} when joint angle 1 is zero. As a result the link parameters d0 , a0 and 0 are always zero. Using the described frame attachment procedure, the link parameters and joint variable can be found as:
i to z i+1 measured along x i. ai = the distance from z i to z i+1 measured about x i. i = the angle between z i1 to x i measured along z i. di = the distance from x i to x i+1 about z i. i = the angle between x
The transformation matrix from frame {i} to {i 1} is found by from the four link parameters ai , i , di and i as:
0 sin i1 cos i1 0
(8.6)
42
Chain 1 consists of the supporting leg, starting from the foot and ending in the hip. Chain 2 consists of the non-supporting leg, starting from its hip joint and ending in the foot. Chain 3 consists of the right arm, starting in the shoulder and ending in the ngers. Chain 4 consists of the left arm, starting in the shoulder and ending in the ngers.
Chain 2, 3 and 4 are attached to chain 1 at the hip joint using transformation matrices. This method is also used in this project, as it is simple and advantageous. It yields a non-moving base frame during the SSP and make use of the well dened procedure in [Craig, 2003] for attaching frames to the four individual chains of links. The frame attachment to the biped is seen in Fig. 8.3a. In the gure, the right foot is the supporting foot. The right leg is abbreviated RL, the left leg LL, the right arm RA and the left arm LA. The frame attachment in Fig. 8.3b depicts the positive direction of rotation of the dierent joint angles. In Fig. 8.3c a front view of the biped robot is seen, showing the link lengths and joint displacements, and the three vectors locating the bases of the arms and the non-supporting legs relative to the hip frame RL5. The zero-frames of the left leg and the arms {LL0 }, {RA0 } and {LA0 } are seen in Fig. 8.4a. These are attached to the body of the biped. The origin of {LL1 }, {RA1 } and {LA1 } coincides with {LL0 }, {RA0 } and {LA0 } respectively, but their orientation is given by a rotation about their z -axes with the joint angles ll1 , ra1 and la1 . Thus, when these angles are zero frame {LL1 }, {RA1 } and {LA1 } coincides with the zero-frames. The base frame {RL0 } is seen in Fig. 8.4b.
43
RA2
RA2
y z
qRA2 x
LA2 LA2
LA2
y z
RA2
RA1
x y
x
RA1
LA1
qLA2 qRA3 qRA1 qRA4 qRL5 qLA4 qLL1 qLA5 qLL2 qRL3 qLA3 qLA1
RA1
y x
RL5
LA1
LA1
y z
LL1
LA4
qRA5 y
LA3
RA3
y
RA3
RA3
RA4
z z
RA5
y x y
RA4
z z
RL5
LA3
LA4
RL5
y x
LL1
LL1
LA4
z z
LA3
RA4
RA5
x z
RL4
RL4
LA5
y x
LA5
LA5
y
RA5
qRL4
LL2
RL4
z x
LL2
LL2
x z
RL3
RL3
y y
RL3
LL3
z x
LL3
LL3
x z
RL2
qLL3 qLL4
RL2
y y
RL2
LL4
z x
LL3
LL4
x y
RL1
RL1
z z
RL1
LL5
y x (a)
LL5
LL5
(b)
+90
-90
aRA2 dRA3
aRA1
RL5
aLA1
pLA0,org
aRL3
aLL2
RL5
aRA3
+36.8
pRA0,org
RL5
pLL0,org
aRL2
-36.8
aLL3
aRA4
aRL4 aRL3
aRL4
aLL1
aLL1
aLA4
+57.2
-57.2
aRL1
aRL1
aLL4
aLL4
aLL2
(c)
Figure 8.3: In gure (a) the frame attachment to the biped is seen, in this case, the
right foot is the supporting leg. The right leg is abbreviated RL, the left leg LL, the right arm RA and the left arm LA. The zero-frames of the four limbs coincides with the 1-frames in the gure as the joint angles are zero. In gure (b) the positive direction of rotation of the joint is indicated. In (c) the link parameters possible to depict in a front view of the biped are shown.
44
x x z y
RA0
LA0
{RL5}
x z z x y
y y x
RL5
LA0
LA0
y
{LL0}
RA0
RA0
LL1
z ,z
LL0
LL1
y x
LL0
LL1
{RA0}
x y x y (c) z
z y
RL5
RL5
LL0
x y
RL0
RL0
z z
RL0
{LA0}
Right leg
(a)
(b)
Figure 8.4: Figure (a) shows the four body-attached frames {RL5 }, {LL0 }, {LA0 } and {RA0 }, each drawn with dashed lines. Figure (b) shows the base-frame {RL0 } and gure (b) shows the relative orientation of the frames {RL5 }, {LL0 }, {LA0 }.
i 1 2 3 4 5
rl,i1 [ ] 0 -90 0 0 90
drl,i [mm] 0 0 0 0 0
45
0 0 0 1 1 0
1 rl5 0 R = la0 0
0 0 1
0 1 0
(8.8)
Given these vectors, rotation matrices and link parameters, the transformation matrices can be found.
Accordingly, the rest of the transformation matrices for the right leg are found: cos rl2 sin rl2 0 arl1 cos rl3 sin rl3 0 arl2 sin rl3 0 0 1 0 cos rl3 0 0 rl1 2 rl rl2T = rl3T = sin rl2 cos rl2 0 0 0 0 1 0 0 0 0 1 0 0 0 1 cos rl4 sin rl4 0 arl3 cos rl5 sin rl5 0 arl4 sin rl4 0 cos rl4 0 0 0 1 0 rl3 rl4 rl4T = rl5T = 0 0 1 0 sin rl5 cos rl5 0 0 0 0 0 1 0 0 0 1 Frame {LL0} is dened by translating frame {RL5 } with the vector rl5pll0,org and 5 rotating it by the matrix rl ll0R given in Eq. (8.8). These two informations are inserted
46
rl5 ll0
rl5 ll0
T =
rl5
0 0 0
pll0,org 1 0 1 0 0
cos ll2 sin ll2 0 0 ll1 ll2T = sin ll2 cos ll2 0 0 cos ll4 sin ll4 0 sin ll4 cos ll4 0 ll3 ll4T = 0 0 1 0 0 0
all3 0 0 1
all1 0 0 1
cos ll1 sin ll1 ll0 ll1T = 0 0 cos ll3 sin ll3 ll2 ll3T = 0 0 cos ll5 0 ll4 ll5T = sin ll5 0
sin ll1 cos ll1 0 0 sin ll3 cos ll3 0 0 sin ll5 0 cos ll5 0
0 0 1 0 0 0 1 0 0 1 0 0
all0 0 0 1 all2 0 0 1
all4 0 0 1
Accordingly, the transformation matrices for the right and left arm are found:
rl5 ra0
rl5 ra0
rl5
ra1 ra2
ra3 ra4
sin ra2 cos ra2 0 ara1 0 0 1 dra2 = cos ra2 sin ra2 0 0 0 0 0 1 cos(ra4 +36.8 ) sin(ra4 +36.8 ) 0 0 = sin(ra4 +36.8 ) cos(ra4 +36.8 ) 0 0
rl5 la0
0 0 0
pra0,org 1
ra0 ra1
ra2 ra3
0 1 0 0
ara3 0 0 1
ra4 ra5
cos ra1 sin ra1 0 0 sin ra1 cos ra1 0 0 = 0 0 1 0 0 0 0 1 cos ra3 sin ra3 0 ara2 0 0 1 dra3 = sin ra3 cos ra3 0 0 0 0 0 1 cos(ra5 +53.2 ) sin(ra5 +53.2 ) sin(ra5 +53.2 ) cos(ra5 +53.2 ) = 0 0 0 0 cos la1 sin la1 0 0 sin la1 cos la1 0 0 = 0 0 1 0 0 0 0 1 cos la3 sin la3 0 ala2 0 0 1 dla3 = sin la3 cos la3 0 0 0 0 0 1 cos(la5 53.2 ) sin(la5 53.2 ) sin(la5 53.2 ) cos(la5 53.2 ) = 0 0 0 0
0 0 1 0
ara4 0 0 1
rl5 la0
rl5
sin la2 cos la2 0 ala1 0 0 1 dla2 la1 la2T = cos la2 sin la2 0 0 0 0 0 1 cos(la4 36.8 ) sin(la4 36.8 ) 0 0 la3 la4T = sin(la4 36.8 ) cos(la4 36.8 ) 0 0
0 0 0
pla0,org 1
la0 la1
la2 la3
0 1 0 0
ala3 0 0 1
la4 la5
0 0 1 0
ala4 0 0 1
Given these matrices it is possible to compute the position and orientation of all the frames relative to each other. For example, the transformation matrix to give the position of a point in the arm frame {RA3} in the base frame {RL0}, can be found as:
rl0 ra3
0 T = rl rl1T
rl1 rl2
rl2 rl3
rl3 rl4
rl4 rl5
rl5 ra0
ra0 ra1
ra1 ra2
ra2 ra3
(8.9)
Having derived the transformation matrices of the biped robot, these are veried in the following section.
47
pCtot =
where mtot =
1 mtot
mi pCi
(8.10)
mi .
The positions of the CoMs of the links in {RL0 } are found by applying transformation matrices: CoM locations of links in right leg:
rl0
pCrl1 = . . .
rl0 rl1
rl1
pCrl1
0 rl5 ll0 ll1 pCll1 = rl pCll1 rl5T ll0T ll1T . . . 0 rl5 ll0 ll5 pCll5 = rl pCll5 rl5T ll0T ll5T
rl0
0 rl1 rl2 rl3 rl4 pCrl4 = rl pCrl4 rl1T rl2T rl3T rl4T
rl0
48
Figure 8.5: Screenshots of the biped implemented in 3ds max as bones using the
link parameters in Tab.8.1, Tab.8.2, Tab.8.3 and Tab.8.4, and the vectors in Eq.(8.7). In gure (a) the joint angles are zero. In (b), dierent joint angles are given to the model, and the global position is in the example found for frame {LL2}.
49
pCra1 = . . .
rl0 rl5
rl5 ra0
ra0 ra1
ra1
pCra1
0 rl5 la0 la1 pCla1 = rl pCla1 rl5T la0T la1T . . . 0 rl5 la0 la5 pCla5 = rl pCla5 rl5T la0T la5T
rl0
rl0
pCt =
rl0 rl5
rl5
pCt
pCrl,foot = rl0pCrl,foot
These expressions are then inserted into Eq. (8.10) to yield an expression for the CoM of the robot. This expression is implemented in a Matlab -script, see appended document [4]. Given the joint angles, the script computes the CoM of the individual links in {RL0 } and afterwards computes the CoM of the robot. The result is plotted in a 3D plot, where the robot is plotted as a stick gure, along with the CoM of the individual links and the CoM of the robot. An example of this is seen in Fig. 8.6.
[m]
CoM
[m]
CoM
CoP
RL0
RL0
CoP
RL0
[m]
z
(a)
RL0
[m]
RL0
[m]
(b)
RL0
[m]
Figure 8.6: The gures illustrate a stick representation of the robot seen in frame {RL0 }. In (a) all the joint angles are zero, while dierent joint angles are given to the robot in (b). The crosses indicate the CoMs of the individual links and the bold dots are the joints. The illustrations show the calculated CoM of the robot and the resulting CoP, i.e. the projection of the CoM onto the surface.
50
p = 1
0 0 0
A B
pB,org 1
p =A BT 1
(8.11)
which transforms the coordinate of point Bp into its coordinates in frame {A}. To derive the transformation matrices between each coordinate system of the robot, a method of describing the links was required. This lead to the use of the DenavitHartenberg notation. The notation states, that the kinematics of a robot can be represented by four parameters for each link, where a link is considered as a rigid body, which denes the relationship of joint axes of a robot. The method used in [Craig, 2003] was used to systemize how frames were attached to the robot. This method axes a frame in each joint of a robot with the z -axis point along the joint axis and the x-axis pointing toward the next frame. A limitation of the frame attachment procedure in [Craig, 2003], is that it only describes axing frames to a single chain of links with a xed base, whereas the biped robot has no xed base and consists of multiple chains. Therefore the biped robot was modelled as four chains: the supporting leg, starting from the supporting foot which was regarded as being xed and ending in the hip; the non-supporting leg, starting from its hip joint and ending in the foot; the right arm, starting in the shoulder and ending in the ngers; and the left arm, starting in the shoulder and ending in the ngers. The three last chains were attached to the supporting leg at the hip joint using transformation matrices. It yielded a non-moving base frame during a SSP and the use of the well dened procedure in [Craig, 2003] for attaching frames to the four individual chains of links. To verify the kinematic model, the links of the robot have been implemented in the 3D design program 3D Studio Max (3ds max). This tool allows the creation of chain of links, dening their joint axes and to give joint angles as arguments. When giving angles to the joints, 3ds max shows the resulting position and orientation of the links, and can compute their coordinates in a global coordinate system. This is without the user supplying any transformation matrices. As a result, the kinematic model was veried using 3ds max, and found correct. Finally, after verifying the kinematic model, the model was applied to give an expression for the CoM of the robot. This expression was implemented in Matlab and gave a reasonable result. As a result, an expression for the CoM given any possible posture of the robot have been obtained, enabling the design of static walk.
Chapter
52
2 3 3
3 2 1 4
Figure 9.1: Illustration of the direction of the Newton-Euler iterations, where step
one and two is outward, step three and four is inward and step ve is the CoP calculation.
53
Angular velocity: The Angular velocity of the center of mass of the links are found
by calculating the angular velocity iteratively from the supporting foot, moving successively, link by link up to the torso.
rl0
rl0 , and
Refer to Fig. 9.2. According to [Craig, 2003] the angular velocity of link i + 1 with respect to frame {0} given in frame {i + 1}, i+1 i+1 , can be expressed in terms of the angular velocity of link i with respect to frame {0} given in frame {i} as:
i+1 +1 i i+1 i+1 z i+1 = i i R i + i+1
(9.1)
+1 where i i R is the rotation matrix that describes frame {i} relative to frame {i + 1}, i+1 i+1 -direction is the joint angle velocity of joint i + 1 and z i+1 is the unit vector in the z for frame {i + 1}.
i+1
Z i+1
Ti+
{i + 1}
lin
Zi
{i}
i+ 1
From Eq. (9.1) the angular velocity of each link can be calculated relative to its own frame. The calculations initiate at frame {RL0}. As the zero frame of the supporting leg is attached to the foot, the angular velocity of this frame (rl0 rl0 ) must be zero. The angular velocity of the torso is equal to the last frame of the supporting leg which is rl5 rl5 .
way as the angular velocity. Again, refer to Fig. 9.2. From [Craig, 2003] the angular
link i
{0}
i+1
54
(9.2)
As was the case for the angular velocity, the angular acceleration of the zero frame rl0 ) is also zero. This means that initiating the calculation at the supporting foot, (rl0 the angular acceleration of each link can be found. The angular accelerations of the CoMs are also known since it is equal to the angular acceleration of each link.
Linear acceleration: The linear acceleration of the origin of frame i + 1 with respect
to {0} given in frame {i + 1} is in [Craig, 2003] given as:
i+1 +1 i i i ipi+1 + i i i i ipi+1 +i v i+1 = i v i R
(9.3)
From Eq. (9.3) the linear acceleration for each frame origin of all frames attached to the supporting leg can be calculated. The calculation process is iterative initiating at the rl0 ). The linear acceleration for this frame is set to 9.82 m/s2 in the zero frame (rl0 v x-direction to include the gravitational acceleration as mentioned earlier. The linear acceleration of the CoMs of each link is found as:
i
Ci =i i ipCi + i i i i ipCi +i v i v
(9.4)
where frame {Ci } is located at the CoM of link i and ipCi is the position vector of that frame. From Eq. (9.1), Eq. (9.2), Eq. (9.3) and Eq. (9.4) the linear acceleration of the CoM of each link can be calculated. The rst step is illustrated in Fig. 9.3, it can be seen that the joint angles of the supporting leg is the input. The outputs are the angular velocity, angular acceleration and linear acceleration of the last frame (the torso) which is used in step 2. The angular velocity, angular acceleration and linear acceleration of the CoM of each link is also output.
RL5 RL
Step 1
vRL5, RL5
RL
RL5
, RL5
RL5
vCRL,
RL
Figure 9.3: Illustration of the outward Newton-Euler iterations for step one.
la0
55
la0
0 ll0 = ll v rl5R
rl5 rl5
rl5 rl5
la0
rl5
rl5
When the angular velocity, angular and linear acceleration of the origin of the three initial frames are known, the outward iterative Newton-Euler algorithm from step one can be used to nd the acceleration of all the CoMs of the links on the free limbs. The second step is illustrated in Fig.9.4, where the input is the angular velocity, angular acceleration and linear acceleration from step one and the joint angles of the free limbs. The outputs are the angular velocity, angular acceleration and linear acceleration of the CoMs of all the links in the free limbs. The outputs are then used in step 3.
, , vCLL, vCRA, vCLA Step 2
RL5 LL LL
LL RL5
RA
LA
vRL5, RL5
RL5
, RL5
, ,
RA RA
, ,
T
LA
T
LA
Step 3: Forces and Torques Applied to the Torso by the Free Limbs
Knowing the linear and angular acceleration of the CoM of each link, the Newton-Euler equations can be applied to calculate the forces (F i ) and torques (N i ) acting at the CoM of each link. The equation for the forces and torques are given by the following two equations.
Ci F i = mi v
where mi is the total mass of link i.
(9.5)
i + i CiI i i N i = CiI i
(9.6)
where CiI i is the inertia tensor of link i with respect to frame {Ci }. Frame {Ci } has its origin at the CoM of link i and has the same orientation as the link frame. Knowing the forces and torques acting on each link in the free limbs the inward NewtonEuler calculation can begin. This is done by writing force balance and torque balance equations based on a free body diagram as depicted in Fig. 9.5. Each link is subjected to a force and a torque by its neighboring links and experiences an inertial force and torque. The calculations are initiated at the last link in the free limbs (link LL5, RA5, and LA5). Summing up the forces acting on link i, yields:
i i+1 F i = if i i f i+1 i+1R
(9.7)
56
ni+1 i
{i+1}
Ni+1
Link i+1 CoM
CoM
fi+1
ni Fi
Fi+1
fi+2
(9.8)
where ini is the torque exerted on link i by link i 1. Inserting Eq. (9.7) into Eq. (9.8) and adding rotation matrices, results in:
i i+1 i+1 N i = ini i ni+1 ipCi iF i ipi+1 i f i+1 i+1R i+1R
(9.9)
At last the force and torque equations are rearranged so they appear as iterative relationships from link i + 1 to link i.
i i+1 f i = iF i + i f i+1 i+1R
(9.10)
(9.11)
The required joint torques are found by taking the z -component of the torque applied by link i + 1 on link i.
i i = ini iz
where the symbol is used for linear actuator force.
(9.12)
The above calculations are made for all the links on the left leg, the right and left arm. From the calculations the torques that should be applied by the actuators on the free limbs ([ll1 , ..., ll5 , ..., ra1 , ..., ra5 , ..., la1 , ..., la5 ]) are known. Moreover, the eect from the torso on the free limbs can be calculated by: ll0f ll0 , ll0nll0 , ra0f ra0 , ra0nra0 , la0 f la0 , and la0nla0 . The third step is illustrated in Fig. 9.6, where the input is the angular velocity, angular acceleration and linear acceleration of the CoMs of all the links in the free limbs from step 2. The outputs are the forces and torques from the base of the free limbs, these outputs are then used in step 4.
57
, ,
RA RA
, ,
T
LA
Step 3
T T
T
LA
f
{RA0}
RL5
{LL0}
CoM C RL5
-n
LA0
-n
RA0
N -f
RA0
LL5
F
{RL5}
RL5
-f
{LL0}
LA0
-n -f
LL0
LL0
RL5
Figure 9.7: Free body diagram for the torso, where the torque and forces acting on the torso is indicated.
These are illustrated in Fig. 9.7. These forces and torques must rst be moved down to the rst frame of the supporting leg. The resulting force acting on the torso can be found by taking the sum of the force exerted on the torso by the supporting leg and the free limbs as shown in Fig. 9.7:
rl5
Rearranging this equation and introducing the associated rotation matrices the force that should be given from link RL4 to the torso is:
rl5
5 ll0 5 ra0 5 la0 f rl5 = rl5F rl5 + rl f ll0 + rl f ra0 + rl f la0 ll0R ra0R la0R
(9.13)
In the same way the torque balance for the torso can be found.
rl5
rl5
Rearranging this equation and introducing the associated rotation matrices the torque that should be given from link RL4 to the torso is:
rl5
5 ll0 5 ra0 5 la0 nrl5 =rl5N rl5 + rl nll0 + rl nra0 + rl nla0 ll0R ra0R la0R 5 ra0 5 la0 + rl5pra0 rl f ra0 + rl5pla0 rl f la0 ra0R la0R 5 ll0 + rl5pCrl5 rl5F rl5 + rl5pll0 rl f ll0 ll0R
(9.15)
The torque the actuator in joint RL5 has to deliver can be found from Eq. (9.12). The calculations are continued down the supporting leg and when the right foot is reached all the torques which has to be delivered by the actuators are known. When these calculated torques are delivered the biped robot should move as specied by the inputs (i ).
58
RL
Step 4
fRL1, nRL1
Reaction forces from the surface, i.e. friction and pressure forces. According to the denition of the CoP, these forces can be summarized as 3 components F p , F fric,y and F fric,z acting at the CoP. Reaction forces from the robot at the ankle joint RL1, i.e. F x , F y and F z . The y -component y of the torque acting on joint RL1. The z -component z of the torque acting on joint RL1.
tRL2
qRL1 -ty
qRL1 Fp
yCoP tz
Fy
x y
RL0
RL0
Fp
zCoP
CoMfoot
ty
Fz
x y
RL0
RL0
RL0
Ffric,y
CoP
CoMfoot Ffoot Fx
hankle
hankle
Ffric,z
RL0
CoP Ffoot
Fx
yCoM,foot
Frontal view of right foot
zCoM,foot
Sagittal view of right foot
Figure 9.9: A frontal (a) and sagittal (b) view of the right foot illustrating the
forces and torques acting on the foot. The torques y and z are the torques exerted on the ankle by the robot. The torques rl1 and rl2 are the torques delivered by the servomotors in joint RL1 and RL2 respectively. The forces Ffric,y and Ffric,z are friction forces. The quantities yCoM,foot and zCoM,foot are the y and z -coordinate of the center of mass of the foot.
During the SSP phase the supporting foot is assumed to be static, i.e. no slippage is assumed between the surfaces and the foot. If the foot is to remain static the resulting
59
= y Ffoot zCoM,foot + Fp zCoP Ffric,z hankle = z + Ffoot yCoM,foot Fp yCoP Ffric,y hankle = Fp Fx Ffoot = Fy Ffric,y = Fz Ffric,z
=0 =0 =0 =0 =0
yCoP = zCoP
(9.16) (9.17)
where yCoP and zCoP are the y and z -coordinate of the CoP. The quantities yCoM,foot and zCoM,foot are the y and z -coordinate of the CoM of the foot given in frame {RL0 }. The torque component z acting on joint RL1 is equal to the torque rl1 delivered by the servomotor with opposite direction, thus z = rl1 . By inspecting Fig. 9.9 the corresponding relation for y can be found:
y =
rl2 cos(rl1 )
(9.18)
Note that Eq. (9.18) becomes unstable or uncertain as rl1 approached 90 , because cos(rl1 ) and rl2 approaches zero. Now the desired expressions are determined. Before they can be used to simulate the biped robot the model must be veried. This is done in the following section.
1 mtot 1 mtot
di mi =
i=1
(9.19) (9.20)
di mi =
i=1
The torques loading the ankle joint are y = Fx dz and z = Fx dy . As the arrangement is static and on a planar surface, friction forces are zero making Fy = Fz = 0 and
60
dy x tz
Ffoot Fx=Fm
RL0
m
Fm
x ty y
RL0
RL0
RL0
RL0
RL0
Ffoot
Fx=Fm
yCoP y CoM,foot
zCoP
zCoM,foot
Figure 9.10: An illustration of the foot with the forces and torques aecting it and
the resulting CoP in the frontal and sagittal plane.
Fx = Fm = mg . Inserting this into Eq. (9.16) and Eq. (9.17) yields the following CoP, yCoP = Ffoot yCoM,foot + z Fy hankle mfoot g yCoM,foot + mgdy mfoot yCoM,foot + mdy = = Fx + Ffoot mg + mfoot g m + mfoot Ffoot zCoM,foot y + Fz hankle mfoot g zCoM,foot mgdz mfoot zCoM,foot mdz zCoP = = = Fx + Ffoot mg + mfoot g m + mfoot
which is equal to those found in Eq. (9.19) and Eq. (9.20). Thus, the mapping from ankle joint forces and torques to CoP is correct. The entire model is veried by implementing it in Simulink . The Simulink model can be found on the appended CD [5]. To verify the Newton-Euler model, the outputs from the ve accelerometers placed on the robot is logged and compared to outputs from the Simulink model. Additionally, the simulated CoP is compared to the CoP position measured by the strain gauges in the feet. To make this comparison, the accelerations of the accelerometers must be extracted from the model along with the CoP position. The accelerometers are not placed in the origin of the joint frame and do therefore not have the same acceleration as this joint frame. The acceleration of the accelerometers depends on two things; the acceleration of the joint frame for the link which they are attached to, and the position of the accelerometers given in the concerned frame. An expression for the acceleration of the accelerometers can be found by rewriting Eq.(9.4).
i
Si =i i ipSi + i i i i ipSi +i v i v
(9.21)
where frame {Si } has its origin in sensor i, and the same orientation as frame {i}. ipSi is the position vector of frame {Si } given in frame {i}. From Eq. (9.21) an expression for the acceleration of the ve accelerometers can be found. Right foot:
rl0
rl0
Left foot:
ll5
ll5
Right arm:
ra5
ra5
Left arm:
la5
la5
61
rl5
With the ability to extract accelerometer data and CoP position from the Newtonian model, it can be veried against the response from the physical biped robot. To make a thorough test of the model, the output of the robot should be logged while all of the servomotors are activated one at the time. As this would be a very comprehensive test, it is decided to carry out a subset of the tests. The subsets are selected in such a way that all the free limbs (arms, torso and swinging leg) are moved a considerable degree. This, along with a test of the measured CoP and the simulated CoP, is considered sucient to verify the correctness of the model. Two separate test scenarios are used. In the accelerometer tests, a scenario is used where the biped robot is xed. This means that when testing the left leg and the arms the robot is xed at the torso so that only the respective limb is moving. The right side of the robot is tested in a similar way. When testing the torso the legs are xed and only the torso moves. In the CoP test, the robot is executing a trajectory, and is thus free. The inputs in the accelerometer test is seen in Tab. 9.1. When performing e.g. the test with the left leg, all other servomotors are in the 0 position. Only the two servomotors LL2 and LL5 are used. Test Case Left Arm Right Arm Torso Left Leg Function to servomotor LA2: 0.52 + 0.52cos(x/0.262) LA3: 0.78cos(x/0.131) RA3: 0.78sin(x/0.131) RA2: 0.52 + 0.52sin(x/0.262) RL4: 0.52sin(x/0.525) RL5: 0.52sin(x/0.525) LL2: 0.78sin(x/0.525) LL5: 0.78sin(x/0.525)
Table 9.1: Table showing which servomotor is given which input in which test case.
Only two servomotors are used in every single test case (x 0 : 2).
The results of these four tests can be seen in Fig. 9.11 through Fig. 9.14. In the rst three test cases, which are depicted in Fig. 9.11 through Fig. 9.13, the model output and the output from the robot coincide almost perfectly. The output from the robot has the same characteristic form but deviate a little in amplitude. The deviation in amplitude is assumed to be caused by several dierent things. One problem could be the dead-bands in the servomotors causing the servomotor shaft not to be exactly at the desired angle. Also, as shown in App.D.6, large oset errors can occur when the servomotors are under heavy load. It might also be inaccuracies within the accelerometer measurements. The main problem, however, is suspected to be slack in the robot. To test the slack present in the robot, a servomotor has been positioned at 45 and is manually moved back and forth within the slack of the servomotor. This test is seen in Fig. 9.15 where the dashed line indicates what the acceleration should be and the solid line indicates the actual accelerometer measurement. As seen, the solid line varies around 6.93 m/s due to the slack in the servomotor. This is expected as the slack is equally large to either side of the 45 which is the reference
2
62
[m/s2]
[m/s2]
10 0 10 0 1 2 3 Time [s] 4 5 6
Figure 9.11: Test results for the right arm. The solid line is output from the
All the accelerations are in their respective frames.
physical biped robot whilst the dotted line is the output from the Simulink model.
[m/s2]
[m/s2]
10 0 10 0 1 2 3 Time [s] 4 5 6
Figure 9.12: Test results for the left arm. The solid line is output from the physical
accelerations are in their respective frames.
biped robot whilst the dotted line is the output from the Simulink model. All the
to the servomotor. It can be seen that the acceleration changes as much as 1.3 m/s . This test clearly supports the suspicion that slack is the main problem for inaccurate output from the robot. Another problem is the high sensitivity of the accelerometers when measuring angles around 45 . As seen in App. D.8 the function, mapping an angle
63
[m/s2]
[m/s2]
10 0 10 0 1 2 3 Time [s] 4 5 6
Figure 9.13: Test results for the left leg. The solid line is output from the physical biped robot whilst the dotted line is the output from the Simulink model. All the
accelerations are in their respective frames.
[m/s2]
10 0 10 0 1 2 3 4 Torso ZRL5 5 6
[m/s2]
10 0 10 0 1 2 3 Time [s] 4 5 6
Figure 9.14: Test results for the torso. The solid line is output from the physical biped robot whilst the dotted line is the output from the Simulink model. All the
accelerations are in their respective frames.
to an acceleration, is a sine function thus making small changes in angles change the output drastically around 45 . All of this leads to dierences in amplitude but not in the characteristic of the output. When inspecting Fig. 9.14 the measured output from the robot is clearly smaller in the
64
Figure 9.15: Slack test using servomotor LL2. The dotted line indicate what the
output should have been and the solid line show the actual output
y -direction but larger in the z -direction. This can also be explained by slack in the robot.
The last test concerns the CoP position. The CoP is calculated on-line in Simulink using the strain gauge measurements and is compared to the CoP calculated in the model. The comparison is seen in Fig. 9.16 where the dotted line is the model output and the solid line is the output from the robot. The CoP is plotted in the global frame. As seen in the topmost plot in Fig. 9.16 the CoP moves from a positive length towards zero and back to a positive length again. This is because the CoP is seen from the global frame which is attached to the right foot. So doing a full gait cycle the CoP moves from the middle to the right foot, then to the left foot and back to the middle again. It can be seen that the output from the robot tracks the model output although with some deviations in amplitude. The lower plot in Fig. 9.16 shows CoP in the x-direction. As expected the CoP moves from the back of the foot and forward and back again during one gait cycle, seen from the right foot. Again the output from the robot tracks the model output although with some deviations in amplitude.
Chapter Summary
In this chapter a dynamic SSP model based on Newton-Euler iterations is derived. The SSP model is derived with the iterations initiated at the supporting foot as this link is xed to the ground which means that the link does not have any velocity or acceleration. From the supporting foot the iterations are continued all the way up to the torso. From the torso the iterations are continued outward to the last link of the free limbs by rst transforming the velocity and acceleration from the last link of the supporting foot to the rst link of the free limbs. The force and torque exerted on the last link are then calculated and used to initiate the inward iterations going from the free limbs to the torso. The forces and torques exerted on the torso by the free limbs are then transformed
65
CoP in ydirection seen from the global frame 8 6 [cm] 4 2 0 2 2 8 10 12 Time [s] CoP in xdirection seen from the global frame 4 6
5 0 5 10
[cm]
6 Time [s]
10
12
Figure 9.16: CoP test of the model versus the physical robot. The dotted line is
the model output and the solid line is the output from the robot. The topmost gure shows the CoP in the y -plane and the lower gure shows the CoP in the x-plane in the global frame.
down to the last link of the supporting leg. When these forces and torques are known they are used to initiate the last iterations which give the force and torque exerted on to the supporting foot. When all the iterations are conducted the actuator torque is known for all the actuators in the biped robot. One last step is performed to calculate the CoP position from the torques. These calculations are implemented in Simulink. To verify the model, the acceleration of the accelerometers and the CoP position are included in the model. Dierent tests are then carried out on the physical robot and the results are compared with the outputs from the Simulink model. The test results show that the outputs from the model resemble the outputs from the biped robot satisfactorily. Therefore it is concluded that the mathematical model can be used to describe the biped robot and be used for simulations.
Chapter
10
66
67
) = I (q , q
A
)dt L(t, q , q
(10.1)
where I is a functional dened on a set of curves with real values, L = T U and is called the Lagrangian, t is time, and q is the generalized coordinates. The necessary condition for the integral to be minimal is that Eq. (10.2), called the Euler-Lagrange equation, is satised. d L L =0 dt q q (10.2)
Since Hamilton's principle states that Eq.(10.1) has a minimum at a trajectory, Eq.(10.2) is satised along that trajectory for a mechanical system. External forces Q can be taken into account using the Lagrange-d'Alembert Principle yielding d L L =Q dt q q (10.3)
In this project the servomotor angles will be used as generalized coordinates as this will yield the simplest calculations. This also turns the external forces into the torques produced gravity and the movement in the system. Friction in the joints and against the air will be neglected as well as the the spring forces from the wiring. Thus Eq. (10.3) gives d L L = dt where is the actuator torque. These equations are inspired by [Wisniewski, 2007] and constitute the theory behind the Lagrangian model of the biped robot.
(10.4)
68
R R rl2prl3,org 0 rl1 rl2 rl3 prl4,org = prl3,org + rl prl4,org rl1R rl2R rl3R rl0 rl1 rl2 rl3 prl5,org = prl4,org + rl1R rl2R rl3R rl4R rl4prl5,org 0 rl1 rl2 rl3 rl4 rl5 0 rl5 pll1,org = prl5,org + rl pll0,org = rl pll0,org rl1R rl2R rl3R rl4R rl5R rl5R rl0 rl5 ll0 ll1 pll2,org = pll1,org + rl5R ll0R ll1R pll2,org 0 rl5 ll0 ll1 ll2 pll3,org = pll2,org + rl pll3,org rl5R ll0R ll1R ll2R rl0 rl5 ll0 ll1 ll2 pll4,org = pll3,org + rl5R ll0R ll1R ll2R ll3R ll3pll4,org 0 rl5 ll0 ll1 ll2 ll3 ll4 pll5,org = pll4,org + rl pll5,org rl5R ll0R ll1R ll2R ll3R ll4R
rl0 rl1 rl1 rl2
rl1
prl2,org
The subscript prl1,org indicates that p is the point located in the joint of frame {RL1}. In this chapter, when no superscript is written to indicate the frame in which a point is given, {RL0} is implied, e.g. prl1 = rl0prl1 . It is assumed that the three outer servomotors in the arms are inactive. Then, only three points in each arm are of interest since they are sucient to describe the torques the arms add to the biped. These points are the rst two joints in the shoulders and the mass center for the entire arm. These points are found from frame {RL5} using the rotation matrices from the kinematics section.
XCoM,ra 0 rl5 ra0 ra1 YCoM,ra = pra2,org + rl rl5R ra0R ra1R ra2R ZCoM,ra
la0 la0 la1 rl0 rl5
rl0 rl5
rl5 ra0
R ra1pra2,org
pra1,org
XCoM,la 0 rl5 la0 la1 YCoM,la = pla2,org + rl rl5R la0R la1R la2R ZCoM,la
R R R la1pla2,org
rl5 la0
pla1,org
From these coordinates it is possible to nd the mass centers of the relevant links. To make the calculations easier the following assumptions are made for the locations of the mass centers.
69
In Fig. 10.1 the placements of the actual mass centers are plotted along with the joint centers which are the approximated mass centers in the Lagrange model. This approximation introduce a maximum displacement of 8 mm in the three directions from the actual mass centers. This is considered acceptable as the moment of inertia from each link is changed very little as the lever arm always is measured from the angle of the supporting foot, which means that the displacement introduced by the approximations is less than 10% when a link is more than 8 cm away from the angle.
[m]
[m]
[m]
[m]
Figure 10.1: This gure illustrates the size of the displacement introduced by the
approximation of the mass centers laying in the joint center. The crosses are the actual mass centers and the dots are the approximated mass centers used by the lagrangian model.
The mass centers CoMrl3 and CoMll2 are neglected due to their relative small weight which is about 1/4 of the other links because no servomotor is attached to these links. With these approximations only the pCoM,t is not yet determined and is given by:
pCoM,t
These points contain all the information needed to describe the position of the joints for every possible angle. This information is not needed to describe a gait and hence simplications can be made. To do so, the expressions are written out in their full length and simplied in App. G.1. The simplications have mainly been carried out using the fact that each servomotor angle varies only within limits smaller than 26
70
rl = rl2 + rl3 + rl4 ll1+ = rl2 + rl3 + rl4 + ll2 ll2+ = rl2 + rl3 + rl4 + ll2 + ll3 ll3+ = rl2 + rl3 + rl4 + ll2 + ll3 + ll4 ll1- = rl2 + rl3 + rl4 ll2 ll2- = rl2 + rl3 + rl4 ll2 ll3 ll3- = rl2 + rl3 + rl4 ll2 ll3 ll4
hip = rl5 + ll1 lls2 = ll2 + ll3 + ll4 lls1 = ll2 + ll3 ra+ = rl2 + rl3 + rl4 + ra1 ra- = rl2 + rl3 + rl4 ra1 la+ = rl2 + rl3 + rl4 + la1 la- = rl2 + rl3 + rl4 la1
In the derivation it is not assumed that rl = 0 because this is not always the case for human gait, but as earlier mentioned a constraint on the gait of the biped robot. The '+' or '-' in the dierent subscripts indicate whether the angles are added or subtracted from the angles in the supporting leg. The simplications have resulted in the following coordinates for the legs. 0 0 prl1,org = arl0 0 pll1,org = prl5,org + ahip 1 0 rl rl5 1 1 prl2,org = prl1,org + arl1 rl1 pll2,org = pll1,org + all4 rl1 rl5 ll1 rl 0 1 cos(ll1- ) prl3,org = prl2,org + arl2 rl1 pll3,org = pll2,org + all3 rl5 ll1 sin(ll1 rl2 ) 1 cos(ll2- ) pll4 = pll3,org + all2 ll1 rl1 prl4,org = prl3,org + arl3 ( + ) sin( rl2 rl3 ll2- ) 1 cos(ll3- ) prl5,org = prl4,org + arl4 rl1 pll5,org = pll4,org + all1 ll1 rl sin(ll3- ) For the mass center of the torso the coordinates are
pCoM,t
71
pra1,org
pra2,org
pCoM,ra
pla1,org
pla2,org
pCoM,la
50.5 = prl5,org + 49.1 50.5rl 18.7 cos(ra+ ) 0 = pra1,org + 18.7 sin(ra+ ) cos(ra+ )YCoM,ra XCoM,ra = pra2,org + sin(ra+ )YCoM,ra 50.5 = prl5,org + 110.7 50.5rl 18.7 cos(la- ) 0 = pla1,org + 18.7 sin(la- ) cos(la- )YCoM,la XCoM,la = pla2,org + sin(la- )YCoM,la
Now the coordinates for the points of interest have been found, and the redundant information has been discarded. The points are ready to be used to determine the energy in the biped robot.
ki =
1 1 i i p i + I i mi p 2 2 i
ki,l ki,r
(10.5)
The rst part represents the linear part of the kinetic energy, denoted ki,l , and the second part represent the rotational kinetic energy, denoted ki,r [Craig, 2003]. The reason ki,r becomes a scalar is that each joint only rotate around the z -axis which gives
i = 0 0
z,i
i , must be deTo be able to calculate Eq. (10.5) the velocities of each mass center, p termined. This is done in App. G.2. Furthermore, the moments of inertia are found in App. G.3. The complete expressions for the moments of inertia does, like the points for the joints, contain unnecessary information for describing the inertia in a gait cycle and hence they have been simplied in the same way. Additionally, some of the elements in the inertia tensor for the dierent parts of the biped robot contributes with a relative small amount of inertia, and are removed from the expressions.
72
pi = mi gxi
The energies of the system have now been determined enabling the Lagrangian to be calculated, and hence the torques in joints RL1 and RL2 can be found.
L=
ki
pi
The torque for each link are determined using Eq. (10.7) in two steps: d L L dt
step 1 step 2
(10.7)
The torque determined in Eq. (10.7) is the actuator torque. It has the size of the torque the biped robot applies to the servomotors along the z -axis due to changes in the energies in the robot, with opposite sign. The control of the biped robot is done by adjusting the servomotor angles to obtain a certain output from the strain gauges on the supporting foot which are mapped to a certain torque in the origin of {RL1} and {RL2}. Hence the only two torques of interest are the torque in joint RL1 to determine how the load is distributed on the foot in the frontal plane, and the torque in joint RL2 to determine how the load is distributed in the foot in the sagittal plane. These two torques are the most comprehensive to determine since they have to take the whole robot into account. Consequently, the calculations is divided into three steps, as seen in Eq. (10.8). As step one from Eq. (10.7) consist of both a linear and a rotational part the step is easily divided into two subparts as dierentiation is a linear operation. d Lr L d Ll + rl1 dt rl1 rl1 dt
step 1.1 step 1.2 step 2
rl1 =
(10.8)
rl2
(10.9)
The torques rl1 and rl2 are scalars as they only represent the torque around the z -axis in their respective coordinate system. This leads to the following derivation of the torques caused by the energy changes.
73
Torque in RL1
The expressions for the terms in Eq. (10.8) are derived in App. G.4 and for brevity only the nal equations are presented here.
d Ll d 2 2 = mrl1 a2 rl1 rl1 + mrl2 (arl1 + arl2 ) rl1 + mrl4 (arl1 + arl2 + arl3 ) rl1 rl1 dt dt
2 2 2 2 +mbody (a2 rl sin(rl1 ) + arl )rl1 + mll1 arl sin(rl1 ) rl1
rl1 all1 ( rl5 + ll1 ))(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 ) rl1 + all2 sin(ll1- ) ll1- )(arl sin(rl1 )) +mll3 (arl sin(rl1 ) rl1 (all1 + all2 )( rl5 + ll1 ))(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 ) rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )(arl sin(rl1 )) +mll4 (arl sin(rl1 ) rl1 (all1 + all2 )( rl5 + ll1 ) all3 ll1 )(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 ) +mll5 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2arl sin(rl1 )
ll3- (arl sin(rl1 )) + (arl1 + arl2 + arl3 ) rl1 +ll4 sin(ll3- ) rl5 + ll1 ) (all3 + all4 ) ll1 (arl1 + arl2 + arl3 ) (all1 all2 )( rl1 + (YCoM,ra 18.7) sin(ra+ ) ra+ )(arl sin(rl1 )) + a2 +marm (arl sin(rl1 ) rl rl1 rl1 (YCoM,la + 18.7) sin(la- ) la- )(arl sin(rl1 )) + a2 +marm (arl sin(rl1 ) rl rl1
(10.10)
and
d Lr d = I + Iyy,rl2 + mrl2 (arl1 + arl2 )2 + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 )2 rl1 dt rl1 zz,rl1 dt
2 2 2 +2 rl Ixx,t + Izz,t + mt (arl + Xt ) + Izz,ll1 + mll1 (arl1 + arl2 + arl3 ) + ahip 2 2 +Ixx,ll3 + mll3 (arl1 + arl2 )2 + a2 hip + sin (ll3- )Ixx,ll4 + cos (ll3- )Iyy,ll4 2 2 2 2 +mll4 a2 rl1 + ahip + sin (ll3- )Ixx,ll5 + cos (ll3- )Izz,ll5 + mll5 ahip
+marm ((arl + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 ) + sin2 (ra+ )Iyy,ra + cos2 (ra+ )Izz,ra + sin2 (la- )Iyy,la + cos2 (la- )Izz,ra +marm ((arl + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 ) (10.11)
These two expressions are not dierentiated with respect to time in the report to keep them as simple as possible. The dierentiation is only carried out in Matlab , which is a rather simple task. The nal of the three expressions in Eq. (10.8) is given by.
74
L 2 =mll1 a2 rl sin(rl1 ) cos(rl1 )rl1 + mll3 (arl sin(rl1 )rl1 + all2 sin(ll1- )ll1- )(arl cos(rl1 )rl1 ) rl1 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )(arl cos(rl1 ) rl1 ) + mll4 (arl sin(rl1 ) rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2+ mll5 arl sin(rl1 ) ll3- (arl cos(rl1 ) rl1 ) +all4 sin(ll3- ) 2 + mbody (a2 rl sin(rl1 ) cos(rl1 )rl1 ) rl1 + (YCoM,ra 18.7) sin(ra+ )ra+ (arl cos(rl1 ) rl1 ) + marm arl sin(rl1 ) rl1 (YCoM,la + 18.7) sin(la+ )la+ (arl cos(rl1 ) rl1 ) + marm arl sin(rl1 ) + (mll1 + mll3 + mll4 + mll5 + mt + mra + mla )garl sin(rl1 )
(10.12)
Inspecting the expressions in Eq. (10.10), Eq. (10.11), and Eq. (10.12) reveal that they seem reasonable. The subparts in Eq. (10.10) all consists of moment of inertia given by the mass of each part multiplied by its displacement, and again multiplied with an angular velocity to get the angular momentum of the whole biped robot due to linear velocity. Dierentiating this with respect to time, the torque is found. The same applies to Eq. (10.11) where the moment of inertia depends on many angles in the biped robot multiplied by the angular velocity of joint RL1. This results in an angular momentum which again is dierentiated with respect to time to get the torque. Finally Eq. (10.12) yields a torque directly as the inertia parts are multiplied with the angular velocity squared. As expected, this expression is dominated by the changes in the potential energy as long as the angular velocity squared is less than the square root of the gravitational acceleration. This means that these expressions do look reasonable, but a further examination is needed to verify the correctness of the expressions. This is done in Sec. 10.5.
Torque in RL2
The torque in the upper angle joint RL2 is given by the expression found in Eq. (10.9) where
d Ll d = (mrl2 a2 rl2 )rl2 + mrl4 (arl2 rl2 arl3 (rl2 + rl3 ))(arl2 arl3 ) dt rl2 dt
rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) (arl2 arl3 ahip rl5 ) + (sin(rl2 )2 rl2 (arl2 + arl3 )2 ) +mll1 arl2
+mll3
rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) + all2 cos(ll1- ) ll1arl2
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- )( sin(rl2 )(arl2 + arl3 ) + all2 sin(ll1- )) +( sin(rl2 )
+mll4
ll1- + all3 cos(ll2- ) ll2- (arl2 arl3 ahip rl5 + all2 cos(ll1- ) + all3 cos(ll2- )) +all2 cos(ll1- )
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- ) +( sin(rl2 )
+mll5
(arl2 arl3 ahip rl5 + all2 cos(ll1- ) + all3 cos(ll2- ) + all4 cos(ll3- )) rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- ) +( sin(rl2 )
( sin(rl2 )(arl2 + arl3 ) + all2 sin(ll1- ) + all3 sin(ll2- ) + all4 sin(ll3- )))
+mt
rl2 (arl2 + arl3 ) + (YCoM,ra 18.7) sin(ra+ ) ra+ )( sin(rl2 )(arl2 + arl3 ) + (YCoM,ra 18.7) sin(ra+ )) +marm ( sin(rl2 )
ra+ (arl2 arl3 arl4 50.5 + (YCoM,ra 18.7) cos(ra+ )) +(YCoM,ra 18.7) cos(ra+ )
rl2 (arl2 + arl3 ) + (YCoM,la 18.7) sin(la- ) la- )( sin(rl2 )(arl2 + arl3 ) + (YCoM,la 18.7) sin(la- )) +marm ( sin(rl2 )
75
la- (arl2 arl3 arl4 50.5 (YCoM,la + 18.7) cos(la- )) (YCoM,la + 18.7) cos(la- )
76
and
d d Lr 2 2 2 = rl2 Izz,rl2 + Izz,rl4 + mrl4 (arl2 + arl3 ) + rl5 Ixx,t + Iyy,t + mt ((arl2 + arl3 + arl4 + XCoM,t ) ) dt rl2 dt
2 2 2 +Iyy,ll1 + mll1 ((arl2 + arl3 )2 + a2 hip ) + Izz,ll3 + mll3 arl2 + ahip + Izz,ll4 + mll4 ahip
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip
+Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 )
(10.14)
+Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 )
and
L 2 (arl2 + arl3 )2 ) + mll1 arl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) =mt ( sin(rl2 ) cos(rl2 ) rl2 rl2 rl5 + ( rl )rl5 ) all1 ( rl ) (ahip rl5 ) + ( sin(rl2 ) cos(rl2 ) 2 (arl2 + arl3 )2 ) ahip ((rl )
rl2
+ mll3
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- ( cos(rl2 ) rl2 (arl2 + arl3 ) + all2 cos(ll1- ) ll1- ) sin(rl2 )
rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) + arl2
rl ) + all2 cos(ll1- ) ll1- (ahip rl5 all2 sin(ll1- ) ll1- ) all1 ( rl2 (arl2 + arl3 ) cos(rl2 )
+ mll4
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2 sin(rl2 )
ll1- + all3 cos(ll2- ) ll2- + arl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) +all2 cos(ll1- )
rl ) + all2 cos(ll1- ) ll1- + all3 cos(ll2- ) ll2- (ahip rl5 all2 sin(ll1- ) ll1- all3 sin(ll2- ) ll2- ) all1 (
+ mll5
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3 sin(rl2 )
rl2 (arl2 + arl3 ) + all2 cos(ll1- ) ll1- + all3 cos(ll2- ) ll2- + all4 cos(ll3- ) ll3- ) ( cos(rl2 )
rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) + arl2
rl5 all2 sin(ll1- ) ll1- all3 sin(ll2- ) ll2- all4 sin(ll3- ) ll3- ) (ahip
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) + (YCoM,ra 18.7) cos(ra+ ) ra+ ((YCoM,rarm 18.7) sin(ra+ ) ra+ ) + arl2
rl2 (arl2 + arl3 ) (YCoM,la + 18.7) la- sin(la- ))( cos(rl2 ) rl2 (arl2 + arl3 ) (YCoM,la + 18.7) la- cos(la- )) + marm ( sin(rl2 )
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) (YCoM,la + 18.7) cos(la- ) la- ((YCoM,la + 18.7) sin(la- ) la- ) + arl2
+ mll3 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- )) + mll4 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- ) all3 sin(ll2- )) + mll5 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- ) all3 sin(ll2- ) all4 sin(ll3- ))
77
+ marm g ((arl2 + arl3 ) sin(rl2 ) + (18.7 YCoM,ra ) sin(ra+ )) + marm g ((arl2 + arl3 ) sin(rl2 ) + (18.7 + YCoM,la ) sin(la- )) (10.15)
78
m RL5
Epot
1
k 0
RL1
RL1
RL1
a.3
Epot
RL1
Figure 10.2: The case with no constraint is depicted in (a). (a.1) shows the position
of the robot in zero position with a lever arm, x, to the mass center of the biped robot, m. (a.2) shows the case when the robot has maximum potential energy and the lever arm is zero. (a.3) illustrate the energy of the robot in the static case, and the two torques experienced in RL1 from the positions in (a.1) and (a.2). (b) shows the case when the constraint is applied. (b.1) shows the position of the robot in zero position which also is the position where the biped robot has maximum of potential energy and a lever arm x. (b.2) shows the case where the lever arm is zero and the potential energy is smaller than the one in (b.1). (b.3) illustrate the energy of the robot in the static case, and the torque experienced in RL1 from the position in (b.1).
In Fig. 10.2 (a) no constraint are applied. When the biped robot is in zero position the joint RL1 is exposed to a torque 0 due to the lever arm x and the mass m, which can be found from dierentiating according to Eq. (10.16)
0 =
Epot rl1
(10.16)
rl1 =0
which is depicted in (a.3). The case when the biped robot has rotated in RL1 such that the lever arm is zero and the maximal potential energy is reach, is seen in (a.2). In this
79
sagittal =mt g (asag ZCoM,t ) + (mrl3 + mrl4 + mll1 + mll2 )gasag + (mll4 + mll5 )g (asag + sin(ll2 )all2 + sin(ll2 + ll3 )all3 ) + mll3 g (asag + sin(ll2 )all2 ) + mrl2 g sin(rl2 )arl2 + mra g (asag sin(ra1 )(YCoM,ra ara1 )) + mla g (asag + sin(la1 )(YCoM,la ala1 ))
where asag = (sin(rl2 )arl2 + sin(rl2 + rl3 )arl3 ). The forces depicted in Fig. 10.3 does result in the following simplied expression for the torque in the frontal plane. (10.17)
frontal =mt g (afro ) + YCoM,t + afro ) + mswingleg g (ahip + afro + sin(ll1 )(all1 + all2 )) + mla g (afro +rl5 py,la0,org XCoM,la + YCoM,la sin(ra2 )) + mra g (afro +rl5 py,ra0,org + XCoM,ra YCoM,ra sin(ra2 )) + msupportleg g sin(rl1 )(arl1 + sin(rl2 )arl2 ) (10.18)
where afro = sin(rl1 )(arl1 + (cos(rl2 )arl2 + cos(rl2 + rl3 )arl3 ) + arl4 ) As the torques from the constraints are relatively short expressions, small angle approximations are not used. These torques from the constraints change Eq. (10.8) and Eq. (10.9) to: d L L frontal rl1 rl1 dt
step 1 step 2
rl1 =
(10.19)
rl2
(10.20)
Introducing these constraints causes the gravitational eect to be taken into account twice which will give wrong results. Hence the terms originating in the gravitational acceleration are removed from the expressions in Eq.(10.12) and Eq.(10.15) [Wisniewski, 2007]. As the expressions take up much space they are not written again.
80
FT FRA FLA
FT FRA FLA
RL5
FSUPPORTLEG
RL1 FRONTAL
FSWINGLEG
FSUPPORTLEG
RL2 SAGITTAL
FSWINGLEG
Figure 10.3: This gure illustrates the torque working on the biped robot not due
to energy changes.
81
0.5
1.5
2.5
3.5
0.5
2.5
3.5
Figure 10.4: This gure illustrate how the CoP is moving on the surface when the dynamic trajectory for the Newton-Euler model is input to the model.
Angle position and angle velocity of RL2 2 Angular position 1 0 1 2 Angular velosity
0.5
1.5
2.5
3.5
Figure 10.5: This gure shows the trajectory of rl1 and rl2 , and their derivative.
82
Moment of inertia I seen from {RL1} and {RL2} 0.12 Moment of inertia 0.1 0.08 0.06 0.04 0 0.5 1 1.5 2 2.5 3 3.5 I from {RL1} I from {RL2}
0 L for linear part L for rotational part 0.05 0 0.5 1 1.5 2 2.5 3 3.5
Angular Momentum L for RL2 Angular Momentum 0.05 L for linear part L for rotational part 0
0.05
0.5
2.5
3.5
frame {RL1} and {RL2} during a gait cycle is shown. In the middle the angular momentums working on the robot are seen from {RL1}, and bottommost the angular momentums working on the robot are seen from {RL2}.
Figure 10.6: Topmost in this gure the inertia of the whole biped robot, seen from
83
Torques from step one and two for RL1 0.01 0 0.01 Nm 0.02 0.03 0.04 0.05 0 1 1.1 1.2 2 2 3 0 0 0.2 0.4 0.6
Torques from step one and two for RL2 0.2 1.1 0.15 1.2 Nm 0.1 0.05 0 0.05 0 1 2 Time in sec. 3 2
Figure 10.7: Topmost is shown the four torque components working in joint RL1. Topmost the left are the torque from the linear part of step one is denoted 1.1, the torque from the rotational of step one part is denoted 1.2, and the torque from step two is denoted 2 shown. The torque from the constraint is depicted topmost to the right. Likewise for the torque components for RL2 shown bottommost.
From Fig.10.7 it is clear that the angular momenta in Fig.10.6 gives the torques denoted 1.1 and 1.2 as the torques in Fig. 10.7 are the derivatives of the angular momentum with respect to time. Hence, the dynamics and size of these seem reasonable. The part from step two, denoted 2, is very close to zero which is expected as the main components from this part have been removed when the constraints where introduced. The torque from the constraint on RL1 does seem intuitively correct as the gravitational torque on RL1 would initially be large and have a minimum halfway through the cycle and then return to the same value, as the entire robot would be moved in the negative y -direction when the right leg is the supporting leg. Brief considerations on the size of the masses of the limbs, their vertical arm to RL1, and gravitational acceleration states that the size of the torque is also correct as seen in Eq. (10.21). E.g. in the beginning and end
84
g (mt larm,t + mswingleg larm,swingleg + mla larm,la mra larm,ra ) 9.82 m/s (0.9 kg 0.03 m + 0.3 kg 0.06 m + 0.3 kg 0.10 m 0.3 kg 0.05 m) 0.62 Nm (10.21)
The torque from the constraint on RL2 does also seem intuitively correct as the weight of the biped robot will begin behind the supporting foot and then move steadily forward, with approximately the same numerical value at the beginning and at the end of the gait cycle. Making the same considerations as in Eq. (10.21) in the sagittal plane shows that the size is as expected. The torque contributions from the dynamic parts are very small compared to that of the constraints. This means that the biped robot simply does not move fast enough to create large enough changes in the energies to give a signicant torque contribution. This is also the reason why the results from the model when a static gait trajectory is inputted are not presented. This would have shown approximately the same result except from the dynamic parts would have been even smaller. The time for a single step must be less than two seconds before the dynamics will have a signicant impact on the torque in the two joints. A trajectory with such a step time is not derived in this project. Hence the dynamic parts will never contribute signicantly, and thus are they are neglected in the further calculations, as this would make the calculations needed to determine the CoP much smaller. Consequently, only the torques from the constraints are used in Eq.(9.16), which enables calculation of the CoP from the joint torques. As Fx is not an output from the Lagrange model is it approximated by the constant gravitational force generated by the mass of the entire robot except the supporting foot. To make it easier to compare the veried CoP trajectory from the Newton-Euler model with those found here, they are plotted together in Fig. 10.8. From this graph it is concluded that the CoP trajectories follows each other satisfactory, as they follow each other with a maximum of 1.2 mm deviation. This degree of precision from the stationary parts justies the exclusion of the dynamic parts, and veries the expressions from the constraints.
2
Chapter Summary
When modelling a biped robot of this size, weight and speed, the dynamic part of the model can be disregarded. This is due to the fact that the accelerations of the dierent limbs are insignicant compared to the size of the gravitational acceleration g , and the length of the lever arms for these accelerations can not make up for this dierence. The inaccuracy, which was expected from the fact that the input angles to the biped robot is dierent from those seen in the human gait in App. A, cancels out when the dynamic parts were neglected in the expression. Hence there is no precise measure of how large this error is, but it can be concluded that it is insignicant for this biped robot, as the achieved expression has a precision of at least 1.2 mm. However, the graphs in Fig. 10.6 and Fig. 10.7 does, to some degree, justify the simplications despite the dierence in input angles compared to those the model where derived from.
85
CoP comparison in the ycoordinate 0.04 CoP from Lagrangian 0.03 meter 0.02 0.01 0 CoP from Newtonian
0.5
1.5
2.5
3.5
CoP comparison in xcoordinate 0.1 CoP from Lagrangian 0.05 meter 0 0.05 0.1 CoP from Newtonian
0.5
2.5
3.5
Figure 10.8: Topmost is the CoP trajectory in the y direction for both the Newtonian and Lagrangian model shown. Bottommost is the CoP trajectory in the x direction for both model plotted.
To achieve a higher degree of precision for the dynamic parts the simplications must be made from the actual input angles from a trajectory. Such an approach should be suited for models of larger/faster biped robots where the dynamic parts can not be neglected. Now the model based on Lagrangian mechanics has been derived and veried with satisfying results, and is hence ready to be used for controlling the biped robot.
Part Summary
In this part the models needed to describe the biped robot's kinematic and dynamics have been derived. The servomotors is modelled as rst order systems which is sucient to get a satisfactory kinematic model. The kinematic model does, however, not take the changing load of each servomotor into account. This makes the servomotor model inadequate in the complete model and hence the model is not included in the following. The kinematic model developed in this report, thereby also dening the frames used to describe the robot. The result of the model are numerous transformations matrices, which describes the relation of the frames as a function of the joint angles. The model is veried thoroughly using the 3D CAD program, 3ds Max. Using the kinematics, a model is also developed to determine the CoP of the robot during static gait. A complete dynamic model of the biped robot is derived using the Newton-Euler iterations. This model is not simplied in any way and hence calculates angular velocity/acceleration, linear acceleration, force, and torque precisely for each link in the biped robot. This result makes it very suitable for o-line simulations used in trajectory generation and controller tuning. The verication of the model is carried out comparing the measured output from the accelerometers on the biped robot with the predicted output from the model. In addition is the output from the strain gauges compared with the CoP from the model, using the models derived in Ch.9.2. Both comparisons showed that the model output is coinciding with the measured output. The Lagrangian based dynamic model is derived in order to obtain a model for on-line calculations of the CoP. This is achieved by simplifying the expressions for the torques in joint RL1 and RL2. It is shown that the dynamic expressions had relatively small contributions to the torque and hence is eliminated in order to make the calculations less comprehensive. This simplication is valid for the walking speeds used in this project, which is about 2.8 sec per step. The nal expressions for the two torques is brought down to a few lines of calculations, and when veried against the Newton-Euler based model the dierence stayed within 1.2 mm. This makes the model precise enough for model based control, but this will not be implemented due to time constraints. An expression to determine the CoP from the torques working on the joint RL1 and RL2 is derived and used in both dynamic models. This expression is rst veried from a theoretical experiment. Now the models needed to describe the gait of the biped robot have been derived, and thus enabled trajectory generation and controller design. This will be carried out in the next part.
86
Part IV
Control
This part begins with a discussion of some dierent approaches to implementing a controller. When a control topology has been decided upon the elements of that topology is described. The rst of these elements is an inverse kinematic model for the robot. This element is used to calculate the angles of each joint in the robot, given a set of points which describes the position of the limbs. The techniques used in the feed-forward part of the controller topology is described, namely the trajectory generation. This is the element in the controller that generates the point set needed by the inverse kinematics for all points in time. In the next chapter the development of an algorithm which maps the strain gauge measurements to the CoP position of the robot is found. The nal part of the implemented control topology, the feedback control, is also described in this part. The feedback uses the measured CoP position to stabilize the robot by correcting CoP with respect to a CoP trajectory generated o-line. At last a suggestion to an implementation of a supervisor in the controller is given. This supervisor should be able to correct for larger disturbances by choosing between several o-line generated trajectories to select the most stable trajectory in the situation.
Chapter
11
Introductory Analysis
The goal in this part of the project is to develop a controller that will enable pseudodynamic walk of the biped robot. As there are several approaches to this kind of control a series of solutions will be presented. Depending on the strengths and shortcomings of these solutions the control method used for obtaining pseudo-dynamic walk will be determined. The rst controller solution is used for xed trajectory based static walk. In this controller, the trajectories for the torso and the extremities will be generated o-line, and the controller will focus on tracking these trajectories. A block diagram describing this topology is shown in Fig. 11.1. The trajectories are generated using the models of the robot with the criteria of continuous postural stability throughout the gait cycle. Such trajectories would make the biped walk statically.
Controller Trajectories Inverse kinematics Angle PI
Figure 11.1: Simple feed-forward control from the trajectory with an angle feedback
control strategy.
In Fig. 11.1 a PI controller is also included. This controller uses the angles outputted by the rotary encoders to correct the servomotor positions. This idea is inspired by the previous project on this robot, as that project group described problems with the tracking capability of the internal controllers in the servomotors. This problem was addressed in Sec. 5.1.2 on page 23 without the use of outer-loop PI controllers. Therefore, the PI controller is not used in this project. 88
89
Ideally, the robot can be made to walk dynamically using the same control strategy by only altering the trajectories. Again o-line generated trajectories are used. These are generated based on new dynamic walk criteria as dened in Sec. 2.2. Both these controllers will work very well under ideal conditions. However, in a realworld situation, perturbations will occur due to model inaccuracies and/or external physical disturbances. Therefore, it will be preferable if the robot was able to deal with these perturbations before they cause irrecoverable consequences. E.g. if the robot is pushed it might take a step back or stop for a while, but it should not fall to the ground. To create such behaviour of the controller, a more complex control strategy must be employed compared to the relatively simple feed-forward strategy mentioned above. A solution to this problem is to add on-line feedback control to maintain balance/stability. To do this the controller needs some input that will provide an indication of the stability of the robot. A quantity that possess these qualities is the zero momentum point (ZMP), which has seen extensive use in exactly this application in [Huang et al., 2001] [Kudoh and Komura, 2003] [Komura et al., 2005] [Sardin and Bessonnet, 2004] [Katic and Vukobratovic, 2003]. The ZMP can be determined by the force sensors (strain gauges) in the feet of the robot [Kim et al., 2005] [Sardin and Bessonnet, 2004], and is thus available as an input to the controller. The position of the ZMP is directly dependent on the posture of the robot, i.e. the joint angles. The controller will thus need a mapping from the angle of the joints to the position of the ZMP. For the controller to have a reference, a desired ZMP trajectory must also be available. This desired ZMP can be generated o-line along with the gait trajectories. A block diagram of this control strategy is shown in Fig. 11.2.
Controller Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping
There exists a problem with one element of the ZMP controller proposed above, which concerns the mapping from the ZMP to the joint angles. As there is only one ZMP and 20 joint angles, there is many dierent ways to map this relationship. To nd the "right" angles more information than just the desired ZMP is needed. This information should include the desired position of the limbs and the range of motion of the angles. The mapping could be simplied further by disregarding some of the joints, and only control the ZMP using a few critical joints. The mapping might also be dierent for dierent states in the gait cycle. By integrating the ZMP controller into the previously mentioned feed-forward controllers, these controllers will be signicantly better equipped to handle perturbations. This scheme is shown in Fig. 11.3.
90
Controller Force to ZMP mapping ZMP error to joint angle mapping Inverse kinematics
ZMP trajectory
Trajectories
Figure 11.3: Feed-forward trajectory based control and zmp control combined.
The trajectory of the ZMP should correspond to the other trajectories such that the ZMP controller does not modify the reference angles during unperturbed motion. Only when the robot experiences perturbations should the ZMP controller intervene. While the ZMP controller is able to handle smaller perturbations and could help correct some inaccuracies in the trajectories, in case of larger perturbations, the feed-forward controller would ght the ZMP controller, and the robot might lose balance despite the eorts of the ZMP controller to maintain balance. To deal with this situation, a supervisory mechanism is needed to change the trajectories to some that are better suited for the situation. Evidence from biomechanical studies also indicate that humans have such a mechanism; a number of dierent strategies prepared in advance, and the most appropriate response motion is launched when the perturbation occurs [Komura et al., 2005]. Not only would this improve robustness towards larger perturbations, it would also increase anthropomorphism. This supervisor would need some input related to the perturbation as a basis for its decisions. Here the outputs from the accelerometers could be used, along with the ZMP position error. Fig. 11.4 illustrates such a supervisor incorporated into the previously mentioned feed-forward/ZMP control scheme. The controller designed in this report will be limited to the topology in Fig. 11.3, i.e. no trajectory supervisor is implemented although a description of the ideas in the supervisor will be included. In the following chapters the blocks in Fig. 11.4 will be described in more detail.
91
Controller Trajectory supervisor Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping
ZMP error
Accelerometers
Chapter
12
Inverse Kinematics
As described in the previous chapter a mapping is needed from a position of an extremity to the angles of the joints in that extremity. This mapping is the inverse of the operation done by the forward kinematic model. The inverse kinematics block is one of the blocks in the constructed controller, see Fig. 12.1.
Controller Accelerometers Trajectory supervisor Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping Trajectories Inverse kinematics
Strain gauges
ZMP error
Servomotors
Figure 12.1: Figure illustrating the block designed in this chapter and it's context
in the controller.
P = f(x,y,z) ( )
(12.1)
where f is a function applying the forward kinematic model to the joint angles and P R320 is the position of the links. When the inverse kinematic model has to be determined the inverse of the function f(x,y,z) ( ) has to be calculated. The inverse function can be written as
= f(x,y,z) 1 (T )
(12.2)
here T is a subset of the position vectors p R3 in P . This function calculates based on the desired position of some key joints T . Calculating the inverse kinematic model can at rst sight seem straight forward, but as both none and multiple solutions can appear the calculation can become rather complex. 92
93
Figure 12.2: Six solutions to the inverse kinematic model for a three joint planer
arm.
Dening constraints to the joints can reduce the number of solutions to the inverse kinematic equations. An example could be that the knee joint is only allowed to bend backward in the sagittal plane.
12.1.1 Constraints
In this section the constraints used to calculate the inverse kinematic model are discussed. These constraints include:
The foot soles are always parallel to the horizontal plane (Only pseudo-dynamic
94
walk is possible).
The outer joints in the arms are not expected to supply much dynamics to the robot. Hence, only two joints in each arm are used to move the arms, namely the roll and pitch of the shoulder joints. The angle of the torso is zero in the frontal plane meaning that the two hip frames {RL5} and {LL1} have their origin at equal height above ground level. The angle of the torso in the median plane is constant.
Together with the angle ranges dened in App. I these constraints simplify the inverse kinematic modelling.
12.1.2 Prerequisites
Some information is needed to calculate the joint angles, i.e. T in Eq. (12.2). The position of the torso is chosen along with the position of the last link in each chain. T is thus dened as:
T = prl1
prl5
pll5
pra5
pla5
(12.3)
Here, and in the rest of this chapter, pi is given in the global reference frame, i.e. pi = globpi . This frame is obtained by rotating RL0 using: 0 0 1 glob 0 1 0 (12.4) rl0 R = 1 0 0 Thus, the global reference frame has axes parallel to those in gure 2.1 on page 6.
Frontal Plane
The roll angles (rl1 and rl5 ) in the frontal plane are found from Fig. 12.3.
pRL5
RL5
RL1
z y
pRL1 Foot
Figure 12.3: Illustration of the right leg in the frontal plane used to calculate rl1
and rl5 .
rl5 can be calculated using tangent for rectangular triangles as both the coordinates for prl1 and prl5 are known. The coordinates attached to point prl1 are denoted
95
Due to the constraint that the foot soles are always parallel to the horizontal plane rl1 can be found from rl5 . See Eq. (12.6).
rl5 = rl1
(12.6)
Sagittal Plane
The pitch angles of the right leg (rl2 , rl3 , and rl4 ) in the sagittal plane are calculated based on Fig. 12.4.
pRL5 aRL4
RL4
L3
pRL4
L 2-4
RL2
aR
RL3
pRL2 aRL1
aRL2
pRL3 z x
pRL1
Figure 12.4: Illustration of the right leg in the sagittal plane used to calculate all
the pitch angles.
The joint angle of the knee can be found as the diagonal from prl2 to prl4 can be calculated. This is done with reference to Fig. 12.5.
pRL5 aRL4
L 2-4
aR
pRL2 aRL1
a RL2
pRL3 z x
L3
pRL4
RL3
pRL1
Figure 12.5: Illustration of the right leg in the sagittal plane used to calculate the
pitch angle of the knee.
96
L2 4 =
where:
2 + 2 + 2
(12.7)
= xrl5 xrl1 = yrl5 arl4 sin rl5 yrl1 arl1 sin rl1 = zrl5 arl4 cos rl5 zrl1 arl1 cos rl1
The pitch angle of the knee can now be calculated using the cosine rule for arbitrary triangles, see Eq. (12.8).
(12.8)
The cos1 have two solutions, but since rl3 must be in the range of 0 to 90 only one solution of cos1 can be used. See App. I for the limitations of the dierent angles. The pitch angle of the hip can be calculated using Fig. 12.6 and Eq. (12.9).
pRL5
RL4
pRL2
temp1
aR
temp2
L3
pRL4
z x
pRL1
Figure 12.6: Illustration of the right leg in the sagittal plane used to calculate the
pitch angle of the hip.
rl4 = 90 cos1
xrl5 xrl1 L2 4
temp1
cos1
(12.9)
The cos1 has two solutions, so the right solution must be chosen. The positive solution is chosen for For temp1 as the angle limitations for angle for RL3 and RL4 . For temp2 is the positive solution chosen. Due to the limitations in the angle RL4 , see App. I for the limitations of the dierent angles. At last the pitch angle of the ankle can be found. Due to the constraint that the feet always are horizontal rl2 can be calculated as in Eq. (12.10).
(12.10)
97
Sagittal Plane
The pitch angle of the right arm (ra1 ) in the sagittal plane is found from Fig. 12.7.
pRA1 z pRA5
RA1
Figure 12.7: Illustration of the right arm in the sagittal plane used to calculate the
pitch angle of the shoulder.
ra1 can be calculated using tangent for rectangular triangles as both the coordinates for pra1 and pra5 are known, see Eq. (12.11). ra1 = tan1 xra1 xra5 zra1 zra5
(12.11)
Frontal Plane
The roll angle of the right arm (ra2 ) in the frontal plane is found from Fig. 12.8
pRA1 z
RA2
pRA5
Figure 12.8: Illustration of the right arm in the frontal plane used to calculate the
roll angle of the shoulder.
ra1 can be calculated using tangent for rectangular triangles as both the coordinates for pra2 and pra5 are known and adding a oset value, see Eq. (12.12). ra2 = tan1 yra1 yra5 zra1 zra5 cos ra1 + ara1 + ra2,oset
(12.12)
In the following section, the developed inverse kinematic model will be veried to ensure that it describes the inverse kinematics of the biped robot accurately.
98
RA1
LA1
RA3 RA5
LA4
LA3 LA5
RL4
LL2
RL3
LL3
RL2
LL4
RL1
LL5
Figure 12.9: Illustration of the simplied robot used to verify the inverse kinematic
model.
This simplied model is also drawn in the 3D modelling environment Rhinoceros 4.0. A screen shot of this environment is found in Fig. 12.10. The same coordinates are given to the Matlab -script and the 3D environment. The dierent angles are measured in the 3D environment and compared to the output from the inverse kinematic model. To make it possible to transport the coordinates from Rhinoceros to Matlab a plugin for Rhinoceros is written. This plug-in can be found on the CD [8]. When the coordinates are imported into Matlab , the function inverse_kinematic.m is run and the angle of each joint is outputted. This output is compared with the angles measured in Rhinoceros. This procedure is done for ten dierent positions of the legs and arms to ensure that the inverse kinematic model is veried properly. The procedure starts by changing one angle, while keeping the rest of the angles in zero position. This angle is measured in Rhinoceros and the coordinates are exported to Matlab where the inverse kinematic script is run. The output angles of the inverse kinematics must be equal to the angles measured in Rhinoceros. Afterwards another angle is changed till all the angles in the right leg are dierent from the zero position. This is illustrated in Fig. 12.11 where the angles rl2 , rl3 and rl4 are changed and measured. This procedure is done for all the angles. The measured angles in Rhinoceros and the calculated angles in Matlab match, and the inverse kinematic model is thus veried.
Chapter Summary
In this chapter an inverse kinematic model has been derived. The inverse kinematic model is capable of calculating all the joint angles to any reachable position of any link. The model is derived using a geometric approach which means that the spatial geometry
99
matic model.
Figure 12.10: Screen shot of the 3D environment used to verify the inverse kine-
Figure 12.11: Illustration of the right leg on the stick robot with measured angles.
problem of the biped robot can be decomposed to several plane geometry problems. The inverse kinematic model is veried satisfactorily using Matlab and the 3D modelling program Rhinoceros. With the use of the inverse kinematic model, trajectories can be derived which is done in the next chapter.
Chapter
13
Controller
Trajectories
This chapter will document the procedure used for generating the trajectories which the robot should follow when walking. These are used in the trajectories block in the controller found in Ch. 11 and depicted in Fig. 13.1.
Accelerometers
Trajectory supervisor Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping
Strain gauges
ZMP error
Servomotors
Figure 13.1: An illustration of the blocks designed in this chapter and its context
in the controller.
The procedure described here generates a trajectory set for one entire SSP. This is the part of the walk covered by the models, and since these are needed to calculate ZMP, the trajectories cannot be generated for a longer period. One SSP is however also sucient. As the DSP only lasts a small fraction of the cycle duration [rts et al., 2006], this phase is not considered. As a result, the SSP for one leg is directly followed by the SSP of the other leg. In practice, using these trajectories, there will be a DSP as slack and torsion in the joints prevent the foot from lifting at exactly the moment planned. To get a trajectory set for the other SSP phase, the generated trajectories are mirrored in the x/z -plane. Trajectories will be given for ve key points on the robot. These points are:
The right foot (origin of RL1 frame: The right hip (origin of RL5 frame: The left foot (origin of LL5 frame:
globp globp
rl1,org
rl5,org
globp
ll5,org
100
101
)
ra5,org
globp
la5,org
For each of these points in space a number (n ) of equally spaced points in time will be given. Thus each point in a trajectory is four dimensional vector containing [x, y, z, time]. A set of trajectories for all these points in space and time is denoted Rn 54 . All the trajectories will be given in the same frame, namely the global reference frame.
Realizability
In the huge solution space of this trajectory problem, many solutions are not realizable by the robot simply because the trajectory lies outside the workspace of the robot. For example, a trajectory point for the right hip may not be further from the right foot than the length of the extended leg. Let the function
(13.1)
map a point in time of a trajectory set to joint angles as described in Ch. 12. This function will then give complex numbers only for those trajectory points that are outside the robots reach. Limiting the trajectories to only those that are realizable for the robot can thus be done by minimizing 13.2.
n
JRealizability =
t=0
{invKin({|time = t})}
(13.2)
Stability
Another important criterion is stability. The trajectories should keep the ZMP inside the stable region dened by the PoS. Furthermore, ZMP should be kept close to the center of the PoS to ensure as large a stability margin as possible. Because these trajectories, as the models, only concerns SSP, the PoS does not move with respect to the global reference frame. The center of the PoS (see appendix I on page 264) is:
0.001 = 0.0095 0
(13.3)
JZMP =
t=0
pC,PoS globpZMP
(13.4)
102
Energy
It would be desirable to also minimize the energy consumption of the servomotors when the robot is walking. As the energy consumption is proportional to the torque delivered by a servomotor, this can be achieved by minimizing:
n
t
t=0
(13.5)
where t is a column vector containing the torque in all joints at time t. There is however also a maximum torque the servomotors can deliver, if this torque is exceeded in any joint, the trajectory can not be realized. To make the trajectory generation algorithm aware of this limit, the torque is modied by the non-linear function expCap before it is used in the performance function. The function
y = expCap(x, cap)
(13.6)
is linear until the value of x exceeds that of cap. Above cap, y increases exponentially. A plot of expCap as a function of x is shown in Fig. 13.2. The performance term that
15
expCap(x,2)
10
JEnergy =
t=0 j =0
expCap(|t,j |, MAX,j )
(13.7)
where MAX,j is the stall torque of the servomotor controlling the j'th joint.
Smoothness
To make the robot move more smoothly, the velocity should vary as little as possible. This is implemented by minimizing the angular acceleration of the joints. This will of cause aect the step time for the robot.
n
JSmooth =
t=0
d2 dt2
(13.8)
2
Trajectory length
To ensure that the robot does not make any large unnecessary motions, the total length travelled by all the trajectory points is also included as a term in the performance
103
function. This should ensure that the movement of e.g. the arms are kept at a minimum. This term is described in Eq. (13.9)
n 1 5
JLength =
t=0 i=1
pt,i1 pt,i
(13.9)
(13.10) (13.11)
is used. This function is zero for values of x smaller than limit sof tness. Between limit sof tness and limit the mapping from x to y is quadric (y = x2 ). Above limit y increases linearly with x with a slope given by:
dx2 dy
x=softness
softDeadZone is thus not only dierentiable, its derivative is a continuous function. This property will help convergence of the solution of the minimization problem using some numeric algorithms. Fig. 13.3 describes the function graphically.
1.5 softDeadZone(x,1,0.5)
0.5
0.5
1 x
1.5
Figure 13.3: Plot describing the input output relation for softDeadZone with xed limit (1) and softness (0.5).
Dening t,j as the angle of the j 'th joint at the time t, the joint angle limiting term of the performance function can be described as in Eq. (13.12).
n 20
JJointLimit =
t=0 j =1
Here MAX,j is the upper limit of the angle j , and MIN,j is the lower.
104
Foot Lift
To keep the swing foot from touching the ground throughout the SSP, a term is added to the performance function. This term is zero when the trajectory for LL5 is outside a specied region. For this purpose the function inRegion is used. It takes a trajectory and two points as input. The function outputs one number proportional to how far inside the axes aligned box spanned by the two points the trajectory is. In inRegion the softDeadZone function is used again to ensure the continuity of the derivative. The foot lift performance is given by Eq. (13.13).
(13.13)
Leg collision
This same method is used to keep the swing foot from colliding with the supporting leg, as described in Eq.(13.14). Here the function outsideRegion, which punishes trajectories that lie outside a specic region i.e. conceptually the inverse of inRegion, is used.
(13.14)
The location of pLC1 and pLC2 is such that the trajectory for LL5 starts just to the left of the region. Thus the algorithm initially moves the left foot a little to the left and thereby avoids collision with the right leg. The region is illustrated in Fig. 13.4
z y
z x
y x
Figure 13.4: The axes aligned box spanned pLC1 and pLC2 (red) shown with the
initial trajectory set (green). The frames in the corners represent the orientation of the global reference frame.
Step Time
When generating dynamic trajectories, the generation algorithm should be able to alter the step time. To ensure that the step time is as short as possible, a term is added in
105
the performance function which punishes long lasting trajectories. This term is dened as:
(13.15)
JVelocityLimit =
20
(13.16)
JRealizability JZMP JEnergy JSmooth JLength J =W JJointLimit JFootLift JLegCollision JTime JVelocityLimit
where W is a row vector of weights.
(13.17)
106
step length, and double support posture. The trajectories are thus dened by: 0 0 0 0 0 0 0 0 rl1 = (13.18) 0 0 0 0 tend tstart tend tstart tstart 2 tend 3 3 xstart,rl5 g1 g5 xend,rl5 ystart,rl5 g2 g6 yend,rl5 rl5 = (13.19) zstart,rl5 g3 g7 zend,rl5 tstart g4 g8 tend xstart,ll5 g9 g13 xend,ll5 ystart,ll5 g10 g14 yend,ll5 ll5 = (13.20) zstart,ll5 g11 g15 zend,ll5 tstart g12 g16 tend xstart,ra5 g17 g21 xend,ra5 ystart,ra5 g18 g22 yend,ra5 ra5 = (13.21) zstart,ra5 g19 g23 zend,ra5 tstart g20 g24 tend xstart,la5 g25 g29 xend,la5 ystart,la5 g26 g30 yend,la5 la5 = (13.22) zstart,la5 g27 g31 zend,la5 tstart g28 g32 tend where gi is a parameter which will be determined numerically. The column vector g containing all the gi parameters is referred to as the genome of the trajectory set. When used to develop dynamic trajectories the time has increased signicance, and the total step time tend tstart is also a variable parameter. This parameter becomes g33 = tend and tstart is set to 0.
13.3 Interpolation
From the g vector a trajectory set can be computed given initial and nal positions. Using the above matrices yields a trajectory set with n = 4. For the purpose of playing back the trajectories on the robot, a time resolution of 4 is inadequate. Also for verifying that the trajectories are sound (minimize the performance function), more points are preferred. To meet these shortcomings, the trajectories are interpolated. Cubic spline interpolation is used, that is nding the ai , bi , ci , and di for i = 1, 2, ..., n to Eq.(13.23).
S (t) = ai (t ti )3 + bi (t ti )2 + ci (t ti ) + di
that fullls:
(13.23)
S i (ti ) = ptraj |t=ti S i (ti+1 ) = ptraj |t=ti+1 S i1 (ti ) = S i (ti ) S i1 (ti ) = S i (ti )
Using the constraints in Eq.(13.24) through Eq.(13.27) yields a natural spline as depicted with a dashed curve in gure 13.5. This might however result in some jerky movement at the transition from one phase to the next, as the velocity (the derivative of the curve)
107
Phase Transission
Figure 13.5: Figure illustration the dierence between the natural (dashed) and
clamped (solid) spline. The circles represent the points from which the curves are interpolated.
is not continues in this point. An extra constraint is added to address this issue. This constraint simply xes the derivative at the start and end of the entire spline. This constraint, formulated in Eq. (13.28), is used to create the clamped spline in Fig. 13.5.
S 1 (t1 ) = S 4 (t4 )
(13.28)
The trajectories for the dierent limbs require dierent approaches to solving the continuity issue. For the LL5 trajectory it is simply not considered an issue, because the LL5 trajectory will be zero for the next step, and the natural spline interpolation is used. For the arms (RA5 and LA5) a zero slope clamping is used (i.e. Eq. (13.29)) to insure that the end of one trajectory matches the beginning of the other.
S 1 (t1 ) = S 4 (t4 ) = 0
(13.29)
For the torso trajectory, RL5, the spline is clamped using Eq. (13.28) in the y dimension and Eq. (13.30) in the other two dimensions. This matches the slope of the torso trajectory to a version of itself mirrored in the x/z -plane.
S 1 (t1 ) = S 4 (t4 )
(13.30)
evalTraj R32 : R1
(13.31)
calculates the performance function of a trajectory set given its genome g . This is done by rst interpolating n,eval points in time for each trajectory. Inverse kinematics are then used to nd the joint angles at all the n,eval points. These angles are then interpolated again and their rst and second derivatives are computed. These are then fed into the Simulink implementation of the Newtonian model to generate the ZMP trajectory and the torque vectors t . All the performance terms can then be calculated from the available information, as described in Sec. 13.1. Minimizing the function can be achieved by dierent methods. Two of these are explained in the next two sections.
108
(13.32)
where g i is a vector of zeros except for a small delta value in the i'th row. Using Eq. (13.32) the gradient is then calculated. By the method of steepest decent it is possible to nd a minimum in the performance function. That is, nding the direction (dimension) in which the performance function declines the most and moving the solution in that direction. After a number of iterations the solution will be at a local minimum in the performance function. The drawback to using steepest decent to determine the best trajectory is that the solution generated may only be a local minimum of the performance function. And since the solution space is 32 dimensional it is bound to have a lot of local minima. The complexity of the performance function also contributes to the large number of local minima.
Step 1 Initially, a number (npop ) of individuals are created based on some initial
genome ginit . The function
(13.33)
takes one genome and mutates it by adding some random amount to a random number of the gi s. It is used to create this initial population P 0 R32npop .
P 0 = mutate(ginit ) mutate(ginit ) . . .
mutate(ginit )
(13.34)
Step 2 Then the tness of each individual F is computed using the previously dened performance function. evalTraj(P 1 ) evalTraj(P 2 ) F = (13.35) . . .
evalTraj(P npop )
Step 3 The next generation is the generated. A few (nelite ) of the most t individuals (lowest values in F ) are selected as elites, and continue to the next generation without changes. Other nbreed individuals are selected for breeding. These have their nbreed ! ospring. Recomgenomes recombined with each other, creating nbreed = 2!(n 2 breed 2)! bination is done using the function
breed R322 : R32
(13.36)
109
that takes the genomes of the parents and for each element in the child genome randomly selects the value from one or the other parent. The rest of the individuals in the old generation (those with the worst tness) die, and are replaced by random mutations of the elite individuals. Let P i,j be the j'th most t individual in the population of the i'th generation, then the population of the next generation P i+1 is described by Eq. (13.37)
P i+1
P i,nelite breed(P i,nelite +1 , P i,nelite +2 ) breed(P i,nelite +1 , P i,nelite +3 ) . . . breed(P i,nelite +1 , P i,nelite +nbreed ) breed(P i,nelite +2 , P i,nelite +3 ) = . . . all combinations of {P i,nelite +1 . . . P i,nelite +nbreed } . . . breed ( P , P ) i,nelite +nbreed 1 i,nelite +nbreed mutate ( P ) i,nelite +nbreed +1 mutate ( P ) i,nelite +nbreed +2 . . . mutate(P i,npop )
P i,1 . . .
(13.37)
Step 2 and 3 are repeated until an acceptable tness is achieved. The genome of the most t individual in the nal generation is then converted into a trajectory set as described in Sec. 13.2 and 13.3. The genetic approach to trajectory generation described in this section is implemented in Matlab . The nal trajectory set is exported to the 3D modelling software Rhinoceros for manual review and verication. Rhinoceros is also used to dene the initial and nal position i.e.
W = w1
w2
w3
w4
w5
w6
w7
w8
w9
w10
(13.38)
and the sizes of the population groups in the genetic algorithm: nbreed npop , nelite , nbreed npop nelite + 2
(13.39)
These are all tuned by hand using the trajectories outputted to Rhinoceros with human walk as a reference.
110
This algorithm is used to generate a trajectory set for one entire SSP. Thus the only thing left to do to get a trajectory for a full gait cycle, is to add a mirrored version of the generated SSP trajectories after the original. The function:
(13.40)
performs this operation. This function operates on the joint angles instead of the trajectories to avoid complications resulting from the reference frame moving between the two SSPs. The mirrored angles ( mir ) is found for each point in time using:
mir,rl1 mir,rl2 mir,rl3 mir,rl4 mir,rl5 mir,ra1 mir,ra2 mir,ra3 mir,ra4 mir,ra5
= = = = = = = = = =
ll5 ll4 ll3 ll2 ll1 la1 la2 la3 la4 la5
mir,ll1 mir,ll2 mir,ll3 mir,ll4 mir,ll5 mir,la1 mir,la2 mir,la3 mir,la4 mir,la5
= = = = = = = = = =
rl5 rl4 rl3 rl2 rl1 ra1 ra2 ra3 ra4 ra5
To summarize, using the genetic algorithm described here, it is possible to generate trajectories for an entire gait cycle. The trajectory set is dened (though not uniquely) by the posture at the start and end of a SSP. The algorithm strives for an optimal trajectory set (one that minimizes J ). Convergence is however not guaranteed, as the algorithm uses genetic analysis. This approach is however more likely to nd the global minimum of J than other methods that could guarantee convergence.
13.5 Tuning
Some extra features are built into the generation algorithm to ease the tuning process. Apart from the utilization of Rhinoceros for visualization, these include the creation of a log le in which the value of each term of the performance function is logged for all elite individuals in each generation. The log also contains the average distance between the elite individuals at all generations.
13.5. TUNING
111
heavily on that term. The log is examined to get an indication of the slopes of each term near the nal solution. The weights are adjusted such that the slopes are in the same order of magnitude. This step requires some engineering intuition and trial and error, as it is not as straight forward as it might seem. For one, some of the terms are zero for a large area around the nal solution. JFootLift is an example of such a term. The slopes of such terms are of course zero in the vicinity of the solution. These are instead adjusted to match the slope of other terms in earlier generations when the individuals are not close enough to the nal solution to make these terms zero. Another property that makes this tuning hard is the fact that even with the same weights, two successive executions of the algorithm may provide dierent solutions. Although this will be rare when the weights are not changed, in the tuning process the weights are changed and the solution will move. This may require re-tuning of weights that was tuned to at good value for the previous solution. When the weights are tuned to make an equal impact on the nal trajectories, these are examined to determine further improvement of W . The solution is compared to normal human gait, and corrections are made to W to put emphasis on some terms of the performance function. To give an example of this process, at a point in the tuning process the weights in Eq. (13.41) are used to generate the trajectory set depicted in Fig. 13.6.
W = 5 1
0.0001 1
0.5
0.2
(13.41)
z y
z x
y x
Figure 13.6: Trajectories corresponding to the weights in 13.41. The dark green line is the generated trajectory, the light green is the starting position and the red line is the CoP for the robot.
Analyzing the output shown in this gure, it is determined that the CoP trajectory (red line) is not satisfactorily inside the PoS (i.e. the rectangle spanned by the right foot in
112
the x/y plane). The weighting for JZMP is therefore increased from 0.5 to 35, and the generation algorithm is run again.
W = 5
0.0001 1
35
0.2
(13.42)
z y
z x
y x
Figure 13.7: Trajectories corresponding to the weights in 13.42. The dark green
line is the generated trajectory, the light green is the starting position and the red line is the CoP for the robot.
As seen in Fig. 13.7 the red line has been moved more onto the area of the foot i.e. the CoP is inside the PoS for a longer time period. It should be noted that the solution in Fig. 13.7 by no means is the nal solution, the tuning continues with other attention paid to the other weights.
Population size
Tuning the population size npop is a compromise between precision and generation time. The same compromise also applies to the tuning of ngen . For trajectories that are meant to be played back by the robot npop = 200 and ngen = 50 is used. This results in a generation time of 5 to 7 hours when using the slower Newton-Euler model to calculate ZMP. Lower values are used for tuning purposes. The sizes of the population subgroups nelite and nbreed are chosen such that about half of each population generated by mutation and half by breeding with only a small number of elites. Through testing the used values are determined to nelite = 6 and nbreed = 13.
113
W = 5 0.01
0.35 5
0.0001
700
0.001
(13.43)
The variables dening the initial and nal posture is also the same for all the trajectories.
z y
z x
y x
Figure 13.8: Trajectories generated using the kinematic model. The dark green line is the generated trajectory, the light green is the starting position and the red line is the CoP for the robot.
114
The performance achieved by these trajectories is: JRealizability 1.2044 106 JZMP 1.2027 JEnergy 0 JSmooth 1.4663 JLength 0.41863 J =W = JJointLimit 2.6148 JFootLift 0 JLegCollision 12.4339 JTime 0 JVelocityLimit 0
(13.44)
The step length is xed, as mentioned, and is 11.6 cm. The step time is also xed for these trajectories, and is set to 3 s. The ZMP (red curve in Fig. 13.8) starts between the two feet. As the robot is essentially in double support at this point in time, the PoS includes this point between the feet. Thus this ZMP position is acceptable, although applying the SSP model theory would state that the robot is unstable with such a ZMP position. This paradox is a result of the lack of a DSP model which can provide the theory to calculate ZMP at this point. As a result, the algorithm tries to move ZMP into what it believes to be the PoS (i.e. the area spanned by the right foot) as fast as possible. This will hopefully result in that, the ZMP is moved far enough inside the PoS, before the DSP ends in reality, to maintain stability. To solve this apparent problem, a separate DSP trajectory set could be generated with this algorithm using a DSP model.
115
z y
z x
y x
Figure 13.9: Trajectories generated using the Newtonian model. The dark green
line is the generated trajectory, the light green is the starting position and the red line is the CoP for the robot.
z y
z x
y x
Figure 13.10: Trajectories generated using the Lagrangian model. The dark green
line is the generated trajectory, the light green is the starting position and the red line is the CoP for the robot.
Chapter Summary
In this chapter the trajectory generation is described. The generation nds a numerical solution to an optimization problem dened through a performance function. The
116
numerical solution is found using a genetic algorithm. This algorithm searches for a minimum of the performance function in a wider area than other numeric methods e.g. steepest decent. The properties of the genetic algorithm also results in a nondeterministic solution, which complicates the tuning process. The verication of the trajectories generated using the algorithm described in this chapter is preformed as part of the accept test in Ch. 17.
Chapter
14
Strain gauges
ZMP error
Servomotors
Figure 14.1: Illustration of the blocks designed in this chapter and it's context in
the controller.
118
Fpressure Fpressure
little toe
Fpressure
contact surfaces
Fpressure
big toe
PoS
Ffriction Ffriction
little heel
big heel
(a)
(b)
Figure 14.2: Right foot of the biped, where the contact forces are illustrated in
(a), i.e. the friction and the pressure forces. In (b) a bottom view of the right foot is given, illustrating the PoS.
Four force sensors are implemented on each foot of the biped robot. These measure the total pressure force at each of the four contact areas. The measured pressure forces are assumed to act in the center of the toes and heels as indicated in Fig. 14.3a. The CoP is determined in the frame {RL0 } attached to the ankle joint. In Fig. 14.3 the point Q is the projection of the origin of frame {RL0 } onto the sole of the foot. According to the denition of the CoP given in Ch.2, the resulting torque due to pressure forces exerted on the foot is zero at the CoP. Hence, at the CoP the y -component y and the z -component z of the resulting torque due to pressures must be equal to zero, which yields the following equations,
y = (Fp,r1 + Fp,r2 )(ltoes zCoP ) + (Fp,r3 + Fp,r4 )(lheels + zCoP ) = 0 z = (Fp,r1 + Fp,r3 )(llittle toe yCoP )+(Fp,r2 + Fp,r4 )(lbig toe + yCoP ) = 0
which give the following expressions for the CoP,
yCoP = zCoP
llittle toe (Fp,r1 + Fp,r3 ) lbig toe (Fp,r2 + Fp,r4 ) Fp,r1 + Fp,r2 + Fp,r3 + Fp,r4 ltoes (Fp,r1 + Fp,r2 ) lheels (Fp,r3 + Fp,r4 ) = Fp,r1 + Fp,r2 + Fp,r3 + Fp,r4
(14.1) (14.2)
where yCoP and zCoP are the y and z -coordinate of the CoP given in frame {RL0 }. Thus, from Eq. (14.1) and Eq. (14.2) the CoP can be determined using the four pressure measurements Fp,R1 , Fp,R2 , Fp,R3 and Fp,R4 .
119
llittle toe-yCoP lbig toe+yCoP
x y Fp,R1 Fp,R2
little toe
RL0
RL0
Fp,R2 z
RL0
RL0
l toes-z CoP
Fp,R3 Fp,R4
CoP
CoP
big toe
y ty lheels
RL0
RL0
z CoP
zCoP
pCoP
Q
tz
right foot (a)
Fp,R3
Fp,R4
bottom view of right foot ( c)
Figure 14.3: In (a) the point Q is the projection of the origin of frame {RL0 }
onto the foot. The pressure forces are assumed to act in the center of the toes and heels. In (b) the distances at which the pressure force acts relative to the point Q are shown. In (c) the CoP position is shown along with its coordinates in the frame {RL0 }.
This is illustrated in Fig. 14.4. Thus, the local CoPs are given as, hankle xCoP,R llittle toe (Fp,r1 +Fp,r3 )lbig toe (Fp,r2 +Fp,r4 ) RL0 pCoP,R = yCoP,R = Fp,r1 +Fp,r2 +Fp,r3 +Fp,r4 ltoes (Fp,r1 +Fp,r2 )lheels (Fp,r3 +Fp,r4 ) zCoP,R Fp,r1 +Fp,r2 +Fp,r3 +Fp,r4 hankle xCoP,L llittle toe (Fp,l1 +Fp,l3 )lbig toe (Fp,l2 +Fp,l4 ) LL5 pCoP,L = yCoP,L = Fp,l1 +Fp,l2 +Fp,l3 +Fp,l4 ltoes (Fp,l1 +Fp,l2 )lheels (Fp,l3 +Fp,l4 ) zCoP,L
Fp,l1 +Fp,l2 +Fp,l3 +Fp,l4
heesl+
yCoP
(14.3)
(14.4)
At CoPR the sum Ftot,R of the pressure forces in the right foot acts, and at CoPL the sum Ftot,L of the pressure forces in the left foot acts, where
Ftot,R = Fp,r1 + Fp,r2 + Fp,r3 + Fp,r4 Ftot,L = Fp,l1 + Fp,l2 + Fp,l3 + Fp,l4
It is necessary to describe CoPR and CoPL in the same frame in order to nd the CoP of the robot in DSP. This kinematic model developed in Ch. 8 is developed for the SSP and cannot directly be applied to the DSP. But the joint angles produced by the gait trajectories in Ch. 13 are supposed to create a posture of the robot, where both feet remains horizontal and static in DSP. Hence, a single support kinematic model starting in either foot will still yield the correct position of the other foot. Thus, the local CoPs can be transformed between the two frames {RL0 } and {LL5 } using the transformation matrices derived in the kinematics:
rl0 ll5
(14.5) (14.6)
pCoP,R =
rl0
pCoP,R
The CoP is where the resulting torque produced by pressure forces is equal to zero, which can be stated as, Fsum,R Fsum,L 0 res = (rl0pCoP,R rl0pCoP ) 0 + (rl0pCoP,L rl0pCoP ) 0 = 0 0 0 0
120
yCoP = zCoP
yCoP,R Fsum,R + yCoP,L Fsum,L Fsum,R + Fsum,L zCoP,R Fsum,R + zCoP,L Fsum,L = Fsum,R + Fsum,L
(14.7a) (14.7b)
where all coordinates are given in {RL0 }. The same expressions are valid if all coordinates are given in {LL5 }. These can be obtained using Eq. (14.5) and Eq. (14.6). Thus the CoP is a weighted mean of the two local CoPs, with the pressure forces of the local CoPs as weights. This seems intuitively correct, as the CoP is dominated by the local CoP with the most pressure on it. Further, if the two pressures are equal the CoP is the midpoint of the two local CoPs.
Fp,L1
toes
Fp,L2
CoPL
Fp,R2
RL0
Fp,R1
z
left foot
pCo
LL5
LL5
pCoP CoP
RL0
RL0
LL5
pCoP
RL0
y
pCoP,R
R
RL0
LL5
pCoP,
CoPR
heels
Fp,L4
Figure 14.4: Illustration of the feet in DSP. Both feet have a local CoP denoted
CoPR and CoPL , where the sum of the foot's pressure forces acts. The CoP of the biped robot can then be found as a weighted mean of the local CoPs using the sum of the local pressure forces as weights.
Note that Eq. (14.7) can also be used in SSP phase as the weight of the lifted foot is zero, but the coordinates should be given in the frame of the supporting leg, i.e. {RL0 } or {LL5 }, otherwise the CoP would be described in a frame moving relative to the ground. The solution is to shift the description of the CoP from {RL0 } to {LL5 } and visa versa in every DSP phase.
right foot
LL5
pCoP,L
P,L
121
This is due to the fact that the locations of the pressure forces Fp,r1 , Fp,r2 , Fp,r3 and Fp,r5 in the toes and heels depends on the location of the CoP. In the CoP model they are assumed to always act in the center of the toes, see Fig. 14.3. Thus, in the y -direction the assumed location of the resulting forces in the toes and heels can dier up to 10 mm from the actual location, as the toes are 20 mm wide. Furthermore, using this assumption, the model cannot yield an CoP outside the center of the heels and toes. In the z -direction, the error of this assumption is small, because the toes and heels are 1.5 mm wide in this direction. As Eq. (14.1) and Eq. (14.2) gives an estimated CoP with a maximum error of 5 mm in a foot of 65 mm width, the results is considered acceptable.
40 30 20 yCoP [mm] zCoP [mm] Actual yCoP Calculated yCoP 5 10 15 20 Test no. 25 30 10 0 10 20 30 40 40 30 20 10 0 10 20 30 40 5 Actual zCoP Calculated zCoP 10 15 20 Test no. 25 30
Figure 14.5: In the two gures the y - and z -coordinates are shown for the actual and
calculated CoP. The actual CoP is found by determining the CoM of the arrangement, while the calculated is determined from the pressure measurement using Eq. (14.1) and Eq. (14.2).
Chapter Summary
In this chapter a model is developed to locate the CoP of the biped robot. The mapping describes the relation between the CoP location and the pressure forces acting on the sole of the foot. This lead to an expression giving the CoP as a function of the four measured pressure forces acting on the foot. This expression is veried experimentally. The model gives the CoP location with an accuracy of 5 mm within a foot of 65 mm width. Part of this error is argued to originate in the simplication that the measured pressure forces always act in the center of the toes and heels, while also the noise in the strain gauge circuits has a signicant impact. A method for measuring the CoP location during the DSP phase is also given. This method uses the expressions for the CoP in the SSP to nd the point in each foot, where the sum of the foot's pressure forces act. These points are then described in the same coordinate system using the transformation matrices from the kinematic model. These two local CoPs can be added as a weighted mean to give the robot's CoP location. The weights used are the sum of the pressure forces for each foot.
Chapter
15
ZMP Controller
The gait cycle signals developed in the previous chapter, should make the robot walk and keep it balanced throughout an entire gait cycle using pure feed-forward. To increase the stability of the biped during gait, i.e. correct for model uncertainties and external disturbance, it would be advantageous to implement some sort of feedback controller. See Ch. 11 for description and Fig. 15.1.
Controller Accelerometers Trajectory supervisor Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping Trajectories Inverse kinematics
Strain gauges
ZMP error
Servomotors
Figure 15.1: An illustration of the block designed in this chapter and it's context
in the controller.
Based on calculating the ZMP on-line, both during gait and stand, the scope of this chapter is to develop a strategy for making small adjustments to the joint angles provided by the gait cycle signals to increase the stability of the robot. The rst section contains a discussion of how a ZMP measurement and a ZMP reference is used to create a ZMP error signal for the controller. The main issue is that the robot is moving and all the previously dened coordinate systems move along with the biped robot. Thus, a strategy for selecting which reference frame to describe the ZMP in is necessary. In the second section, a controller is developed, which maps the ZMP error into an adjustment of the joint angle provided by the gait cycles signal. In the third section, the controller is tested and discussed. 122
123
Frame {RL0 } located in right foot is used to describe ZMP when in SSP-R Frame {LL5 } located in left foot is used to describe ZMP when in SSP-L
Thus, the ZMP is always described in a frame xed to the ground and the frames follow the motion of the robot. The disadvantage of this method is managing the shifting of frames. Another argument for using two coordinate systems can be found by considering how the ZMP is determined. The method for mapping the force measurements to a ZMP was described in Ch. 14, where an expression for nding the ZMP both during SSP and DSP was found, which is repeated here:
yCoP = zCoP
yCoP,R Fsum,R + yCoP,L Fsum,L Fsum,R + Fsum,L zCoP,R Fsum,R + zCoP,L Fsum,L = Fsum,R + Fsum,L
(15.1a) (15.1b)
where all coordinates are given in {RL0 }. The same expressions are valid if all coordinates are given in {LL5 }. The force Fsum,R and Fsum,L are the sum of pressure forces
124
acting on the right and left foot respectively. The coordinates yCoP,R and zCoP,R are the location of the local CoP in the right foot, and yCoP,L and zCoP,L is the local CoP of the left foot. Thus the CoP is a weighted mean of the two local CoPs, with the pressure forces of the local CoPs as weights. In Eq. (15.1) if for example frame {RL0 } is chosen, the position of the local CoP in the left foot is transformed to frame {RL0 } using a chain of transformation matrices, going from the left foot, through the hips, to the right foot. However, this long transformation may introduce some deviation in the ZMP computation from the actual ZMP, because of for example backlash in the legs, which the kinematic model does not take into account. But during SSP the lifted foot does not contribute to the ZMP, as its weight Fsum is zero. Hence, seen from this perspective, it is also advantageous always to switch to the frame located in the supporting foot, as this would reduce the error from transforming between frames. How the frame shifting works is seen in Fig. 15.2, where it is illustrated how the coordinates of the ZMP changes to reect the frame of the support foot. In the illustration the ZMP reference and the measured ZMP are both constant.
SSP-R SSP-L SSP-R SSP-L
left foot
ZMPmes
erry
zRL0
coordinate value
0 -1 -2 -3 -4
zLL0 yLL0
yref ymes
time
errz
yRL0
ZMPref
(b)
SSP-R SSP-L
coordinate value
SSP-L
SSP-R
SSP-L
SSP-R
SSP-L
2 1 0
-1
-1 (d)
Figure 15.2: To illustrate the idea of switching frames, the ZMP reference and the
measured ZMP are made constant through a gait. In (a) the location of {RL0 } and {LL5 } are shown, as the measured ZMP, ZMPmes , and the reference ZMP, ZM Pref . In (b) and (c) it is shown hown the coordinates changes depending on the frame. In (d) the ZMP errors are shown.
(15.2a) (15.2b)
125
where y and z are given in either frame {RL0 } or {LL5 } depending of the state of the gait. Furthermore, to ease the controller design, the errors should always have the properties given in Fig. 15.3. As a result, if err y is for example positive, the controller knows that the ZMP should be adjusted to the right, without knowing the state of the gait.
toes ZMPmes toes ZMPmes toes ZMPref toes ZMPref ZMPref
left foot right foot
ZMPref
left foot right foot
ZMPmes
left foot right foot left foot
ZMPmes
right foot
ZMP to the right of reference ZMP to the left of reference ZMP to the left of reference ZMP in the front of reference ZMP in the front of reference ZMP behind reference erry > 0 erry < 0 erry > 0 errz > 0 errz < 0 errz < 0
ZMP to the right of reference ZMP behind reference erry < 0 errz > 0
Figure 15.3: Illustration of the meaning of the sign of the error signals.
Using Eq. (15.2b), the ZMP-error is illustrated in Fig. 15.2d in both frames. As the y -axis of frame {RL0 } and {LL5 } points in opposite directions, the err y error changes sign depending on which frame is used. To design the error signal so it complies with the denition in Fig. 15.3, the quantity err y is multiplied with -1 during SSP-L. How the creation of the error signal is implemented, is seen in the Simulink model in Fig. 15.4. The frame shifting is performed midways in a gait cycle, i.e. during the DSP phase. As the duration of a complete gait cycle is know from the trajectory, the time of switch is determined by simple switching halfway using a clock or counter.
1
xRL0 yRL0 x zRL0 xLL5 yLL5 zLL5 Phase Signal Phase Signal
If in SSPR
1 Terminator1
y_ZMP
If in SSPL
z_ZMP
2 z_err
0 lim SSPL
1 0 0
Counter Limited Counts the time of one gait cycle and wraps around
0 0 1 0 1 0 1 0 0
Switch1
Terminator2
y_ref z_ref
ZMP_reference 1 SSPR Roation matrix from global frame to {LL5} ZMP trajectory from gait data
Figure 15.4: This gures shows how the ZMP error is implemented in
Simulink . The phase signal is 1 when in SSP-R and 0 when in SSP-L. The signal is generated by restarting a counter for every completed gait cycle, and when the counter reaches half though a cycle, the output value of the switch-function switches from 1 to 0.
Using this conguration, the error signal have the boundaries shown in Fig. 15.5 during
126
SSP. The ZMP reference is not allowed outside the PoS and the measured ZMP is always within the dashed box.
0.124 m
Fp,R3
0.064 m 0.044 m right foot
Fp,R2
During SSP:
Fp,R4
Figure 15.5: Boundaries of the ZMP-error during SSP. The measured ZMP is
always within the dashed box.
Having created the input signal to the controller, the controller is ready to be designed.
S
+
qgait
Robot
Strain gauges
Servomotors
Figure 15.6: The small disturbance controller. The ZMP-error vector is the difference between the measured ZMP and the ZMP reference provided by the gait trajectory. From the ZMP-error the controller computes control joint angles, which are added to the gait cycle angles to remove the ZMP error.
127
In the previous section, the ZMP-error signal was divided into two components, the quantity err y describing the error of the ZMP in the frontal plane and err z describing the error in the sagittal plane. Accordingly, the controller is divided into two, a frontal plane controller reducing the err y error and a sagittal plane controller reducing err z . During the design it is considered how the two controllers can be decoupled, i.e. controlling err y without changing err z and visa versa.
The torso is always vertical. The hips, i.e. joint RL5 and LL1, are always located in the same horizontal plane. The feet are always horizontal.
These properties are illustrated in Fig. 15.7a. It is seen that the joints axes of joint RL1, RL5, LL1 and LL5 are always parallel. Thus, the CoM of the robot can be moved by adjusting joint RL1, RL5, LL1 and LL5 while still keeping a reasonable posture of the robot, i.e. the feet are still horizontal and the orientation of the torso remains the same, as it is a parallel displacement of the torso. This is illustrated in Fig. 15.7b. Further, this collective angle adjustment does not alter the ZMP location in the sagittal plane. When adjusting the joint angles of joint RL1, RL5, LL1 and LL5, it is chosen to adjust them the same amount. As a result, the strategy is also usable during stand or DSP. If the adjustment of RL5 and LL1 did not have the same numerical value, the feet would be forced to slide on the surface when regulating during DSP. The method of giving the same angle adjustment in RL1, RL5, LL1 and LL5 is in this report referred to as torso displacement.
CoM movement RA2 RA1 RL5 LA2 LA1 LA1 LL1 LL1 RL5 RA1
LL5 LL5
RL1
frontal view (a)
Figure 15.7: Figure (a) an illustrate the robot's posture during gait. The joints
axes of joint RL1, RL5, LL1 and LL5 are always parallel, as the gait is designed to always keep the torso vertical and the hips in the same horizontal plane. Fig (b) illustrate how the torso can be displaced, and thereby the CoM, using joint RL1, RL5, LL1 and LL5.
Besides the legs, the arms can also be used to adjust the ZMP in the frontal plane. By using the shoulders, i.e. joint RA2 and LA2, the arms can be lifted away from the torso
128
in the frontal plane, thereby manipulating the CoM. Most likely, the arms are faster and more precisely moved compared to using the torso displacement, because the actuators in the arm are not as heavily loaded. But the weight of the arms are small compared the total weight of the robot. Thus, the arms can move the CoM more precisely, but not as much as the as torso displacement, i.e. the arms saturate faster in terms of adjusting the CoM. When having multiple control signals and only one measurement to manipulate, in this case err y , a classic strategy is mid-ranging. The mid-range control uses the fast and precise actuator directly to control the measurement, while the task of the slower actuator is to prevent the control signal of the fast actuator to saturate, i.e. keep the fast actuator in mid-range. The controller is shown in Fig. 15.8.
set point arms
Torso displacement controller: RL1,RL5,LL1 and LL5 Arm controller: RA2 and LA2
qlegs,y
Biped robot
erry
qarms,y
Figure 15.8: The mid-range controller. The error signal is used as input to the arm
controller, while the input to the torso displacement controller is the output from the arm controller. The arm controller should reduce the ZMP error, while the torso displacement controller should prevent the arms from saturating.
As the arm controller, a simple P-controller is used as this give a simple and fast response of the arms. For the torso displacement controller a PI-controller is used with a weak P-term. Thus, given an error the arms react fast, while the legs smoothly adjust the torso position so the arms can be lowered back toward the torso again. The weak Pterm is included for two reasons. The rst is for the leg to respond immediately if the arms are suddenly given a large control signal. The other is due to the anti-windup implementation. If the actuator saturates, the input to the integrator is set to zero, and if no P-control was included, the controller would be in a dead lock, as the integrator would maintain the actuator saturated. The weak P-term is enough to turn o the anti-windup signal, when the error switches sign. The boundaries of the error signal err y during SSP is given in Fig. 15.5. The gait trajectories also apply to the arms, i.e. the arms are not in zero position during the gait, but are lifted slightly from the torso. As a result, the arm controller is chosen to be able to lift the arms 60 in the shoulder joint during SSP, yielding the following gain for the controller:
kP,arm,y =
60 1100 0.054
(15.3)
When adjusting the legs, smaller angles are required. As the legs are 0.0205 m the torso and arms are displaced approximately 0.01 m for every 3 . This corresponds to moving the CoM of the robot approximately the same amount. By tuning, the weak P-term of the torso displacement controller have been chosen to give around 1 , when the arm controller gives maximum output during SSP:
kP,leg,y =
1 0.015 60
(15.4)
129
kI,leg,y = 0.045
(15.5)
If the control signal to the arms is for example 60 for one second, this gain corresponds to adjusting the legs 2.7 during this second, i.e. moving the CoM approximately 0.01 m, which should be fast enough to keep the arms out of saturation, compared to the ZMP error being at maximum 0.054 m during SSP. The mid-range controller for controlling the ZMP in the frontal plane is implemented in Simulink as seen in Fig. 15.9. The control signal to the legs is chosen to be in the range from -15 to 15 to prevent the legs from hitting each other. This range allows the controller to displace the torso from -0.053 m to 0.053 m, which is approximately twice the width of the foot, which should be enough. The sign of the gains in Fig. 15.9 ensures that the arms and legs are moved in the intended direction. It is seen in Fig.15.9 from the saturation blocks, that only one arm is lifted at a time, depending on which direction the ZMP should be moved.
0.01 P gain legs K Ts Antiwindup z1 Integrator 0.45 1 I Gain == Satuation signal Change sign2 Saturation Legs: 15 to 15 degrees 1 Change sign 1 RL1 adjust 2 RL5 adjust 3 LL1 adjust 4 LL5 adjust 5 90 to 0 degrees 1 err_y 1100 P Gain arms 90 to 0 degrees RA2 adjust 6 LA2 adjust
Antiwindup signal
Simulink implementation of the mid-range controller for adjusting the ZMP in the frontal plane.
Having discussed how the ZMP is controlled in the frontal plane, the following describes how the ZMP is controlled in the sagittal plane.
kP,arm,z = 1000
(15.6)
Considering the legs, multiple ways exist for displacing the CoM. Three of the joints in each leg have parallel joint axes as illustrated in Fig. 15.10a. To maintain posture of the torso posture, the joint angles of the supporting the leg could be manipulated as illustrated in Fig. 15.10b, where the torso is displaced in SSP-R by keeping the sum of the joint angles RL2, RL3 and RL4 constant. But during DSP, altering the posture
130
of only one leg may lead to an unintended result. As a result, the non-supporting leg must also be altered. To avoid this amount of manipulation of the robot during gait, a simpler solution is used. Here the CoM is moved by tilting the torso as shown in Fig. 15.10c by adjusting joint RL4 and LL2 with the same amount. A consequence of tilting the torso is that the joint axes of joint RL1, RL5, LL1 and LL4 does not remain parallel as assumed in the frontal plane controller. But if the torso is not tilted more than -15 to 15 the strategy have been found to still work in practice, as the lifted feet still remains nearly horizontal during SSP, and during DSP, the feet are able to glide slightly.
CoM movement RA2 RA1 LA2 LA1 CoM movement
LL4
Figure 15.10: Figure (a) is an illustration of the robot's posture during gait. The
joints axes of joint RL2, RL3 and RL4 are always parallel, and likewise for LL2, LL3 and LL5. In (b) it is illustrated how the torso can be displaced, while still keeping it vertical. This is done by keeping the sum of the joint angles RL2, RL3 and RL4 constant. In (c) joint RL4 and LL2 are adjusted with the same angle, thereby tilting the torso, but still moving the CoM.
The weak P-term of the torso displacement controller in the sagittal plane is given the same value as in the frontal plane:
kP,leg,z = 0.015
The gain of the integrator is tuned to the following gain:
(15.7)
kI,leg,y = 0.060
(15.8)
If the control signal to the arms are for example 60 for one second, this integral gain corresponds to tilting the torso 3.6 during this second. The CoM of the torso and arms is approximately 8 cm above joint RL4, i.e. adjusting 3.6 corresponds to moving the CoM approximately 0.005 m. This should be fast enough to keep the arms out of saturation. The mid-range controller for controlling the ZMP in the sagittal plane is implemented in Simulink as seen in Fig. 15.11. The sign of the gains are such, that arms and legs are moved in the intended direction.
131
0.02 P gain legs K Ts Antiwindup z1 Integrator 0.60 I Gain == Satuation signal1 3 RA1 adjust 4 LA1 adjust Saturation Legs: 10 to 10 degrees1 1 RL4 adjust 2 LL2 adjust
Antiwindup signal
Figure 15.11: The Simulink implementation of the mid-range controller for adjusting the ZMP in the sagittal plane.
x y
RL0
RL0
x y
(a)
RL0
RL0
RL0
x z
RL0
RL0
z
end ZMP
RL0
Figure 15.12: The performed step test. In the rst test (a) the robot is stepped from a ZMP reference in the left foot to a reference in the center. In the second test, the robot is stepped from a ZMP reference behind the ankle joint, to a reference slightly in front of the ankle.
In the second test, the robot is again placed in zero position. The controller is then given a ZMP reference behind the ankle, zref = 0.03 m and stepped to a reference in front of the ankle, zref = 0.01 m. This is illustrated in Fig. 15.12b. The result of the test is seen in Fig. 15.14. The ZMP reaches the reference in approximately after 5 seconds and settles. It is seen that the controller immediately gives a large signal to the arms, and the legs are adjusted smoothly afterwards until the arms are given zero again as
132
0.02 in RL0 [m] 0.04 0.06 0.08 ZMP reference ZMP position 0 1 2 3 Time [s] 20 Angle [ ]
o
ZMP
intended in mid-ranging.
0.02 zZMP in RL0 [m] 0 0.02 0.04 ZMP reference ZMP position 0 2 4 6 8 10 12 Time [s] 14 16 18 20 22
133
Chapter Summary
In this chapter a controller for stabilizing the robot is developed. The idea of the controller is to add small adjustment to the joint angles provided by the o-line generated gait cycle trajectories. As a measure of stability of the biped robot, the ZMP is used, as maintaining the ZMP inside the PoS is a valid stability criterion for both stable stand, static walk and dynamic walk. As each o-line generated gait trajectory also includes the theoretically (desired) ZMP trajectory, this ZMP trajectory is used as reference. This should keep the robot stable, and make the robot walk as intended. To describe the ZMP location, it is chosen to switch between two coordinate systems:
Frame {RL0 } located in right foot is used to describe ZMP when in SSP-R Frame {LL5 } located in left foot is used to describe ZMP when in SSP-L
Thus, the ZMP is always described in a frame xed to the ground and the frames follow the motion of the robot. This yields an easy interpretation of the ZMP coordinates. When using frame {RL0 } and {LL5 }, only the y and z coordinates are of interest when considering the ZMP, as the x-axis is always vertical in the supporting foot. The ZMP-error is divided into two quantities, one for each direction: the error in the y -direction erry and the error in the z -direction err z . These are given as the dierence between the ZMP reference and the measured ZMP. Accordingly, the controller is divided into two, a frontal plane controller reducing the err y and a sagittal plane controller reducing err z . The developed control strategy is based on adjusting the ZMP position by moving the CoM of the robot. To adjust the ZMP, both the arms and legs can be used. As a result, mid-range controllers are implemented. The mid-range control strategy uses the arms directly to correct the ZMP-error, while the task of the legs is to prevent the arms from saturating. Thus, the arms react and afterwards the torso is displaced by the legs, so the arms can be lowered back toward the torso again. The controllers are implemented in Simulink and two tests are conducted on the robot, where the controllers are given a step in the ZMP reference. Both the frontal plane and sagittal plane controller is able to reach and settle at the reference, and the mid-range strategy works as intended. The arms reacts immediately to the error, and the legs displaces the torso smoothly afterwards so the arms are lowered back toward the torso. Thus, the controllers are ready to be tested against the requirements specied in Sec.3.3.
Chapter
16
Trajectory Supervisor
This chapter concerns the supervisor described in Ch. 11, see Fig. 16.1. It contains a description of the concepts and ideas behind a trajectory supervisor on a higher level of abstraction. Thus, what is presented here is not a nal design, and no supervisor is implemented in the controller.
Controller Accelerometers Trajectory supervisor Force to ZMP mapping ZMP trajectory ZMP error to joint angle mapping Trajectories Inverse kinematics
Strain gauges
ZMP error
Servomotors
Figure 16.1: The block designed in this chapter and it's context in the controller.
The supervisor can choose between several trajectories. These trajectories contain data for dierent gaits that can be used when experiencing large sudden perturbations in dierent directions. These are illustrated in Fig. 16.2. The supervisor could distinguish between eight dierent directions when determining the direction of the perturbation. These extra trajectories are meant for cases where an external disturbance is so large, that the current trajectories will not be able to maintain balance. The decision to change trajectories could be based on threshold values of the disturbances. The accelerometer in the torso can be used to measure these disturbances. When no larger external perturbations are registered, the optimal trajectory will be used. One trajectory for each of the eight directions the supervisor can choose between will not be adequate, because the disturbance may not be of the same magnitude every time. It should thus be possible to use dierent trajectories, even when the perturbation has the same angle of attack. In Fig. 16.3 the concept is exemplied using the trajectory for LL5. To get a suciently low quantization error, four dierent trajectory sets for each direction of perturbation could be used. This means the supervisor has 32 dierent trajectories to choose between, when an external disturbance requires a trajectory change. 134
135
Figure 16.2: An illustration of the robot and the eight perturbation directions.
The change to another trajectory should be quick to avoid falling over, it should also be
Pertubation
Direction of locomotion
Figure 16.3: Example of dierent trajectories available for cases where external
force is applied from the right. The solid line represents the optimal trajectory and the dashed line the alternatives.
done smoothly to minimize the un-modelled dynamic eects of such a quick movement. This blending of the two trajectories is created using a cubic spline interpolation between the two curves, as in the trajectory chapter, see 13.3 on page 106 for details. See Fig. 16.4 where an interpolation is shown. During the blending the trajectories might not be stable, as stability is not taken into account when interpolating. This is a reason for making the duration of the blending small. However the accelerations should not be too great either, which entails longer blending duration. The actual value will have to be determined experimentally. After using the alternative (and more stable in the situation) trajectory set for one step, the supervisor gradually changes back to the optimal trajectory. For this transition a special trajectory is used. Especially when the perturbation is parallel to the walking direction these transition trajectories are important. This case is illustrated in Fig. 16.5. After the longer step taken by LL5, the initial position for the next SSP, moving RL1 forward, is dierent from the one used to generate the optimal trajectory set. Thus using
136
ZMP position
Interpolation time
Figure 16.4: View of ZMP trajectory, for the optimal trajectory and trajectory
shift when an disturbance occur.
Pertubation LL5 y z x {GLOB} RL1 Direction of locomotion
Figure 16.5: Illustration of a case where the robot takes a longer step to keep
balance when pushed from behind. The solid line indicate the alternative trajectory for LL5/RL5, dashed lines indicate the original/optimal trajectory.
the optimal trajectory set from this point on could make the robot fall. A transition trajectory set is used in this situation. During the next step, this trajectory set moves the robot back to the initial posture, from where the optimal trajectory set can take over. Transition trajectories should be available to the supervisor for each of the alternative trajectories. This way, though the transition to the alternative set might be sudden when the perturbation occurs, the transition back to optimal walk will be seamless.
Part Summary
In this part, the development of the controller implemented on the robot is described. A controller based on o-line trajectory generation is developed and implemented. Trajectories based on a kinematic, Newtonian, and Lagrangian model are developed in Ch. 13. A genetic algorithm is used to develop the trajectories. This algorithm uses a performance function, in which several parameters are included, to gain an optimal trajectory for the robot. In Ch. 14 a Newtonian model is derived, enabling the CoP to be determined from forces acting on the sole of the foot, which is successfully veried experimentally. A method for determining the CoP during DSP is derived, which enables a comparison of the theoretically calculated CoP from the kinematic model with the measured CoP during DSP. A feedback controller is developed in Ch. 15, to make the robot more resilient to disturbances in a limited range. The developed control strategy is based on adjusting the CoP position by moving the CoM of the robot. To adjust the CoP, both the arms and legs are used. This is implemented using mid-range controllers. Furthermore a design of a controller that can change trajectories on-line is proposed. Compared to the controller implemented on the robot, this controller should be able to maintain balance, when larger perturbations occur.
137
Part V
In this closing part of the main report the results from the tests which are described in Ch. 3 and dened in App. B are presented. In the conclusion the main results in this report are emphasized. Afterwards the obtained results are discussed along with the project as a whole and the improvements which can be made to the biped robot in this project. Finally a closing statement is given to put this project into a greater perspective regarding the development of biped robotics at AAU.
Chapter
17
Acceptance Test
In this chapter the biped robot is tested against the requirements specied in Sec. 3.3. In order to test if the biped robot reacts as expected a comparison is made of the CoP calculated from strain gauge measurements and the CoP calculated in the Simulink model. This gives a good indication as to whether the robot follows the trajectories developed in Ch. 13. The robot is tested with a trajectory developed from the kinematic model and with a trajectory developed from the dynamic Newton-Euler model. Further more a controller is implemented but this is only tested with the kinematic model. The reason for this is that the impact from the controller is the same using either of the trajectories thus making the eect from the controller visible with only one graph. The tests are carried out under the same test conditions. This means that the tests are always carried out on a horizontal supporting surface. The results are documented with video clips which can be found on the enclosed CD [1]. The precision of the measurements from the strain gauges does not allow for verication of the CoP demands specied in Sec. 3.3 for test 4, 5, 7, and 8. Hence are these not comment further but it can be concluded that the biped robot fail on these demands.
Test Scenarios
The tests presented in this section are divided into four separate scenarios which each cover an area of the agility of the biped robot. The test scenarios are arranged such that the more simple tests are covered rst, i.e. test scenarios increase in complexity. As not every test can be veried by complying with some exact value, some of the tests are simply evaluated with a subjective opinion of this group with a passed or not passed. All the results are presented in the following section including the most important graphs. The test scenarios are discussed one by one and the results are shown in Tab. 17.1. The graphs showing the test information is shown at the end of this section. 140
141
Results Test One tests the robots ability to stand. This test is passed as the robot stands
without falling.
test is both veried through a video clip, see [10] and with a graph showing the CoP position. The topmost graph in Fig. 17.1 and in Fig. 17.2 shows the test with the static trajectory without a controller. The step length can be seen in Fig. 17.2 which shows the CoP in the x-direction. The step length is the maximum dierence in CoP position which is determined to be 12.5 cm. As it can be seen on the video clip the robot takes approximately 2.6 seconds per step. This leads to a walking speed of 4.8 cm/s. The lifting height of the feet has been determined to be 1 mm by inspecting the video clip. Due to the low walking speed of the robot the dynamics of the system is insignicant, making the CoM a good approximation of the CoP. As the robot does not fall during a gait cycle, the CoP, which is coinciding with the ZMP, is by denition inside the PoS. By examining the topmost graph in Fig. 17.2 closer it shows that a step with the left foot is faster than a step with the right foot. The CoP position in y -direction is more coincident.
CoP Test with Static Walk without Controller in Ydirection 0.1 CoP Position [m] 0.05 0 0.05
Test Two investigates the static walk of the biped robot without a controller. This
10
12
14
16
CoP Test with Static Walk and Controller in Ydirection 0.1 CoP Position [m] 0.05 0 0.05
8 Time [s]
10
12
14
16
Figure 17.1: CoP test while walking static with reference to y in the global frame. The solid line is the measured CoP, and the dotted line is the CoP from the model.
Test Three investigates the dynamic walk of the biped robot without a controller.
This test is both veried through a video clip, see [11] and through a graph showing the CoP position, see Fig. 17.3. First of all the step length is determined from investigating the CoP in the x-direction showed in Fig. 17.3. The step length is determined to be
142
CoP Test with Static Walk without Controller in Xdirection 0.1 CoP Position [m] 0.05 0 0.05 0.1 0 2 4 6 8 10 12 14 16
CoP Test with Static Walk and Controller in Xdirection 0.1 CoP Position [m] 0.05 0 0.05 0.1 0 2 4 6 8 Time [s] 10 12 14 16
Figure 17.2: CoP test while walking static with reference to x in the global frame.
The solid line is the measured CoP, and the dottet line is the model CoP.
approximately 12.5 cm. From the video clip is has been determined that the robot takes around 2.2 seconds per step. This leads to a walking speed of 5.6 cm/s. The maximum foot lift has been determined to be 2 mm. With the same argumentation as in the previous test case ZMP is by denition inside the PoS as the robot does not fall during a gait cycle. It is seen bottommost in Fig. 17.3, that the CoP is delayed with respect to the estimated CoP in the x-direction when taking a step with the left foot but it is faster when taking a step with the right foot. In the y -direction CoP position is more coincident with the theoretical CoP.
Test Four is veried through a video clip, see [12] and through the bottommost graphs
in Fig. 17.1 and Fig. 17.2 showing the CoP position. The robot still manages to walk with the controller applied to the system and by investigating Fig. 17.1 the CoP does
143
CoP Test with Dynamic Walk in the Ydirection 0.1 CoP Position [m] 0.05 0 0.05
10
12
14
CoP Test with Dynamic Walk in the Xdirection 0.1 CoP position [m] 0.05 0 0.05 0.1 0 2 4 6 8 Time [s] 10 12 14
Figure 17.3: CoP test while walking dynamic, with reference to x and y in the
global frame. The solid line is the measured CoP, and the dottet line is the model CoP.
seem to be closer to the estimated CoP when decreasing but suer from overshoot when increasing.
Test Five is veried through a video clip, see [13]. The robot is still capable of walking
with the controller but CoP measurement is not presented as the result is the exact same as for the static walk.
Test Six is veried through a video clip, see [14] and through a graph in Fig. 17.4
showing the CoP position. The graph shows the test which is initialized with the robot balancing on the left foot and hence the CoP reference at 0 cm. After 7 seconds the CoP reference is stepped to right between the feet equal to approximately -3 cm, as seen in Fig. 17.4. As seen the CoP of the robot is stabilizing at 0 cm until applying the step. From the gure it is determined that the rise time is around 0.5 second with an overshoot of 33% and a settling time at around 3 seconds. The biped robot is also able to maintain balance when external disturbances up to 4 N are applied.
144
Double Support Phase Test with Controller 0.02 0.01 0 CoP Position [m] 0.01 0.02 0.03 0.04 0.05
5 Time [s]
10
15
Figure 17.4: Step test for double support with controller. The CoP position is seen
from LL5.
Test Seven is only veried through a video clip, see [15] with no graphs representing the
results. The robot is able to keep walking although exposed to external disturbances. The robot reacts to direct disturbances as it pushes the arms and tilt the torso in the opposite direction of the disturbance.
Test Eight is only veried through a video clip, see [16] with no graphs representing the
results. The result is the same as in Test Seven. The robot reacts to the disturbances without falling.
Test Nine is only veried through a video clip, see [17] with no graphs representing
the results. In this test all the wires are disconnected, the battery is inserted and the trajectories are uploaded to the robot. As seen in the video clip the robot is able to play back the trajectories and thus walk.
145
Result Summation
To give an overview of the achieved results they are presented in a tabular. Test Case One Two Three Four Five Six Seven Eight Nine Speed X Not Passed Not Passed Not Passed Not Passed X Not Passed Not Passed X Step Length X Passed Passed Passed Passed X Passed Passed X Foot Lift X Passed Passed Passed Passed X Passed Passed X CoM/ZMP Criteria X Passed Passed Not Passed Not Passed Passed Not Passed Not Passed Passed
Table 17.1: Table showing the results from the acceptance test. A "X" denote when no verication test is performed.
Chapter
18
Conclusion
The main purpose of this project was to make the biped robot walk. This goal should be accomplished through modelling the robot and using these models in the trajectory generation. Additionally a controller should be implemented to stabilize the robot under external disturbances. As this project is a follow-up certain hardware improvements were proposed in the last project in order to achieve better performance with the robot. The main improvement is a new foot design with strain gauges as sensors. This resulted in a much more accurate CoP calculation. Further more the implementation of a microcontroller enabled an autonomous gait completely without any wires to the surroundings. A model of the servomotors is developed. This model turned out to lack precision and, due to time constraints, it is not developed further and thus not used in this project. Additionally a kinematic model is developed and veried in 3D Studio Max. The model is able to accurately describe the position and rotation of every link in the robot. The Newton-Euler model describes the dynamics using torques and forces acting in every link of the robot. This approach leads to a very precise but very complex model suitable for o-line simulation where accuracy is valued over computation speed. The Newton-Euler model is veried to a satisfactory degree using measurement from the physical robot. In order to create a less complex model, which could be used in on-line model based controllers, the Lagrangian model is derived. Simplications to this model reduce it to a simple static model as the dynamics can be disregarded as a result of the low gait speed of the robot. A comparison with the Newton-Euler model revealed that the two models produced almost identical results. This leads to the conclusion that the dynamics can be disregarded with only a minor loss of accuracy. An inverse kinematic model is derived in order to convert the desired position of the robot's limbs into actual angles of the servomotors. All these models are used in the genetic trajectory generation algorithm to create the trajectories used to make the robot walk. The application of a genetic algorithm to the trajectory generation problem proves an eective and exible solution. Two trajectories are generated: One static gait and one dynamic gait.
146
147
Finally a feedback controller is developed using CoP/ZMP measurements as the input. The CoM is moved to keep ZMP at a reference determined o-line through the trajectory generation. This ZMP controller implements mid-ranging to move the CoM using both the arms and legs. The principle of mid-ranging proved a simple and eective way to solve the problem of having two actuators that control one system output. The acceptance test revealed that the robot was able to walk with both the static and the dynamic trajectory. Both gaits failed the gait speed requirements, but complied with the requirements regarding foot lift, step length and half of the tests concerning the ZMP criteria. Implementing the controller did not stabilize the robot further during gait. In stand the controller did perform better. Test shows that using the arms to control, do not change CoP enough to maintain balance, when external disturbance occur. Even though the robot never achieved real human-like dynamic heel-strike-toe-o gait, the project is seen as a success as the models are veried and used in the trajectory generation. The controller did not stabilize the robot further but the principle with a mid-range controller showed to work and further improvement to the mechanic of the robot and tuning of the controller is seen as a possibility.
Chapter
19
Discussion
This chapter will discuss the results given in the conclusion by evaluating whether the methods used in this report are applicable for modelling and controlling a biped robot. It will discuss the choice of hardware and also provide a brief summary of the main problems encountered during the development. Further improvements to the robot will also be discussed here. Due to their importance in control aspects, the hardware of primary concern is the feet of the robot which have been improved in several ways in this project. In order to determine the CoP, the use of strain gauges as force sensors has proven a viable alternative to the force sensing resistors. The redesign of the feet resulted in two things. First of all the new design gives a much better signal from the strain gauges and secondly provides more grip when walking. However, further improvement is needed to make the robot able to walk dynamically. The large area of the feet makes the robot very stable statically, even without a controller. As a result, a stability controller has limited use in the robot. Smaller feet will make the robot less stable but help in gaining the heelstrike-toe-o capability required for true dynamic walk. The general hardware problem of achieving faster walking speeds with the pre-AAUBOT is the fact that all the links are entirely rigid. This causes a jolt through the robot as the feet touch the ground. At low walking speeds, these eects are minor, but as the speed increases it causes the robot to become increasingly unstable until it ultimately falls over. It can be compared to a human walking on stilts. Fitting mechanical dampers may prove very dicult. Instead, the damping eects could be obtained by modifying the servomotors to allow control of the generated torque. This way, by applying less torque to some joints in the impact phase the servomotors would move with the stress and absorb the jolt. But with the limited amount of control of the servomotors, it is estimated that, until better feet and/or actuators are tted to the robot, this rigidness will be a limit to the walking speed. Generally, the frame and the servomotors introduce much slack in the robot, which is inherently dicult to model and control. By locating the parts introducing the slack and replacing them with improved hardware, it is assumed that the models of the robot would be more accurate and enable better control. The modelling of the servomotors resulted in a purely kinematic model, which did not take the load torques into account. This resulted in a model in which the servomotors could theoretically have unlimited torque. Tests during a gait cycle and simulation show
148
149
that the load torques at least surpasses the maximal torque delivered by the HS-645MG. To make a model which can be used for o-line simulations of controllers an improved servomotor model must be developed which take the load torque into account. The derived dynamic model based on Newton-Euler iterations has proven quite precise and describe all the forces and torques working on the pre-AAUBOT. This makes it very suited for use in simulations, trajectory generation, and controller tuning. It is, however, comprehensive and time consuming to calculate and hence not a valid option for on-line model based control. The Lagrangian model deals with this problem by simplifying the expressions and only determines the essential torques. Furthermore it is determined that the dynamic have a small impact on the torque on the biped robot. This justify that the dynamic parts of the model are removed, making the model even simpler. Despite the achieved simplicity and precision for this model, it have not been used for on-line simulation, due to time constraint. The SSP model derived in this project can found a base for on-line model based control, due to the simplicity of the achieved expressions. The trajectory generation is based on a genetic algorithm. This approach yields an optimal trajectory according to some performance function. This method is both ecient in the sense that it optimises the gait, and exible in the sense that dierent aspects can be considered for optimality by designing the performance function accordingly. The practical application of the algorithm, though it required some resources to tune satisfactorily, proved eective. Thus, this report conrms the feasibility of the application of a genetic algorithm for trajectory generation. As the models are based on single support, so is the case for trajectory generation. Thus a trajectory for a complete gait cycle is made by mirroring the SSP and inserting it after the rst SSP. This entails insecurity in the transition from one SSP to the next. In an area in time around this transition the robot will, in practise, have two feet on the ground, i.e. be in double support. As this is not how the model interprets this situation, the calculated ZMP will not conform to reality in the transition. However the ZMP is set to be in between the legs at the time of the transition. That is, the transition occurs at the most stable point in the gait cycle. Hence the eects of the inaccuracy in the models at the transition do not lead to instability. The lack of a double support model does however bring other limitations. For the robot to walk truly dynamically, it should, in the transition phase, use the previously supporting leg to push the CoM towards the new supporting foot. This eect can not be modelled using the SSP model. The eects of the push are so signicant, that, without a DSP model, it will be very dicult to implement and still keep the robot stable. A DSP model is therefore advantageous with respect to the implementation of the described push-o feature. The heel-strike-toe-o feature would also require such a DSP model. Both these gait features would be desirable in an anthropomorphic robot, and thus a DSP model would be a valuable addition to the models developed in this report. Some possible issues with the feedback controller is the long delay in the control loop and the inability to precisely control or measure the CoP/ZMP. The delay is mainly caused by the slow lters needed on the input signals to make up for the imprecision in the measurements. The backlash in the servomotors is the main contributor to the imprecision in actuators, and thus in the CoM movement. A more advanced controller could use the gyroscope in the torso for sensor fusion with the accelerometer in the torso. This sensor fusion could give a more exact tilt of the torso which could be used to control the tilt of the robot. An area which should also be investigated further is the real time aspect of the mi-
150
crocontroller. The microcontroller is programmed with IsoMaxTM and it has not been investigated fully if any problems arise from using this language which is an interpreted language. It is possible to ash the microcontroller and program it with C via a JTAC cable and maybe gain some speed in processing the programs and enable a feedback controller to be implemented on the microcontroller.
Chapter
20
Closing Statement
The reasons for this project are two-sided. As mentioned in the beginning of this report Aalborg University is currently working on a human-scale biped robot. In order to introduce students to the concept of modelling and controlling biped robots, this smallscale robot project was started. The main objective for this group was to model and control the biped robot and to make the robot walk. Furthermore, the robot is properly also to be used in later projects at Aalborg University, so the results from this project make the foundation for even better control and more human-like gait with the robot. The results are also to be used in a wider perspective. The knowledge gained from this project can be transferred into modelling and controlling a human-scale biped robot, as the techniques for modelling and controlling a small-scale robot are the same as when dealing with large-scale robots. Although the procedure when modelling and developing controllers are the same, some issues need to be treated dierently. The Lagrangian model was found most suited when on-line calculations are necessary, but the model can not be used directly in the present form, when dealing with a large-scale robot. One issue is the dynamic part of the model which has a much greater inuence on a large-scale robot and should of course be included in the model. Further more a model describing the double support phase is a necessity to achieve human-like dynamic walk. Also the knowledge from the controller development is useful when dealing with large-scale robots. Although the controller did not improve the performance of the biped robot the principle and design strategy was found suitable. With a faster controller and better sensor measurements great improvements are possible. To summarize, the knowledge and experience gained from this project is a sound foundation for the development of large-scale biped robots.
151
Bibliography
[Brennan, 1999] Brennan, S. N. (1999). Modeling and control issues associated with scaled vehicles. [Craig, 2003] Craig, J. J. (2003). Introduction to Robotics. Pearson Prentice Hall, 3rd edition. ISBN 0-13-123629-6. [Cuevas et al., 2005] Cuevas, E. V., Zaldivar, D., and Rojas, R. (2005). Bipedal robot description. Control and Applications, 460. [Fraden, 2004] Fraden, J. (2004). "Handbook of Modern Sensors". Springer-Verlag, third edition. [Hitec, 2006] Hitec (2006). http://www.hitecrcd.com/servos/list. Hitec RCD USA. [Honda, 2007] Honda (2007). http://world.honda.com/asimo/history/. Accessed 2903-2007. [Huang et al., 2001] Huang, Q., Yokoi, K., Kajita, S., Kaneko, K., Arai, H., Koyachi, N., and Tanie, K. (2001). Planning walking patterns for a biped robot. IEEE TRANSACTIONS ON ROBOTICS AND AUTOMATION, 17:280289. [Humanoid Robotics Institute, 2007] Humanoid Robotics Institute, W. U. (2007). http://www.eu-japanfest.org/english/program/12/lille/robot.html. Accessed 29-032007. [Katic and Vukobratovic, 2003] Katic, D. and Vukobratovic, M. (2003). Survey of intelligent control techniques for humanoid robots. Journal of Intelligent and Robotic Systems, 37:117 141. [Kim et al., 2005] Kim, D., Kim, N.-H., Seo, S.-J., , and Park, G.-T. (2005). Fuzzy modeling of zero moment point trajectory for a biped walking robot. IEEE Proceedings - Control Theory and Applications, 152:411426. [Komura et al., 2005] Komura, T., Leung, H., Kudoh, S., and Kuner, J. (2005). A feedback controller for biped humanoids that can counteract large perturbations during gait. Proceedings of the 2005 IEEE International Conference on Robotics and Automation. [Kudoh and Komura, 2003] Kudoh, S. and Komura, T. (2003). C2 continuous gaitpattern generation for biped robots. Intelligent Robots and Systems, IEEE/RSJ International Conference, 2:1135 1140. 152
BIBLIOGRAPHY
153
[Pickel, 2003] Pickel, A. (2003). "Control for a Biped Robot with Minimal Number of Actuators". None. [Popovic and Sinkjaer, 2000] Popovic, D. and Sinkjaer, T. (2000). Control of Movement for the Physically Disabled. Springer-Verlag. ISBN 1-85233-279-4. [rts et al., 2006] rts, P. F., Chirstensen, J., Nielsen, J. L., Svendsen, M. S., Svendstrup, M. S., and Winther, K. (2006). Modelling and Control of a Biped Robot. none. [Sardin and Bessonnet, 2004] Sardin, P. and Bessonnet, G. (2004). Forces acting on a biped robot. center of pressure-zero moment point. Systems, Man and Cybernetics, Part A, IEEE Transactions, 34:630 637. [Serway and Jewett, 2004] Serway, R. A. and Jewett, J. W. (2004). Physics for Scientist and Engineers. David Harris, 6th edition. ISBN 0-534-40949-0. [Inernational Organization for Standardization, 1994] Inernational Organization for Standardization (1994). ISO 8373:1994 Manipulation Industrial Robots. [Wirhed, 2002] Wirhed, R. (2002). "Anatomi og bevgelsesllre i idrt". Samsprk Forlags AB. [Wisniewski, 2007] Wisniewski, R. (2007). Modelling of mechanical systems ii.
Appended Documents
[1] Video clips of the Biped Robot. CD-ROM path: \Acceptance Test Videos\ [2] The written IsoMax Code for the microcontroller. CD-ROM path: \IsoMax Code\ [3] 3D Studio Max bone model of the biped robot and a Matlab model of the kinematics. These are used for verication of the kinematics. CD-ROM path: \Kinematic Model\ [4] Implementation of the calculation of the CoM of the biped robot in Matlab. CD-ROM path: \Matlab\calc_com.m [5] Implementation of the Newtonian model in Simulink. CD-ROM path: \Matlab\Newtonian\newtonian_model.mdl [6] A Matlab script to verify the expressions for rl1 and rl2 . CD-ROM path: \Matlab\Lagrange\ [7] Implementation of the inverse kinematic model in Matlab. CD-ROM path: \Matlab\Trajectories\inverse_kinematic.m [8] Source code and binary to Rhinoceros plugin. CD-ROM path: \Plugin\ [9] Matlab les that implements the generic algorithm. CD-ROM path: \Matlab\trajectories\generate_trajectories.m [10] Walking static with no controller. CD-ROM path: \Acceptance Test Videos\Test Two\ [11] Walking dynamic with no controller. CD-ROM path: \Acceptance Test Videos\Test Three\ [12] Walking static with controller. CD-ROM path: \Acceptance Test Videos\Test Four\ [13] Walking dynamic with controller. CD-ROM path: \Acceptance Test Videos\Test Five\ [14] Double support phase with controller and disturbances. CD-ROM path: \Acceptance Test Videos\Test Six\ 154
APPENDED DOCUMENTS
[15] Walking static with controller and disturbances. CD-ROM path: \Acceptance Test Videos\Test Seven\ [16] Walking dynamic with controller and disturbances. CD-ROM path: \Acceptance Test Videos\Test Eight\ [17] Walking without any wires. CD-ROM path: \Acceptance Test Videos\Test Nine\
155
[18] Data sheet for the MMA7250Q accelerometer CD-ROM path: \Datasheets\MMA7260Q_large_disturbance_accelerometer.pdf [19] Data sheet for the MCP3208 ADC. CD-ROM path: \Datasheets\mcp3208.mgp
Part VI
Appendix
Appendix
Human Gait
During human gait, the angles of the dierent joints are usually within some boundaries. This knowledge can be used to ease the modelling of the biped by using approximations as the small angle approximations. To determine these boundaries, an analysis of human gait has been carried out. To emphasize the important data for the Lagrangian model it is dierent from the one in [rts et al., 2006] . However, the fraction of the DSP phase found in [rts et al., 2006] to be 8% is used. The data covers half a gait cycle because this will provide all the information needed, since e.g. rl2 and ll4 gives the angles in the sagittal plane through a whole cycle. The reason why they do not exactly start and stop at each others start and stop points is that each half gait cycle is not exactly alike. But as seen in the graphs they are close to be alike and hence, one half gait cycle can represent the gait. To get more precise values of the angles an average of more whole cycles (and dierent persons) should be taken. For the purpose of modelling simplications it is sucient to get an of the span of the angles and hence the data from one half gait cycle is sucient. The numerical value of the angles in each joint from the human gait does not represent the angles in the joints on the biped for two reasons. Firstly, the joints are placed dierently on the biped than on a human, and secondly the reecting balls on the human test person are not placed on a vertical line. The second part results in some osets on the angles measured on the human body, and no information of these osets are given by the group that carried out the experiment. Hence, it is mainly the angle variations which can be derived from the data. The limits within the angles vary are given in degrees in favour of radians as angles in degrees make it more intuitive to visualize the bending of the joints. In the calculations, the angles will always be in radians. First, the angels in the sagittal plane in the legs are examined. By only using the x and z component from the data to nd a vector in each limb (foot, shin, thigh, and torso) the angles in the sagittal plane are found. They are shown in graph A.1. To get rid of redundant information in the Lagrangian model, the sums of these angles are of particular interest. These are shown on graph A.2 and A.3.
158
159
50 servoangle 0 50 20
LL4 RL2
40
60
80
100
120
140
160
50 servoangle 0 50 20
LL3 RL3
40
60
80
100
120
140
160
50 servoangle 0 50 20 LL2 RL4 40 60 80 100 120 Datapoints for a half gait cycle 140 160
Figure A.1: These three graphs shows the angels in each joint of the legs in the
saggital plane.
servoangle
50 0 50 20
LL2
40 +
60
80
100
120
140
160
servoangle
50 0 50 20
LL2
LL3
40 + +
60
80
100
120
140
160
servoangle
50 0 50 20
LL2
LL3
LL4
40
140
160
Figure A.2: These three graphs shows the sums of the angels in the swing leg, in the saggital plane. A zero lines is also plotted to make it easier to see when the angles change sign.
160
RL2
RL3
RL4
LL2
140 +
LL3
160
LL2+LL3+LL4 RL2+RL3+RL4 50 servoangle 0 50 20 40 60 80 100 120 Datapoints for a half gait cycle 140 160 RL2+RL3+RL4 LL2LL3LL4
Figure A.3: These three graphs show the sums of angels in each joint of the legs in
the sagittal plane.
From these graphs it is seen that the angles vary within the following limits given in degrees.
rl2 rl2 + rl3 rl2 + rl3 + rl4 ll2 ll2 + ll3 ll2 + ll3 + ll4 ll2 rl2 rl3 rl4 ll2 + ll3 rl2 rl3 rl4 ll2 + ll3 + ll4 rl2 rl3 rl4
: 15 : 26 : 20 : 12 : 52 : 70
to to to to to to
10 4 15 22 25 10
: 25 to 40 : 45 to 32 : 65
to
22
For the Lagrangian model, small angle approximations can be used on the four rst expressions as these lies within 26 degrees Furthermore, it is seen from the graph A.3 that the angles in the supporting leg are considerably smaller than the angles in the swinging leg, which allows for the following
161
approximation.
ll2 + ll3 rl2 rl3 rl4 ll2 + ll3 ll2 + ll3 + ll4 rl2 rl3 rl4 ll2 + ll3 + ll4
The angles in the frontal plane are found in the same way using the x and y coordinates. The angles are seen on graph A.4 and A.5.
20
40
60
80 RL5
100
120
140
160
180
10 15 20
20
40
60
80
100 +
RL5
120
140
160
180
RL1
6 8 10
20
40
140
160
180
Figure A.4: The upper two graphs shows the angels in the supporting leg in the
frontal plane, and the third show the sum of these two.
20
40
60
80 LL5
100
120
140
160
180
20 10 0
20
40
60
RL1
80 +
RL5
100 +
120
140
160
180
LL1
0 5 10
20
40
140
160
180
Figure A.5: These two graphs show the angels in the swing leg in the frontal plane.
162
Here the following variations are found:
to to to to to to
Hence, small approximations are very valid for the angles in the legs in the frontal plane. Furthermore, for the angels in the supporting leg it does seem reasonable to approximate a sine to the angles in the supporting leg with a zero since their values are lower than 0.1 rad, in some relations where it makes them insignicant compared to other parts not multiplied with this angle. It is also noticed that the sum of rl1 and rl5 has a variation close to 0 rad and hence keeps the torso in upright position, as expected. The angles in the arms varies as shown on graph A.6 and A.7.
RA1 servoangle in degrees 10
20
40
60
80 RA2
100
120
140
160
180
servoangle in degrees
22 20 18 16 14
20
40
140
160
180
Figure A.6: These two graphs show the angels in the right arm. ra1 is in the
sagittal plane and ra2 is in the frontal plane.
ra1 :
1.6
to
163
20
40
60
80 LA2
100
120
140
160
180
servoangle in degrees
20
18
16
14
20
40
140
160
180
Figure A.7: These two graphs show the angels in the left arm. la1 is in the sagittal plane and la2 is in the frontal plane.
Appendix
Test One
Stand stable with no external disturbance and with the controller disabled.
The biped robot is given a reference signal consisting of constant zeros. This test is carried out to determine the wobble of the servomotors, the interfacing between the servomotors and the microcontroller. The robot is standing in zero position when power is applied. A picture of zero position is found in Fig. B.1
Test Two
Walk static with no external disturbance and with the controller disabled.
164
165
vstatic =
The step length of a human is approximately 72 cm scaling this down to the robot gives a static step length of:
lstep = 72 cm
29 cm 11.6 cm 180 cm
An exact measure for the feet lift for a human gait has not been obtained, and hence is the only demand regarding the foot lift that the swing foot must be lifted completely from the ground in the swing phase. At last must the CoM lie within the PoS at all time for the walk to be stable. These requirements can me summarized to the following: 1. Minimum speed of 0.2 km/h 5.6 cm/s. 2. Minimum walking cycle length of 11.6 cm. 3. The foot must leave the ground. 4. The CoP must be within the PoS during the whole gait cycle. This test is carried out to validate that the trajectory is able to make the biped robot walk static. This is done by examine the CoP output from the sensors in the feet. This test will also show whether the servomotors are strong enough to hold the biped robot in the right positions during a gait.
166
Test Three
Walk pseudo-dynamic with no external disturbance and with the controller disabled.
The biped robot is given a trajectory for pseudo-dynamic walk and has to walk one meter without any disturbances or any controller. The same considerations and scaling factors from the previous test is used again giving the following requirements: 1. Minimum speed of 0.8 km/h 22.4 cm/s. 2. Minimum walking cycle of 11.6 cm. 3. The foot must leave the ground. 4. The CoP must be within the PoS during the whole gait cycle. This test is carried out to validate that the trajectories are able to make the biped robot walk pseudo-dynamic. This is done by examine the CoP output from the sensors in the feet.
Test Four
Walk static with no external disturbance and with the controller enabled.
This test is done to verify that the controller does not destabilize the static trajectory. In this test there are no external disturbances. 1. The CoP must be within 0.3 cm of the CoP specied for the trajectory. This test is carried out to clarify the controllers aect on the static gait of the biped robot. This is done by comparing the CoP output with that from test two and examine that it is within the requirements.
Test Five
Walk pseudo-dynamic with no external disturbance and with the controller enabled.
This test is done to determine the objectives of the biped robot with no external disturbances and the controller is enabled in pseudo-dynamic walk. 1. The CoP must be within 0.3cm of the CoP specied for the trajectory. This test is carried out to clarify the controllers aect on the pseudo-dynamic gait of the biped robot. This is done by comparing the Cop output with that from test three and examine that it is within the requirements.
167
Test Six
Stand stable with external disturbance and with the controller enabled.
The biped robot is given a reference signal consisting of constant zeros and the controller is enabled. The biped robot is then aected with a disturbance in form of a force in each direction in the sagittal plane with the attack point at the center of the torso. The same force is applied from each direction in the frontal plane with attack point at each shoulder. The disturbances are approximately 2-4 Newton. The forces are applied rst as a push and then gradually over a period of approximately 3 seconds. During each force test of the biped robot is the CoP recorded from the strange gauges on the feet, giving the following requirements: 1. The CoP must be held within PoS when applied disturbances around 2-4 N. This test is carried out to determine the controller's ability to maintain CoP within the PoS.
Test Seven
Walk static with external disturbance and with the controller enabled.
This is carried out as test four but with external disturbances aecting the biped robot whilst walking static. The disturbances are created as described in the previous test. This leads to the following requirements: 1. The CoP must be within 0.5 cm of the CoP specied for the trajectory. This test is carried out to clarify the controller capability to suppress external disturbances aecting the biped robot during static walk. This is done by comparing the CoP output with the one from test two and examine that it is within the requirements
Test Eight
This is carried out as test ve with external disturbances aecting the biped robot whilst walking pseudo-dynamic. The disturbances are created as described in the previous tests. This leads to the following requirements: 1. The CoP must be within 0.5 cm of the CoP specied for the trajectory. This test is carried out to clarify the controller capability to suppress external disturbances aecting the biped robot during pseudo-dynamic walk. This is done by comparing the CoP output with the one from test three and examine that it is within the requirements.
168
Test Nine
Walk autonomous without any wires attached.
This test scenario covers the tests which are to determine the biped robots abilities to walk autonomous without any wires connected to the biped robot. Tests one to three are repeated with batteries mounted and no wires connected to the biped robot. The requirements for these three tests are the same as described in the respective tests. These tests are carried out to verify that the biped robot can stand and walk both static and pseudo-dynamic using its on-board power supply and microcontroller. The CoP is compared to that of test two and three to show how the changes made by mounting the batteries and using the microcontroller aect the biped robot.
Appendix
Test Description
In the test, the right foot of the biped was dismounted from the robot and instead a test frame consisting of two crossed bars was attached to the ankle servomotor. This is depicted in Fig. C.1. As a result, the foot could be given a known CoP by placing weights on the bars as seen in Fig. C.2. The servo was applied power and a control signal to keep it locked at RL0 = 0.
m1 m5 m3
m4 m2
x y
RL0
RL0
RL0
Figure C.1: The right foot of the biped dismounted from the robot. Instead a test frame consisting of two crossed bars was attached to the ankle servomotor. A known CoP was applied to the foot by placing weights on the bars at the ve indicated places on the gure.
The arrangement consisted of 3 pieces, the foot (including the servomotor), the bracket 169
170
dm pCbars m5 x
RL0
dm pC bracket
m4
pCRL,foot y
RL0
m3 z
RL0
Saggital view
dm
dm pCbars pC bracket m5
m1
x y
RL0
RL0
m2
z pCRL,foot
RL0
Front view
Figure C.2: The test arrangement consisted of 3 pieces, the foot (including the
servomotor), the bracket mounted on the servo (dark grey), and the two crossed bars mounted on the bracket (light grey). A known CoP was applied to the foot by applying weights m1 , m2 , m3 , m4 and m5 to the bars. The servo was applied a current and a control signal to keep RL1 at zero.
mounted on the servomotor, and the two crossed bars mounted on the bracket. These had the following center of masses given in {RL0 },
pCRL,foot
(C.1)
mfoot = 0.1007 kg
mbracket = 0.0106 kg
mbars = 0.0430 kg
(C.2)
The center of masses of the ve attached weights in Fig. C.2 have the following y and z -coordinates,
pCm1
pCm4
where the x-coordinate has been omitted because the CoP only depends on the y and z -coordinates, as it is the projection of the CoM on the sole of the foot.
171
The CoM on the entire test arrangement with applied weights can be found as:
pCtot =
1 mfoot pCRL,foot mfoot + mbracket + mbars + m1 + m2 + m3 + m4 + m5 + pCbracket mbracket + pCbars mbars + pCm1 m1 + pCm2 m2 + pCm3 m3 + pCm4 m4 + pCm5 m5
[m] (C.3)
The CoP is then given as the y and z -coordinate of pCtot as the test arrangement is static. During SSP the CoP can be found by inserting the four pressure measurements on the supporting foot into Eq. (14.1) and Eq. (14.2),
yCoP = zCoP
where:
llittle toe (Fp,r1 + Fp,r3 ) lbig toe (Fp,r2 + Fp,r4 ) Fp,r1 + Fp,r2 + Fp,r3 + Fp,r4 ltoes (Fp,r1 + Fp,r2 ) lheels (Fp,r3 + Fp,r4 ) = Fp,r1 + Fp,r2 + Fp,r3 + Fp,r4
[m] [m]
(C.4) (C.5)
ltoe = 0.0627 m
lheels = 0.0608 m
The total mass of the robot have been measured to be 2.24 kg. As a result, a total mass between 1.000 kg and 2.010 kg was distributed on the bars during the tests. The microcontroller mounted on the robot was used to sample the pressure measurements from the four strain gauges on the foot. To remove any oset from the output of the force measurements using the strain gauges, their output was rst measured with the foot lifted from the ground and subtracting from the following measurements.
Test Results
In Tab.C.1 the dierent values of the masses placed on test arrangement are listed along with the measured pressure forces. The placement of the masses corresponds to those depicted in Fig. C.1, and forces corresponds to those found in Fig. 14.3. The mass values of Tab. C.1 are inserted into Eq. (C.3) to determine the theoretical CoP location. The force values of Tab. C.1 are inserted into Eq. (C.4) and Eq. (C.5) to nd the CoP location using the measurements. The results are compared in Fig. C.3, where it is seen that the measured CoP follows the position of the calculated CoP. The measured y -coordinate diers with a maximum of 8 mm from the calculated and the measured z -coordinate diers with a maximum of 10 mm from the calculated. Thus, from the measurements it will possible to give a CoP within a radius of 10 mm from the actually CoP. As the foot is 124 mm 64.0 mm it is possible to use the measurement to ensure the CoP is within the PoS.
172
Test no. 1 2 3 4 5 6 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
m1 [g] 0 0 100 150 200 250 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 460 0 0 0 100 250 250 1000 0 100 0
m3 [g] 0 0 0 0 0 0 100 150 200 250 300 0 0 0 0 0 0 0 0 0 0 0 460 0 0 100 100 150 0 1000 0 200
m5 [g] 0 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1650 1650 1650 1650 1650 1650 1650 650 650 650 650
Fp,R1 [N] 0.374 1.90 2.59 2.93 3.27 3.82 2.39 2.66 2.90 3.12 3.40 1.55 1.41 1.22 0.834 0.365 1.74 1.61 1.55 1.49 1.40 6.21 5.90 0.007 2.59 4.63 5.57 5.78 7.64 6.74 1.39 1.57
Fp,R2 [N] 0.374 4.70 4.33 4.22 4.18 4.03 5.56 6.03 6.44 6.85 7.29 5.87 6.48 7.11 7.96 9.00 4.69 4.64 4.74 4.79 4.73 6.79 11.9 16.4 7.56 8.18 8.00 8.38 2.26 11.8 6.35 4.44
Fp,R3 [N] 0.374 1.68 2.62 3.13 3.57 4.35 1.47 1.40 1.29 1.16 1.07 1.08 0.770 0.474 0.450 0.478 2.16 2.39 2.65 2.91 3.16 6.93 1.60 0.499 5.36 3.53 4.96 4.78 9.93 0.798 0.493 6.05
Fp,R4 [N] 0.374 5.35 4.87 4.63 4.46 4.28 4.15 5.26 5.26 5.26 5.23 5.22 6.53 7.17 7.73 7.96 8.17 6.12 6.53 7.02 7.47 7.82 5.56 7.15 11.8 11.1 6.78 6.24 6.10 4.00 6.60 12.6
Table C.1: The masses placed on the foot along with the corresponding pressure
measurements. A total of 33 tests were conducted.
173
yCoP [mm]
Figure C.3: In the two gures the y - and z -coordinates are shown for the calculated and measured CoP respectively. The calculated CoP is found by determining the CoM of the arrangement, while the measured is determined from the pressure measurement.
zCoP [mm]
Appendix
Table D.1: Table of the pins on the ServopodTM where the dierent PWM signals
is connected to the servomotors.
The dierent feedback signals are connected in two dierent ways. Some of the signals, which is converted into a digital value, is sent through a serial interface using the Serial Peripheral interface (SPI) and some signals is simply connected directly to the ADC ports on the ServopodTM . Five ADC's with eighth ADC channels and SPI communication is placed on the robot. One on each foot, one on each hand and one in the torso. In order to connect to these chips ve chip selects is needed. PA0 to PA4 is used for this purpose. A table showing all the sensor signals sent via SPI is shown in Tab. D.2. The sensors signals connected directly to the ServopodTM and which pins they are connected to is seen in Tab. D.3. 174
175
Body Part Right Foot -||-||-||-||-||-||-||Left Foot -||-||-||-||-||-||-||Torso -||-||-||-||-||-||-||Right Arm -||-||-||-||Left Arm -||-||-||-||-
Channel CH0 CH1 CH2 CH3 CH4 CH5 CH6 CH7 CH0 CH1 CH2 CH3 CH4 CH5 CH6 CH7 CH0 CH1 CH2 CH3 CH4 CH5 CH6 CH7 CH0 CH1 CH2 CH6 CH7 CH0 CH1 CH2 CH6 CH7
Specic Sensor Strain Gauge Big Toe Strain Gauge Big Heel Strain Gauge Little Toe Strain Gauge Little Heel Acc Horizontal Plane Acc Frontal Plane Acc Sagital Plane Angle RL1 Strain Gauge Little Toe Strain Gauge Little Heel Strain Gauge Big Toe Strain Gauge Big Heel Acc Horizontal Plane Acc Frontal Plane Acc Sagital Plane Angle LL5 Gyro Horizontal Plane Gyro Frontal Plane Acc-Low-Res Sagital Plane Acc-Low-Res Horizontal Plane Acc-Low-Res Frontal Plane Acc-High-Res Frontal Plane Acc-High-Res Horizontal Plane Acc-High-Res Sagital Plane Acc Sagital Plane Acc Frontal Plane Acc Horizontal Plane Angle RA2 Angle RA3 Acc Sagital Plane Acc Frontal Plane Acc Horizontal Plane Angle LA2 Angle LA3
Table D.2: Table of the pins on the ServopodTM which the dierent sensors is
connected to. This table show where on the body the ADC is situated, which channel on the ADC the sensor is connected to, which specic sensor it is and which pin is used to chip select the ADC. `Acc' means the accelerometer and `Gyro' means the gyroscope. As the torso has both a high resolution and a low resolution accelerometer these are denoted Acc-High-Res and Acc-Low-Res respectively. Angle means the measurement from the potentiometer in the servomotors describing the angle of the servomotors.
176
Table D.3: Table of the pins on the ServopodTM with the dierent sensor signals
which is connected directly to the ServopodTM . Angle means the measurement from the potentiometer in the servomotors describing the angle of the servomotors.
D.2 IsoMax
Programming the ServoPodTM is achieved using a programming language called IsoMax. The architecture is called Virtual Parallel Machine Architecture which makes IsoMax ideal when programming real time programs when in need of parallel processes. This section will describe the fundamental idea behind IsoMax programming.
State: When in a state, no outputs or actions are taken. The only activity occurring
when the condition in a state is satised. Then will a transition happens. And when this has happened, it will return into a wait state. This means, the states in IsoMax is dierent wait states. In a state, no outputs are changed. If outputs need to be changed, the wait state is no longer valid. If no outputs need to be changed, the wait state is valid.
Transition: All processing actions take place during a transition from one state to
another. Transitions have four components. The rst component is the state with which they are associated. The second is the condition under which they cause transition. If the condition is met, the current wait is no longer valid. The transition becomes selected. The third part of a transition is the action. Once a condition is valid, actions must be performed. Often this requires processing and output manipulation. This action has normally no waiting component. The transition's action is done as fast as the available hardware can be made to run. The nal component of a transition is the vector, or destination of the transition. As soon as possible, all processing will be accomplished. Re-entry to a condition of real time waiting follows. Therefore, a transition always ends in another wait state.
The whole idea with IsoMax is to create numerous state-machines which is equally important in the sense that they are polled at the exact same frequency. This means that the programmer can create e.g. two state-machines controlling two dierent things. Before creating any state machine it is important to see what a state machine consists of. Every state-machine can consist of numerous states while a state-machine can o course only be in one state at a time. Every state consists of minimum one transition.
D.2. ISOMAX
177
This transition denes how to react and which state to jump to afterwards. Every transition consists of four distinct components as seen in Tab. D.4. One component, IN-STATE, which declares in which state the state-machine should be in before checking the CONDITION clause. This means that despite a state-machine can consist of numerous states, only one of these states is checked to see if a transition should occur. The CONDITION component declares when a transition should occur. When the CONDITION is true a transition occur. The CAUSES component simply causes the actions. This could be to turn o a LED, gather sensor information etc. The THEN-STATE denes which state to set the state-machine after the transition. IN-STATE state CONDITION clause CAUSES action THEN-STATE state
STATE OFF
WITHIN THRESHOLD
Figure D.1: These gures shows the principle of programming in IsoMax. The circles denote the STATEs in which no actions can be taken. The lines from one STATE too another denote the TRANSITIONs in which every action is taken.
The two state-machines in Fig. D.1 are polled at the same frequency. This means that the two machines are polled at e.g. 100 Hz and every time the machine is polled a wait criterion is checked. Depending on this wait criterion one of two things can happen. If the wait criterion is not true any more, a transition will not occur and if the wait criterion is true, a transition will occur, and it is only during a transition any action can be taken.
178
Lets rst of all see what happens when polling the state-machine called TEMP. If the temperature is within the threshold the CONDITION is not true and this state-machine stays in the WITHIN THRESHOLD state and nothing happens. When polling the statemachine DIODE nothing happens here either as the CONDITION clause in this statemachine is dependent on if the temperature is outside the threshold in the other statemachine. These two state-machines continue to be polled without any actions until the temperature rises or falls outside the threshold. When this happens the CONDITION in the state-machine TEMP is changed to true and this causes a transition where it either turns on the heater and jump to the TO-COLD state or it turns on AC (Air Condition) and jump to the TO-HOT state. Further more it changes a global variable called ERROR to true. This variable is used in the other state-machine DIODE as this variable is the CONDITION clause which forces a transition. When polling the state-machine DIODE again the CONDITION which takes the argument ERROR is true which causes the CONDITION to be true and this causes the state-machine to make a transition in which it turns on a LED and jump to the state ON. The state-machines stay in these two new states until the temperature is within the threshold again which makes the two state-machines return to their initial states. DIODE turn o the LED and TEMP waits for the temperature to go outside the threshold. This simple example shows some of the benets of IsoMax. It is simple to construct numerous state-machines which coexist with the same CPU running as parallel processes. Further more implementing the state-machine diagram as real IsoMax code is simple. As an example the DIODE state-machine is converted. Two states consist within this state-machine, ON and OFF state. In Tab. D.5 the state-machine has been translated from the ow chart in Fig. D.1 into an actual IsoMax program. As seen in Tab. D.5 the same CONDITION clause is used in both states. If the error becomes true when in the o state a transition occur and if the error becomes not true when in the on state a transition occur. IN-STATE o CONDITION error CAUSES LED on THEN-STATE on IN-STATE on CONDITION not error CAUSES LED o THEN-STATE o
179
ited. Hence, it is important to be able to send and receive data to and from an external PC. This can be used for both logging purposes and for making more computationally intensive controllers. The robot is connected to an external PC with a serial cable. The function of the ServoPodTM in this situation is to gather sensor signals from the numerous sensors on the robot and send this data to the external PC. This PC is running a controller and sends back the actuator signals to the ServoPodTM which nally sends the actuator signals to the respective servomotors. A ow chart of the program is seen in Fig. D.2.
380Hz 76Hz
Figure D.2: Flow chart of the program when the ServoPodTM is congured with
the second conguration.
As seen in Fig. D.2, two state-machines are created in this routine. One state-machine gathers sensor signals at 380 Hz. This sampling frequency chosen to avoid aliasing, as the analog lters implemented has a cut o frequency of 156 Hz. This means that the sample frequency should be at least 312 Hz. As the servomotors is updated at 76 Hz and due to the way IsoMax is structured, the sample frequency is chosen as ve times 76 Hz = 380 Hz. The second state-machine performs several tasks. It averages over ve samples from the sensors. This constitutes a lter with the digital transfer function 1/(0.2z + 0.2z 1 + 0.2z 2 + 0.2z 3 + 0.2z 4 ). A bode plot of this lter is seen in Fig. D.3. The averaged samples are sent to the external PC. Also, it receives the new actuator signals from the external PC and sends these to the respective servomotors. This routine is executed at 76 Hz as mentioned earlier as this is the maximum update frequency.
180
Bode Diagram 0 System: sysz Frequency (rad/sec): 214 Magnitude (dB): 2.99
50
100
10 10 Frequency (rad/sec)
10
181
ATLX-ATLZ Accelerometer Torso High Sensitivity X-Y-Z SLBT,SRBT Strain Gauge Left/Right Big Toe SLLT,SRLT Strain Gauge Left/Right Little Toe SLBH,SRBH Strain Gauge Left/Right Big Heel SLLH,SRLH Strain Gauge Left/Right Little Heel ARFX-ARFZ Accelerometer Right Foot X-Y-Z ALFX-ALFZ Accelerometer Left Foot X-Y-Z ARHX-ARHZ Accelerometer Right Hand X-Y-Z ALHX-ALHZ Accelerometer Left Hand X-Y-Z Trailer Trailer byte (0xF0)
Table D.6: Packet format used for serial transmission from the ServoPodTM to an
external computer.
2 SRA1 12 SRL1 22
3 SRA2 13 SR2 23
4 SRA3 14 SRL3 24
5 SRA4 15 SRL4 25
6 SRA5 16 SRL5 26
7 SLA1 17 SLL1 27
8 SLA2 18 SLL2 28
9 SLA3 19 SLL3 29
10 SLA4 20 SLL4 30
Header Header byte (0xF0) SRA1-SRA5 Servomotor Right Arm 1-5 SLA1-SLA5 Servomotor Left Arm 1-5 SRL1-SRL5 Servomotor Right Leg 1-5 SLL1-SLL5 Servomotor Left Leg 1-5
Table D.7: Packet format used for serial transmission from an external computer
to the ServoPodTM .
182
190Hz
Any data at the receive buffer yes Reset counter Put data into buffer
no
Reset counter
Received 19 bytes no Send new angles to servos Received stop byte yes
yes
no
Figure D.4: Flow chart of the routine receive 19 bytes from an external PC via
RS232 where the last byte is a stop byte.
183
184
7000
7200
7400
7600
7800
8000
8200
8400
8600
7000
7200
7400
7800
8000
8200
8400
Figure D.6: Resulting angle of servomotor when applying dierent duty cycles to
the servomotor. The duty cycle is denoted as used with IsoMax.
As the servomotors are not mounted mechanically in the exactly same position, dierent duty cycles orient the dierent servomotors to the robots centre position. These duty cycles has been found using trial and error simply by adjusting the duty cycle until a satisfying result is obtained. The osets are seen in Tab. D.8. Servomotor LL5 LL4 LL3 LL2 LL1 LA1 LA2 LA3 LA4 Oset 7450 7440 7640 7300 7000 7950 5100 7500 9850 Servomotor RL5 RL4 RL3 RL2 RL1 RA1 RA2 RA3 RA4 Oset 7580 7700 8100 7400 7300 8100 9100 7100 5200
Table D.8: Osets for the dierent servomotors positioning them in centre position.
These results enable the creation of a mapping function from the desired angle of the servomotors to the actual duty cycle which should be applied to the servomotors. As an example servomotor LL5 will be used. From Eq. (D.2) it can be seen that changing the duty cycle by 22.7 results in a change in angle of one degree. This enables an easily mapping function: ang 22.7 + 7450 = duty (D.3)
185
3000
1600 1500
ADC Value
2500
1400 1300
2000
1200 1100
1500 6500
8500
1000 6000
9000
Figure D.7: ADC values from corresponding duty cycles. The rst column shows
the measurements from the Hitec HSR-5995TG servomotor whilst the second column shows the measurements from the Hitec HS-645MG servomotor. The rst row shows the measurements using the ADC in the ServoPodTM whilst the second row shows the measurements using the MCP3208.
As it is seen in Fig. D.7 four tests have been performed as there are two dierent servo-
186
motors and two dierent ADC's. As seen in Fig. D.7 the functions are approximately linear. These function has been found using Matlab and are listed below. The function mapping a duty cycle applied to the Hitec HSR-5995TG to the ADC in the ServoPodTM , as seen in Fig. D.7a: adc = 5.8 duty + where is the oset of the dierent servomotors. The function mapping a duty cycle applied to the Hitec HSR-5995TG to the MCP3208, as seen in Fig. D.7b: adc = 0.7 duty + (D.5) where is the oset of the dierent servomotors. The function mapping a duty cycle applied to the Hitec HS-645MG to the ADC in the ServoPodTM , as seen in Fig. D.7c: adc = 1.5 duty + where is the oset of the dierent servomotors. The function mapping a duty cycle applied to the Hitec HS-645MG to the MCP3208, as seen in Fig. D.7d: adc = 0.2 duty + (D.7) where is the oset of the dierent servomotors. In order to calculate the exact mapping function the ADC value when the robot is in its center position the ADC has been logged. These values are seen in Tab. D.9: Servo LL5 LL4 LL3 LL2 LL1 LA1 LA2 LA3
position.
(D.4)
(D.6)
Table D.9: ADC osets for the dierent servomotors when positioned in center
A mapping function from the ADC value to the actual angle can be created using the test results. As an example the LL5 servomotor is used. This servomotor has feedback through an MCP3208. First of all the oset is calculated:
(D.8)
(D.9)
And a combination of Eq. (D.3) and Eq. (D.9) gives the desired mapping function from the digital ADC values to the actual angle: ang = adc 7262 7450 /22.7 0.7 (D.10)
187
The test should have been performed on each and every servomotor resulting in an exact mapping function for every servomotor. But tests showed that the gain of the functions were the same for every servomotor but with dierent osets. This meant that the same function could be used for every servomotor with an oset adjustment.
Servo
70
ml
l=10.2 cm ml
Table D.10: Table summarizing the results of the test with various loads given to
The tests show clearly, that there is a strong dependency between load and the performance of the servomotor. The performance regarding position error, maximal velocity and maximal acceleration is deteriorating as the load is increased. Especially at loads which are close to the stall torque.
188
Positions at various loads 3 Pos. [rad] 2 1 3 Pos. [rad] 2 1 3 Pos. [rad] 2 1 3 Pos. [rad] 2 1 X: 0.001 Y: 2.883 X: 1.201 Y: 1.83 X: 0.001 Y: 2.77 0 0.2 0.4 0.6 0.8 X: 1.201 1 Y: 1.612 1.2 X: 0.001 Y: 2.745 0 0.2 0.4 0.6 0.8 X: 1.201 1 Y: 1.556 1.2 X: 0.001 Y: 2.664 0 0.2 0.4 0.6 0.8 1 X: 1.201 Y: 1.455
1.2
0.2
0.4
0.8
1.2
Velocities at various loads 2 0 2 4 6 8 2 0 2 4 6 8 2 0 2 4 6 8 2 0 2 4 6 8 Vel. [rad/s] X: 0.222 Y: 6.912 0 0.2 0.4 0.6 0.8 1 1.2
Vel. [rad/s]
0.6
0.8
1.2
Vel. [rad/s]
0.2
0.6
0.8
1.2
Vel. [rad/s]
189
Accelerations at various loads Acc. [rad/s2] 100 0 100 100 0 100 100 0 100 100 0 100 X: 0.163 Y: 62.57 X: 0.151 Y: 74.15 0 0.2 0.4 0.6 0.8 1 1.2 X: 0.144 Y: 96.91 0 0.2 0.4 0.6 0.8 1 1.2
Acc. [rad/s2]
Acc. [rad/s2]
0.2
Acc. [rad/s2]
0.6
0.8
1.2
0.2
0.4
0.8
1.2
190
ADCs are not strictly necessary, as this can be done by external hardware linked to the microprocessor via a serial bus (as done for the strain gauges). However, the inclusion of ADCs on the processor board would decrease the amount of external components and decrease development time. Immediate availability of the board is of great importance as waiting time would result in lost project time. Therefore the board should be obtainable within one week.
The candidates
Having looked around on the net, the following candidates have been selected.
Newmicros ServoPod
The ServoPod is a microcontroller board designed for control of a large amount of servomotors. It includes 26 PWM outputs for servomotor control. Apart from this, it has SPI and I2C serial buses. 16 General purpose I/O ports. 2 RS232 and a CAN bus, 16 channel 12-bit A/D and H-bridge, timers and quad encoders. All in all, more than sucient I/O, and most importantly, on-board connectors for all the servomotors. The processor is a DSP56F807 16-bit DSP running at 80 MHz giving 40 MIPS. The connection to the board is achieved using either a RS232 or a USB connection. Also, a JTAG connector is included. The board size is 5.9 7.7 cm for the RS232 version and 5.9 10.2 cm for the USB version. The board is programmed using a language called IsoMax, which is optimized for embedded real time applications. However, it is also possible to ash the processor with custom compiled programs from other languages using the JTAG interface. This board is available from USA, delivery time approximately 1 week.
nanoLIAB
The nanoLIAB is an embedded Linux platform with an Atmel AT91RM9200 microprocessor and Ethernet. The processor includes RS-232 serial communication, USB, PIO, I2C, SPI and 18 general purpose I/O ports.
191
Programming is done using an ARM cross compiler delivered with the board. Programming languages includes c and c++. LIAB is situated in Stvring, Denmark, delivery time 1 day.
Choice of Board
The Mini Atom Bot board was opted out because of lack of features. The nanoLIAB and ServoPod had way more functionality without having larger board sizes. The nanoLIAB was available from Denmark and had an Ethernet connection. The Ethernet allowed easy data logging and monitoring. Also, the on-board Linux distribution allows having numerous tools. The nanoLIAB ARM processor is faster than the one on the ServoPod. The ServoPod is able to control up to 26 RC servomotors at a time. It also has on-board ADCs to interface with sensors. When comparing the ServoPod and the nanoLIAB boards, no board had a clear advantage over the other, hence, the boards were chosen according to availability. At the time of purchase, the nanoLiab was not available, so the ServoPod was ordered. However, a nanoLiab board became available while the ServoPod was shipping, so a nanoLiab was also purchased. By having two boards, the one oering the simplest implementation and interfacing or oering the best features could be determined by hands-on experiences.
ServoPod
The ServoPod was easy to set up using the RS232 cable. Programming in IsoMax proved very easy, and interfacing with the servomotors and ADCs was extremely easy. The PWM ports on the ServoPod had the quirk that the minimum frequency obtainable was 76 Hz, and not 50 Hz as required by the servomotors. This can be overcome by halving the speed of the CPU. However, testing the servomotors with a PWM period of 76 Hz proved that they still work when given signals with this period. Preliminary tests of the real-time performance showed that the ServoPod with IsoMax was able to run a routine with regular intervals without much jitter or delay.
nanoLiab
Connecting to the nanoLiab was easy using both a telnet connection to the on-board Ethernet or the RS232 connection. Both methods yielded a login prompt to the onboard Linux distribution. Programming for the nanoLiab was done on a host Linux computer using the crosscompiler on the nanoLiab CD-ROM. Accessing the microprocessor SPI ports and I/O must be done in kernel-mode, so kernel module programming is necessary. The LED and button module supplied by Liab is an easy to understand example on reading and writing to registers on the nanoLiab. The source for this module is included. However, Linux kernel module programming was considered too time-consuming a task compared to using the IsoMax language available on the ServoPod. Hence, the ServoPod was chosen as microprocessor board.
192
Data Treatment
In this section the data from the accelerometer test is tted with a sine wave. As there are 5 accelerometers which each measure in 3 dimensions this leads to 15 tests. The crosses in Fig. D.12 through Fig. D.15 denotes the actual measured values from the accelerometer whilst the solid line is the tted sine curve.
Output from accelerometer Right Foot XRL1 4000 3000 2000 1000 100 4000 3000 2000 1000 100 Left Foot XLL5
100
100
100
o
100
o
gravity is perpendicular to the sensor and 0 is when the gravity is parallel to the sensor. The title denotes which limb the accelerometers in placed on and which axis it measures in.
Figure D.12: Test results from the accelerometer test. 90 is the situation when
193
Right Foot YRL1 4000 3000 2000 1000 100 4000 3000 2000 1000 100
100
100
100
100
Figure D.13: Test results from the accelerometer test. 90 is the situation when
gravity is perpendicular to the sensor and 0 is when the gravity is parallel to the sensor.'
Right Hand XRA5 4000 3000 2000 1000 100 4000 3000 2000 1000 100
100
100
100
100
Figure D.14: Test results from the accelerometer test. 90 is the situation when
gravity is perpendicular to the sensor and 0 is when the gravity is parallel to the sensor.'
194
Torso Y RL5 4000 3000 2000 1000 100 4000 3000 2000 1000 100
Torso ZRL5
0 Torso XRL5
100
100
100
o
gravity is perpendicular to the sensor and 0 is when the gravity is parallel to the sensor.'
Figure D.15: Test results from the accelerometer test. 90 is the situation when
Using fminsearch in Matlab lead to the functions describing the accelerometer output when applied varying angles with respect to the gravity, as seen in Tab. D.11. In order to measure the acceleration instead of the tilt a linear mapping is constructed from the same test giving the functions in Tab.D.11. The output is measured at dierent 2 accelerations thus giving an ADC value when the acceleration is 0 m/s and a gain. In order to calculate the actual acceleration a formula describing the ADC value with respect to the analogue input to the ADC is found from the data sheet [19]: ADC 3.3 = Vin 4096 (D.11)
Knowing the input voltage from the accelerometer the gain can be calculated as the ADC value is known for 0 g and for 1 g . These measurements are shown in Tab. D.12. From Tab. D.12 linear function are easily constructed which maps the ADC output to an acceleration. The reason for not showing it for the right leg is that it is always the supporting foot thus there are no acceleration seen from that foot.
195
Placement RF RF RF LF LF LF RH RH RH LH LH LH T T T
Direction zRL1 yRL1 xRL1 zLL5 yLL5 xLL5 zRA5 yRA5 xRA5 zLA5 yLA5 xLA5 zRL5 yRL5 xRL5
Function y = 2031.042 + 1033.496 sin(0.0189 x) y = 2075.477 996.9887 sin(0.0178 x) y = 2130.1321 + 972.2518 sin(0.0194 x) y = 1976.379 + 1045.9388 sin(0.0188 x) y = 2133.3736 993.0082 sin(0.0185 x) y = 2146.863 + 995.2353 sin(0.0192 x) y = 2096.153 + 997.7545 sin(0.0163 x) y = 2002.4211 + 982.9864 sin(0.0173 x) y = 2019.1428 1017.7454 sin(0.0164 x) y = 2187.0183 1002.2872 sin(0.0180 x) y = 1983.1052 + 1003.8638 sin(0.0169 x) y = 2111.381 994.0982 sin(0.0175 x) y = 2213.3254 967.4174 sin(0.0170 x) y = 2121.1372 996.5332 sin(0.0165 x) y = 2002.6223 989.073 sin(0.0170 x)
Table D.11: Mapping functions for the 15 dierent accelerometers mapping the output from the accelerometer into an angle in the specied direction. The four dierent placements: Right Foot (RF), Left Foot (LF), Right Hand (RH), Left Hand (LH), Torso (T). The directions of the accelerations is dened by the coordinate systems in Fig. 8.3
Placement LF LF LF RA RA RA LA LA LA T T T
Direction xLL1 yLL1 zLL1 xRA5 yRA5 zRA5 xLA5 yLA5 zLA5 xRL5 yRL5 zRL5
0g 2136 2144 1964 2012 2003 2095 2012 2003 2095 2002 2113 2121
Gain [ADC/g ] 993 993 1043 1018 981 993 1018 981 993 981 956 993
Table D.12: ADC values for 0g and gain for the accelerometers. The four dierent placements: Left Foot (LF), Right Hand (RH), Left Hand (LH), Torso (T). The directions of the accelerations is dened by the coordinate systems in Fig. 8.3
196
10
10
10
10
Figure D.16: Strain gauge measurements from the right foot. The gure shows the
output from the strain gauges when applying a varying force.
As seen in the gures the functions can be approximated with a linear function for all the strain gauges. As mentioned only the slope of the function is useful from this test as the o-set is varying every time the robot has been walking. The functions is seen in Tab. D.13. Placement RBH RLH RBT RLT LBH LLH LBT LLT Function y = 106 x + y = 135 x + y = 106 x + y = 131 x + y = 140 x + y = 154 x + y = 140 x + y = 126 x +
Table D.13: The eight functions describing the relationship between the applied
force on the strain gauges to the output from the strain gauges. The rst letter in the placement denotes the foot, R for right and L for left and the following letters is Big Heel (BH), Little Heel (LH), Big Toe (BT) and Little Toe (LT).
197
Right Little Heel Output from ADC 3000 2000 1000 0 3000 2000 1000 0
10
10
10
10
Figure D.17: Strain gauge measurements from the right foot. The gure shows the
output from the strain gauges when applying a varying force.
Accelerometer PCB
The print circuit board (PCB) for the wrist can be found in gure D.20. This board is a double layer print, to ensure small physical size of the board. The PCB board for the foot is found in gure D.21. This board is also a double layer print to ensure small physical size. The accelerometer PCB board for the torso is found in gure D.22. This board is also a double layer print to ensure small physical size.
198
ADC1 1 2 3 4 5 6 7 8 9 10 CON10 POWER 1 2 CON2 ADC2 1 2 3 4 5 6 7 8 9 10 CON10 JTAG 1 2 3 4 5 6 7 8 9 10 CON10 1 2 3 4 5 6 7 8 9 10 CON10 J8 C9 1n C10 1n C11 1n C12 1n C13 1n C14 1n C15 1n C16 1n R11 R12 1k R14 1k R17 1k 1k R13 1k R16 1k 1k R15 1k R18 1 2 3 4 5 6 7 8 9 10 VCC 1 2 CON2 R3 R4 1k R6 1k R9 1k 1k POWER C1 1n C2 1n C3 1n C4 1n C5 1n C6 1n C7 1n C8 1n R5 1k R8 1k 1k R7 1k R10 1 2 3 4 5 6 7 8 9 10
J5
CON10
J6
CON10
199
(a)
(b)
Figure D.20: The accelerometer PCB in the wrist. Figure a is the PCB board from button and b is the board from top
(a)
from top
(b)
Figure D.21: The accelerometer PCB in the foot. Figure a is from button and b is
(a)
(b)
Figure D.22: The accelerometer and gyroscope PCB in the body. Figure a is from button and b is from top
This is done using an xPC setup, where the real-time processing of the Simulink model is done on a dedicated PC while the development of the Simulink model is done on a host computer. The setup is seen in Fig. D.23. The structure of the Simulink model is seen in Fig. D.24. It includes the following sub-blocks. 1. A send and receive block receives the data from the microprocessor and splits the data packet up into the various sensor data. This block outputs the raw data from each sensor. It also formats the servomotor angle input data into a packet, and sends it to the microprocessor. 2. A sensor model block, which translates the raw data into physical values such as ZMP position and tilt. The outputs from this block are the tilt of the limbs and the ZMP of the robot. 3. A controller block, which uses the feedback from the sensors to ensure stability of the robot. It also gets the trajectories and ZMP references which have been generated o-line. The output from this block is the angles given to the servomotors. The main block also logs all the data received from and sent to the microprocessor.
200
Host computer
Figure D.23: The interface between the robot, the xPC target and the host computer.
Raw data
Sensor information
Controller block
Appendix
Servomotor model
In this appendix, models of the servomotors are developed. As the specications regarding the internal structure of the servomotors are unavailable, it is chosen to regard them as a closed system, and determine their dynamic response using a system-identication approach. In [Brennan, 1999] it is concluded that RC servomotors can be approximated by a second order system with a rate-limitation and dead-zones. The rate-limitations refer to the maximal velocity and acceleration of the servomotor. The dead-zone is incorporated into the internal servomotor controller to avoid the DC motor to be constantly activated. In [rts et al., 2006], the servomotors are modeled as acceleration limited, velocity limited rst order systems with no dead-zones. According to the data-sheets for the servomotors, the dead-zones for the HS-645MG and HSR-5995TG are 8 s and 2 s, respectively. This translates to a dead-band of 8 45/400 = 0.9 and 2 90/400 = 0.45 , respectively. Hence, with the addition of dead-zones and a delay, it was found that this servomotor model approximates the real servomotors suciently. Hence, this approach is used instead of a second-order system. A Simulink model is seen in Fig. E.1. Using a state-space representation, the model is:
A xk + B uk 1 Ts 0 c 0 0 0 1 0 0 1/Ts 1/Ts
k 0 0 k c 0 k-1 + 0 ref 0 k 0 0
C xk+1 1 0 0 1 0 0 0 0 0
where xk , yk and uk are the states, the outputs and the inputs at time k and A is the system matrix, B is the input matrix and C is the output matrix. 201
202
In [rts et al., 2006], nothing is written about a test comparing the model to the actual responses of the servomotors. Parameters regarding maximal velocity can be found in data sheets, but there is no documentation about where the maximal acceleration of the servomotors or the c parameter describing the behaviour of the rst order system have been obtained. It was found out verbally, that the parameters were obtained experimentally. However, to ensure the correctness of the servomotor model other tests will be performed here and documented to verify the data sheet values as well as produce experimentally based parameters for the model.
0 HS5995TG model Constant RT Rate Transition Product Add Dead band switch 15 Constant2 K*u Gain |u| Abs 1 theta 1 z Unit Delay Saturation Rate Limiter RT Rate Transition1 K*u Transport Delay Gain1 2 thetadot 3 thetadotdot
1 theta_ref
0.1
0.2
0.3
0.4
0.1
0.2
0.3
0.3
0.4
0.2
0.3
100
0.4
200
0 X: 0.086 Y: 156.2
0.2
0.3
Figure E.2: Positions, velocities and accelerations of the two servomotors given a
45 step.
Analyzing the step responses, it is seen that the HS-645MG has a maximal velocity of
203
5.213 rad/s positively. This corresponds well with the data sheet value of 5.235 rad/s which is used in the model. This correspondence adds to the verication of the test. 2 The maximal acceleration is found to be 96.61 rad/s . As there are no data sheet values of the acceleration, this value is used in the model.
The HS-5995TG has a maximal velocity of 7.6 rad/s, which is somewhat larger than the data sheet value of 6.98 rad/s. Even though the measured value is 8.2% larger than the data sheet value the relatively small dierence validates the test suciently. The value obtained from the test is used in the model. The maximal acceleration is found to be 2 156.2 rad/s . As there are no data sheet values of the acceleration, this value is used in the model. With the maximal acceleration and velocity determined, the delay and the rst order approximation are determined by supplying a step of increasing magnitude to the servomotors, and tting the parameters to give the best estimate of the response. It was found, that a delay of 0.021 ms for both models and a c parameter of 25 and 15 for the HS-645MG and the HSR-5995TG respectively gave an adequate t. The measured values and the model response with tted parameters is seen in Fig. E.3. Details in the signal edges can be seen in Fig. E.4 and Fig. E.5.
Hitec HS645MG Servomotor Response vs. Model Position [rad] 0.6 0.5 0.4 2 Position [rad] 0.04 0 0.04 2 Position [rad] 3 4 5 6 7 8 Hitec HSR5995TG Servomotor Response vs. Model 9 3 4 5 6 7 8 Hitec HS645MG Servomotor Response vs. Model Error 9
0.8 0.7 0.6 2 3 4 5 6 7 8 Hitec HSR5995TG Servomotor Response vs. Model Error 9
Position [rad]
Figure E.3: Increasing pulse response of the servomotors. The dashed line is the
model response and the solid line is the response of the servomotor. The dotted boxes shows the areas plotted in Fig. E.4 and Fig. E.5.
204
Hitec HS645MG Servomotor Response vs. Model Position [rad] 0.5 0.45 2.02 Position [rad] 0.52 0.5 0.48 0.46 0.44 0.42 3 Position [rad] 0.55 0.5 0.45 0.4 0.35 8.02 0.55 0.5 0.45 0.4 0.35 9 9.02 9.04 9.06 9.08 9.1 Time [s] 9.12 9.14 9.16 9.18 3.02 3.04 3.06 3.08 3.1 3.12 3.14 3.16 3.18 2.04 2.06 2.08 2.1 2.12 2.14 2.16
8.04
8.06
8.08
8.1
8.12
8.14
8.16
8.18
8.2
Figure E.4: Hitec HS-645MG increasing pulse response details. The dashed line is
the model response and the solid line is the response of the servomotor.
Position [rad]
205
Hitec HSR5995TG Servomotor Response vs. Model Position [rad] 0.76 0.74 0.72 0.7 0.68 2 Position [rad] 0.75 0.7 0.65 3.02 Position [rad] 0.8 0.7 0.6 8 Position [rad] 0.8 0.7 0.6 9.05 9.1 9.15 Time [s] 9.2 9.25 8.05 8.1 8.15 8.2 8.25 3.04 3.06 3.08 3.1 3.12 3.14 3.16 3.18 3.2 3.22 2.05 2.1 2.15 2.2 2.25
Figure E.5: Hitec HSR-5995TG increasing pulse response details. The dashed line
is the model response and the solid line is the response of the servomotor.
Appendix
Angular Velocity
i+1 +1 i i+1 i+1 i+1 = i z i R i + i+1
(F.1)
i = 0...4:
1 rl0 rl1 rl1z rl1 rl1 = rl rl0 + rl0R . . . rl5 rl5 rl5z rl5 rl5 = rl5R rl4 rl4 +
rl1 rl4
Angular Acceleration
i+1 +1 i +1 i i+1 i+1 i+1z i+1 = i i+i i+1 + i+1 z i R i R i i+1
(F.2)
i = 0...4:
rl1
1 rl0 1 rl0 rl1 rl1z rl1 rl1z rl1 = rl rl0 + rl rl1 + rl1 rl0 rl0R rl0R . . . rl5 rl5 rl5z rl5 rl5z rl5 = rl5R rl4 rl4 + rl5R rl4 rl4 rl5 + rl5
rl4 rl4
206
207
Linear Acceleration
i+1 +1 i i+1 = i i ipi+1 + i i i i ipi+1 +i v i v i R
(F.3)
i = 0...4:
rl1
rl0
rl0
rl5
rl4
rl4
0 rl5 ll0 = ll rl5 rl5R 0 rl5 ll0 = ll rl5 rl5R 0 ll0 = ll v rl5R
rl5
ll0
rl5
0 rl5 ra0 = ra rl5 rl5R 0 rl5 ra0 = ra rl5 rl5R 0 ra0 = ra v rl5R
rl5
ra0
rl5
la0
0 la0 = la v rl5R
rl5
rl5
208
Angular Velocity
i = 1...5:
ll1
1 ll0 ll1 ll1z ll1 ll1 = ll ll0 + ll0R . . . ll5 ll5 ll5z ll5 ll5 = ll5R ll4 ll4 +
ll4
Angular Acceleration
i = 1...5:
ll1
1 ll0 1 ll0 ll1 ll1z ll1 ll1z ll1 + ll1 ll1 = ll ll0 + ll ll0 ll0R ll0R . . . ll5 ll5 ll5z ll5 ll5z ll5 = ll5R ll4 ll4 + ll5R ll4 ll4 ll5 + ll5
ll4 ll4
Linear Acceleration
i = 1...5:
ll1
ll0
ll0
ll5
ll4
ll4
Ci =i i ipCi + i i i i ipCi +i v i v
(F.4)
i = 1...5 :
ll1
Cll1 =ll1 ll1 ll1pCll1 + ll1 ll1 v . . . Cll5 =ll5 ll5 ll5pCll5 + ll5 ll5 v
ll1
ll5
ll5
(F.5)
ll1
Cll1 v
ll5
ll5
Cll5 v
209
(F.6)
ll1
ll1
ll1 + ll1 ll1 Cll1I ll1 ll5 + ll5 ll5 Cll5I ll5
ll1
ll5
ll5
ll5
ll5
(F.7)
i = 5...1 :
ll5
ll1
(F.8)
i = 5...1 :
ll5
5 ll6 5 ll6 nll5 = ll5N ll5 + ll nll6 + ll5pCll5 ll5F ll5 + ll5pll6 ll f ll6 ll6R ll6R . . .
ll1
1 ll2 1 ll2 nll1 = ll1N ll1 + ll nll2 + ll1pCll1 ll1F ll1 + ll1pll2 ll f ll2 ll2R ll2R
210
Angular Velocity
i = 1...5:
ra1
1 ra0 ra1 ra1z ra1 ra1 = ra ra0 + ra0R . . . ra5 ra5 ra5z ra5 ra5 = ra5R ra4 ra4 +
ra4
Angular Acceleration
i = 1...5:
ra1
1 ra0 1 ra0 ra1 ra1z ra1 ra1z ra1 = ra ra0 + ra ra1 + ra1 ra0 ra0R ra0R . . . ra5 ra5 ra5z ra5 ra5z ra5 + ra5 ra4 + ra5R ra4 ra4 ra5 = ra5R ra4
ra4 ra4
Linear Acceleration
i = 1...5:
ra1
ra0
ra0
ra5
ra4
ra4
Cra1 =ra1 ra1 ra1pCra1 + ra1 ra1 v . . . Cra5 =ra5 ra5 ra5pCra5 + ra5 ra5 v
ra1
ra5
ra5
ra1
Cra1 v
ra5
ra5
Cra5 v
211
ra1
ra1 + ra1 ra1 Cra1I ra1 ra5 + ra5 ra5 Cra5I ra5
ra1
ra1
ra5
ra5
ra5
ra5
5 ra6 f ra5 = ra5F ra5 + ra f ra6 ra6R . . . 1 ra2 f ra2 f ra1 = ra1F ra1 + ra ra2R
ra1
5 ra6 5 ra6 nra5 = ra5N ra5 + ra nra6 + ra5pCra5 ra5F ra5 + ra5pra6 ra f ra6 ra6R ra6R . . . 1 ra2 1 ra2 nra1 = ra1N ra1 + ra nra2 + ra1pCra1 ra1F ra1 + ra1pra2 ra f ra2 ra2R ra2R
ra1
212
Angular Velocity
i = 1...5:
la1
1 la0 la1 la1z la1 la1 = la la0 + la0R . . . la5 la5 la5z la5 la5 = la5R la4 la4 +
la4
Angular Acceleration
i = 1...5:
la1
1 la0 la1 la0 la1 la1z la1 la1z la1 = la la0 + la la1 + la1 la0 la0R 0R . . . la5 la5 la5z la5 la5z la5 + la5 la5 = la5R la4 la4 + la5R la4 la4
la4 la4
Linear Acceleration
i = 1...5:
la1
la0
la0
la5
la4
la4
Cla1 =la1 la1 la1pCla1 + la1 la1 v . . . Cla5 =la5 la5 la5pCla5 + la5 la5 v
la1
la5
la5
la1
Cla1 v
la5
la5
Cla5 v
la1
la1 + la1 la1 Cla1I la1 la5 + la5 la5 Cla5I la5
la1
la1
la5
la5
la5
la5
213
5 la6 f la5 = la5F la5 + la f la6 la6R . . . 1 la2 f la1 = la1F la1 + la f la2 la2R
la1
la1
Crl5 v
rl5
rl5
I torso
rl5
rl5
214
Non-Supporting Leg
ll0 ll0
0 f ll0 = ll ll1R
ll0 ll1
ll1 ll1
f ll1 nll1
nll0 =
Right Arm
ra0 ra0
0 f ra0 = ra ra1R
ra0 ra1
ra1 ra1
f ra1 nra1
nra0 =
Left Arm
la0 la0
0 f la0 = la la1R
la0 la1
la1
f la1 nla1
nla0 =
la1
5 ll0 5 ra0 5 la0 f rl5 = rl5F rl5 + rl f ll0 + rl f ra0 + rl f la0 ll0R ra0R la0R 5 ll0 + rl5pCrl5 rl5F rl5 + rl5pll0 rl f ll0 ll0R
5 ll0 5 ra0 5 la0 nrl5 = rl5N rl5 + rl nll0 + rl nra0 + rl nla0 ll0R ra0R la0R 5 ra0 5 la0 + rl5pra0 rl f ra0 + rl5pla0 rl f la0 ra0R la0R
Crl1 =rl1 rl1 rl1pCrl1 + rl1 rl1 v . . . Crl5 =rl5 rl5 rl5pCrl5 + rl5 rl5 v
rl1
rl5
rl5
215
rl1
Crl1 v
rl5
rl5
Crl5 v
rl1
rl1 + rl1 rl1 Crl1I rl1 rl5 + rl5 rl5 Crl5I rl5
rl1
rl1
rl5
rl5
rl5
rl5
4 rl5 f rl5 f rl4 = rl4F rl4 + rl rl5R . . . 1 rl2 f rl2 f rl1 = rl1F rl1 + rl rl2R
rl1
4 rl5 4 rl5 f rl5 nrl4 = rl4N rl4 + rl nrl5 + rl4pCrl4 rl4F rl4 + rl4prl5 rl rl5R rl5R . . . 1 rl2 1 rl2 nrl1 = rl1N rl1 + rl nrl2 + rl1pCrl1 rl1F rl1 + rl1prl2 rl f rl2 rl2R rl2R
rl1
Appendix
Lagrange
In this chapter all the calculations and simplications needed in the Ch. 10 are written out to enable the reader to go through them if desired.
R R rl2prl3,org 0 rl1 rl2 rl3 prl4,org = prl3,org + rl prl4,org rl1R rl2R rl3R rl0 rl1 rl2 rl3 prl5,org = prl4,org + rl1R rl2R rl3R rl4R rl4prl5,org 0 rl1 rl2 rl3 rl4 rl5 0 rl5 pll1,org = prl5,org + rl pll0,org = rl pll0,org rl1R rl2R rl3R rl4R rl5R rl5R 0 rl5 ll0 ll1 pll2,org = pll1,org + rl pll2,org rl5R ll0R ll1R rl0 rl5 ll0 ll1 pll3,org = pll2,org + rl5R ll0R ll1R ll2R ll2pll3,org 0 rl5 ll0 ll1 ll2 ll3 pll4,org = pll3,org + rl pll4,org rl5R ll0R ll1R ll2R ll3R rl0 rl5 ll0 ll1 ll2 ll3 pll5,org = pll4,org + rl5R ll0R ll1R ll2R ll3R ll4R ll4pll5,org
rl0 rl1 rl1 rl2
rl1
prl2,org
Only three points in the each arm is of interest since this is sucient to describe the torque which the arms do aect the whole biped with. These points are the rst two joints in the shoulders and the mass center for the entire arm. These points are found from the {RL5} frame in the supporting leg using the rotation matrices from the kine216
217
XCoM,ra 0 rl5 ra0 ra1 YCoM,ra = pra2,org + rl rl5R ra0R ra1R ra2R ZCoM,ra
la0 la0 la1 rl0 rl5
rl5 ra0
R ra1pra2,org
pra1,org
XCoM,la 0 rl5 la0 la1 YCoM,la = pla2,org + rl rl5R ra0R la1R la2R ZCoM,la
R R R la1pla2,org
rl5 la0
pla1,org
pCoM,t
To make these expressions useful they must be written out in their fully length, and simplied. The simplication is manly based on that the expressions contain a lot of redundant information to describe a gait cycle, which can be cut away. E.g. does some joints turn within a limited set of angles when walking, and enabling small angle approximations. Further does some lengths contributes with little information on the position as a whole, and hence can be neglected. To make the following expressions more foreseeable has the following notation been used.
rl =rl2 + rl3 + rl4 ll1+ =rl2 + rl3 + rl4 + ll2 ll2+ =rl2 + rl3 + rl4 + ll2 + ll3 ll3+ =rl2 + rl3 + rl4 + ll2 + ll3 + ll4 ll1- =rl2 + rl3 + rl4 ll2 ll2- =rl2 + rl3 + rl4 ll2 ll3 ll3- =rl2 + rl3 + rl4 ll2 ll3 ll4
hip = rl5 + ll1 lls2 = ll2 + ll3 + ll4 lls1 = ll2 + ll3 ra+ = rl2 + rl3 + rl4 + ra1 ra- = rl2 + rl3 + rl4 ra1 la+ = rl2 + rl3 + rl4 + la1 la- = rl2 + rl3 + rl4 la1
Leg Points
First is the equation for the points in the legs found.
218
prl1,org
0 = arl0 0 0
prl2,org
prl3,org
prl4,org
prl5,org
pll1,org
pll2,org
pll3,org
APPENDIX G. LAGRANGE
pll4,org
cos(rl1 ) = prl1,org + arl1 sin(rl1 ) 0 cos(rl2 ) cos(rl1 ) = prl2,org + arl2 cos(rl2 ) sin(rl1 ) sin(rl2 ) cos(rl2 + rl3 ) cos(rl1 ) = prl3,org + arl3 cos(rl2 + rl3 ) sin(rl1 ) sin(rl2 + rl3 ) cos(rl ) cos(rl1 ) = prl4,org + arl4 cos(rl ) sin(rl1 ) sin(rl ) cos(rl ) cos(rl1 ) sin(rl5 ) + sin(rl1 ) cos(rl5 ) = prl5,org + ahip cos(rl ) sin(rl1 ) sin(rl5 ) cos(rl1 ) cos(rl5 ) sin(rl ) sin(rl5 ) cos(rl ) cos(rl1 ) cos(hip ) + sin(rl1 ) sin(hip ) = pll1,org + all1 cos(rl ) sin(rl1 ) cos(hip ) cos(rl1 ) sin(hip ) sin(rl ) cos(hip ) (cos(rl ) cos(rl1 ) cos(hip ) sin(rl1 ) sin(hip )) cos(ll2 ) cos(rl1 ) sin(rl ) sin(ll2 ) = pll2,org + all2 (cos(rl ) sin(rl1 ) cos(hip ) + cos(rl1 ) sin(hip )) cos(ll2 ) sin(rl1 ) sin(rl ) sin(ll2 ) sin(rl ) cos(hip ) cos(ll2 ) cos(rl ) sin(ll2 ) (cos(rl ) cos(rl1 ) cos(hip ) sin(rl1 ) sin(hip )) cos(ll2 + ll3 ) cos(rl1 ) sin(rl ) sin(ll2 + ll3 ) = pll3,org + all3 (cos(rl ) sin(rl1 ) cos(hip ) + cos(rl1 ) sin(hip )) cos(ll2 + ll3 ) sin(rl1 ) sin(rl ) sin(ll2 + ll3 ) sin(rl ) cos(hip ) cos(ll2 + ll3 ) cos(rl ) sin(ll2 + ll3 )
pll5,org
(cos(rl ) cos(rl1 ) cos(hip ) sin(rl1 ) sin(hip )) cos(lls2 ) cos(rl1 ) sin(rl ) sin(lls2 ) = pll4,org + all4 (cos(rl ) sin(rl1 ) cos(hip ) + cos(rl1 ) sin(hip )) cos(lls2 ) sin(rl1 ) sin(rl ) sin(lls2 ) sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )
By examine the human gait in App. A it is determined that the servo angles in the sagittal plane, at any point in the gait, are less than 0.26 rad. This enables two simplications
sin() cos() 1
i j 0
prl1,org 1
0 = arl0 0 0
prl2,org = prl1,org + arl1 rl1 0 cos(rl2 ) prl3,org = prl2,org + arl2 cos(rl2 )rl1 sin(rl2 ) cos(rl2 + rl3 ) prl4,org = prl3,org + arl3 cos(rl2 + rl3 )rl1 sin(rl2 + rl3 )
219
220
prl5,org
pll1,org
pll2,org
pll3,org
pll4,org
pll5,org
cos(rl ) = prl4,org + arl4 cos(rl )rl1 sin(rl ) cos(rl )rl5 + rl1 1 = prl5,org + ahip sin(rl )rl5 cos(rl ) = pll1,org + all1 cos(rl )rl1 rl5 ll5 sin(rl ) cos(rl ) cos(ll2 ) sin(rl ) sin(ll2 ) = pll2,org + all2 cos(rl )rl1 cos(ll2 ) (rl5 + ll1 ) cos(ll2 ) rl1 sin(rl ) sin(ll2 ) sin(rl ) cos(ll2 ) cos(rl ) sin(ll2 ) cos(rl ) cos(ll2 + ll3 ) sin(rl ) sin(ll2 + ll3 ) = pll3,org + all3 cos(rl )rl1 cos(ll2 + ll3 ) (rl5 + rl5 ) cos(ll2 + ll3 ) rl1 sin(rl ) sin(ll2 + ll3 ) sin(rl ) cos(ll2 + ll3 ) cos(rl ) sin(ll2 + ll3 ) cos(rl ) cos(lls2 ) sin(rl ) sin(lls2 ) = pll4,org + all4 cos(rl )rl1 cos(lls2 ) (rl5 + rl5 ) cos(lls2 ) rl1 sin(rl ) sin(lls2 ) sin(rl ) cos(lls2 ) cos(rl ) sin(lls2 )
sin(A) cos(B ) sin(B ) cos(A) = sin(A B ) cos(A) cos(B ) sin(B ) sin(A) = cos(A B )
APPENDIX G. LAGRANGE
prl1,org
0 = arl0 0 0
prl2,org = prl1,org + arl1 rl1 0 cos(rl2 ) prl3,org = prl2,org + arl2 cos(rl2 )rl1 sin(rl2 ) cos(rl2 + rl3 ) prl4,org = prl3,org + arl3 cos(rl2 + rl3 )rl1 sin(rl2 + rl3 ) cos(rl ) prl5,org = prl4,org + arl4 cos(rl )rl1 sin(rl ) cos(rl )rl5 + rl1 1 pll1,org = prl5,org + ahip sin(rl )rl5 cos(rl ) pll2,org = pll1,org + all1 cos(rl )rl1 rl5 ll5 sin(rl ) cos(ll1- ) pll3,org = pll2,org + all2 rl1 cos(ll1- ) (rl5 + ll1 ) cos(ll2 ) sin(ll1- ) cos(ll2- ) pll4,org = pll3,org + all3 rl1 cos(ll2- ) (rl5 + ll1 ) cos(ll2 + ll3 ) sin(ll2- ) cos(ll3- ) pll5,org = pll4,org + all4 rl1 cos(ll3- ) (rl5 + ll1 ) cos(lls2 ) sin(ll3- )
222
By analyzing the human gait closely in App. A does the following angles varying within the given limits. to to to to to to to to to
rl2 rl2 + rl3 rl2 + rl3 + rl4 ll4 ll4 + ll3 ll4 + ll3 + ll2 ll2 rl2 rl3 rl4 ll2 + ll3 rl2 rl3 rl4 ll2 + ll3 + ll4 rl2 rl3 rl4
: 15 : 26 : 20 : 12 : 52 : 70 : 25 : 45 : 65
10 4 15 22 25 10 40 32 22
As the four rst sums lies within 26 degrees (0.45 rad) small angel approximations can be applied. Further more are the following approximation found in App. A.
ll3 + ll4 rl2 rl3 rl4 ll2 + ll3 ll2 + ll3 + ll4 rl2 rl3 rl4 ll2 + ll3 + ll4
prl1,org
0 = arl0 0 0 1
APPENDIX G. LAGRANGE
prl3,org = prl2,org + arl2 rl1 rl2 1 rl1 prl4,org = prl3,org + arl3 (rl2 + rl3 ) 1 prl5,org = prl4,org + arl4 rl1 (rl ) 0 1 pll1,org = prl5,org + ahip (rl )rl5 1 pll2,org = pll1,org + all1 rl1 rl5 ll1 rl cos(ll1- ) pll3,org = pll2,org + all2 rl1 cos(rl2 + rl3 + rl4 ll2 ) (rl5 + ll1 ) sin(ll1- ) cos(ll2- ) pll4,org = pll3,org + all3 (rl1 + rl5 + ll1 ) cos(ll2 + ll3 ) sin(ll2- ) cos(ll3- ) pll5,org = pll4,org + all4 (rl1 + rl5 + ll1 ) cos(lls2 ) sin(ll3- )
The y -components of pllj5 and pllj4 are approximated with ll1 . This is justied by the fact that the sum of rl1 + rl5 is small compared to ll1 . This removes a part which would have made the y-component bit larger and hence is the cos() also removed, since this will make the y-component
223
224
a bit smaller. The two removed parts rl1 + rl5 and cos() are not the exact inverse of each other and hence will introduce some extra error, but it is considered acceptable as long as the angles stays within the limits specied by the human gait, and it will make the further calculations much easier.
pll4,org
pll5,org
cos(ll2- ) = pll3,org + all3 ll1 sin(ll2- ) cos(ll3- ) = pll4,org + all4 ll1 sin(ll3-
pll3,org
Now are the expressions cut down to hold just enough information to describe the gait specied by the analysis of the human gait, and hence they are ready to be used in calculating the Lagrangian, which is carried out in App. G.2.
These approximations in the supporting leg do however introduce a larger error when more body parts are added. Hence to comply with the needed degree of precision when calculating the height of {RL5} is it adjusted as follows. The height of {RL5} is in the frontal plane approximated with (arl1 + arl2 + arl3 + arl4 ) cos(rl1 ), and in the saggital plane by arl1 + (arl2 + arl3 ) cos(rl2 ) + arl4 . The reason why not one expression is used for both planes is to keep the calculations simpler.
APPENDIX G. LAGRANGE
In this section are the constants XCoM,t , YCoM,t , and ZCoM,t used instead of actual numbers, because these can change as the physical design of the biped changes. This will ease implementation of this model when further development on the biped are carried out.
The position of the mass center written fully out are given below. (cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 ))XCoM,t (cos(rl ) cos(rl1 ) sin(rl5 ) + sin(rl1 ) cos(rl5 ))YCoM,t + cos(rl1 ) sin(rl )ZCoM,t (cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 ))XCoM,t pCoM,t = prl5,org + (cos(rl ) sin(rl1 ) sin(rl5 ) + cos(rl1 ) cos(rl5 ))YCoM,t + sin(rl1 ) sin(rl )ZCoM,t sin(rl ) cos(rl5 )XCoM,t + sin(rl ) sin(rl5 )YCoM,t + cos(rl )ZCoM,t
Applying the same small angel approximation as on the legs gives, cos(rl )XCoM,t (cos(rl )rl5 + rl1 )YCoM,t + sin(rl )ZCoM,t (cos(rl )rl1 + rl5 )XCoM,t + YCoM,t + rl1 ZCoM,t pCoM,t = prl5,org + sin(rl )XCoM,t + sin(rl )rl5 YCoM,t + cos(rl )ZCoM,t
and applying the knowledge that small angle approximation can be used on rl and the sum of rl1 + rl5 is very close to zero states: XCoM,t + ZCoM,t (rl ) YCoM,t + rl1 ZCoM,t pCoM,t = prl5,org + (rl )(YCoM,t rl5 XCoM,t ) + ZCoM,t
Finally is the ZCoM,t in this project insignicant compared to XCoM,t and YCoM,t , and is hence removed from the expression for pCoM,t . Further is the YCoM,t rl5 insignicant compared with XCoM,t and is removed as well. This results in the following expression.
pCoM,t
Now is this expression also ready to be included in the calculations of the Lagrangian.
225
226
Arm Points
pra1,org
pra2,org
pla1,org
APPENDIX G. LAGRANGE
pla2,org
50.5 cos(rl1 ) cos(rl ) cos(rl5 ) 50.5 sin(rl1 ) sin(rl5 ) 49.1 cos(rl ) cos(rl1 ) sin(rl5 ) 49.1 sin(rl1 ) cos(rl5 ) + 0.5 cos(rl1 ) sin(rl ) 50.5 sin(rl1 ) cos(rl ) cos(rl5 ) + 50.5 cos(rl1 ) sin(rl5 ) = prl5,org + 49.1 cos(rl ) sin(rl1 ) sin(rl5 ) + 49.1 cos(rl1 ) cos(rl5 ) + 0.5 sin(rl1 ) sin(rl ) 50.5 sin rl2 + rl3 + rl4 cos(rl5 ) + 49.1 sin(rl ) sin(rl5 ) + 0.5 cos(rl ) 18.7(cos(rl1 ) cos(rl ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(ra1 ) 18.7 cos(rl1 ) sin(rl ) sin(ra1 ) +1.3(cos(rl1 ) cos(rl ) cos(rl5 ) sin(rl1 ) sin(rl5 )) sin(ra1 ) + 1.3 cos(rl1 ) sin(rl ) cos(ra1 ) 18.7(sin(rl1 ) cos(rl ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(ra1 ) 18.7 sin(rl1 ) sin(rl ) sin(ra1 ) = pra1,org + +1.3(sin(rl1 ) cos(rl ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) sin(ra1 ) + 1.3 sin(rl1 ) sin(rl ) cos(ra1 ) 18.7 sin(rl ) cos(rl5 ) cos(ra1 ) 18.7 cos(rl ) sin(ra1 ) 1.3 sin(rl ) cos(rl5 ) sin(ra1 ) + 1.3 cos(rl ) cos(ra1 ) 50.5 cos(rl1 ) cos(rl ) cos(rl5 ) 50.5 sin(rl1 ) sin(rl5 ) +110.7 cos(rl ) cos(rl1 ) sin(rl5 ) + 110.7 sin(rl1 ) cos(rl5 ) + 0.5 cos(rl1 ) sin(rl ) 50.5 sin(rl1 ) cos(rl ) cos(rl5 ) + 50.5 cos(rl1 ) sin(rl5 ) = prl5,org + +110.7 cos(rl ) sin(rl1 ) sin(rl5 ) 110.7 cos(rl1 ) cos(rl5 ) + 0.5 sin(rl1 ) sin(rl ) 50.5 sin(rl ) cos(rl5 ) 110.7 sin(rl ) sin(rl5 ) + 0.5 cos(rl ) 18.7(cos(rl1 ) cos(rl ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(la1 ) + 18.7 cos(rl1 ) sin(rl ) sin(la1 ) 1.3(cos(rl1 ) cos(rl ) cos(rl5 ) sin(rl1 ) sin(rl5 )) sin(la1 ) + 1.3 cos(rl1 ) sin(rl ) cos(la1 ) 18.7(sin(rl1 ) cos(rl ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(la1 ) + 18.7 sin(rl1 ) sin(rl ) sin(la1 ) = pla1,org + 1.3(sin(rl1 ) cos(rl ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) sin(la1 ) + 1.3 sin(rl1 ) sin(rl ) cos(la1 ) 18.7 sin(rl ) cos(rl5 ) cos(la1 ) + 18.7 cos(rl ) sin(la1 ) +1.3 sin(rl ) cos(rl5 ) sin(la1 ) + 1.3 cos(rl ) cos(la1 )
(((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(ra1 ) cos(rl1 ) sin(rl ) sin(ra1 )) sin(ra2 ) +( cos(rl ) cos(rl1 ) sin(rl5 ) sin(rl1 ) cos(rl5 )) cos(ra2 )) XCoM,ra + (((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(ra1 ) cos(rl1 ) sin(rl ) sin(ra1 )) cos(ra2 ) ( cos(rl ) cos(rl1 ) sin(rl5 ) sin(rl1 ) cos(rl5 )) sin(ra2 )) YCoM,ra +((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) sin(ra1 ) + cos(rl1 ) sin(rl ) cos(ra1 ))ZCoM,ra (((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(ra1 ) sin(rl1 ) sin(rl ) sin(ra1 )) sin(ra2 ) +( cos(rl ) sin(rl1 ) sin(rl5 ) + cos(rl1 ) cos(rl5 )) cos(ra2 )) XCoM,ra pCoM,ra = pra2,org + + (((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(ra1 ) sin(rl1 ) sin(rl ) sin(ra1 )) cos(ra2 ) ( cos(rl ) sin(rl1 ) sin(rl5 ) + cos(rl1 ) cos(rl5 )) sin(ra2 )) YCoM,ra +((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) sin(ra1 ) + sin(rl1 ) sin(rl ) cos(ra1 ))ZCoM,ra (( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) sin(ra2 ) + sin(rl ) sin(rl5 ) cos(ra2 ))XCoM,ra +(( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) cos(ra2 ) sin(rl ) sin(rl5 ) sin(ra2 ))YCoM,ra +( sin(rl ) cos(rl5 ) sin(ra1 ) + cos(rl ) cos(ra1 ))ZCoM,ra (((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(la1 ) + cos(rl1 ) sin(rl ) sin(la1 )) sin(la2 ) +(cos(rl ) cos(rl1 ) sin(rl5 ) + sin(rl1 ) cos(rl5 )) cos(la2 )) XCoM,la + (((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) cos(la1 ) + cos(rl1 ) sin(rl ) sin(la1 )) cos(la2 ) (cos(rl ) cos(rl1 ) sin(rl5 ) + sin(rl1 ) cos(rl5 )) sin(la2 )) YCoM,la +((cos(rl ) cos(rl1 ) cos(rl5 ) sin(rl1 ) sin(rl5 )) sin(la1 ) + cos(rl1 ) sin(rl ) cos(la1 ))ZCoM,la (((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(la1 ) + sin(rl1 ) sin(rl ) sin(la1 )) sin(la2 ) +(cos(rl ) sin(rl1 ) sin(rl5 ) cos(rl1 ) cos(rl5 )) cos(la2 )) XCoM,la pCoM,la = pla2,org + + (((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) cos(la1 ) + sin(rl1 ) sin(rl ) sin(la1 )) cos(la2 ) (cos(rl ) sin(rl1 ) sin(rl5 ) cos(rl1 ) cos(rl5 )) sin(la2 )) YCoM,la +((cos(rl ) sin(rl1 ) cos(rl5 ) + cos(rl1 ) sin(rl5 )) sin(la1 ) + sin(rl1 ) sin(rl ) cos(la1 ))ZCoM,la (( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 ) sin(rl ) sin(rl5 ) cos(la2 ))XCoM,la +(( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 ) + sin(rl ) sin(rl5 ) sin(la2 ))YCoM,la +(sin(rl ) cos(rl5 ) sin(la1 ) + cos(rl ) cos(la1 ))ZCoM,la
227
228
Here is the small angle approximation on the angles in the frontal plane on the supporting leg changed to
sin() 0 cos() 1
This is reasonable as there now is a lot more expressions for each coordinate, and hence does one expression multiplied by sinus or cosine to a small angle have small impact on the entire expression. This will, however, make the points in the arms particular fragile to changes in the frontal plane in the supporting leg.
pra1,org
pra2,org
APPENDIX G. LAGRANGE
pCoM,ra
50.5 cos(rl ) + 0.5 sin(rl ) 49.1 = prl5,org + 50.5 sin(rl ) + 0.5 cos(rl ) 18.7 cos(rl ) cos(ra1 ) 18.7 sin(rl ) sin(ra1 ) +1.3 cos(rl ) sin(ra1 ) + 1.3 sin(rl ) cos(ra1 ) 0 = pra1,org + 18.7 sin(rl ) cos(ra1 ) 18.7 cos(rl ) sin(ra1 ) 1.3 sin(rl ) sin(ra1 ) + 1.3 cos(rl ) cos(ra1 ) (cos(rl ) cos(ra1 ) sin(rl ) sin(ra1 )) sin(ra2 )XCoM,ra (cos(rl ) cos(ra1 ) sin(rl ) sin(ra1 )) cos(ra2 )YCoM,ra +(cos(rl ) sin(ra1 ) + sin(rl ) cos(ra1 ))ZCoM,ra cos(ra2 )XCoM,ra sin(ra2 )YCoM,ra = pra2,org + ( sin(rl ) cos(ra1 ) cos(rl ) sin(ra1 )) sin(ra2 )XCoM,ra ( sin(rl ) cos(ra1 ) cos(rl ) sin(ra1 )) cos(ra2 )YCoM,ra +( sin(rl ) sin(ra1 ) + cos(rl ) cos(ra1 ))ZCoM,ra
pla1,org
pla2,org
pCoM,la
50.5 cos(rl ) + 0.5 sin(rl ) 110.7 = prl5,org + 50.5 sin(rl ) + 0.5 cos(rl ) 18.7 cos(rl ) cos(la1 ) + 18.7 sin(rl ) sin(la1 ) 1.3 cos(rl ) sin(la1 ) + 1.3 sin(rl ) cos(la1 ) 0 = pla1,org + 18.7 sin(rl ) cos(la1 ) + 18.7 cos(rl ) sin(la1 ) +1.3 sin(rl ) sin(la1 ) + 1.3 cos(rl ) cos(la1 ) (cos(rl ) cos(la1 ) + sin(rl ) sin(la1 )) sin(la2 )XCoM,la +(cos(rl ) cos(la1 ) + sin(rl ) sin(la1 )) cos(la2 )YCoM,la (cos(rl ) sin(la1 ) + sin(rl ) cos(la1 ))ZCoM,la cos( ) X + sin( ) Y = pla2,org + la2 CoM,la la2 CoM,la ( sin(rl ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 )XCoM,la +( sin(rl ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 )YCoM,la +(sin(rl ) sin(la1 ) + cos(rl ) cos(la1 ))ZCoM,la
Now removing the parts which at most contribute with 1.3mm (and Z), and applying both the small angle approximation on the supporting leg and the following trigonometrical relations,
cos(A) cos(B ) sin(A) sin(B ) = cos(A + B ) sin(A) cos(B ) + sin(B ) cos(A) = sin(A + B ) sin(A) cos(B ) + sin(B ) cos(A) = sin(B A)
229
230
result in:
pra1,org
pra2,org
pCoM,ra
pla1,org
pla2,org
pCoM,la
50.5 49.1 = prl5,org + 50.5(rl ) 18.7 cos(ra+ ) 0 = pra1,org + 18.7 sin(ra+ ) cos(ra+ )(sin(ra2 )XCoM,ra cos(ra2 )YCoM,la ) cos(ra2 )XCoM,la sin(ra2 )YCoM,ra = pra2,org + sin(ra+ )(sin(ra2 )XCoM,ra + cos(ra2 )YCoM,ra ) 50.5 = prl5,org + 110.7 50.5(rl ) 18.7 cos(la- ) 0 = pla1,org + 18.7 sin(la- ) cos(la- )(sin(la2 )XCoM,la + cos(la2 )YCoM,la ) cos(la2 )XCoM,la + sin(la2 )YCoM,la = pla2,org + sin(la- )(sin(la2 )XCoM,la + cos(la2 )YCoM,la )
APPENDIX G. LAGRANGE
231
Once again examin the human gait it is seen that the joints in the arms only have small changes in the angles which enables a small angle approximation on the shoulder joints. In fact are the angle in the joints in the frontal plane, pra2,org and pla2,org , very close to zero. For that reason is the following simplications made to the coordinates.
pra1,org
pra2,org
pCoM,ra
pla1,org
pla2,org
pCoM,la
50.5 49.1 = prl5,org + 50.5(rl ) 18.7 cos(ra+ ) 0 = pra1,org + 18.7 sin(ra+ ) cos(ra+ )YCoM,ra XCoM,ra = pra2,org + sin(ra+ )YCoM,ra 50.5 = prl5,org + 110.7 50.5(rl ) 18.7 cos(la- ) 0 = pla1,org + 18.7 sin(la- ) cos(la- )YCoM,la XCoM,la = pla2,org + sin(la- )YCoM,la
Now all the desired points of the biped have been simplied to get rid of redundant information to describe dynamic gait. Then these points are ready to be used in the energy considerations needed to calculate the Lagrangian.
232
APPENDIX G. LAGRANGE
Kinetic Energy
In order to determine the Lagrangian the kinetic energies must be known, and these are found using Eq. (G.1)
ki =
1 1 i i + i p mi p I i 2 2 i
ki,l ki,r
(G.1)
The rst part represent the linear part of the kinetic energy, denoted ki,l , and the second part represent the rotational kinetic energy, denoted ki,r [Craig, 2003]. The determination of the kinetic energy is divided into two, rst the linear part and then the rotational part.
p rl1,org
0 = arl0 0 0
rl1 p rl2,org = p rl1,org + arl1 0 0 rl1 p rl3,org = p rl2,org + arl2 rl2 0 rl1 p rl4,org = p rl3,org + arl3 (rl2 + rl3 ) 0 rl1 p rl5,org = p rl4,org + arl4 rl 0 0 p CoM,t = p rl5,org + rl XCoM,t 0 0 p ll1,org = p rl5,org + ahip rl5 rl rl5 (rl ) 0 rl1 rl5 ll1 p ll2,org = p ll1,org + all1 rl
233
p ll3,org
p ll4,org
p ll5,org
p ra1,org
p ra2,org
p CoM,ra
p la1,org
p la2,org
p CoM,la
From these velocities of the approximated mass centers of the relevant joints, can the linear kinetic energy be determined. Starting with the supporting leg:
1 rl1 )2 + (z rl2 + rl3 ))2 rl2 + arl3 rl2 arl3 ( krl4,l = mrl4 (y 2
y rl4 z rl4
The energies krl5,l and kll1,l are included in the energy for the body, hence not described individually, but the velocities of prl5 and pll1 are needed. Thus are their components
234
given here.
APPENDIX G. LAGRANGE
rl1 x rl5 = (arl1 + arl2 + arl3 + arl4 ) sin(rl1 ) rl2 x rl5,2 = (arl2 + arl3 ) sin(rl2 ) y rl5 z rl5 x ll1 rl1 =y rl4 + arl4 rl =z rl4 arl4 =x rl5
(G.2) (G.3)
1 ll1- )2 + (y rl5 + ll1 ))2 + (z ll1- )2 mll3 (x ll1 + all2 sin(ll1- ) ll2 all2 ( ll2 + all2 cos(ll1- ) 2
x ll3 y ll3 z ll3
1 ll2- )2 + (y ll1 )2 + (z ll2- )2 kll4,l = mll4 (x ll3 + all3 sin(ll2- ) ll3 all3 ll3 + all3 cos(ll2- ) 2
x ll4 y ll4 z ll4
1 ll3- )2 + (y ll1 )2 + (z ll3- )2 kll5,l = mll5 (x ll4 + all4 sin(ll3- ) ll4 all4 ll4 + all4 cos(ll3- ) 2
ra x ra = x rl5 18.7 sin(ra+ ) rl 18.7 cos(ra+ ) ra z ra = z rl5 50.5 la x la = x rl5 18.7 sin(la- ) rl 18.7 cos(la- ) la z la = z rl5 50.5
235
1 ra YCoM,ra )2 + (y ra YCoM,ra )2 kra,l = marm (x ra + sin(ra+ ) rl5 )2 + (z ra + cos(ra+ ) 2 1 la YCoM,ra )2 + (y la YCoM,la )2 kla,l = marm (x la sin(la- ) rl5 )2 + (z la cos(la- ) 2
(G.4)
When two links are put together is the inertia given by Eq. (G.4) added by the inertia from the second link which is found using the Parallel Axis Theorem.[Serway and Jewett, 2004] This gives:
(G.5)
where 1 2R is the rotation matrix rotating the second link, to align it with an axis which is parallel with the z-axis of the rst link, enabling the parallel axis theorem to be applied. A3 is the 33 identity matrix. m1 is the mass of the rst link and is hence constant. d21 (t) is the distance from joint two to the mass center of link one and dependent of the rst joint angle and hence dependent of time. From Eq. (G.1) it is seen that only the Izz part of the matrices found in Eq. (G.5) contribute to the kinetic energy since all joints rotate around the z-axis which gives.
0 i = 0 z,i
Using this approach gives the following expressions for the moments of inertia for the rotational part of the kinetic energies in the swing leg.
I ll0 =I zz,ll0
0 T LL0 I ll1 =I zz,ll1 + LL LL1R Ill0 LL1R + mll5 all4 A3 1 T LL1 LL1 LL0 T LL0 LL1 I ll2 =I zz,ll2 + LL LL2R Ill1 LL2R + mll4 all3 I 3 + (LL2R LL1R ) Ill0 (LL1R LL2R ) + mll5 (all4 + all3 )A3
. . .
As seen do these expressions become large when moving toward the supporting leg. To avoid unnecessary calculations is it rst determined which angles the dierent moments rl1 , of inertia depend on, because later when only dierentiate with regard to rl1 , rl2 , and rl2 , will some moments of inertia appear as constants. Hence not worth to
236
derive as they contribute with zero.
APPENDIX G. LAGRANGE
krl0,r =0 1 rl1 krl1,r = I (rl2 , rl3 , rl4 , rl5 , ll1 , ll2 , ll3 , ll4 , ll5 , ra1 , ra2 , la1 , la2 ) 2 rl1 1 rl2 krl2,r = I (rl3 , rl4 , rl5 , ll1 , ll2 , ll3 , ll4 , ll5 , ra1 , ra2 , la1 , la2 ) 2 rl2 1 rl4 krl4,r = I (rl5 , ll1 , ll2 , ll3 , ll4 , ll5 , ra1 , ra2 , la1 , la2 ) 2 rl4 1 ll1, kll1,r = I (ll2 , ll3 , ll4 , ll5 ) 2 ll1 1 ll3 kll3,r = I (ll4 , ll5 ) 2 ll3 1 ll4 kll4,r = I (ll5 ) 2 ll4 1 2 kll5,r = Izz,ll5 2 ll5 1 rl5 kt,r = I (ll1 , ll2 , ll3 , ll4 , ll5 , ra1 , ra2 , la1 , la2 ) 2 rl5 1 ra kra,r = I arm 2 ra 1 la I arm kla,r = 2 la
For this project are only the moments of inertia in joint RL1 and RL2 of interest and hence are only krl1,r and krl2,r needed as the other rotational kinetic energies will appear as constants. The expressions for Irl1,t and Irl2,t are derived in Sec. G.3 and shown below:
Irl1,t =Izz,rl1 + Iyy,rl2 + mrl2 (arl1 + arl2 )2 + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 )2 + 2 rl Ixx,t + Izz,t + mt (arl1 + arl2 + arl3 + arl4 + Xt )2 + Izz,ll1 + mll1 (arl1 + arl2 + arl3 )2 + a2 hip
2 2 2 2 + Ixx,ll3 + mll3 (arl1 + arl2 )2 + a2 hip + sin (ll2- )Ixx,ll4 + cos (ll2- )Iyy,ll4 + mll4 arl1 + ahip 2 2 + sin2 (ll2- )Ixx,ll5 + cos2 (ll2- )Izz,ll5 + mll5 a2 hip + sin (ra+ )Iyy,ra + cos (ra2+ )Izz,ra
+ marm (((arl1 + arl2 + arl3 + arl4 ) cos(rl1 ) + 50.5 + 18.7 cos(ra ) Yarm cos(ra ))2 + (49.1 + Xra )2 ) + sin2 (la- )Iyy,larm + cos2 (la- )Izz,ra + marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la ) + Yarm cos(ra ))2 + (110.7 Xla )2 )
2 Irl2,t =Izz,rl2 + Izz,rl4 + mrl4 (arl2 + arl3 )2 + rl5 Ixx,t + Iyy,t + mt ((arl2 + arl3 + arl4 + Xt )2 ) 2 2 2 + Iyy,ll1 + mll1 ((arl2 + arl3 )2 + a2 hip ) + Izz,ll3 + mll3 arl2 + ahip + Izz,ll4 + mll4 ahip
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip + Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra + marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yra cos(ra ))2 + (49.1 + Xra )2 ) + Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la + marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + Yra cos(la- ))2 + (110.7 Xla )2 )
Note that rl2 is not contained in ll3 , ra+ , and la- as {RL2} is the base frame for Irl2,t . The reason why the index has not been changed is to avoid confusion with new indexes.
237
Potential Energy
The potential energies of the approximated mass centres are determined using Eq.(G.6).
pi = mi gxi
First the supporting leg.
(G.6)
Before moving to the free limbs and the body, are the heights of joint RL5, LL5, RA1, RA2, LA1, and LA2 found.
xrl5 =(xrl4 + arl4 ) cos(rl1 ) xrl5,2 =(arl1 + (arl2 + arl3 ) cos(rl2 ) + arl4 ) xll5 =xrl5 xra1 =xla1 = xrl5 + 50.5 xra2 =xra1 + 18.7 cos(ra+ ) xla2 =xla1 + 18.7 cos(la- )
Note that the expression for xrl5 is used when considering the biped robot in the frontal plane and xrl5,2 is used when considering the biped robot in the sagittal plane. Then is the potential energy in the swing leg given by
238
APPENDIX G. LAGRANGE
pra =marm g (xra2 YCoM,ra cos(ra+ )) pla =marm g (xla2 + YCoM,la cos(la- ))
Now are the dierent energies on the biped determined, and hence can the Lagrangian be determined.
239
rl =rl2 + rl3 + rl4 ll1+ ll2+ ll3+ ll1ll2ll3=rl2 + rl3 + rl4 + ll2 =rl2 + rl3 + rl4 + ll2 + ll3 =rl2 + rl3 + rl4 + ll2 + ll3 + ll4 =rl2 + rl3 + rl4 ll2 =rl2 + rl3 + rl4 ll2 ll3 =rl2 + rl3 + rl4 ll2 ll3 ll4
hip = rl5 + ll1 lls2 = ll2 + ll3 + ll4 lls1 = ll2 + ll3 ra+ = rl2 + rl3 + rl4 + ra1 ra- = rl2 + rl3 + rl4 ra1 la+ = rl2 + rl3 + rl4 + la1 la- = rl2 + rl3 + rl4 la1
I ll5,t = I ll5
5 ll5 I ll4,t = I ll4 + LL LL4R Ill5 ll4R + mll5 all4 I 3 4 ll4 I ll3,t = I ll3 + ll + mll4 all3 I 3 ll3R Ill4 ll3R 4 ll5 ll5 ll4 + (ll ll3R ll4R )Ill5 (ll4R ll3R ) + mll5 (all4 + all3 )I 3
To determine a complete Lagrangian model are the moments of inertia needed for each part of the biped. Initially are only the moments of inertia of the whole biped seen from joint RL1 and RL2 needed, since these expressions are the only one depending on rl1 , rl1 or/and rl2 , rl2 . Hence when calculating the torque of joint RL1 and joint RL2 using the Lagrangian, will the rest of the expressions of the moments of inertia appear as constants, and since they are added to the linear part of the dierent kinetic energies, they will contribute with a zero. For this reason are only the moments of inertia for RL1 and RL2 found. To ease notation a vector is used instead of the scalar di to give the displacement of the mass centers. First the expression for the inertia in joint RL1.
240
APPENDIX G. LAGRANGE
1 rl1 I rl1,t = I rl1 + rl + mrl2 (P rl3,org P rl3,org I 3 P rl3,org P rl3,org ) rl2R I rl2 rl2R 1 rl1 T + rl + mrl4 (P rl4,org P rl4,org I 3 P rl4,org P rl4,org ) rl4R I rl4 rl4R 1 rl1 + rl + mt (P t P t I 3 P t P t ) rl5R I t rl5R 1 rl1 + rl + mll1 (P ll2,org P ll2,org I 3 P ll2,org P ll2,org ) ll1R I ll1 ll1R 1 rl1 + rl + mll3 (P ll3,org P ll3,org I 3 P ll3,org P ll3,org ) ll3R I ll3 ll3R 1 rl1 + rl + mll4 (P ll4,org P ll4,org I 3 P ll4,org P ll4,org ) ll4R I ll4 ll4R 1 rl1 + rl + mll5 (P ll5,org P ll5,org I 3 P ll5,org P ll5,org ) ll5R I ll5 ll5R 1 rl1 + rl + marm (P ra P ra I 3 P ra P ra ) ra2R I arm ra2R 1 rl1 + rl + marm (P la P la I 3 P la P la ) la2R I arm la2R
Note that these points to the dierent joints are given from frame {RL1}, and these are simplied when they enter the calculations in the following. By inspecting the equation of the rotational part of the kinetic energy,
ki,r =
1 T I i i 2 i
(G.7)
it is seen that only the Izz part of the inertia tensor I i contribute to the kinetic energy since
0 i = 0 z,i
This is due to the fact that the servomotors only rotate around one axis, which always is the z -axis. Hence does I rl1,t become a scalar Irl1,t . Entering the expression for Irl1,t in Matlab gives the following expression and since it is quite large is it divided it peaces, which should be summed to get the total expression.
Irl1,t =Izz,rl1
+ (sin(rl2 )Ixx,rl2 + cos(rl2 )Iyx,rl2 ) sin(rl2 ) + (sin(rl2 )Ixy,rl2 + cos(rl2 )Iyy,rl2 ) cos(rl2 ) + mrl2 (arl1 + arl2 )2
+ (sin(rl )Ixx,rl4 + cos(rl )Iyx,rl4 ) sin(rl ) + (sin(rl )Ixy,rl4 + cos(rl )Iyy,rl4 ) cos(rl ) + mrl4 (arl1 + arl2 + arl3 )2
( sin(rl ) cos(rl5 )Ixx,t + sin(rl ) sin(rl5 )Iyx,t + cos(rl )Izx,t ) sin(rl ) cos(rl5 ) + ( sin(rl ) cos(rl5 )Ixy,t + sin(rl ) sin(rl5 )Iyy,t + cos(rl )Izy,t ) sin(rl ) sin(rl5 )
2 + ( sin(rl ) cos(rl5 )Ixz,t + sin(rl ) sin(rl5 )Iyz,t + cos(rl )Izz,t ) cos(rl ) + mt (arl1 + arl2 + arl3 + arl4 + Xt )2 + Yt
+ (sin(rl ) cos(hip )Ixx,ll1 sin(rl ) sin(hip )Iyx,ll1 + cos(rl )Izx,ll1 ) sin(rl ) cos(hip ) (sin(rl ) cos(hip )Ixy,ll1 sin(rl ) sin(hip )Iyy,ll1 + cos(rl )Izy,ll1 ) sin(rl ) sin(hip ) + (sin(rl ) cos(hip )Ixz,ll1 sin(rl ) sin(hip )Iyz,ll1 + cos(rl )Izz,ll1 ) cos(rl )
+ mll1 (arl1 + arl2 + arl3 + arl4 all1 )2 + (ahip + all1 (rl5 ll1 ))2
+ ((sin(rl ) cos(hip ) cos(lls1 ) cos(rl ) sin(lls1 ))Ixx,ll3 (sin(rl ) cos(hip ) sin(lls1 ) + cos(rl ) cos(lls1 ))Iyx,ll3 sin(rl ) sin(hip )Izx,ll3 ) (sin(rl ) cos(hip ) cos(lls1 ) cos(rl ) sin(lls1 )) + ((sin(rl ) cos(hip ) cos(lls1 ) cos(rl ) sin(lls1 ))Ixy,ll3 (sin(rl ) cos(hip ) sin(lls1 ) + cos(rl ) cos(lls1 ))Iyy,ll3
sin(rl ) sin(hip )Izy,ll3 ) ( sin(rl ) cos(hip ) sin(lls1 ) cos(rl ) cos(lls1 )) ((sin(rl ) cos(hip ) cos(lls1 ) cos(rl ) sin(lls1 ))Ixz,ll3 (sin(rl ) cos(hip ) sin(lls1 ) + cos(rl ) cos(lls1 ))Iyz,ll3
241
242
+ ((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 ))Ixx,ll4 (sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Iyx,ll4 sin(rl ) sin(hip )Izx,ll4 ) (sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) + ((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 ))Ixy,ll4 (sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Iyy,ll4 sin(rl ) sin(hip )Izy,ll4 ) ( sin(rl ) cos(hip ) sin(lls2 ) cos(rl ) cos(lls2 )) ((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 ))Ixz,ll4 (sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Iyz,ll4 sin(rl ) sin(hip )Izz,ll4 ) sin(rl ) cos(hip )
+ mll4 (arl1 + arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ))2
+(ahip + all1 (rl5 ll1 ) + all2 (rl5 ll1 ) + all3 (ll1 ))2
+ (((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) cos(ll5 ) sin(rl ) sin(hip ) sin(ll5 ))Ixx,ll5 +((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) sin(ll5 ) sin(rl ) sin(hip ) cos(ll5 ))Iyx,ll5 +(sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Izx,ll5 )
((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) cos(ll5 ) sin(rl ) sin(hip ) sin(ll5 )) + (((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) cos(ll5 ) sin(rl ) sin(hip ) sin(ll5 ))Ixy,ll5
+((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) sin(ll5 ) sin(rl ) sin(hip ) cos(ll5 ))Iyy,ll5 +(sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Izy,ll5 ) ((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) sin(ll5 ) sin(rl ) sin(hip ) cos(ll5 ))
+ (((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) cos(ll5 ) sin(rl ) sin(hip ) sin(ll5 ))Ixz,ll5 +((sin(rl ) cos(hip ) cos(lls2 ) cos(rl ) sin(lls2 )) sin(ll5 ) sin(rl ) sin(hip ) cos(ll5 ))Iyz,ll5
+(sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))Izz,ll5 ) (sin(rl ) cos(hip ) sin(lls2 ) + cos(rl ) cos(lls2 ))
APPENDIX G. LAGRANGE
+ mll5 (arl1 + arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ) all4 cos(ll4 ))2
+(ahip + all1 (rl5 ll1 ) + all2 (rl5 ll1 ) + all3 (ll1 ) + all4 (ll1 ))2
+ (((sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) sin(ra2 ) + sin(rl ) sin(rl5 ) cos(ra2 ))Ixx,ra
+(( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) cos(ra2 ) sin(rl ) sin(rl5 ) sin(ra2 ))Iyx,ra +( sin(rl ) cos(rl5 ) sin(ra1 ) + cos(rl ) cos(ra1 ))Izx,ra (( sin(rl ) cos(rl5 ) cos(ra1 )
cos(rl ) sin(ra1 )) sin(ra2 ) + sin(rl ) sin(rl5 ) cos(ra2 ))) + ((( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) sin(ra2 ) + sin(rl ) sin(rl5 ) cos(ra2 ))Ixy,ra
+(( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) cos(ra2 ) sin(rl ) sin(rl5 ) sin(ra2 ))Iyy,ra +( sin(rl ) cos(rl5 ) sin(ra1 ) + cos(rl ) cos(ra1 ))Izy,ra (( sin(rl ) cos(rl5 ) cos(ra1 )
cos(rl ) sin(ra1 )) cos(ra2 ) sin(rl ) sin(rl5 ) sin(ra2 ))) + ((( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) sin(ra2 ) + sin(rl ) sin(rl5 ) cos(ra2 ))Ixz,ra
+(( sin(rl ) cos(rl5 ) cos(ra1 ) cos(rl ) sin(ra1 )) cos(ra2 ) sin(rl ) sin(rl5 ) sin(ra2 ))Iyz,ra +( sin(rl ) cos(rl5 ) sin(ra1 ) + cos(rl ) cos(ra1 ))Izz,ra ( sin(rl ) cos(rl5 ) sin(ra1 ) + cos(rl ) cos(ra1 )))
+ marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yarm cos(ra ))2 + (49.1 + Xra )2 )
243
244
+ (((sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 ) sin(rl ) sin(rl5 ) cos(la2 ))Ixx,la +(( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 ) + sin(rl ) sin(rl5 ) sin(la2 ))Iyx,la +(sin(rl ) cos(rl5 ) sin(la1 ) + cos(rl ) cos(la1 ))Izx,la (( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 ) sin(rl ) sin(rl5 ) cos(la2 ))) + ((( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 ) sin(rl ) sin(rl5 ) cos(la2 ))Ixy,la +(( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 ) + sin(rl ) sin(rl5 ) sin(la2 ))Iyy,la +(sin(rl ) cos(rl5 ) sin(la1 ) + cos(rl ) cos(la1 ))Izy,la (( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 ) + sin(rl ) sin(rl5 ) sin(la2 ))) + ((( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) sin(la2 ) sin(rl ) sin(rl5 ) cos(la2 ))Ixz,la +(( sin(rl ) cos(rl5 ) cos(la1 ) + cos(rl ) sin(la1 )) cos(la2 ) + sin(rl ) sin(rl5 ) sin(la2 ))Iyz,la +(sin(rl ) cos(rl5 ) sin(la1 ) + cos(rl ) cos(la1 ))Izz,la (sin(rl ) cos(rl5 ) sin(la1 ) + cos(rl ) cos(la1 )))
+ marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la ) + Yarm cos(ra ))2 + (110.7 Xla )2 )
To get a useful expression for the inertia in joint RL1 are the small angle approximations, justied by examine the human gait, used. Further are expressions which contribute with an inertia less than 106 kg m removed.
This result in the following simplied expressions. First the supporting leg as a whole:
Irl1,t = Izz,rl1 + Iyy,rl2 + mrl2 (arl1 + arl2 )2 + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 )2
+ Ixx,t 2 rl + Izz,t
2 + mt (arl1 + arl2 + arl3 + arl4 + Xt )2 + Yt
APPENDIX G. LAGRANGE
+ Izz,ll1 + mll1 (arl1 + arl2 + arl3 + arl4 all1 )2 + ((ahip + all1 (rl5 ll1 ))2
sin A cos B cos A sin B = sin(A B ) cos A cos B + sin A sin B = cos(A B )
+((arl1 + arl2 + arl3 + arl4 )rl1 ahip + all1 (rl5 ll1 ) + all2 (rl5 ll1 ))2
+ mll4 (arl1 + arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ))2
+((arl1 + arl2 + arl3 + arl4 )rl1 ahip + all1 (rl5 ll1 ) + all2 (rl5 ll1 ) + all3 (ll1 ))2
+ mll5 (arl1 + arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ) all4 cos(ll4 ))2
+(ahip + all1 (rl5 ll1 ) + all2 (rl5 ll1 ) + all3 (ll1 ) + all4 (ll1 ))2
The analysis of the human gait in App. A has shown that the small angle approximation also apply on the angles in the arms. For the right arm does it result in:
+ marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yarm cos(ra ))2 + (49.1 + Xra )2 )
245
246
+ marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la ) + Yarm cos(ra ))2 + (110.7 Xla )2 )
The x-components in the swing leg have also been shortened by assuming that joint e.g. RL2 has the same height as LL4. This does of course introduce an error, but it is justied by the fact that the displacement of the joints in the swing leg from joint RL1 mainly is in the y -direction. Further have some insignicant parts of the displacement of the joints been cut out. Finally are some rearrangement made on the expressions.
Irl1,t = Izz,rl1 + Iyy,rl2 + mrl2 (arl1 + arl2 )2 + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 )2
2 2 2 + 2 rl Ixx,t + Izz,t + mt (arl1 + arl2 + arl3 + arl4 + Xt ) + Izz,ll1 + mll1 (arl1 + arl2 + arl3 ) + ahip
2 2 2 2 + Ixx,ll3 + mll3 (arl1 + arl2 )2 + a2 hip + sin (ll2- )Ixx,ll4 + cos (ll2- )Iyy,ll4 + mll4 arl1 + ahip
2 2 + sin2 (ll2- )Ixx,ll5 + cos2 (ll2- )Izz,ll5 + mll5 a2 hip + sin (ra+ )Iyy,ra + cos (ra2+ )Izz,ra
+ marm (((arl1 + arl2 + arl3 + arl4 ) cos(rl1 ) + 50.5 + 18.7 cos(ra ) Yarm cos(ra ))2 + (49.1 + Xra )2 ) + sin2 (la- )Iyy,la
+ cos2 (la- )Izz,ra + marm ((arl1 + arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la ) + Yarm cos(ra ))2 + (110.7 Xla )2 )
Following the same procedure is an expression for the inertia of the biped in joint RL2 found. The inertia is given by:
2 rl2 + rl + mt (P t P t I 3 P t P t ) rl5R I t rl5R 2 rl2 + rl + mll1 (P ll2,org P ll2,org I 3 P ll2,org P ll2,org ) ll1R I ll1 ll1R 2 rl2 + rl + mll3 (P ll3,org P ll3,org I 3 P ll3,org P ll3,org ) ll3R I ll3 ll3R 2 rl2 + rl + mll4 (P ll4,org P ll4,org I 3 P ll4,org P ll4,org ) ll4R I ll4 ll4R 2 rl2 + rl + mll5 (P ll5,org P ll5,org I 3 P ll5,org P ll5,org ) ll5R I ll5 ll5R 2 rl2 + rl + marm (P ra P ra I 3 P ra P ra ) ra2R I arm ra2R 1 rl1 + rl + marm (P la P la I 3 P la P la ) la2R I arm la2R
APPENDIX G. LAGRANGE
2 rl2 I rl2,t = I rl2 + rl + mrl4 (P rl4,org P rl4,org I 3 P rl4,org P rl4,org ) rl4R I rl4 rl4R
the points used here are a bit dierent from those used to nd the inertia in joint RL1, as {RL2} now is the base frame, and hence are displacements of the parts of the biped calculated from joint RL2 and not from {RL1}. Using Matlab have the following expressions been achieved.
2 + (sin(rl5 )Ixx,t + cos(rl5 )Ixy,t ) sin(rl5 ) + (sin(rl5 )Ixy,t + cos(rl5 )Iyy,t ) cos(rl5 ) + mt ((arl2 + arl3 + arl4 + Xt )2 + Yt )
( sin(hip )Ixx,ll1 cos(hip )Ixy,ll1 ) sin(hip ) ( sin(hip )Ixy,ll1 cos(hip )Iyy,ll1 ) cos(hip )
+ mll1 ((arl2 + arl3 + arl4 all1 )2 + (ahip + all1 (rl5 ll1 ))2 )
LL3
( sin(hip ) cos(lls1 )Ixx,ll3 + sin(hip ) sin(lls1 )Ixy,ll3 cos(hip )Izx,ll3 ) sin(hip ) cos(lls1 )
+ ( sin(hip ) cos(lls1 )Ixy,ll3 + sin(hip ) sin(lls1 )Iyy,ll3 cos(hip )Izy,ll3 ) sin(hip ) sin(lls1 ) ( sin(hip ) cos(lls1 )Ixz,ll3 + sin(hip ) sin(lls1 )Iyz,ll3 cos(hip )Izz,ll3 ) cos(hip )
LL4
( sin(hip ) cos(lls2 )Ixx,ll4 + sin(hip ) sin(lls2 )Ixy,ll4 cos(hip )Izx,ll4 ) sin(hip ) cos(lls2 ) + ( sin(hip ) cos(lls2 )Ixy,ll4 + sin(hip ) sin(lls2 )Iyy,ll4 cos(hip )Izy,ll4 ) sin(hip ) sin(lls2 )
+ mll4 (arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ))2
+(ahip + all1 (rl5 ll1 ) + all2 (ll1 rl5 ) + all3 (ll1 ))2
247
248
LL5
+ (( sin(hip ) cos(lls2 ) cos(ll5 ) cos(hip ) sin(ll5 ))Ixx,ll5 + (sin(hip ) cos(lls2 ) sin(ll5 ) cos(hip ) cos(ll5 ))Ixy,ll5 sin(hip ) sin(lls2 )Izx,ll5 )( sin(hip ) cos(lls2 ) cos(ll5 ) cos(hip ) sin(ll5 )) + (( sin(hip ) cos(lls2 ) cos(ll5 ) cos(hip ) sin(ll5 ))Ixy,ll5 + (sin(hip ) cos(lls2 ) sin(ll5 ) cos(hip ) cos(ll5 ))Iyy,ll5 sin(hip ) sin(lls2 )Izy,ll5 )(sin(hip ) cos(lls2 ) sin(ll5 ) cos(hip ) cos(ll5 )) (( sin(hip ) cos(lls2 ) cos(ll5 ) cos(hip ) sin(ll5 ))Ixz,ll5 + (sin(hip ) cos(lls2 ) sin(ll5 ) cos(hip ) cos(ll5 ))Iyz,ll5 sin(hip ) sin(lls2 )Izz,ll5 ) sin(hip ) sin(lls2 )
+ mll5 (arl2 + arl3 + arl4 all1 all2 cos(ll1 ) all3 cos(ll2 ) all4 cos(ll3 ))2
+(ahip + all1 (rl5 ll1 ) + all2 (ll1 rl5 ) + all3 (ll1 ) + all4 (ll1 ))2
Right arm
+ (( sin(rl5 ) cos(ra1 ) sin(ra2 ) + cos(rl5 ) cos(ra2 ))Ixx,ra + ( sin(rl5 ) cos(ra1 ) sin(ra2 ) + cos(rl5 ) sin(ra2 ))Iyx,ra + sin(rl5 ) sin(ra1 )Izx,ra ) ( sin(rl5 ) cos(ra1 ) sin(ra2 ) + cos(rl5 ) cos(ra2 ))
+ (( sin(rl5 ) cos(ra1 ) sin(ra2 ) + cos(rl5 ) cos(ra2 ))Ixy,ra + ( sin(rl5 ) cos(ra1 ) cos(ra2 ) cos(rl5 ) sin(ra2 ))Iyy,ra + sin(rl5 ) sin(ra1 )Izy,ra ) ( sin(rl5 ) cos(ra1 ) cos(ra2 ) cos(rl5 ) sin(ra2 ))
APPENDIX G. LAGRANGE
+ (( sin(rl5 ) cos(ra1 ) sin(ra2 ) + cos(rl5 ) cos(ra2 ))Ixz,ra + ( sin(rl5 ) cos(ra1 ) cos(ra2 ) cos(rl5 ) sin(ra2 ))Iyz,ra + sin(rl5 ) sin(ra1 )Izz,ra ) sin(rl5 ) sin(ra1 )
+ marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yra cos(ra ))2 + (49.1 + Xra )2 )
Left arm
+ ((sin(rl5 ) cos(la1 ) sin(la2 ) cos(rl5 ) cos(la2 ))Ixx,la + (sin(rl5 ) cos(la1 ) cos(la2 ) + cos(rl5 ) sin(la2 ))Iyx,la sin(rl5 ) sin(la1 )Izx,la ) (sin(rl5 ) cos(la1 ) sin(la2 ) cos(rl5 ) cos(la2 )) + ((sin(rl5 ) cos(la1 ) sin(la2 ) cos(rl5 ) cos(la2 ))Ixy,la + (sin(rl5 ) cos(la1 ) cos(la2 ) + cos(rl5 ) sin(la2 ))Iyy,la sin(rl5 ) sin(la1 )Izy,larm ) (sin(rl5 ) cos(la1 ) cos(la2 ) + cos(rl5 ) sin(la2 )) ((sin(rl5 ) cos(la1 ) sin(la2 ) cos(rl5 ) cos(la2 ))Ixz,la + (sin(rl5 ) cos(la1 ) cos(la2 ) + cos(rl5 ) sin(la2 ))Iyz,la sin(rl5 ) sin(la1 )Izz,la ) sin(rl5 ) sin(la1 )
+ marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + Yla cos(la- ))2 + (110.7 Xla )2 )
Using the same procedure as for the previous inertia are the following expressions found.
LL3
2 +Izz,ll3 + mll3 a2 rl2 + ahip
LL4
249
250
LL5
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip
Right arm
+ Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra
+ marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yra cos(ra ))2 + (49.1 + Xra )2 )
Left arm
+ Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la
+ marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + Yla cos(la- ))2 + (110.7 Xla )2 )
2 Irl2,t = Izz,rl2 + Izz,rl4 + mrl4 (arl2 + arl3 )2 + rl5 Ixx,t + Iyy,t + mt ((arl2 + arl3 + arl4 + Xt )2 )
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip + Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra + marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra ) Yra cos(ra ))2 + (49.1 + Xra )2 ) + Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la + marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + Yla cos(la- ))2 + (110.7 Xla )2 )
APPENDIX G. LAGRANGE
Note that for Irl2,t is rl2 not at part of the sums such as ra+ and ll1 . The subscripts have not been changed as this would introduce more variables which would make i harder to follow the calculations.
The moments of inertia seen from the rest of the links can be found in the same way, but for this project are these two sucient.
251
L=
ki
pi
(G.8)
The torque for each link is determined using the following rule:
i =
d L L dt i i
(G.9)
The reason why the generalized forces are torques is that the generalized coordinates are angles. The determined torque is the torque the biped does apply to the servomotors along the z axis. The regulation and control of the biped is done by adjusting the angles to obtain a certain output from the strain gauges on the supporting foot which is mapped to a certain torque in the origin of the base frame. Hence the only two torques of interest is, the torque in joint RL1 to determine how the foot is loaded in the frontal plane, and the torque in joint RL2 to determine how the foot is loaded in the sagittal plane. These two torques are the most complicated to determine since they have to take the whole biped into account, and therefore are the calculations divided into two steps, as seen in Eq. (G.10).
rl1 =
d L L 1 dt 1
step 1 step 2
(G.10)
rl2 =
d L L 2 dt 2
Torque in RL1
First step one for rl1 . To make the calculations more foreseeable are the dierentiations divided into a part with the linear kinetic- and potential energy, and a part with the rotational kinetic energy. Beginning with the linear part of step one. For shortness does arl replace arl1 + arl2 + arl3 + arl4 .
252
d Ll d = k + krl2,l + krl4,l + kll1,l + kll3,l + kll4,l + kll5,l + kt,l + kra,l + kla,l rl1 dt rl1 rl1,l dt d 1 1 2 rl1 )2 + 1 mrl4 ((arl1 + arl2 + arl3 ) rl1 )2 = mrl1 a2 mrl2 ((arl1 + arl2 ) rl1 rl1 + dt rl1 2 2 2 1 rl1 )2 + ((arl ) rl1 )2 + mt (arl sin(rl1 ) 2 1 rl1 )2 + ((arl1 + arl2 + arl3 ) rl1 all1 ( rl5 + ll1 ))2 + mll1 (arl sin(rl1 ) 2 1 rl1 + all2 sin(ll1- ) ll1- )2 + mll3 (arl sin(rl1 ) 2 rl1 (all1 + all2 )( rl5 + ll1 ))2 +((arl1 + arl2 + arl3 )
1 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )2 + mll4 (arl sin(rl1 ) 2 rl1 (all1 + all2 )( rl5 + ll1 ) all3 ll1 )2 +((arl1 + arl2 + arl3 )
APPENDIX G. LAGRANGE
1 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- )2 + mll5 (arl sin(rl1 ) 2 rl1 (all1 all2 )( rl5 + ll1 ) (all3 + all4 ) ll1 )2 +((arl1 + arl2 + arl3 )
1 rl1 + (YCoM,ra 18.7) sin(ra+ )ra+ )2 + (arl rl1 )2 + marm (arl sin(rl1 ) 2 1 rl1 (YCoM,la + 18.7) sin(la+ )la+ )2 + (arl rl1 )2 + marm (arl sin(rl1 ) 2
d 2 2 2 2 2 mrl1 a2 rl1 rl1 + mrl2 (arl1 + arl2 ) rl1 + mrl4 (arl1 + arl2 + arl3 ) rl1 + mt (arl sin(rl1 ) + arl )rl1 dt rl1 + ((arl1 + arl2 + arl3 ) rl1 all1 ( rl5 + ll1 ))(arl1 + arl2 + arl3 ) + mll1 a2 sin(rl1 )2
rl
rl1 (all1 + all2 )( rl5 + ll1 ))(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 )
rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )(arl sin(rl1 )) + mll4 (arl sin(rl1 )
rl1 (all1 + all2 )( rl5 + ll1 ) all3 ll1 )(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 )
rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- )(arl sin(rl1 )) + mll5 (arl sin(rl1 )
rl1 (all1 all2 )( rl5 + ll1 ) (all3 + all4 ) ll1 )(arl1 + arl2 + arl3 ) +((arl1 + arl2 + arl3 )
rl1 + (YCoM,ra 18.7) sin(ra+ ) ra+ )(arl sin(rl1 )) + a2 + marm (arl sin(rl1 ) rl rl1
(G.11)
rl1 (YCoM,la + 18.7) sin(la- ) la- )(arl sin(rl1 )) + a2 + marm (arl sin(rl1 ) rl rl1
253
254
d Lr d = k rl1 dt rl1 rl1,r dt d 1 2 = I + Iyy,rl2 + mrl2 (arl1 + arl2 )2 + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 )2 rl1 2 rl1 zz,rl1 dt
2 2 2 2 +Ixx,ll3 + mll3 (arl1 + arl2 )2 + a2 hip + sin (ll3- )Ixx,ll4 + cos (ll3- )Iyy,ll4 + mll4 arl1 + ahip
2 2 + sin2 (ll3- )Ixx,ll5 + cos2 (ll3- )Izz,ll5 + mll5 a2 hip + sin (ra+ )Iyy,rarm + cos (ra+ )Izz,ra
+marm ((arl + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 ) + sin2 (la- )Iyy,larm
+ cos2 (la- )Izz,ra + marm ((arl + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 )
d d Lr 2 2 = rl1 Izz,rl1 + Iyy,rl2 + mrl2 (arl1 + arl2 ) + Iyy,rl4 + mrl4 (arl1 + arl2 + arl3 ) dt rl1 dt
2 2 2 2 +Ixx,ll3 + mll3 (arl1 + arl2 )2 + a2 hip + sin (ll3- )Ixx,ll4 + cos (ll3- )Iyy,ll4 + mll4 arl1 + ahip
2 2 + sin2 (ll3- )Ixx,ll5 + cos2 (ll3- )Izz,ll5 + mll5 a2 hip + sin (ra+ )Iyy,ra + cos (ra+ )Izz,ra
+marm ((arl + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 ) + sin2 (la- )Iyy,la
(G.12)
APPENDIX G. LAGRANGE
+ cos2 (la- )Izz,ra + marm ((arl + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 )
255
These expressions are not dierentiated with regard to time because it is easy to do on the computer and it also keeps the expressions simpler and more foreseeable. Now for step two.
L = (kll1,l + kll3,l + kll4,l + kll5,l + kbody,l + kra,l + kla,l rl1 rl1 pCoM,t pll1 pll3 pll4 pll5 pCoM,ra pCoM,la ) 2 1 rl1 + 1 mll3 (arl sin(rl1 ) rl1 + all2 sin(ll1- ) ll1- )2 = mll1 arl sin(rl1 ) rl1 2 2 1 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )2 + mll4 (arl sin(rl1 ) 2 1 rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- )2 + mll5 (arl sin(rl1 ) 2 1 rl1 )2 + mt (arl sin(rl1 ) 2 1 rl1 + (YCoM,ra 18.7) sin(ra+ )ra+ )2 + marm (arl sin(rl1 ) 2 1 rl1 (YCoM,la + 18.7) sin(la+ )la+ )2 + marm (arl sin(rl1 ) 2 mt g (arl cos(rl1 ) + XCoM,t ) mll1 g (arl cos(rl1 ) all1 ) mll3 g (arl cos(rl1 ) all1 all2 cos(ll1- )) mll4 g (arl cos(rl1 ) all1 all2 cos(ll1- ) all3 cos(ll2- )) mll5 g (arl cos(rl1 ) all1 all2 cos(ll1- ) all3 cos(ll2- ) all3 cos(ll3- )) mra g (arl cos(rl1 ) + 50.5 + 18.7 cos(ra+ ) YCoM,arm ) mla g (arl cos(rl1 ) + 50.5 + 18.7 cos(la- ) + YCoM,arm )
2 =mll1 a2 rl sin(rl1 ) cos(rl1 )rl1 + mll3 (arl sin(rl1 )rl1 + all2 sin(ll1- )ll1- )(arl cos(rl1 )rl1 ) rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )(arl cos(rl1 ) rl1 ) + mll4 (arl sin(rl1 ) rl1 + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2+ mll5 arl sin(rl1 ) ll3- (arl cos(rl1 ) rl1 ) +all4 sin(ll3- ) 2 + mt (a2 rl sin(rl1 ) cos(rl1 )rl1 ) rl1 + (YCoM,ra 18.7) sin(ra+ )ra+ (arl cos(rl1 ) rl1 ) + marm arl sin(rl1 ) rl1 (YCoM,la + 18.7) sin(la+ )la+ (arl cos(rl1 ) rl1 ) + marm arl sin(rl1 ) + (mll1 + mll3 + mll4 + mll5 + mt + mra + mla )garl sin(rl1 )
(G.13)
Subtracting the Eq.(G.13) from Eq.(G.11) and Eq.(G.12) gives the torque in joint RL1, rl1 , but due to the large subexpressions it will not be written as a single expression.
Torque in RL2
Using the same procedure as for rl1 is rl2 determined, but note that now xrl5,2 is used i favor of xrl5 as RL2 rotate in the sagittal plane. First the linear part of step one. Since arl4 = all1 is the expression shortened a bit.
256
d d Ll = (k + krl4,l + kll1,l + kll3,l + kll4,l + kll5,l + kt,l + kra,l + kla,l ) rl2 dt rl2 rl2,l dt d 1 2 + 1 mrl4 (arl2 rl2 arl3 ( rl2 + rl3 ))2 = m a2 rl2 2 rl2 rl2 rl2 dt 2
2
1 mll1 2 1 + mll3 2
2
rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) arl2 rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- )2 + ( sin(rl2 )
ll1+all2 cos(ll1- )
+
2
1 mll4 2
rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) arl2 rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )2 + ( sin(rl2 )
+
2
1 mll5 2
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- )2 +( sin(rl2 )
1 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) XCoM,t ( rl ))2 + ( sin(rl2 ) rl2 (arl2 + arl3 ))2 mt (arl2 2 2 1 rl2 (arl2 + arl3 ) + (YCoM,ra 18.7) sin(ra+ ) ra + arl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) sin(rl2 ) + marm 2
2
+
2
1 marm 2
APPENDIX G. LAGRANGE
d (mrl2 a2 rl2 )rl2 + mrl4 (arl2 rl2 arl3 (rl2 + rl3 ))(arl2 arl3 ) dt rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) (arl2 arl3 ahip rl5 ) + (sin(rl2 )2 rl2 (arl2 + arl3 )2 ) + mll1 arl2
+ mll3
rl2 arl3 ( rl2 + rl3 ) ahip ((rl ) rl5 + ( rl )rl5 ) + all2 cos(ll1- ) ll1arl2
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- )( sin(rl2 )(arl2 + arl3 ) + all2 sin(ll1- )) +( sin(rl2 )
+ mll4
ll1- + all3 cos(ll2- ) ll2- (arl2 arl3 ahip rl5 + all2 cos(ll1- ) + all3 cos(ll2- )) +all2 cos(ll1- )
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- )( sin(rl2 )(arl2 + arl3 ) + all2 sin(ll1- ) + all3 sin(ll2- )) +( sin(rl2 )
+ mll5
(arl2 arl3 ahip rl5 + all2 cos(ll1- ) + all3 cos(ll2- ) + all4 cos(ll3- )) rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3- ) +( sin(rl2 )
( sin(rl2 )(arl2 + arl3 ) + all2 sin(ll1- ) + all3 sin(ll2- ) + all4 sin(ll3- )))
+ mt
rl2 arl3 ( rl2 + rl3 ) (arl4 + XCoM,t )( rl ) (arl2 arl3 arl4 XCoM,t ) + sin(rl2 )2 rl2 (arl2 + arl3 )2 arl2
rl2 (arl2 + arl3 ) + (YCoM,ra 18.7) sin(ra+ ) ra+ )( sin(rl2 )(arl2 + arl3 ) + (YCoM,ra 18.7) sin(ra+ )) + marm ( sin(rl2 )
ra+ (arl2 arl3 arl4 50.5 + (YCoM,ra 18.7) cos(ra+ )) +(YCoM,ra 18.7) cos(ra+ )
rl2 (arl2 + arl3 ) + (YCoM,la 18.7) sin(la- ) la- )( sin(rl2 )(arl2 + arl3 ) + (YCoM,la 18.7) sin(la- )) + marm ( sin(rl2 )
257
la- (arl2 arl3 arl4 50.5 (YCoM,la + 18.7) cos(la- )) (YCoM,la + 18.7) cos(la- )
258
d Lr d = k rl2 dt rl2 rl2,r dt d 1 2 2 = I + Izz,rl4 + mrl4 (arl2 + arl3 )2 + rl5 Ixx,t + Iyy,t + mt ((arl2 + arl3 + arl4 + Xt )2 ) rl2 2 rl2 zz,rl2 dt
2 2 2 +Iyy,ll1 + mll1 ((arl2 + arl3 )2 + a2 hip ) + Izz,ll3 + mll3 arl2 + ahip + Izz,ll4 + mll4 ahip
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip
+Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 )
+Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 )
d Lr d 2 = I + Izz,rl4 + mrl4 (arl2 + arl3 )2 + rl5 Ixx,t + Iyy,t + mt ((arl2 + arl3 + arl4 + Xt )2 ) rl2 dt rl2 zz,rl2 dt
2 2 2 +Iyy,ll1 + mll1 ((arl2 + arl3 )2 + a2 hip ) + Izz,ll3 + mll3 arl2 + ahip + Izz,ll4 + mll4 ahip
(hip cos(lls2 ) + ll5 )2 Ixx,ll5 + Iyy,ll5 + mll5 (all4 cos(ll3 ))2 + a2 hip
+Ixx,ra + 2(rl5 ra1 )Izx,ra (rl5 + ra2 )Ixy,ra + (rl5 + ra2 )2 Iyy,ra
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(ra+ ) YCoM,ra cos(ra+ ))2 + (49.1 + XCoM,ra )2 )
(G.15)
+Ixx,la + 2(rl5 la1 )Izx,la (rl5 + la2 )Ixy,la + (rl5 + la2 )2 Iyy,la
APPENDIX G. LAGRANGE
+marm ((arl2 + arl3 + arl4 + 50.5 + 18.7 cos(la- ) + YCoM,la cos(la- ))2 + (110.7 XCoM,la )2 )
L = (kt + kll1,l + kll3,l + kll4,l + kll5,l + kra,l + kla,l pt pll1 pll3 pll4 pll5 pra pla ) rl2 rl2 1 rl2 (arl2 + arl3 ))2 = mt ( sin(rl2 ) rl2 2 2 1 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) all1 ( rl ) + ( sin(rl2 ) rl2 (arl2 + arl3 ))2 mll1 arl2 2 2 1 rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + arl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) + mll3 sin(rl2 ) 2
2
1 + mll4 2
2
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2 sin(rl2 )
rl5 + ( rl )rl5 ) all1 ( rl ) + all2 cos(ll1- ) ll1- + all3 cos(ll2- ) ll2ahip ((rl )
1 + mll5 2
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3 sin(rl2 )
rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) + arl2
2
1 + marm 2
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) + (YCoM,ra 18.7) cos(ra+ ) ra+ + arl2
2
1 + marm 2
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) (YCoM,la + 18.7) cos(la- ) la+ arl2
259
mt g (arl1 + (arl2 + arl3 ) cos(rl2 ) + arl4 ) mll1 g ((arl2 + arl3 ) cos(rl2 ) + arl4 )
mll3 g ((arl2 + arl3 ) cos(rl2 ) + arl4 all2 cos(ll1- )) mll4 g ((arl2 + arl3 ) cos(rl2 ) + arl4 all2 cos(ll1- ) all3 cos(ll2- )) mll5 g ((arl2 + arl3 ) cos(rl2 ) + arl4 all2 cos(ll1- ) all3 cos(ll2- ) all4 cos(ll3- ))
260
Dierentiate this expression with regrad to rl2 gives L 2 (arl2 + arl3 )2 )+ =mt ( sin(rl2 ) cos(rl2 ) rl2 rl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) all1 ( rl ) (ahip rl5 ) + ( sin(rl2 ) cos(rl2 ) 2 (arl2 + arl3 )2 ) mll1 arl2 rl2
+ mll3
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- ( cos(rl2 ) rl2 (arl2 + arl3 ) + all2 cos(ll1- ) ll1- ) sin(rl2 )
rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) all1 ( rl ) + all2 cos(ll1- ) ll1- (ahip rl5 all2 sin(ll1- ) ll1- ) + arl2 rl2 (arl2 + arl3 ) cos(rl2 )
+ mll4
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2 sin(rl2 )
ll1- + all3 cos(ll2- ) ll2- + arl2 rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) +all2 cos(ll1- )
rl ) + all2 cos(ll1- ) ll1- + all3 cos(ll2- ) ll2- (ahip rl5 all2 sin(ll1- ) ll1- all3 sin(ll2- ) ll2- ) all1 (
+ mll5
rl2 (arl2 + arl3 ) + all2 sin(ll1- ) ll1- + all3 sin(ll2- ) ll2- + all4 sin(ll3- ) ll3 sin(rl2 )
rl2 (arl2 + arl3 ) + all2 cos(ll1- ) ll1- + all3 cos(ll2- ) ll2- + all4 cos(ll3- ) ll3- ) ( cos(rl2 )
rl2 arl3 ( rl2 + rl3 ) arl4 ( rl ) ahip ((rl ) rl5 + ( rl )rl5 ) + arl2
rl5 all2 sin(ll1- ) ll1- all3 sin(ll2- ) ll2- all4 sin(ll3- ) ll3- ) (ahip
rl2 (arl2 + arl3 ) + (YCoM,ra 18.7) ra+ sin(ra+ ))( cos(rl2 ) rl2 (arl2 + arl3 ) + (YCoM,ra 18.7) ra+ cos(ra+ )) + marm ( sin(rl2 )
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) + (YCoM,ra 18.7) cos(ra+ ) ra+ ((YCoM,ra 18.7) sin(ra+ ) ra+ ) + arl2
rl2 (arl2 + arl3 ) (YCoM,la + 18.7) la- sin(la- ))( cos(rl2 ) rl2 (arl2 + arl3 ) (YCoM,la + 18.7) la- cos(la- )) + marm ( sin(rl2 )
APPENDIX G. LAGRANGE
rl2 arl3 ( rl2 + rl3 ) (arl4 + 50.5)( rl ) (YCoM,la + 18.7) cos(la- ) la- ((YCoM,la + 18.7) sin(la- ) la- ) + arl2
+ mt g (arl2 + arl3 ) sin(rl2 ) + mll1 g (arl2 + arl3 ) sin(rl2 ) + mll3 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- )) + mll4 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- ) all3 sin(ll2- ))
(G.16)
+ mll5 g ((arl2 + arl3 ) sin(rl2 ) all2 sin(ll1- ) all3 sin(ll2- ) all4 sin(ll3- )) + marm g ((arl2 + arl3 ) sin(rl2 ) + (18.7 YCoM,ra ) sin(ra+ )) + marm g ((arl2 + arl3 ) sin(rl2 ) + (18.7 + YCoM,la ) sin(la- ))
By adding Eq. (G.14) and Eq. (G.15) and subtracting Eq. (G.16) is the torque in joint RL2 determined.
A more detailed knowledge about the other torques on the biped can be achieved using the same procedure, but as this project has no need for these torques they are not determined.
Appendix
old
new
263
Contact surface
Contact surface
Contact surface
Contact surface
Figure H.2: The possible attacking point with the old feet design
FSR 1 FSR 2 F
Figure H.3: The possible attacking point with the new feet design
(a)
(b)
Figure H.4: In gure a is the dashed area where the force gives output to the sensors. In gure a is it shown for the old design and in b is it for the new design.
the foot give the same output when the same force is applied. But this is not the case, as the sensors drift with temperature and the sensitive for the FSR is typically 10 [Fraden, 2004].
Appendix
Nomenclature
This chapter gives a brief description of the meaning of the symbols and abbreviation used throughout the report. How the dierent quantities and symbols are typographically represented is also given here, as is the meaning and value of all the constants used throughout the report. First, a table containing the used abbreviation is given in Sec. I.1 on page 264. In Sec. I.2, the typographic representation of the dierent quantities and symbols is described. The symbols generally used for dierent physical quantities are also listed. In Sec. I.3 on 266, a description of the joint angles of the biped robot is given. In Sec. I.4 on 268, all the used constants are dened and their value given.
264
265
Example b {B } B b B
When a vector is given a prex in superscript, it denotes the frame, in which the vector is given. For example, the following denotes a vector v given in frame {A}:
A
(I.1)
A transformation matrices, denoted T , is used to transform vectors between frames, see page 40. A transformation matrix, mapping a vector from frame {B } to {A}, is represented as A BT . Hence:
A B v=A BT v
(I.2)
Correspondingly, a rotation matrix R mapping the orientation of a vector given in frame {B } into frame {A} coordinates, is denoted A BR . The symbols and typographic used for representing dierent physical vector quantities is seen in Tab. I.3.
If the vector symbols of Tab. I.3 is not typeset in bold during the report, it means the length of the vector. For example:
F =
(I.3)
To name variable of same type, subscripts are used. For example, joint angle of joint RL2 is denoted:
rl2
(I.4)
266
APPENDIX I. NOMENCLATURE
Position vectors describing the position of a frame origin have org in their subscript. For example, the origin of frame {LA0 } seen from {RL5 } is given by the following vector:
rl5
pla0,org
(I.5)
The position vectors describing the location of CoMs have double subscripts with a C in the rst subscript. For example, the CoM location of link RL1 given in frame {RL1 } is:
rl1
pCrl1
(I.6)
Joint Angles
The joint angles used through the modelling are given in Tab.I.4. The rst column shows the symbol of the joint angle variable. In the second column the physical meaning of the variables are described where the terms roll, pitch and yaw is used as dened in Ch. 2. The third species the plane of rotation, note that in zero position roll corresponds to a rotation in the frontal plane, a pitch corresponds to a rotation in the sagittal plane, and a yaw corresponds to a rotation in the horizontal plane. In the fourth column the zero position is given. The fth column species the approximate maximum range of the joint angles. Where maximum means that in some cases depending on other joint positions, the joint will have less freedom of rotation.
267
Range [45 ; 45 ] [90 ; 90 ] [90 ; 0 ] [90 ; 90 ] [0 ; 90 ] [90 ; 0 ] [90 ; 90 ] [90 ; 0 ] [90 ; 90 ] [90 ; 0 ] [90 ; 0 ]
ra1 ra2 ra3 ra4 ra5 la1 la2 la3 la4 la5
Other Variables
268
I.4 Constants
In this section the meaning of all the constants used throughout the report is given along with their value. The rst three tables contains the link parameters used in the Denavit-Hartenberg notation: In Tab. I.7 the link lengths are listed, in Tab. I.8 on page 270 the link twists are listed, and in Tab. I.9 on page 271 the link osets are listed. These constants are taken from [rts et al., 2006]. In Tab. I.10 on page 271 the masses of the links of the robot are given. These constants are taken from [rts et al., 2006], except for the torso, where extra weight have been added due to the mounted microcontroller. On page 272 the position of the CoMs for the dierent link are found, and on page 273 the inertia tensors for the links are listed. These are also from [rts et al., 2006]. The position of the accelerometers is given on page 274, and nally some additional lengths concerning the feet is given on page 275.
Link Lengths
Table I.7: Link length.
Constant arl1 Interpretation Link length from the roll axis to the pitch axis of the right ankle. Link length from the pitch axis of the right ankle to the pitch axis of the right knee. Link length from the pitch axis of the right knee to the pitch axis of the right hip. Link length from the pitch axis to the roll axis of the right hip. Link length from the pitch axis to the roll axis of the left hip. Continued on Value 0.0429 m 0.0572 m 0.0429 m 0.0429 m 0.0429 m next page
269
all3 all4 ara1 ara2 ara3 ara4 ala1 ala2 ala3 ala4
Link Twists
Table I.8: Link Twists.
Constant rl1 Interpretation Value Link twist between the roll axis and the pitch axis 90 of the right ankle. Link twist between the pitch axis of the right an- 0 kle and the pitch axis of the right knee. Link twist between the pitch axis of the right knee 0 and the pitch axis of the right hip. Link twist between the pitch axis and the roll axis 90 of the right hip. Link twist between the roll axis and the pitch axis 90 of the left hip. Link twist between the pitch axis of the left hip 0 and the pitch axis of the left knee. Link twist between the pitch axis of the left knee 0 and the pitch axis of the left ankle. Link twist between the pitch axis and the roll axis 90 of the left ankle. Link twist between the pitch axis and the roll axis 90 of the right shoulder. Continued on next page
270
90 0 90 90 90 0
Link osets
Table I.9: Link osets.
Constant drl1 Interpretation Link oset between the roll axis and the pitch axis of the right ankle. Link oset between the pitch axis of the right ankle and the pitch axis of the right knee. Link oset between the pitch axis of the right knee and the pitch axis of the right hip. Link oset between the pitch axis and the roll axis of the right hip. Link oset between the roll axis and the pitch axis of the left hip. Link oset between the pitch axis of the left hip and the pitch axis of the left knee. Link oset between the pitch axis of the left knee and the pitch axis of the left ankle. Link oset between the pitch axis and the roll axis of the left ankle. Link oset between the pitch axis and the roll axis of the right shoulder. Link oset between the roll axis of the right shoulder and the yaw axis of the right elbow. Link oset between the yaw axis of the right elbow and the roll axis of the right wrist. Link oset between the roll axis of the right wrist and the roll axis of the right ngers. Link oset between the pitch axis and the roll axis of the left shoulder. Continued on Value 0m 0m 0m 0m 0m 0m 0m 0m 0m 0.0013 m 0.0688 m 0m 0m next page
drl2 drl3 drl4 dll1 dll2 dll3 dll4 dra1 dra2 dra3 dra4 dla1
271
dla3 dla4
Center of Masses
Table I.10: Center of masses.
Constant mrl,foot mrl1 mrl2 mrl3 mrl4 mll1 mll2 mll3 mll4 mll5 mra1 mra2 mra3 mra4 mra5 mla1 mla2 mla3 mla4 mla5 mt Interpretation The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the The mass of the right foot right ankle right shin right thigh right hip left hip left thigh left shin left ankle left foot right shoulder right overarm right forearm right wrist right ngers left shoulder left overarm left forearm left wrist left ngers torso Value 0.0988 kg 0.08164 kg 0.08164 kg 0.02117 kg 0.0817 kg 0.0817 kg 0.02117 kg 0.08164 kg 0.08164 kg 0.0988 kg 0.01166 kg 0.14211 kg 0.01166 kg 0.13200 kg 0.01385 kg 0.01166 kg 0.14211 kg 0.01166 kg 0.13200 kg 0.01385 kg 0.3537 kg
272
APPENDIX I. NOMENCLATURE
pCrl,foot
rl3
pCrl3
0.00515 = 0.00859 m, 0.00455 0.02819 = 0.00039 m, 0.00087 0.03840 = 0.00463 m, 0.00731 0.00450 = 0.00731 m, 0.00526 0.00584 m, 0 = 0.01526 0.01629 = 0.00083 m, 0.00399 0.00584 m, 0 = 0.01526 0.016231 = 0.00085 m, 0.00398 0.03426 = 0.03084 m 0.00817
rl1
pCrl1
rl4
pCrl4
0.03840 = 0.00573 m, 0.00602 0.00450 = 0.00731 m 0.00541 0.02819 = 0.00039 m, 0.00087 0.00515 = 0.00859 m 0.00455
rl2
pCrl2
Left leg
ll1
pCll1
ll2
pCll2
ll3
pCll3
ll4
pCll4
ll5
pCll5
Right arm
ra1
pCra1
ra4
pCra4
0.01472 ra2 pCra2 = 0.01015 m, 0.00784 0.00114 ra5 pCra5 = 0.03463 m 0.00122 0.01472 = 0.01015 m, 0.00784 0.00114 = 0.03463 m 0.00127
ra3
pCra3
0.00584 m 0 = 0.01526
Left arm
la1
pCla1
la2
pCla2
la3
pCla3
0.00584 m 0 = 0.01526
la4
pCla4
la5
pCla5
Torso
rl5
pCrl5
CRA2 CRA3 CRA1 CT CRA4 CRA5 CLL1 CRL4 C LL2 CRL3 C CRL3 LL3 CRL2 CRL1 CRL,foot CLL5 CLL4 CRL2 CLA1 CLA3 CLA4
CLA2
[m]
CLA5
[m]
[m]
[m]
I.4. CONSTANTS
273
Inertia Matrices
Right leg
Crl,foot
I rl,foot
Crl1
I rl1
Crl2
I rl2
Crl3
I rl3
Crl4
I rl4
0.00006187 0.00000073 0.00000151 = 0.00000073 0.00004666 0.00000155 kg m2 0.00000151 0.00000155 0.00002896 0.00002354 0.00000156 0.00000104 = 0.00000156 0.00002348 0.00000201 kg m2 0.00000104 0.00000201 0.00002085 0.00002374 0.00000126 0.00000157 = 0.00000126 0.00002529 0.00000181 kg m2 0.00000157 0.00000181 0.00001907 0.00001107 0 0 kg m2 0 0.00001603 0 = 0 0 0.00000713 0.00002374 0.00000158 0.00000126 = 0.00000158 0.00001907 0.00000181 kg m2 0.00000126 0.00000181 0.00002529
Left leg
Cll1
I ll1
Cll2
I ll2
Cll3
I ll3
Cll4
I ll4
Cll5
I ll5
0.00002374 0.00000126 0.00000158 = 0.00000126 0.00002529 0.00000181 kg m2 0.00000158 0.00000181 0.00001907 0.00001107 0 0 kg m2 0 0.00001603 0 = 0 0 0.00000713 0.00002374 0.00000157 0.00000126 = 0.00000157 0.00001907 0.00000181 kg m2 0.00000126 0.00000181 0.00002529 0.00002354 0.00000156 0.00000104 = 0.00000156 0.00002348 0.00000201 kg m2 0.00000104 0.00000201 0.00002085 0.00006187 0.00000073 0.00000151 0.00000155 kg m2 = 0.00000073 0.00004666 0.00000151 0.00000155 0.00002896
274
Right arm
Cra1
APPENDIX I. NOMENCLATURE
I ra1
Cra2
I ra2
Cra3
I ra3
Cra4
I ra4
Cra5
I ra5
0.000007212 0 0.000000885 kg m2 0 0.000002663 0 = 0.000000885 0 0.000006986 0.00003555 0.00000372 0.00000068 = 0.00000372 0.00004920 0.00000021 kg m2 0.00000068 0.00000021 0.00004917 0.000007212 0 0.000000885 kg m2 0 0.000002663 0 = 0.000000885 0 0.000006986 0.00003785 0.00000008 0.00000022 0.00004014 0.00000062 kg m2 = 0.00000008 0.00000022 0.00000062 0.00005021 0.00001174 0.00000087 0 kg m2 0 = 0.00000087 0.00000612 0 0 0.00000777
Left arm
Cla1
I la1
Cla2
I la2
Cla3
I la3
Cla4
I la4
Cla5
I la5
0.000007212 0 0.000000885 kg m2 0 0.000002663 0 = 0.000000885 0 0.000006986 0.00003535 0.00000426 0.00000163 = 0.00000426 0.00004911 0.00000032 kg m2 0.00000163 0.00000032 0.00004903 0.000007212 0 0.000000885 kg m2 0 0.000002663 0 = 0.000000885 0 0.000006986 0.00003789 0.00000044 0.00000025 0.00000060 kg m2 = 0.00000044 0.00004017 0.00000025 0.00000060 0.00005029 0.00001174 0.00000087 0 kg m2 0 = 0.00000087 0.00000612 0 0 0.00000777
Torso
Accelerometer Positions
0.0110 rl0 pSrl0 = 0.0110 m, 0.0470 0.0222 ra4 pSra4 = 0.0004 m, 0.0030 0.0110 = 0.0110 m, 0.0470 0.0212 = 0.0066 m 0.0030 0.0220 = 0.0300 m 0.0500
ll5
pSll5
rl5
pSrl5
la4
pSla4
I.4. CONSTANTS
275
Additional Constants
Table I.11: Additional Constants.
Constant lheels Interpretation The horizontal distance (sagittal plane) to the center of the heels from frame {RL0 } and {LL5 } The horizontal distance (sagittal plane) to the center of the toes from frame {RL0 } and {LL5 } The horizontal distance (frontal plane) to the center of little toe from frame {RL0 } and {LL5 } The horizontal distance (frontal plane) to the center of the big toe from frame {RL0 } and {LL5 } The center of the foot seen in frame {RL0 } Value 0.0608 m 0.0627 m 0.0315 m 0.0125 m [-0:02,0:0095,-0:001]T m
Appendix
276