Control of knee flexion in a knee simulator.
Dieter De Jongh
Willem Wargnye
Promotor: Prof. dr. ir. Robain De Keyser
Supervisor: ir. Amélie Chevalier
Master's dissertation submitted in order to obtain the academic degree of
Master of Science in Electromechanical Engineering
Department of Electrical Energy, Systems and Automation
Chairman: Prof. dr. ir. Jan Melkebeek
Faculty of Engineering and Architecture
Academic year 2013-2014
Control of knee flexion in a knee simulator
Dieter De Jongh
Willem Wargnye
Promotor: Prof. dr. ir. Robain De Keyser
Supervisor: ir. Amélie Chevalier
Master's dissertation submitted in order to obtain the academic degree of
Master of Science in Electromechanical Engineering
Department of Electrical Energy, Systems and Automation
Chairman: Prof. dr. ir. Jan Melkebeek
Faculty of Engineering and Architecture
Academic year 2013-2014
iv
The authors give permission to make this thesis available for consultation, and parts of the thesis to be copied for
personal use. Any other use is subject to the limitations of copyright, particularly with regard to the obligation to
explicitly mention the source when citing results from this thesis.
De auteurs geven de toelating deze thesis voor consultatie beschikbaar te stellen en delen van
de thesis te kopiëren voor persoonlijk gebruik. Elk ander gebruik valt onder de beperkingen van het auteursrecht,
in het bijzonder met betrekking tot de verplichting de bron uitdrukkelijk te vermelden bij het aanhalen van
resultaten uit deze thesis.
© 02/06/2014
De Jongh Dieter and Wargnye Willem
v
Preface
About twelve months ago we, Wargnye Willem and De Jongh Dieter, chose “control of a knee simulator” as a
subject for our master’s thesis. Originally the goal was to individually develop, implement and test several different
control strategies on a knee simulator apparatus situated at the University Hospitals of Ghent. Unfortunately it
turned out that this machine was frequently not available. Therefore it was decided after discussion with our
supervisor, A. Chevalier, to collaborate and develop a similar but scaled experimental apparatus. By the end of
this thesis the setup should be equipped with a data acquisition interface and a basic controller.
This paper is the report covering the long process from the design through to the final implementation and testing
of a controller. It was a subject on which we really enjoyed working as it allowed us for the first time to elaborate a
system control and automation project from scratch. It combined various aspects in the fields of biomedical
science, mechanics, electricity and system control. Nevertheless, this report cannot express the long days spent
in the lab or the joy felt when all pieces came together.
All of this work was conducted in the Control Engineering and Automation department of University of Ghent,
temporarily situated at the Technicum campus. None of the text of this thesis is taken directly from previously
published or collaborative articles, books, web pages or any other material without clear reference to the source.
The design of the experimental apparatus is completely our own. The construction of the required individual parts
was primarily done with the assistance from the EELAB department of the University of Ghent. The assembly, the
electrical part and the data acquisition interface are also of our own design and implementation with the sporadic
contribution of the EELAB and Automation department’s members.
vi
Acknowledgement
Writing and completing a master’s thesis successfully, cannot be done without the support of some important
people.
Firstly we wish to thank sincerely our promoter Robain De Keyser for making this subject available to thesis
students. Furthermore, his encouragement and insight helped to develop this knee simulator up to the point as it
stands to date.
We also would like to acknowledge our supervisor Amélie Chevalier for her help and guidance throughout the
entire project and for the constructive discussions we had. Her enthusiasm regarding the implementation and use
of system control in the field of biomedical experiments inspired us when faced with problems we came up
against.
In addition we would also like to express our gratitude to Stephan Dhondt and Tony Boone for their all-round help
with the production of the mechanical parts and to open their workshop to us.
In general a thesis indicates the end of many years of study. These last years at the university would not have
been such a special experience if it was not for our friends Robin Van Daele and Karel Ostin. Although they
specialize in different fields of engineering, their views and opinions were useful to re-examine our problems from
another angle of approach. Thank you all for the nice evenings in Ghent.
Our warmest thanks are reserved for our family. We are very grateful for their never-ending understanding,
support and patience during all ours years of study.
De Jongh Dieter and Wargnye Willem – 02/06/2014 – Gent
vii
viii
ix
x
Table of contents
Abbreviations xiii Chapter 1: Introduction 1
Chapter 2: Anatomy of the knee 3
2.1 Planes and axes of movement 3
2.2 Anatomy 4
2.2.1 Bones 4
2.2.2 Articular cartilage and menisci 6
2.2.3 Ligaments 6
2.2.4 Muscles 7
2.3 Movements 9
Chapter 3: Knee simulators 11
3.1 Introduction 11
3.2 The Oxford Knee Rig 11
3.2.1 Origin and construction 11
3.2.2 Dynamics 12
3.2.3 Control and measurement techniques 13
3.3 Robotic Knee Systems 14
3.4 Ghent Knee Rig 15
Chapter 4: development of a simulator 17
4.1 Introduction to the setup 17
4.2 Kinematics and dynamics 18
4.2.1 Quadriceps force 18
4.2.2 Quadriceps elongation 21
4.2.2.1 Distance between pulley centers 21
4.2.2.2 Covered circumference on knee pulley 22
4.2.2.3 Covered circumference on hip pulley 22
4.2.2.4 Stroke length 22
4.3 Electromechanical component 23
4.4 Mechanical Construction 24
xi
4.5 Electrical components 26
4.5.1 Power supply 26
4.5.2 Data acquisition 26
4.5.3 Motor driver 27
4.5.4 Sensors and safety 27
4.5.5 Overview 29
Chapter 5: finished knee simulator 30
5.1 Technical issues 30
5.2 Modifications 30
5.3 Final electrical setup 31
5.4 Labview 32
5.5 Finished simulator 32
Chapter 6: Theoretical modeling and simulation 34
6.1 Mathematical modeling 34
6.1.1 Dead band and driver 34
6.1.2 Motor 34
6.1.3 Actuation system 36
6.1.4 Knee simulator 37
6.1.4.1 Elongation 37
6.1.4.2 Stiffness 38
6.1.4.3 Hip angle 39
6.1.5 Overview 40
6.2 Simulation 43
6.3 Model insight 44
Chapter 7: System control 46
7.1 Objectives 46
7.1.1 General objectives 46
7.1.2 Thesis objectives 46
7.2 Staircase experiment 47
7.3 System identification 50
7.3.1 Parametric system identification 50
xii
7.3.2 Validation of identification results 51
7.3.3 Combined model for Simulation 52
7.4 Controllers 53
7.4.1 Control strategy 53
7.4.2 Disturbance rejection controllers 54
7.4.2.1 PD controller 54
7.4.2.2 PI controller 58
7.4.2.3 PID controller 61
7.4.2.4 Comparison PD,PI and PID 63
7.4.3 Setpoint tracking controller 66
7.4.3.1 PI controller 67
7.4.3.2 PID controller 68
7.4.3.3 Conclusion 68
Chapter 8: Conclusions and future work 69
8.1 Summary 69
8.2 Conclusion 69
8.3 Future work 70
8.4 Epilogue 70
Appendix A: financial overview 71
Appendix B: Matlab code to determine design parameters for actuator 72 Appendix C: Matlab code for the theoretic model 75 Appendix D: Labview program 77
References 83
xiii
Abbreviations
Ac Cross sectional area of the cable
ACL Anterior cruciate ligament
ALL Anterolateral ligament
B Viscous damping
CACSD Computer Aided Control System Design
CChp Covered circumference of the hip pulley
CChp0 Initial CChp
CCkp Covered circumference of the knee pulley
CCkp0 Initial CCkp
DAQ Data acquisition
DOF Degrees of freedom
e back electromagnetic force
Ec Young's modulus of the cable
Fq Quadriceps force
g Gravitational acceleration
GKR Ghent Knee Rig
HMI Human machine interface
Jact Total inertia of actuator
Jm Motor inertia
Kb Back EMF constant
Kc Spring constant of the cable
Kp Proportional gain
Kt Torque constant
L Electrical inductance of motor
Lc Length of the cable
LCL Lateral collateral ligament
Lf Length of the femur
Lp Length of the patella (leverage)
Lpees Length of the patellar ligament
Lt Length of the tibia
Mact Mass of the actuator
MCL Medial collateral ligament
Mf Mass of the femur
Mhip Mass of the hip joint
Mt Mass of the tibia
OKR Oxford Knee Rig
PCL Posterior cruciate ligament
PID proportional-integral-derivative
PWM Pulse width modulation
R Electrical resistance of motor
r Radius pulley
r1 Distance between ankle joint and knee
pulley
r2 Distance between hip joint and knee pulley
r3 Distance between ankle joint and hip joint
r4 Vertical distance between hip joint and hip
pulley
r5 Horizontal distance between hip joint and
hip pulley
r7 Initial distance between movable pulley
and hip joint
r8 Height movable pulley to femur
r9 Distance between hip- and movable pulley
r9,0 Distance between hip- and movable pulley
in upright position
RC Remote controlled
RLS Recursive least squares
SP Setpoint
Td Derivative time constant
Ti Integral time constant
Tm Motor torque
UFS universal force moment sensor
UH University Hospitals
α Angle between ground and tibia
α’ Complement of α
β Hip angle
ΔX Translation of movable pulley along femur
ϑ Flexion angle
ϒ Angle between femur and tibia
ϕ Angle between cable and tibia at the point
of attachment
© Thesis: Control of knee flexion in a knee simulator p 1 / 86
Chapter 1: Introduction
In 2006 the University of Ghent created a test rig, called a knee simulator, for medical research and educational
purposes. This device has been designed according to the generally accepted Oxford Knee Rig model and allows
the knee to move in a natural way. It executes a simple squat movement by inducing a force on the quadriceps
muscle of human cadaveric or artificial knees. During this motion the mutual interactions between the different
anatomical components and the forces acting upon them are examined.
Up to date the setup is not equipped with any kind of automation and as such it is very difficult to flex the knees
accurately to a desired flexion angle. The latter is defined as the angle between the upper leg and the imaginary
elongation of the lower leg. The lack of accuracy and repeatability leads to unsatisfactory experimental results as
the subsequent behaviour of anatomical structures is strongly dependent on the degree of flexion. To rule out
deviant testing results, a controller should be implemented onto the knee rig.
The development of an accurate control system for the Ghent Knee Rig (GKR) is challenged by the intrinsic
nonlinear relations between the different components of the setup as well as nonlinearities in the knee itself.
Furthermore, human knees are never exactly the same and consequently the controller should be robust enough
to deal with it or adapt its control strategy.
Besides ensuring that a knee flexes accurately to a given angle, it is also required that the trajectory to this
desired value follows a predefined path. This latter requirement allows to mimic the biomechanical behaviour of
the knee during walking, running, climbing stairs, etc.
At the moment the GKR is frequently used in medical experiments as well as for educational purposes.
Consequently not much time is available to test different control strategies. Therefore it was agreed with the
supervisor of this thesis, A. Chevalier, that the goal of the current work would be first of all to design and develop
a miniature version of the knee rig. Secondly, a P(I)(D) controller should be implemented and its performance in
the presence of the nonlinearities should be examined. More advanced control strategies will be subject for
further research.
The structure of this thesis can be roughly divided into 5 parts. The first part consists of the chapters 2 and 3 in
which some background is given on the anatomy of the knee and the design and characteristics of knee
simulators. The second part is made up of chapter 4 and 5, in which the design and development of a scaled and
modified version of the GKR is elaborated. This includes the choice of the different mechanical and electrical
components and their collaboration with the data acquisition system. Chapter 6 forms the third part of this thesis
which is devoted to derivation of a theoretical model of the system. In chapter 7 a parametric identification is
performed on the system and some controllers for disturbance rejection and setpoint tracking are developed.
Their performance is examined and mutually compared. Chapter 8 is the final part of this thesis and contains the
conclusion of this work together with suggestions for future work.
© Thesis: Control of knee flexion in a knee simulator p 2 / 86
Figure 1: own developed knee simulator
© Thesis: Control of knee flexion in a knee simulator p 3 / 86
Chapter 2: Anatomy of the knee
The knee joint is the biggest joint in the human body and is located in between the upper and lower leg. It can
transfer heavy loads whilst ensuring a great deal of flexibility and hence plays a crucial role in a wide variety of
everyday activities. As a consequence the knee joint is a complex anatomical structure composed of many
different parts.
This chapter has not the intension to give a complete anatomical explanation of the knee joint, but rather to
introduce some basic terminology. For a more in-depth description the reader is referred to other books.
2.1 Planes and axes of movement
To describe positions of the body, human anatomy direction adjectives are used since they indicate positions
relative to the anatomical planes (see Figure 2).The median plane or midsagittal plane passes through the trunk
of the body dividing it in left and right parts. Structures that lay closer or further to the median plane are
respectively referred to as medial and lateral. A plane parallel to the median plane is called a sagittal plane. The
coronal or frontal plane is the vertical plane dividing the body in posterior and anterior parts, wherein posterior and
anterior respectively refer to parts in the front or back of the body. The transverse plane is the horizontal plane
that addresses the upper and lower parts of the body as superior and inferior. Note that the direction adjectives
don’t necessary refer to the plane itself. For example, the patella or kneecap as a whole lays anterior of the
median plane, however the front and back of the patella can be addressed as the anterior and posterior side of
the patella. In addition, when describing distance referring to the point of attachment of a limb, ‘distal’ indicates
the further end in contrast to ‘proximal’ which defines the closer end.
Figure 2: Directional adjectives and anatomical planes of the body
Also motions are described relative to 3 perpendicular axes that are related to the anatomical planes. Each axis
describes two opposite translations and rotations. The sagittal axis lies in the median plane, perpendicular to the
frontal plane. The two opposite rotations around this axis are referred to as abduction and adduction, the
translation along this axis as anterior-posterior translation. The coronal axis lies in the frontal plane, perpendicular
© Thesis: Control of knee flexion in a knee simulator p 4 / 86
to the median plane and describes the flexion and extension rotations and medial/lateral translation. The third
axis, perpendicular to sagittal and coronal axis, is called the vertical or longitudinal axis. Here internal and
external are the opposite rotations and inferior-superior express translation.
2.2 Anatomy
The human knee acts primarily like a hinge between the upper and lower part of the leg and is made up of
different components, such as: bones, muscles, ligaments and menisci. In fact, the term knee does not refer to a
singular joint but rather to a capsule containing two different joints, namely the patellofemoral and the tibiofemoral
(see Figure 3).
The patellofemoral joint involves two bones: the femur (also called thighbone) and the patella (or kneecap).
Although the latter bone is relatively small compared to the surrounding bones, it fulfils two important tasks: firstly,
it creates a leverage for the quadriceps tendon and secondly it serves a protecting functionality as well due to its
anterior locationt. The region in between the tibia (or shinbone) and the femur is referred to as the tibiofemoral
joint. The smaller bone in the lower leg, namely the fibula (or calfbone), is not involved in the movement around
the knee, but responsible for moving the ankle and is as such not a part of the knee joint.
Figure 3: the location of the patellofemoral and the tibiofemoral joint (right knee, medial view). [36]
2.2.1 Bones
The femur is the largest and strongest bone in the body since it has to bear the body’s weight. The distal part
consists of a lateral and medial condyle (see Figure 4) which are separated at the posterior by a region called the
intercondylar fossa. Some ligaments attach to the latter. At the anterior, the condyles form a groove that guides
the patella during flexion-extension motions and is termed the patellofemoral groove or trochlea.
Like the distal femur, the proximal part of the tibia consist of a lateral and medial condyle where the femoral
condyles rest upon (see Figure 4). The surfaces of condyles are separated by the intercondylar eminence that
provides attachment for the menisci and ligaments. At the anterior, the tibial tuberosity forms a surface that sticks
out. This is used as an attachment point for the patellar ligament.
© Thesis: Control of knee flexion in a knee simulator p 5 / 86
Figure 4: a) anterior of the femur, b) posterior of the femur, c)anterior of tibia and fibula (right knee) [6]
The patella is shaped with a base directed proximally and its point or apex directed distally (see Figure 5). At the
anterior the quadriceps tendon is attached at the base, where as the apex forms the connection for the patellar
ligament (see Figure 6). The posterior is covered with a thick layer of cartilage forming an articular surface. The
surface is divided in two facets that match with the femoral condyles.
Figure 5: Anterior and posterior view of the patella [7]
© Thesis: Control of knee flexion in a knee simulator p 6 / 86
2.2.2 Articular cartilage and menisci
Articular cartilage is found where two boney surfaces move against each other or ‘articulate’. Cartilage is a
slippery substance with a smooth surface and elastic properties. Its main purpose is to facilitate motion by
reducing friction between sliding surfaces in joints. In addition, the elasticity allows the absorption of shocks.
As in all joints, the bones around the patella femoral joint are covered with a thick layer of this cartilage. However,
additional protection of the knee is necessary since large forces may occur. This is achieved by two menisci (see
Figure 6). A meniscus is a C-shaped, special layer of cartilage that is located at the top of the tibia (both lateral as
medial) and which fulfils two main functions. First of all it adds stability and reduces friction by making sure that
the round end of the femur fits nicely with the flat end of the tibia. Therefore the menisci are flat at the bottom but
round shaped at the top. Secondly, its structure is thicker on the outside than on the inside allowing for extra
shock absorption: under loading, the menisci make a slight outward movement.
2.2.3 Ligaments
Ligaments are made of stiff fibers connecting bone to bone. The function of ligaments consist either of reinforcing
joints, guiding motions or restricting excessive motions.
To the medial and lateral side, the femur is connected to the tibia by the medial collateral ligament (MCL) or tibial
collateral ligament and the lateral collateral ligament (LCL) or fibular collateral ligament (see Figure 6). When the
leg is fully extended, these ligaments are taut. This obstructs medial-lateral translation between femur and tibia
and prevents abduction/adduction of the tibia.
The cruciate ligaments also connect femur and tibia. The anterior cruciate ligament (ACL) starts at the anterior of
the intercondylar eminence of the tibia and runs to the posterior of the lateral femoral condyle where it’s attached
at the medial side of the condyle. The second cruciate ligament is called the posterior cruciate ligament (PCL) as
it starts at the posterior of the intercondylar eminence of the tibia. It crosses the ACL as it runs to the lateral face
of the medial femoral condyle. At any bended knee position, one of the two cruciate ligaments or at least a part of
the ligament is tensed. As they are always tensed, the ligaments guide the knee during bending motions by
keeping femur and tibia together. Additionally the ligaments restrict posterior-anterior translation of the tibia with
respect to the femur.
Recently, Claes et al. [9] published a study in which they give an anatomical characterization of a fifth ligament:
the anterolateral ligament (ALL). It originates near the lateral condyle of the femur (round end of the bone) and
attaches to the lateral meniscus1. According to their findings, the ALL would greatly contribute to rotary stability.
The patellar ligament (see Figure 6) connects the patella to the tibial tuberosity (see Figure 4). It transfers the
force, originating from the quadriceps muscle to the tibia in order to extend the knee.
1 Due to the recentness of the publication, a clear/simplified schematic illustration of the location was not yet available at the
moment of writing.
© Thesis: Control of knee flexion in a knee simulator p 7 / 86
Figure 6: overview of some of the anatomical components of the knee joint [s.n.]
2.2.4 Muscles
The mobility of the lower extremities is established by cooperation of many different muscles. The movement that
a muscle causes is highly determined by the location of its points of attachment as contraction of the muscle tries
to decrease the distance between these points. The connection to muscle and bone is made by tendons. Only the
muscles that have a major impact on flexion and extension of the knee are mentioned below since in this thesis
only squat movements are considered.
The quadriceps femoris is the muscle located on the femur (see Figure 7). The muscle originates at 4 different
points. Three are located at the lateral, anterior and medial side of the femur while the last one is connected to the
hipbone. This leads to the 4 muscles forming the quadriceps femoris: respectively vastus lateralis, vastus
intermedius, vastus medialis and rectus femoris. Note that the vastus intermedius lays under the rectus femoris
.To make this visible the rectus femoris is left out on the left leg in Figure 7. The 4 muscles are joined together by
the quadriceps tendon that is connected to the patella. When the quadriceps femoris contracts, its force is
transferred through the patella to the tibia, causing the knee to extend.
At the posterior of the femur the hamstring muscles are located (see Figure 8). They contain the biceps femoris,
semitendinosus and semimembranosus. The biceps femoris consists of a part originating at the hipbone, called
the long head, and a part originating at the lateral side of the femur, called the short head. These parts are joined
together at the fibula. The biceps femoris cause flexion and an outwards rotation of the knee.
The semitendinosus and semimembranosus both run from the hipbone to the medial side of the tibia which allow
them to flex the knee and rotate it inwards.
© Thesis: Control of knee flexion in a knee simulator p 8 / 86
Figure 7: Muscles of qaudriceps femoris (latin denomination) [5]
Figure 8:The hamstring muscles (latin denomination)[5]
© Thesis: Control of knee flexion in a knee simulator p 9 / 86
2.3 Movements
Due to the conflicting needs of mobility and stability the knee joint is a complex structure that possesses six
degrees of freedom (DOF): three in translation and three in rotation (see Figure 10). These motions are generally
called joint actions and can be termed in pairs of opposite movements:
Extension - Flexion: respectively straighten and bending of the leg around the coronal axis. The angle
between the tibia and the imaginary extension of the femur is referred to as the flexion angle. It ranges
from about minus five degrees when hyper-extended to 120 – 140 degrees when fully bent.
Figure 9: definition of the flexion angle.
Internal – External: rotation (max. 25°-30°) around the longitudinal axis and is only possible if the knee
is flexed.
Varus – Valgus: rotation around the sagittal axis (6° – 8°), provided that there is some flexion present.
Another term for this motion is abduction – adduction.
Medial – Lateral: translation along the transverse axis (1 – 2 mm).
Anterior – Posterior: translation along the sagittal axis (5 – 10 mm).
Proximal – distal: translation along the longitudinal axis, causes compression or distraction of the joint
(2 – 5 mm).
Figure 10: schematic illustration of the 6 degrees of freedom [21]
© Thesis: Control of knee flexion in a knee simulator p 10 / 86
As a result of the tight coupling between the different components of the knee, the tibiofemoral movement is in
general a combination of the above motions. For instance, the initial flexion of the knee is accompanied by an
internal rotation while at maximum flexion there is an anterior sliding movement. [2], [3], [37].
© Thesis: Control of knee flexion in a knee simulator p 11 / 86
Chapter 3: Knee simulators
3.1 Introduction
A high level of medical treatment of injuries or disorders related to the knee joint requires a thorough
understanding of its kinematic behavior. However, this can be difficult to obtain due to the complex nature of the
knee joint, and therefore a wide range of both in vivo and in vitro techniques exist. In vitro studies depart from a
dead organism or a part thereof. They have the advantage that experimental circumstances can be well
controlled, and moreover they permit invasive manipulations such as testing of new surgical procedures or
artificial replacements. This would not be possible in vivo, where a living organism is used (e.g. roentgen, MRI,
etc.).
In vitro research of the knee kinematics is generally done by means of a knee simulator. This is, as described by
Maletsky and Hillberry [12], “a type of machine that can dynamically simulate the loads and motions on either a
cadaver specimen or a complete set of prostheses “. In order to stay as close as possible to the correct
physiological conditions, such a device should not constrain the six natural degrees of freedom (DOF) possessed
by the knee joint.
Up to date, two kinds of simulators are generally accepted by the biomechanical research community, namely the
Oxford Knee Rig and the Robotic Knee Systems. They are distinguished from each other by the way they transmit
the loads on to the specimen.
In the next two sections of this chapter, these devices will be elaborated in more detail including information on
system control. An extended description of the latter is unfortunately difficult to find in literature. To conclude this
chapter, the simulator of the University Hospitals (UH) of Ghent (a rig type setup) will be discussed separately.
3.2 The Oxford Knee Rig
These devices simulate dynamic knee flexion by executing a squat movement, and thus mimic motions occurring
in activities such as: cycling, walking, climbing or descending stairs, etc.
3.2.1 Origin and construction
The original Oxford Knee Rig dates back to 1978 and was developed by Bourne et al. As described by Zavatsky
[10], the apparatus is composed of two major assemblies: the mechanical hip and ankle. The hip can slide across
two vertical guiding rails what results in a flexion or extension movement. An additional roller bearing provides the
hip with the possibility to abduct or adduct. The ankle assembly on its turn is capable of flexion/extension,
abduction/adduction, and internal/external rotation.
Using mathematical techniques, Zavatsky [10] proves that the combination of the above movements provides the
knee-joint its six degrees of freedom though the hip and ankle joints have constraints that are not in accordance
with the biomechanical reality.
© Thesis: Control of knee flexion in a knee simulator p 12 / 86
Figure 11: the original Oxford Knee Rig [10]
3.2.2 Dynamics
Knee simulators can mainly be distinguished from one another based on the applied driving mechanism. The
choice of this characterizes things as: the loading capability, the range of motion, simulation speed and control
techniques.
A first possibility is to attach a vertical linear actuator (electric or hydraulic) to the mechanical hip. This allows to
vary the position hereof as a function of time causing the knee to bend or straighten. The kinematics observed in
this way are referred to as passive or unloaded, meaning that the muscles of the knee specimen are not used. In
contrary are the loaded tests that use one or more actuators/motors to put tension on one or more
muscles/tendons (see Figure 12, right). According to Wünschel et al. [13] and Victor et al. [15] significant
differences in kinematics exist between the passive and the loaded conditions.
In most setups only the quadriceps tendon is attached to an actuator. In such a case the vertical actuator is often
replaced by additional (body)weight on top of the hip (see Figure 12, left). Consequently, applying a quadriceps
force will then induce a flexion movement. However, depending upon the type of research, the vertical actuator is
sometimes preferred above a dead bodyweight. Good examples are the researches performed by Victor et al.
[15] and Wünschel et al. [13] where they wanted the ground reaction force to remain constant during the entire
dynamical test. In other words, the quadriceps forces had to be adjusted while the hip slides up and downward.
© Thesis: Control of knee flexion in a knee simulator p 13 / 86
Figure 12: left: OKR with quadriceps motor and hip load[[18]; right: a loaded rig with a vertical actuator to mimic bodyweight [13].
3.2.3 Control and measurement techniques
The easiest way to drive and control knee rigs is by using stepper motors. When given a pulse, these machines
will move to the next position and then hold it there. If the resolution (i.e. the step size) is high enough and the
motor is carefully sized for the application, a high accuracy can obtained even in open loop control.
Closed loop control is generally required in setups where linear actuators are being used. In general two types of
control can be distinguished: force control and position control. Both of them are often applied within the same
simulator, as for example in the knee rigs of Kansas [12] and Leuven [15]. The principles can be easily explained
based on the rig illustrated in the left part of Figure 12. As depicted there, the rig is driven by appropriately
tensioning the quadriceps.
That same actuator can be used in position control as well, so that a given flexion-extension motion can be
duplicated. Therefore a rotational sensor connected to the hip (the actual knee flexion-angle is often hard to
measure) in combination with the known lengths of the tibia and femur, can be used to determine the actual knee
flexion. This information then serves as a controller input.
According to the author’s knowledge, the Kansas Knee Rig is the most sophisticated knee simulator that can be
found in publications to date. This simulator is capable of duplicating the load patterns that occur in daily activities
by controlling several of the six DOF possessed by a knee joint. This apparatus therefore needs to control five
axes. The actuators can be controlled in either position or force mode. Controlling each of them with their own
© Thesis: Control of knee flexion in a knee simulator p 14 / 86
PID-controller does not provide satisfactory results due to the mutual effect between some of the axes. To deal
with these cross couplings, a Multiple-Input-Multiple-Output (MIMO) control strategy is used. [12]
The motions of the different knee components are in most researches registered by ‘motion capturing systems’.
This usually consists of a set of reflective markers and specialized cameras (i.e. high speed / infrared / …).
3.3 Robotic Knee Systems
A totally different type of knee simulator is the Robotic Knee System. It consists of a six DOF robotic manipulator
often [13], [14], [16], [17] combined with a universal force-moment sensor (UFS). The latter is a load cell which
measures three forces along, and three moments around a Cartesian coordinate system (fixed to the sensor).
During an experiment, one side (femur or tibia) of the knee specimen will be firmly attached to the UFS, which in
its turn is mounted to the end-effector of the robot. The other end of the knee joint will be attached to a bottom
plate by means of a mechanical ball joint. See Figure 13.
Figure 13: schematic diagram of a robotic simulator equipped with an UFS testing system (a knee specimen in place) [16].
Whereas the Knee Rigs were capable of loaded simulations by connecting the muscles to actuators, this is
technically very difficult with a Robotic System. Instead, it uses a pulley and weight system to tension the desired
muscles [17], [18]. This is not a very elegant solution, and therefore the Robotic System is preferably used in
studies where passive joint kinematics are central.
To find out the physiologic unloaded motion of a specimen, the following procedure is used. Start with the knee at
an initial flexion angle equal to its upper or lower limit. Measure the forces and moments (with UFS) and
manipulate the robot’s end-effector along its other five DOF, such that the residual forces and moment are
minimized. Store this position and then increment the flexion angle to repeat the procedure. The series of
positions obtained in this way is called the ‘passive path’. In other words, the knee will flex or stretch with a
minimal amount of forces and moments when the manipulator traces this path. [13], [17].
© Thesis: Control of knee flexion in a knee simulator p 15 / 86
Controlling the movements of an industrial, six DOF robot can usually be done in two modes: force control or
displacement (position) control. In the latter case the end-effector will follow a predefined path independently of
the required forces (as long as they remain smaller than the maximum rating of the machine). In doing so, the
UFS can simultaneously measure the forces and moments that will occur in the knee specimen. When the force
control mode is selected, the manipulator will move in such a way that a specific force imposed on the specimen
will be maintained.
3.4 Ghent Knee Rig
Since the year 2006, the researchers at the Ghent University Hospital possesses their own knee simulator. The
design of this self-made machine [41] is based on the Oxford Knee Rig, and is therefore referred to as the Ghent
Knee Rig (GKR). Its construction will be explained by means of Figure 14.
The GKR is constructed around a central frame. This frame holds the two vertical guiding rails (B) for the hip
assembly. The hip has 3 DOF: one vertical translation and two rotations (flexion/extension movement and
internal-external rotation). Furthermore this joint has a cylindrical fixation device to hold the femur (E) and a
rotational sensor (C). The latter can be used to determine the flexion angle.
The mechanical ankle assembly consists of a sled system with a ball-joint (I) on top of it and thus allows three
rotations and two horizontal translations. Although the latter two DOF are unnecessary to ensure the knee a
natural way of motion, it allows the researchers to study the effect of another ankle position. Just beneath the
fixation cylinder a rotary sensor and a load sensor (H) are mounted. The former measures internal rotation while
the latter measures the forces occurring in the tibia.
The last main component of the GKR is the linear actuator, which moves up en down together with the hip
assembly. The end of the actuator is through a cable and pulley (D) attached to the quadriceps tendon by means
of a costume made clamp (F). Under the influence of simulated bodyweight (about 30 kg), a force of the actuator
(measured by an in line sensor) will induce a flexion or extension movement of the knee specimen.
In the original setup, the pulley was located next to the hip due to technical considerations. This is not conform the
correct physiological truth and as a consequence kinematic deviations were observed. This issue was corrected
[24] by modifying the position of both the pulley and the actuator, as depicted in Figure 14 right.
The linear actuator in the GKR can deliver a peak force of 3000 Newton, has a maximum stroke length of 10 cm
and is capable of reaching a speed up to 275 mm/s. The software was supplied with the actuator and allows for
position or force control. [41]
© Thesis: Control of knee flexion in a knee simulator p 16 / 86
Figure 14: Ghent Knee Rig; the original setup (right) [22] and the modified version (left) [24]. Components: a) linear actuator, b)
linear guiding system, c) rotary sensor, d) pulley, e) quadriceps muscle simulation, f) clamping, g) cadaveric knee, h) pressure
cell lower limb, i) ankle joint.
D
A
C
A
B
E
F
G
H
I
D
© Thesis: Control of knee flexion in a knee simulator p 17 / 86
Chapter 4: development of a simulator
As mentioned earlier the GKR is often in use and therefore it was decided to design and construct a miniature
version that would allow the development and testing of control strategies. This chapter describes the
development of the knee simulator, including the calculation of the required specifications, the mechanical design,
the electrical setup and the Human Machine Interface.
4.1 Introduction to the setup
As the miniature knee simulator will only be used for testing purposes, a simple setup is desired. However, a
physiological parallel should be maintained. In this regard, the major approximation made, is the reduction of the
knee with 6 degrees of freedom to a sagittal plane model that exhibits just one degree of freedom. This allows for
a simple construction and mathematical modeling of the knee simulator. The resulting model is limited to flexion-
extension movements only which is also the single motion that needs to be controlled as goal of this thesis. In
addition to the 1 DOF model, the combined force exerted at the quadriceps tendon is considered solely
responsible for the flexion-extension movements. Although the muscles mentioned in the previous chapter have
their contribution in real life, their effect is negligible in a 1 DOF model that only considers squats.
In addition to a simple construction, the knee simulator was desired to be movable within office buildings. The
mechanical design was therefore scaled with a factor ½ in correlation to average anatomical measures found in
literature [4], [6], [41].
Based on the oxford knee rig and previous mentioned approximations, a mechanical design was developed as
depicted in Figure 15. The red dots are hinged joints corresponding with hip, knee and ankle joints. These are
spaced by bars representing the femur and tibia. The hip joint has to be mounted on a linear guide that only
allows vertical displacements with respect to the fixed ankle joint. The construction so far forms the ‘mechanical
knee’ of the simulator. Note that, in contrast to the Oxford Knee Rig design, the hip, ankle and knee joint only
need to allow flexion-extension movement.
Figure 15: design of knee simulator (right figure copied from [40]).
© Thesis: Control of knee flexion in a knee simulator p 18 / 86
The quadriceps muscle force is generated by a linear actuator placed in a vertical position above the hip joint. The
quadriceps tendon and patellar ligament are replaced by a cable that runs from the actuator’s rod along a first
pulley situated at the hip joint. From there it continues to go around a second pulley that resembles the knee joint
and finally attaches to a point where anatomically seen the patellar ligament would fix to the tibia (the tibial
tuberosity). The knee pulley creates the leverage between the center of rotation of the knee joint and the cable
just like the patella does with respect to the quadriceps tendon.
4.2 Kinematics and dynamics
Before elaborating a mechanical design the actuator needs to be dimensionalized.
4.2.1 Quadriceps force
In order to find an expression for the required quadriceps force that corresponds to a pre-defined vertical
displacement of the hip joint , the following force vectors are considered (see Figure 16):
: summation of the gravitational force and the acceleration force that act on
the hip joint as a result of the combined weight of actuator and body (without the weight of the lower
extremities).
: summation of the gravitational force and the acceleration force that act on the center
of the femur as a result of the weight of the femur.
: summation of the gravitational force and the acceleration force that act on the center
of the tibia as a result of the weight of the tibia.
: reaction force that acts on the ankle joint as a result of previous mentioned forces.
where is the gravitational acceleration. The moments of inertia of the tibia and femur are
negligible because they will be small due to the limited rotational acceleration in combination with their relatively
low mass (when compared to the total mass that slides up and down).
The length of the tibia has been chosen to be 17.5 cm while the femur measures 22 cm. They are respectively
denoted as Lt and Lf. The pulley that resembles the knee joint has a radius of 2 cm and is symbolized by
because it corresponds to the thickness of the patella. The point at which the patellar ligament is attached to the
tibia is chosen to equal one third of the tibia length, indicated by Lpees. The forces, lengths and angles used in the
remaining of this thesis are all illustrated in Figure 16. The flexion angle is denoted by ϑ.
© Thesis: Control of knee flexion in a knee simulator p 19 / 86
Figure 16:some forces in the knee simulator
The quadriceps force can be deducted from a torque balance of the tibia around the knee joint:
Assuming that is known, the time varying position of the centers of mass of the femur and tibia with respect
to the ground reference can be written as:
Taking the second time derivative of these position vectors gives an approximation of the accelerations used in
the expressions for , and . Their horizontal component can be neglected considering that flexion mainly
results in a vertical displacement of the centers of mass.
This thesis will only feature squat movements over a maximum flexion angle range of 143 degrees and with a
period of 4 seconds to fulfill a full bending and flexing motion. This renders following time function for the hip joint
position vector:
⁄
(1)
(2)
(3)
(4)
© Thesis: Control of knee flexion in a knee simulator p 20 / 86
Since the time period is relatively long, the acceleration forces can be expected to be small relative to the required
quadriceps force to keep the knee in a static equilibrium state.
The above formulas are programmed in Matlab [56] and Simulink [57] (see Appendix B) to calculate the
quadriceps force as a function of time and as a function of the flexion angle; once with and once without
considering the accelerations. Hereby the following masses are assigned to the different components:
The result is presented in Figure 17. As expected the quadriceps forces is at its largest when the flexion angle is
at its maximum. When taking accelerations into account a maximum force of 1217 N is achieved while 1201 N is
reached when they are neglected; so there is only a slight decrease.
Figure 17: quadriceps force as a function of time; with- and without taking accelerations into account.
As of now the accelerations will be omitted as it simplifies the differential equations of the quadriceps force to a
static equation wherein the force only depends on the flexion expressed by the angle α. This renders
with K constant,
0 0.5 1 1.5 2 2.5 3 3.5 40
200
400
600
800
1000
1200
1400
t [s]
Fq [
N]
with accelerations
without accelerations
(5)
⁄
(6)
© Thesis: Control of knee flexion in a knee simulator p 21 / 86
4.2.2 Quadriceps elongation
The calculation of the required stroke length needed by the actuator to induce a complete flexion is mostly based
on geometric expressions. First it should be noted that an extension of the actuator’s rod will mainly manifest itself
as an additional part of the knee- and hip pulley’s circumference that is being covered. However, one should also
take into account the fact that the distance between the knee and hip pulley varies with the flexion angle.
4.2.2.1 Distance between pulley centers
Based on the position vectors defined in Figure 18 an expression for the distance between the pulley centers is
obtained:
α
ε
ϒ
β
r7
r3
r4
r5
r1
r2
i
j
ζ δ
Rpulley
Rpulley
CChp
CCkp
Figure 18: defining position vectors and angles
( ) ( ) (7)
© Thesis: Control of knee flexion in a knee simulator p 22 / 86
4.2.2.2 Covered circumference on knee pulley
To calculate the length of the cable that covers the knee pulley, the points where the cable loses contact with the
pulley have to be determined. This is done by finding the size of the angles ε, ζ, γ and δ defined in Figure 18.
Firstly, the length of the cable between both pulleys (L) is given by:
From this the angle δ can be derived as:
The angle ζ is given by:
where and respectively denote the vertical and horizontal distance between the hip pulley and hip joint. They
are both equal to 0.045 m. Also the angle ε is defined:
And thus is the circumference covered by the cable (cckp): given as a function of the angle (which in its turn is
geometrically related to the flexion angle):
whereby the angles should be expressed in radians and the radius in meter.
4.2.2.3 Covered circumference on hip pulley
To determine precisely how much of the hip pulley’s circumference (cchp) is covered is not straightforward.
However, a graphical analysis has shown that it can be closely approximated by:
where the units are the same as in the previous section.
4.2.2.4 Stroke length
As a result the required stroke length of the actuator to flex is given by:
√( )
(8)
(
⁄
) (9)
(
) (10)
(
) (11)
(12)
(13)
( ) (14)
© Thesis: Control of knee flexion in a knee simulator p 23 / 86
where and are respectively the initial length of the cable between the two pulleys and the initial
circumference covered on the knee pulley, when the knee is in a fully stretched state. These are calculated by
substituting into equations (7) through (14).
The evolution of the stroke length as a function of the flexion angle is depicted in Figure 19. It can be seen that a
maximum stroke length of about 16 mm is required for a full squat movement.
Figure 19: the required stroke length for a certain flexion.
4.3 Electromechanical component
Based on the above kinematic analysis an appropriate actuator can be chosen. It should fulfill the following main
specifications:
• Force: > 1600N;
• Stroke length: > 20 mm ;
• Speed: >40 mm/s.
Another important property to take into consideration is the so called duty ratio. This percentage informs the user
how long the actuator must cool down after it has been used. As the simulator should preferable be capable of
executing a sequence of one hundred squats, the duty ration should be as high as possible to avoid overheating.
© Thesis: Control of knee flexion in a knee simulator p 24 / 86
After contacting several manufactures, the best option regarding the specifications and price was an actuator of
the IDM8B series, delivered by “Industrial Devices”. It has the following specifications (see the datasheet [46] for
more details):
• Brushed DC-motor with permanent magnets (24V DC, 11A);
• Dynamic load: 2300 N;
• Static load: 13600 N;
• Stroke length: 100 mm;
• Speed at full load of 45 mm/s and at no load of 65 mm/s;
• Duty ratio: 25%;
• Gear ratio: 5 : 1 .
As can be seen, the deliverable dynamic force greatly exceeds the maximum quadriceps force. This has the
advantage that the actuator will mostly work below its rated power and consequently can be operated for a longer
time before overheating becomes an issue. Hence, the specified duty ratio can be exceeded.
Figure 20: linear IDM 8B Series Actuator [46].
4.4 Mechanical Construction
Departing from the chosen actuator a mechanical design was developed in SolidWorks [60]. A 3D-image is
depicted in Figure 14. 2D-drawings were also made to manufacture the parts at the University of Ghent.
As mentioned in the introduction, the one-degree of freedom approximation allowed for a simple design. In
contrast to the setups discussed in chapter 3, the 2D-model can be established with a single vertical linear guide.
This avoids alignment issues of parallel running guideways and simultaneously reduces size and weight of the
knee simulator. For the same reasons mentioned, a rail guide manufactured by HIWIN [48] is used instead of the
economical interesting guide shafts. Namely, in contrast to shaft guides, a rail guide does not necessarily need to
be constructed as a pair in order to avoid axial rotation of the guided elements.
An aluminum plate parallel to the linear guide rail will serve as a base to mount the hip joint as well as the
actuator and hip pulley. Furthermore a small plateau is foreseen at the top to allow the addition of more weight.
The unity is supported by three external guiding blocks of the linear guide. The middle one is connected to the
rod’s end mounting bracket of the actuator. The mounting bracket hinders the inherent axial rotation of the
actuator’s lead screw. Relative displacement between baseplate and the support of the rod end, is established
through the groove in the baseplate.
© Thesis: Control of knee flexion in a knee simulator p 25 / 86
The joints of the knee simulator are constructed as hinged joints of which the shafts are restricted to axial rotation
corresponding with flexion-extension of the knee. The shafts are all designed with the same diameter enabling
easy manufacturing. Moreover, Igus flanged plain bearings [55] are used because they provide a low-cost
solution and are easily mounted. The flange obstructs direct contact between the rotating and fixed parts
surrounding the shaft.
A squared profile acts as the femur of the knee. The shaft at the hip joint is welded to the squared profile in order
to allow for angle measurements at the hip joint. For the tibia an U-shaped profile is used since it has an open
side which enables an easy attachment of the cable.
Finally, an easy construction of the frame is possible with extruded square aluminum profiles.
Figure 21: Construction drawing of the setup
© Thesis: Control of knee flexion in a knee simulator p 26 / 86
4.5 Electrical components
The electrical part of the simulator consists of three major parts: the power supply, the motor driver and the data
acquisition board.
4.5.1 Power supply
The actuator has to be supplied from a power supply capable of handling 24V DC / 11A. A non-controllable
switched power supply SITOP PSU100D of Siemens was chosen for this purpose [53]. It can deliver a maximum
output current of 12.5A and has a static voltage tolerance of 2%. The output voltage ripple is about 100mV peak
to peak.
Figure 22: power supply 24V DC / 12.5A.
4.5.2 Data acquisition
The simulator will be connected to a data acquisition card (DAQ) which enables the exchange of input-output data
with a computer. The USB-6008 DAQ system of National Instruments (Figure 23) has been chosen for this
purpose. A brief list of its specifications (see the datasheet [45] for a complete overview):
• 8 single ended + 4 differential analog inputs (12 bits);
• 2 analog outputs (12 bits);
• 12 digital inputs/outputs (programmable);
• 32 bit digital counter;
• Maximal sample rate: 10 Ks/s;
• Output rate: 150 Hz;
• Software timed;
• Power: input: usb 5V; output 2.5V/5V and 200mA (max).
The Human Machine Interface (HMI) will be programmed with NI Labview 2010 [59].
Figure 23: a NI USB-6008 DAQ card [44].
© Thesis: Control of knee flexion in a knee simulator p 27 / 86
4.5.3 Motor driver
In order to be able to control the actuator, a variable voltage is required. This will be achieved by connecting the
main power supply (DC) via an H-bridge motor driver to the actuator. The motor driver that will be used is the
MD03 from “Robot Electronics” (see Figure 24) and is rated for 24V / 20A. This driver will create a 15kHz PWM
signal with a duty ratio from 0-100% depending on the inputs it receives at its logic circuit.
Some specifications (see also the datasheet [51]):
• Motor supply: 24 VDC and max. 20A;
• Logic supply: 5V and max. 50mA;
• PWM: controllable between 0 – 100% duty ratio, frequency of 15 kHz;
• Bidirectional motor control;
• Control modes:
o I2C bus, up to 8 MD03 modules, switch selectable addresses;
o 0v-2.5-5v analog input. 0v full reverse, 2.5v center stop, 5v full forward;
o 0v-5v analog input with separate direction control;
o RC mode. Controlled directly from the RC receiver output;
o PWM.
In this thesis the 0-5V analog input control mode will be used. This logic signal will be generated by the DAQ
system.
Figure 24: the MD03 H-bridge motor driver [51]
4.5.4 Sensors and safety
The objective of the knee simulator is to control the flexion angle ϑ. For a mechanical knee this can be measured
by mounting a sensor directly on the knee joint. However, in the simulator (GKZ) situated in the University
Hospitals (UH) Ghent real knees are tested and it is hence impossible to fix an accurate sensor to this joint in
such a way that true physiological conditions are still ensured. Due to the many geometric relations between the
different components a sensor may be placed somewhere else and then the flexion angle can be calculated
therefrom. Many options are available, such as: measuring the vertical displacement of the hip joint with respect
to the ground level, measuring the stroke length or measuring the ankle or hip rotation.
In the setup at UH Ghent it was chosen to measure the angular displacement of the hip joints. This choice will
introduce nonlinearities into the control system due to the presence of sines and cosines. Nevertheless, as the
simulator in this thesis should be similar to the GKR, the same controlled variable is chosen.
© Thesis: Control of knee flexion in a knee simulator p 28 / 86
To measure the angular displacement of the hip joint a magnetic encoder was chosen, namely the AEAT- 6012
developed by “Avago Technologies” (see Figure 25). This sensor measures the absolute angle. It has a 12 bit
resolution and as such will be accurate up to 0.0879°. Positional data is presented in a serial bit stream. The
encoder requires a 5V power supply. [49]
Figure 25: the AEAT- 6012 magnetic encoder (left) with its exploded view (right). [49], [50]
Furthermore the simulator will be equipped with two limit switches to prevent the actuator to extend or retract
further than necessary. These switches have a roller blade (see Figure 26) and are placed in the logic circuit.
Hence they provide a digital signal to the DAQ-system instead of immediately interrupting the power system. If it
would do so, then it will not be possible to maneuver the actuator’s rod away when a limit switch is activated while
this will be the case when it’s carefully programmed in Labview [59].
Figure 26: left) limit switch with roller lever; right) thermal circuit breaker
To protect the actuator from overheating a thermal circuit breaker will be installed in the power circuit. One rated
for 5 Amps produced by “Tyco Electronics” was chosen (see Figure 26). According to the datasheet [52] it should
trip after one hour when carrying 7.25 Amps and after 6 – 30 seconds for a current of 10 Amps. Consequently, the
actuator will be disconnected from its power supply when overloading is about to happen, i.e. when the knee
simulator is obstructed in its movement. Furthermore this thermal circuit breaker features a reset button that
extends when tripped to provide a visual indication.
To protect the motor driver from peak currents, a fuse will be placed at the output of the DC power supply. The
fuse is rated for 15A and 32 VDC. [54] The fuse is together with its holder depicted in Figure 27.
Figure 27: 15A fuse (left) and fuse holder (right)
© Thesis: Control of knee flexion in a knee simulator p 29 / 86
4.5.5 Overview
A simplified diagram that shows how the different components are linked together is displayed in Figure 28. A
more detailed wiring diagram will be given in the next chapter.
Data aquisition card
AC/DC voltage converter
Knee simulator
Limit switch
Limit switch
Hip angle sensor
Motor driver
0 – 24V DC0 – 11 A
PCLabview interface
Reference signal
0 – 5V 0 – 24 V
Data
Power supply
AC/DC voltage converter
AC grid Thermal CircuitBreaker
Fuse
Figure 28: simplified electrical diagram
© Thesis: Control of knee flexion in a knee simulator p 30 / 86
Chapter 5: finished knee simulator
5.1 Technical issues
To validate the setup a few small tests were performed, such as increasing and decreasing the input voltage
manually, slow voltage ramps or applying small voltage steps. In the remaining of this thesis the following
convention for the sign of the voltage will be used: the input is positive when the actuator’s rod extends and is
negative when it retracts. The tests revealed two major problems.
At first, it was hard to execute a squat movement in a controlled fashion. This was due to the small required
stroke length and the presence of a large dead band. The latter means that any input within the range “-1 V to
+0.6 V” will cause no change in the actuator’s rod position whatsoever. So if a ramp input was applied at the
input, then nothing would happen at first until the limit of the dead band was reached. Then the actuator’s rod
extended very fast until the limit switch was hit. This phenomenon is graphically illustrated in Figure 29.
Figure 29: dead band phenomenon
The second problem has to do with the magnetic encoder. Although this sensor worked perfectly when the
mechanical knee was not connected to the actuator (unloaded), it gives completely wrong measurements when
implemented in the total setup (loaded). The cause of its malfunctioning may be related to the tight mechanical
constraints (i.e. +-0.08 mm shaft axial play and +- 1mm shaft length play) that should be fulfilled [48]. Probably
these tolerances are no longer met when the different components are under load. A mathematical relationship
between the real and the wrongly measured angles has not been discovered.
Furthermore the encoder requires at least 12 successive pulses to allow its position data to be serially transferred
to the DAQ system. This should be done as fast as possible to collect enough samples. Unfortunately the DAQ
card is not capable of producing enough pulses when other code has to be executed in parallel.
5.2 Modifications
To overcome the problem of the small stroke length, the quadriceps cable was cut into two pieces and a small
movable pulley was suspended in between. Thus the cable from the actuator runs along this new pulley wheel
and attaches to the hip joint, while the cable that attaches to the tibia connects to the pulley frame. The latter
cable is from now on referred to as the ‘quadriceps cable’. This is schematically illustrated in Figure 36. As a
consequence of this modification, the necessary stroke length is almost twice as long while the required actuator
0 2
0.6
1
Input: voltage (V)
Time (s)
20
50
2 0
Output: hip angle (°)
Time (s)
© Thesis: Control of knee flexion in a knee simulator p 31 / 86
force is halved. The result of this intervention is very satisfying: the squat movement can be controlled much
easier. However, the radius of curvature of the cable around the pulley wheel is too small and consequently
wears. Therefore it is advised to regularly check the cable for damages.
As the magnetic encoder did not output the correct angular values nor was capable of producing enough
samples, it was chosen to abandon this sensor. Instead a classical rotary potentiometer was mounted on the
shaft of the hip joint. Its resistance can be changed in one revolution from 0 to 10 kΩ. The resolution is unknown
because it depends on its internal design and a datasheet is unavailable. Furthermore this sensor has the
advantage that is does not require a series of pulses before a value can be read by the DAQ nor does it require
much programming in Labview. Hence a much higher sample rate than with the encoder is possible. A
disadvantage however is that this passive electrical component was never constructed to be turned so frequently
and thus wears relatively fast.
5.3 Final electrical setup
As mentioned in the previous chapter a NI USB-6008 DAQ card [44] forms the interface between the computer
and the electrical hardware. The computer used in this thesis is equipped with a CPU ‘AMD Athlon 64 processor
3800+’ at 2.40 GHz, a GPU ‘NVidia Quadro NVS 210S’, 1.93 GB Ram and runs on Windows XP professional SP
3.
The limit switches are connected between the GND and the digital inputs I0.4 and I0.5. The potentiometer is
connected between the +5V and the ground and the variable voltage drop across it is measured differentially via
the pins AI0+|AI0-. Besides measuring differential, also a capacitor is connected across these terminals and
shielded wires are used to decrease significantly the amount of measuring noise.
The MD03 motor driver interconnects the DAQ-card, 24 VDC power supply and actuator with each other. The
DAQ provides the required logic power while the motor power is delivered by the external supply. A thermal circuit
breaker and a 15 amps fuse are connected inline. The actuator connects straight to the motor terminals. As the
actuator can draw a nominal current up to 11A, it is important to use electrical cables rated for this. Cables with a
cross sectional area of 2.5 mm² are used.
On the logical side, the SCL-pin is connected to the digital output PO.0 and influences the motor direction. At the
SDA pin an analog reference signal has to be supplied. It is this voltage signal (between 0-5V) that determines
the duty ratio of the PWM signal. It is via an additional bistable switch connected to the analog output AO.0. This
small switch allows the user to choose whether the actuator should be controlled or not (for example only
simulation). Furthermore it also allows to stop the actuator much faster than with the emergency button.
The 230VAC/24VDC convertor is connected to the grid through an emergency button. A detailed diagram of this
electrical setup is given in Figure 30.
In case future changes are made to the electrical part of the knee simulator, it is important to draw attention to the
fact that the motor driver internally connects the grounds of the power and logic circuit. So do not additionally
connect it yourself to avoid the introduction of noise through ground loops. In the same trend, realize that the
grounds from the DAQ-card and as such also the grounds of the motor driver are connected to the mains’ earth
through the USB cable and PC plug. Be careful to not introduce earth ground loops into the system.
© Thesis: Control of knee flexion in a knee simulator p 32 / 86
Fuse 15A
Actuator
5V logic1
SCL2
3SDA
4GND logic
GND motor
Motor 1
Motor 2
24V motor
5
6
7
8
MotorDriver
Thermalcircuit breaker
Lim
it s
wit
ches
V+
Vout
C+
GND
C-
Voltage Converter 230VAC/24VDC
InterruptSignal switch
Emergency button
PWM Grid230 VAC
Potentiometer
Figure 30: detailed electrical diagram2.
Finally:
In the power circuit deadly currents can flow !!! Ensure that there are no blank contact points
present!
5.4 Labview
The Human Machine Interface is created with Labview 2010 [59]. A detailed description of its features and how to
use it is given in appendix D. Furthermore, the appendix also summarizes considerations regarding safety. Please
read them first before using the knee simulator.
5.5 Finished simulator
The parts were manufactured in the workspace of EELAB3 for low-cost realization. It is important to note that due
to restricted quality of the used machinery the manufactured parts didn’t necessarily meet the predefined
tolerances on the 2D-drawings. In addition the parts were made in function of the available materials. This
resulted in some differences compared to the original mechanical design. For example the aluminum base plate
was constructed as a steel plate of 2 mm, reinforced by 2 side bends and 2 squared profiles.
Pictures of the finished knee simulator are shown in Figure 1 and Figure 31. A financial overview is given in
appendix A.
2 For a sharper and larger image please consult the digital version of this thesis.
3 Department of Electrical Energy, University of Ghent, Belgium.
© Thesis: Control of knee flexion in a knee simulator p 33 / 86
Figure 31: angle view of the knee simulator.
Actuator
Actuator’s rod
Hip pulley
Hip joint
Lower limit switch
Main power supply Motor driver
Thermal circuit breaker Emergency stop button DAQ card
Movable pulley
Knee pulley
Hip sensor
Ankle joint
Extra switch
© Thesis: Control of knee flexion in a knee simulator p 34 / 86
Chapter 6: Theoretical modeling and simulation
To gain more insight into the system a theoretical model is derived. The hip angle β was chosen to be the
controlled variable although the goal of this thesis is to control the flexion angle ϴ. The reason being that it is the
hip angle that is being measured and the relation between the hip- and flexion angle is based on trigonometric
formulas. The manipulated variable will be the reference voltage from the DAQ card to the motor driver. 4
6.1 Mathematical modeling
The system’s model can be divided into four major parts: the dead band and voltage amplifier, the motor, the
actuator and the knee simulator.
6.1.1 Dead band and driver
As already mentioned in paragraph 5.1 the system suffers from a dead band: the system does not respond to any
input that fall within that zone. Experiments have shown that the dead band is ranges from -1V to +0.6V. As a
reminder: positive voltages cause the actuator to extend, while negative voltages cause it to retract. This
behaviour is modelled in Simulink [57] with the aid of ‘switches’ as depicted in Figure 32.
Figure 32: modeling dead band effect and motor driver.
The motor driver enforces the output voltage from the DAQ-card (0-5V) and transmits it as a PWM signal (0-24V)
to the actuator’s motor. This effect is simply modelled as a static gain of 4.8. In real life it takes some time before
the driver has modified its output in response to a new reference input. Therefore a ‘Time delay’ block has been
added.
6.1.2 Motor
Inside the actuator a brushed permanent magnet DC motor (PMDC) is used to convert the input voltage into a
rotating shaft motion. Its physical behavior can be modeled by means of the following equations.
Firstly, the relationship between input voltage (V), current (i) and back EMF (e) is given by:
4 Comment: the figures showing the implementation in Simulink are not always sharp and clearly readable. If so, please consult
the digital files on the attached CD.
(15)
© Thesis: Control of knee flexion in a knee simulator p 35 / 86
According to the manufacturer [46], the armature resistance R is equal to 0.4 Ω and the inductance L equals 0.85
mH. The back EMF can be written as a function of the angular speed :
The torque delivered by the motor (Tm) is equal to:
Where and are respectively the so called back EMF and torque constants. They have the same value when
they are expressed in their standard SI units. However, the values given by the manufacturer differ slightly:
The conventional torque balance leads to:
where B stands for the viscous motor friction, Jact for the actuator’s inertia and TL for the load torque generated by
bending the knee. The following values are specified by the manufacturer:
⁄
These equations can be combined and then implemented in Simulink. This is depicted in Figure 33.
Figure 33: DC motor model in Simulink
The actuator cannot be back driven by the load although a high efficiency ball screw is used (this characteristic is
usually seen in lead screw transmissions). This has the advantage that the knee will remain in the same position
when the actuator is not powered. To model this behavior an additional subsystem has been added. It ensures
that when the load torque exceeds the motor torque nothing will happen (a zero output).
(16)
(17)
(18)
© Thesis: Control of knee flexion in a knee simulator p 36 / 86
6.1.3 Actuation system
The rotational motion of the motor shaft has to be converted to a translational motion that pulls on the quadriceps
cable. Therefore the angular speed is first reduced in a gear transmission while the generated torque is
increased. As mentioned in paragraph 4.3, the actuator has a gear ratio of 5:1. The backlash inside the gear box
will be neglected.
In the second stage a ball screw converts to rotary motion into a linear displacement. An important characteristic
of a ball screw transmission system is the lead. It expresses how far the rod will travel during one revolution of
the screw. This specification is however nowhere given. Therefore catalogue details of similar actuators from
other manufacturers (i.e. [47]) were collected and based upon that a lead of 12mm was chosen.
A schematic drawing of an actuator with a parallel mounted motor and gearbox can be seen in Figure 34.
Figure 34: schematic illustration of a basic linear actuator [34]
Figure 35 shows how the rotary to linear conversion is implemented in Simulink. Integration of the translational
speed gives the linear displacement of the end of the actuator’s rod. The saturation block has been added for
simulation purposes only. It assures that the stroke length never exceeds its maximum.
Figure 35: rotary to linear conversion in Simulink
When this part of the model is connected to that of the motor, it can be confirmed that the lead was chosen
correctly: at no load a linear speed of about 65mm/s is obtained while at full load this is about 45mm/s.
Motor
Rod or piston
Gear mechanism
Motor shaft
Ball screw Enclosure Mounting aid
Sealing
© Thesis: Control of knee flexion in a knee simulator p 37 / 86
6.1.4 Knee simulator
The simulator itself converts the linear displacement of the actuator’s rod to an angular displacement of the hip.
This is achieved by modeling the quadriceps cable as a spring with a certain stiffness (Kc). The multiplication of
the spring constant with its corresponding elongation will result in the quadriceps force from which the hip angle
can be calculated. So first expressions for the lengthening and the stiffness of the able are derived.
6.1.4.1 Elongation
To relate the rod’s position to a hip angle, the same reasoning as in paragraph 4.2.2 can be used. However, the
introduction of the movable pulley situated just above the femur causes the need to alter the calculations. The
degree of flexion depends on the translation (ΔX) of the movable pulley along the femur. The distance it can travel
is due to three things: firstly the extension of the actuator’s rod (stroke_length), secondly the change in relative
distance between the hip- and movable pulley (Δr9 ) and thirdly the additional covered circumference on top of the
hip pulley (ΔCChp). Wherein everything is expressed in comparison to the upright position. In symbols:
where CChp is given by equation (13) and thus . The relative distance between the
two pulleys (r9) can be calculated as follows:
where the position vectors are defined in Figure 36. r7 denotes the distance between the hip joint and the movable
pulley when the leg is fully extended. r8 refers to the height from the movable pulley to the femur. Furthermore,
with r9,0 the distance between the two pulleys when the leg is fully stretched, one can write:
The displacement of the movable pulley will manifest itself in an increased coverage of the knee pulley (ΔCCkp)
by the quadriceps cable. To determine this, it is assumed with good approximation that the quadriceps cable
remains parallel to the femur during the entire squat motion. This results in the following expression (see Figure
36):
where is the covered circumference of the knee pulley when the leg is fully stretched and where and
are the same as defined in paragraph 4.2.2.
(19)
(20)
√ (21)
(
) (22)
© Thesis: Control of knee flexion in a knee simulator p 38 / 86
α
ε
ϒ
β r7r8
r9
r4
r5
Movable pulley
Quadriceps
cable
CCkp
i
j
Figure 36: a schematic illustration of the knee simulator equipped with the movable pulley.
With the above expressions also the next equation should hold:
If equation (23) differs from zero then it implies that there is an additional factor responsible for the flexion and
extension movements. This factor will be the elasticity of the quadriceps cable (ΔL).
6.1.4.2 Stiffness
The stiffness of the cable (KC) can be determined based on the relation between the Young’s Modulus (Ec), the
cross sectional area (Ac) and the length of the cable (Lc):
The difference between the displacement of the rod and the actual displacement of the knee due to the elongation
of this cable is multiplied with the stiffness constant of the cable. This results in the quadriceps (or actuator) force.
This methodology in modeling electromechanical actuated systems is frequently applied, i.e. [31], [34]. There are
(23)
(24)
© Thesis: Control of knee flexion in a knee simulator p 39 / 86
no specifications given about the cable, so again these are assumed as best as possible based on other
documented metal wires5. So the values are:
⁄
For simplification it is assumed that all elasticity occurs in the cable below the movable pulley. The length of this
cable is defined by the constructional parameters:
√
The spring constant thus equals:
⁄
6.1.4.3 Hip angle
Finally, the quadriceps force can be calculated with the stiffness and elongation of the cable:
As mentioned in paragraph 4.2.1 the forces due to accelerations are negligible and therefore the angle α can be
derived from equations (5) and (6) together with equation (25). The hip angle β is then obtained through basic
trigonometry.
From the hip angle β one recalculates the equations (19) through (22) to obtain Δr9, ΔCCkp and CChp. Combining
with the stroke length yields the elongation (23).
Figure 37: modeling the simulator
The quadriceps force Fq is recalulated as a torque using the transmission ratio, the lead and the factor 2
originating from the movable pulley. This load torque is then fed back to the motor block.
5 For example the following documentation: http://www.s3i.co.uk/wire-rope-technical.php
(25)
© Thesis: Control of knee flexion in a knee simulator p 40 / 86
6.1.5 Overview
The constants used in the model are together with their value and a brief description summarized in Table 1. The
composition of the different model subsystems into the complete model can be seen in Figure 38.
Symbol Description Value
Motor
R Resistance 0.4 ohm
L Inductance 0.85*10^-3 Henry
Kt Torque constant 0.52*(10^-2)*9.81 Nm/A
Kb Back EMF constant 6/1000*(60/(2*pi) V/(rad/s)
Jm Motor inertia 0.00011 kg*m²
Jact Total inertia of actuator 0.00015 kg*m²
B Viscous damping 0.011Nm/(rad/s)
Actuator
Gear_ratio Speed reduction due to transmission 1/5
Lead Lead: linear displacement per revolution 12*10^-3 m
Simulator
Mact Mass actuator 2 kg
Mhip Mass of the hip joint 10 kg
Mtibia Mass of the tibia 1 kg
Mfemur Mass of the femur 1.5 kg
Lt Length of the tibia 0.175 m
Lp Length of the patella (leverage) 0.020 m
Lf Length of the femur 0.220 m
Lpees Length of the patellar ligament 1/3*Lt m
r Radius pulley Lp
r4 Vertical distance between hip joint and hip pulley 0.045 m
r5 Horizontal distance between hip joint and hip pulley 0.045 m
r7 Initial distance between movable pulley and hip joint 0.08 m
r8 Height movable pulley to femur 0.015 m
r9,0 Distance between hip- and movable pulley in upright position Sqrt ((r5-r8) 2 + (r4+r7)
2)
© Thesis: Control of knee flexion in a knee simulator p 41 / 86
Cable
Ec Young's modulus 3.0*10^10 N/m²
Lc Length of the cable Lf - r7+CCkp,0+ sqrt(Lpees2-Lp
2)
Ac Cross sectional area of the cable π 10^-6 m²
Kc Spring constant of the cable Ec*Ac/Lc
General
g Gravitational acceleration 9.81 m/s²
Table 1: overview of the constants used in the Simulink model.
© Thesis: Control of knee flexion in a knee simulator p 42 / 86
Figure 38:overview of the complete Simulink model of the knee simulator. (for a clearer image please consult the Simulink file on the CD)
Voltage input
generated by
DAQ
Dead band + PWM amplifier DC motor (+ anti back drive due to load) Actuator Knee simulator
© Thesis: Control of knee flexion in a knee simulator p 43 / 86
6.2 Simulation
The obtained white model of the knee setup can be validated with real life results. Therefore voltage steps
generated by the DAQ (system input) are applied to the system and the hip angle (system output) is observed.
Both signals are recorded together with time. The same inputs are also applied to the model such that the
system’s responses can be compared. Voltage steps and impulses were used as a test signal.
The validation revealed several issues. First of all, an additional load torque corresponding to a 190 N linear force
has to be added to the motor. Consequently the motor speeds up a little slower. The origin of this extra load is
unknown but might be related to the internal breaking system of the actuator (it can carry an enormous static
load). However, there are no details known about its inner design. Experiments have shown that this additional
load mustn’t be altered for new simulation circumstances; it is a constant.
Secondly, modeling the PWM motor driver as a fixed gain together with a delay is not accurate enough. For each
experiment the delay has to be adjusted manually to match the physical data. This delay symbolizes the slow
build up of the voltage. Moreover, when the driver receives the command to change its output from i.e. 15V to 0V,
then again this does not happen immediately. Therefore a voltage step down should be modeled as a steep ramp.
Two validation experiments are illustrated below. In Figure 39 an impulse response to an input of 1 V during
500ms is depicted. The corresponding model parameters are set to:
• Delay: 0.13s;
• Input: ramp with initially 1V, start time 0.5s;
• slope: -3;
• Stroke length (integrator limits): [0.0281-0.068].
Figure 39: open loop impulse response (in red: simulated; in blue: measured).
0 0.2 0.4 0.6 0.8 1 1.224
26
28
30
32
Time (s)
Hip
angle
Beta
(°)
0 0.2 0.4 0.6 0.8 1 1.20
0.2
0.4
0.6
0.8
1
Time (s)
Voltage input
(V)
© Thesis: Control of knee flexion in a knee simulator p 44 / 86
In Figure 40 to response to a step input of 0.65 V can be seen. The corresponding model parameters are set to:
• Delay: 0.7s;
• Input: step down of 0.65V;
• Stroke length (integrator limits): [0.023-0.068].
Figure 40: open loop impulse and step responses (in red: simulated; in blue: measured)
All validation experiments confirmed that simulation and reality match very well if the parameters of the motor
driver subsystem are tuned.
Finally, the limits of the limited (saturated) integrator block responsible for the conversion from linear speed to rod
position (see Figure 35) are used to set an initial output (hip angle) to the simulation model. I.e. start the
simulation from an initial hip angle of 25°.
6.3 Model insight
Deriving a transfer function from input to output based on the theoretical model is not straightforward due the
presence of many nonlinear blocks, such as (co)sines, square roots, saturation, switches, … Linearization of the
complete model by Matlab does not produce satisfactory results. Therefore a system identification of the physical
setup will be required. However, to be able to use parametric identification methods the structure of the model
should be known in advance.
So first of all, it was decided to reduce the model by omitting all switches. As a result it was decided to leave out
the subsystem that introduces the dead band zone behaviour and the block that ensures that the motor cannot be
driven backwards by the load.
Secondly, the subsystem ‘knee simulator’ is composed out of many (co)sine- and square root blocks. However,
as additional acceleration forces were neglected, the differential equations describing the system were
0 1 2 3 4 5 6 7 820
30
40
50
Time (s)
Hip
angle
Beta
(°)
1 2 3 4 5 6 7 80
0.5
1
Time (s)
Voltage input
(V)
© Thesis: Control of knee flexion in a knee simulator p 45 / 86
transformed to regular equations. Consequently, the function describing the relation between input and output of
the subsystem can thus be regarded as a gain that varies with the flexion angle. The remaining model is
schematically depicted in Figure 41.
Motor Actuator Knee simulator
Load
Hip angle Beta
Voltage input
Figure 41: schematic of the simplified theoretic model
The simplified model can be linearized by Matlab. Because of the simplifications this transfer function will not be
accurate, but this is not such an issue since we are only interested in the order of the system one might expect.
So finally this yields a third order system with no zeros. This information will be used in the next chapter for
parametric identification of the real life system.
© Thesis: Control of knee flexion in a knee simulator p 46 / 86
Chapter 7: System control
The aim of this chapter is to control the hip angle, β, by designing a controller that manipulates the voltage across
the actuator. Consequently, the controlled variable and the manipulated variable are respectively the hip angle
and the reference voltage to the motor driver. After specifying the objectives for the control system, a model of the
process will be derived using parametric identification. Subsequently a controller will be designed based upon that
model and its performance will be evaluated.
7.1 Objectives
7.1.1 General objectives
In the case of the knee simulator both a disturbance-rejection controller as well as a setpoint tracking controller
can be of use. The former is valuable in line with static tests for acquiring information at a specific flexion angle. In
this case the controller must be able to reach any setpoint within the flexion angle range, and keep it stable at the
steady state. Additionally, the controller should reckon with possible disturbances. A first disturbance source can
be found in voltage deviations at the input of the process. These are caused by inconsistencies in the electrical
equipment such as the accuracy of the PWM, voltage ripple and nominal voltage deviations of the power supply.
Apart from these smaller deviations which are always present, a disturbance can be simulated by adding extra
weight to the hip when the system is at steady state. This has a physical parallel to the lifting or carrying of objects
in which the load on the lower extremities suddenly increases. For disturbance rejection the followed trajectory in
terms of overshoot and settling time is of lesser importance. However, the overshoot and settling time are
preferably minimal.
In contrast to disturbance rejection, setpoint tracking is of use for dynamical testing in which the controller needs
to follow a specific flexion angle trajectory. This allows to simulate real life activities such as walking or climbing
stairs. The controller should be able to follow the setpoint in a smooth fashion that maintains the shape of the
setpoint trajectory because even small angle deviations can affect experimental results during tests with
cadaveric knees. For example, disorders in the structure of a knee joint can cause a pressure which rapidly
changes with the flexion angle.
A common ground for these controllers can be found in repetitive testing, in which the setpoint alternates stepwise
between different values. This can be applicable to wear and tear testing for which the repeatability is of greater
importance in comparison to the followed trajectory of the system. Overshoot is not desirable for the same reason
as mentioned in the previous paragraph about setpoint tracking. In this case a disturbance rejection controller with
no overshoot and limited settling time can be sufficient.
Finally one needs to consider the changing circumstances of the intended in-vitro test. Firstly, the observed
cadaveric knees or prostheses may exhibit deviant physical behavior. Secondly, the circumstances under which
the experiments are preformed may vary. For example additional load can be added to the knee to resemble body
mass differences encountered amongst people in real life. Regarding these arguments, the controller for
disturbance rejection as well as setpoint tracking is ought to be robust.
7.1.2 Thesis objectives
This thesis features the suitability of linear controllers such as PD, PI and PID controllers to previously mentioned
objectives. Due to the limitations of the constructed mechanical knee, deviant physical behavior of real knees
cannot be considered. Hence robustness will only be checked by adding extra weight on top of the hip.
© Thesis: Control of knee flexion in a knee simulator p 47 / 86
For disturbance rejection the aim is to design a controller with no overshoot and a settling time of 5 seconds, so
that it would also be applicable to slow repetitive testing. In the case of setpoint tracking, only squat motions are
considered, which are approximated by sinusoidal setpoint trajectories. The goal here is to maintain the same
sinusoidal shape and amplitude. A shift in phase (delay) is not an issue.
7.2 Staircase experiment
As shown in the mathematical modeling of the system, a nonlinear system is to be expected. In order to confirm
this nonlinearity, a staircase experiment was performed for both flexion and extension of the mechanical knee.
The input towards the process consisted of a sequence of voltage pulses with a constant duration and magnitude.
Pulses were used instead of step inputs due to the presence of an approximate integral action in the system. This
will be shown later in paragraph 7.3 together with the identification results.
The process outputs are depicted in Figure 42 and Figure 43 for input pulses with a duration of 0.3s and a
magnitude of 2V. The figures show that the system is in fact nonlinear as the same input pulses lead to a
different step size in the output depending on the starting angle of the knee simulator. Furthermore it is noted that
the step size tends to increase for smaller hip angle values. This behaviour is expected since the quadriceps force
increases when the knee is flexed to a higher degree. On the other hand the force delivered by the actuator
remains unchanged as the input voltage stays the same. Consequently, the net amount of force is lower and thus
acceleration of the different components is less as well.
Figure 42: Staricase experiment: extension.
0 2 4 6 8 10 12 14 16-2.5
-2
-1.5
-1
-0.5
0
t [s]
Voltage [
V]
Step up pulses (0.3s and 2V)
0 2 4 6 8 10 12 14 1610
20
30
40
50
t [s]
Beta
[°]
© Thesis: Control of knee flexion in a knee simulator p 48 / 86
Figure 43: Staircase experiment: flexion
In order to see how the dynamic behavior of the system changes with each voltage pulse, all the steps in the
output response are scaled between 0 and 1, with 0 zero being the starting angle and 1 the angle at steady state.
The resulting plots, depicted in Figure 44 and Figure 45, show that the different curves tend to the same trajectory
with the same settling time and no overshoot. One can conclude that, apart from a variable gain that causes
difference in the output step-size, the dynamical behavior stays identical throughout the considered hip angle
range. This stokes with the findings of the modeling where the nonlinearity was asserted/capitalized as a variable
gain.
Additional information acquired from this test is the sample time. As a rule of thumb, one divides the time until the
setpoint is reached in about 50 samples. In these staircase experiments the settling time is around 1 second, and
hence the sample period is approximately 20ms.
Also important to note are the similarities between Figure 44 and Figure 45. Both for flexion and extension the
system reacts in the same way, apart from a small difference in delay. In the case of extension of the mechanical
knee, the actuator makes a retracting motion that pulls on the cable. As the system wants to move against gravity,
the loading of the cable increases, causing the cable to stretch prior to the extension of the knee. This leads to an
additional delay in contrast to flexion where the system instantly follows the extracting motion of the actuator’s
rod.
0 2 4 6 8 10 12 14 160
0.5
1
1.5
2
2.5
t [s]V
oltage [
V]
Step down pulses (0.3s and 2V)
0 2 4 6 8 10 12 14 1610
20
30
40
50
t [s]
Beta
[°]
© Thesis: Control of knee flexion in a knee simulator p 49 / 86
Figure 44: Normalised output responses (flexion)
Figure 45: Normalised output responses (extension)
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8-0.2
0
0.2
0.4
0.6
0.8
1
1.2
t [s]
Norm
aliz
ed o
utp
ut
Step down pulses (0.3s and 2V)
12°-20°
20°-29°
29°-38°
38°-43°
43°-48°
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8-0.2
0
0.2
0.4
0.6
0.8
1
1.2
t [s]
Norm
aliz
ed o
utp
ut
Step up pulses (0.3s and 2V)
47°-43°
43°-38°
38°-32°
32°-26°
26°-18°
© Thesis: Control of knee flexion in a knee simulator p 50 / 86
7.3 System identification
Before designing a PID controller, a linear model of the plant is required.
7.3.1 Parametric system identification
In order to obtain an accurate identification result, one needs to consider the nonlinearities such as Coulomb
friction and backlash. Friction creates a dead zone whereas backlash occurs at the gear transmission of the
actuator and introduces hysteresis. These nonlinearities can be eliminated from the identification data by
considering only input-output measurements for which the velocity of the system is not equal to zero. Therefore
the system’s input signal used for identification should be unidirectional and maintain a sufficiently large
magnitude in order to guarantee constant excitation of the system. [31], [25].
In this regard a shifted Pseudo Random Binary Sequence (PRBS) signal is used to excite the process. This is
displayed together with the acquired output data in Figure 46. The voltage offset of 0.5 V guarantees a continuous
flexion movement of the knee, whereas the PRBS signal causes additional excitation of the knee. The datavector
that eventually is used for identification contains the data marked by the frame in Figure 46.
Figure 46: Input and output signal of system identification for flexion
From the theoretical model derived in chapter 6 it was concluded that the system would be from a third order
without any zeros. Based on this insight the Matlab command ‘tfest’ is used to estimate a continuous transfer
function with the specified amount of zeros and poles. For the obtained datavector this renders the following
transfer function for flexion:
Factorization leads to an expression in which the poles are visible:
© Thesis: Control of knee flexion in a knee simulator p 51 / 86
Note that the transfer function has a pole near the imaginary axis which causes the system to approximately
behave as if it would have an integrator. This complies perfectly to the physical reality where the hip angle keeps
increasing/decreasing when a voltage step is applied. Furthermore, this explains why the staircase experiment
discussed in section 7.2 is executed with input pulses instead of steps.
For extension of the knee, the system is expected to behave in the same way but with an additional delay
compared to flexion movement. This was already mentioned in section 7.2. Consequently, the same transfer
function is used for an extension movement but with an additional delay of 3 samples as expressed below:
7.3.2 Validation of identification results
Validation of the model is done by comparing the simulated and real life process responses with each other for
the same excitation signal. Figure 47 displays the simulated and real response to the shifted PRBS signal used
for identification. A good match between the identified model and the real system is found as a 94.75% fit is
established.
Figure 47: Simulated and real time response to shifted PRBS excitation signal for flexion.
© Thesis: Control of knee flexion in a knee simulator p 52 / 86
Further validation of the models was achieved by comparison of real versus simulated responses to different
excitation signals. Once again only the data satisfying the non-zero-velocity demand was considered. Some of
these results are listed below:
• Step signal of 0.6 V: 88.15% fit
• Combination of a 1.5 V step and negative ramp: 94.68 %fit
• Shifted PRBS that differs from the one used for identification: 95.94% fit
In average a fit of about 93% was obtained. This confirms that the identified models seem to be a sufficient
approximation for the nonlinear system. Hence, it will be used as a reference for the controller design.
7.3.3 Combined model for Simulation
To simulate the identified model in Simulink, it is completed with the deadband subsystem given in paragraph
6.1.1. This is illustrated in Figure 48. The delay block allows to set the additional time delay for the extension
model. For flexion it is equal to zero.
Figure 48: identified model completed with deadband.
© Thesis: Control of knee flexion in a knee simulator p 53 / 86
7.4 Controllers
7.4.1 Control strategy
Based on the derived transfer function a linear controller can be developed using FRtool in Matlab [58]. It’s a
frequency response tool for Computer Aided Control System Design (CACSD) that allows the user to design a
controller that matches predefined conditions concerning overshoot, settling time, robustness, phase margin and
gain margin, in a graphical way. The specifications are chosen in line with objectives for repetitive testing with a
focus on disturbance rejection. In practical terms: no overshoot, a settling time of 5 seconds, and a high
robustness of 0.6. For the resulting PID controller, the controller parameters and are derived so they can
be entered in the Labview interface. The transfer function of a PID-controller in terms of its control parameters is
expressed below:
[
]
Designing a controller in such a way doesn’t lead to satisfactory results. The reason being that FRtool [58 ]only
considers the linear model of the process and hence the controller does not reckon with the nonlinearities. The
latter being foremost the dead band. The main problem associated with that phenomenon is that if the system
comes to a halt before the setpoint is reached, only the integrator part of the controller can compensate for the
error. As a result, implementing a controller in real life tends towards a different dynamical behavior than
suggested by FRtool. Nevertheless the controller parameters found with FRtool are a good indication of the order
of magnitude that may be expected.
According to literature (i.e. [25] [35]) better results can be obtained with static friction compensation which
theoretically overcomes the dead band. As the threshold voltage of the dead band [+0.6V ; -1V] remains
approximately constant at all hip angles, friction compensation will be established by adding a constant value to
the control action (see Figure 49). Theoretically the feedforward of the threshold voltage can neutralize the dead
band completely. In practice it leads to an overcompensation and hence the destabilization of the system. This
effect was very evident. Therefore the compensating values are chosen smaller than the dead band thresholds
and the voltage deficiency is eventually compensated by the integrator action. [25]
Figure 49:Control scheme with example values for feedforward friction compensation
The required offset values are determined experimentally. Generally following trade off holds. A feedforward that
approximates the threshold value will increase the reactiveness of the controller and consequently causing
smooth motion of the system. However this will also encourage overshoot and oscillations around the setpoint.
On the other hand, oscillations will be avoided with a smaller friction compensation at the expense of a slower
controller (see for example Figure 55). In addition, a small compensation can evoke discontinuous movements of
the system when the control effort is in the neighborhood of the threshold voltage.
© Thesis: Control of knee flexion in a knee simulator p 54 / 86
Starting from the controller parameters derived in FRtool, the offset values and control parameters were tuned
experimentally. An error of 0.3° is allowed due to noise on the measured signal. The concrete results will be
discussed in the remaining of this thesis.
7.4.2 Disturbance rejection controllers
The tested controllers are PD, PI and PID. Even though a PD controller is theoretically unable to compensate for
disturbances due to the absence of an integrator, it is examined as well because it may not be forgotten that
system internally contains a pole close to the imaginary axis. The following tests are performed for each of the
controllers.
In the first conducted experiment the controllers are tested on their suitability to reach their setpoint without
overshoot and with a settling time of 5 seconds. The setpoint signal for testing consists out of small, intermediate
and large angle steps for flexion as well as extension throughout the whole flexion angle range.
The second experiment is to acquire information about the robustness of the controller. In this case the same
setpoint signal is used but an additional weight of 4.9 kg is placed on top of the actuator. These two experiments
are plotted together in order to see the difference.
In a final test the disturbance rejection of the controller is checked. This is achieved by adding a weight to the
actuator after the steady state is reached.
7.4.2.1 PD controller
The controller parameters are:
• Kp = 0.25
• Td = 0.12 s
• Offset: +0.4 V flexion / -0.55 V extension
Before discussing the results of the experiments just mentioned, a comparison is made between the simulated
and real data using the PD controller. The simulated data is acquired with Simulink [57] where the identified
model is used to represent the process of the plant. In addition, to obtain results that are closer to the reality, the
deadband and used feedforward values are implemented as well. The resulting Simulink scheme is depicted in
Figure 50.
Figure 50: Simulating PD-controller in Simulink.
© Thesis: Control of knee flexion in a knee simulator p 55 / 86
In Figure 51 and Figure 52 the output angle β and the control effort are compared for an input step of 10° for both
flexion and extension. In the case of flexion there is a good correlation between the simulated output and the real
data. For the simulated response there is a steady state error, but this is to be expected as there is no integrator
part in the controller. The comparison of the control effort is less obvious because of the discontinuities. These
occur when the offest switches between the negative and positive value. Due to the differences between
simulated data and real data, the switching can occur at slightly different time instants. In order to compare the
control effort properly one should subtract the feedforward values and regard the obtained trajectories. Doing this
for Figure 51 would result in two similar curves for the control effort. In the case of knee extension, the same
model is used but with an additional delay of 0.06 seconds. One can see from Figure 52 that the simulated data
doesn’t fit the real data as well as for flexion. However the same trends can be observed between simulated and
real data.
Figure 51:Comparison simulated and real data for flexion.
0 0.5 1 1.5 2 2.5-1
0
1
2
3
t [s]
Contr
ol eff
ort
[V
]
Real
Simulated
0 0.5 1 1.5 2 2.525
30
35
40
45
t [s]
Beta
[°]
Setpoint
Real
Simulated
© Thesis: Control of knee flexion in a knee simulator p 56 / 86
Figure 52:Comparison simulated and real data for extension.
Now it is proceeded with the actual experiments. Figure 53 and Figure 54 show that the PD controller (blue line)
can be tuned such that setpoint is reached without any overshoot and with a limited settling time. However, the
tuning is only possible in a single direction. In this case flexion (positive steps) yields good results, whereas for
extension there is a clear steady state error. Since there is no integral action in the controller the steady state
error can’t be eliminated. In addition, adding weight to the actuator leads to greater steady state errors,
particularly visible for negative steps. These observations remain the same throughout the whole flexion angle
range, and are not influenced by the size of the steps.
Also important to note is the presence of motion shocks in the system. Although these aren’t noticeable in the
data of the figures below, they were clearly visible for the naked eye during the conduction of the experiments.
Note that disturbance rejection isn’t considered here since a PD controller can’t theoretically remove a steady
state error. Consequently, a PD controller isn’t adequate for disturbance rejection. However the experiment shows
that a PD controller can be tuned so that the steady state error is minimal. This is made possible because of the
approximate integrator part of the process.
0 0.5 1 1.5 2 2.5
-3
-2
-1
0
1
t [s]
Contr
ol eff
ort
[V
]
Real
Simulated
0 0.5 1 1.5 2 2.525
30
35
40
45
t [s]
Beta
[°]
Setpoint
Real
Simulated
© Thesis: Control of knee flexion in a knee simulator p 57 / 86
Figure 53: PD controller (small setpoint steps)
Figure 54: PD controller( large setpoint steps)
0 5 10 15 20 25 30 35 40 4520
25
30
35
40
45
50
t [s]
Beta
[°]
PD controller small steps
Setpoint
PD
PD loaded
0 5 10 15 20 25 30 35 40 45-3
-2
-1
0
1
2
3
t [s]
Contr
ol E
ffort
[V
]
PD
PD loaded
45 50 55 60 65 70 7520
25
30
35
40
45
50
t [s]
Beta
[°]
PD controller large steps
Setpoint
PD
PD loaded
45 50 55 60 65 70 75-3
-2
-1
0
1
2
3
t [s]
Contr
ol E
ffort
[V
]
PD
PD loaded
© Thesis: Control of knee flexion in a knee simulator p 58 / 86
Remark: When looking closer at the control effort (i.e. Figure 53) one notices that sometimes the voltage shortly
jumps to zero. This probably originates at the power side of the motor driver. The latter creates a PWM signal
which is realized with a high switching frequency while the motor is an inductive load. When the induced voltages
in the signal lines from the limit switches are high enough, the DAQ card reads an activated limit switch. In the
Labview HMI it is programmed to set the voltage across the motor’s terminals to zero as soon as a limit switch is
triggered. This is the effect seen in the control effort. Adding a snubber capacitor across the motor’s terminals
might resolve this issue.
7.4.2.2 PI controller
The controller parameters are:
• Kp = 0.25
• Ti = 0.96 s
• Offset: +0.4 V flexion / -0.55 V extension
To demonstrate the effect of feed forward, Figure 55 is added. For small steps there is overshoot present for the
controller with an additional offset (red) but this phenomenon is absent when there is no offset (blue). As
mentioned in paragraph 7.4.1 the setpoint is reached faster with offset than without but at the expense of
overshoot.
At around 30 seconds (blue) one might incorrectly think there is a non-minimum phase behavior present. This
behavior is caused by applying the next step at the same moment the controller was eliminating the error that was
still present.
For large steps, the system’s response with the (same) PI-controller without offset (blue) differs from what was
observed for small steps. Namely, overshoot is exhibited as well now. The time the integrator part of the controller
needs to remove this error is considerably longer than the PI controller with feed forward (red). This is because
the integrator action needs to overcome the dead band of the system.
The difference in step response for small and large setpoint changes is most likely related to the acting
accelerations and thus inertia forces. For small steps the accelerations are indeed smaller than for larger steps.
© Thesis: Control of knee flexion in a knee simulator p 59 / 86
Figure 55: Effect feed forward (FF) on PI controller (top: small steps; bottom: big steps)
Although the controller without offset works nicely for small steps, its behaviour for large steps is unacceptable.
Therefore it is chosen to conduct the experiments for robustness and disturbance rejection with a PI with
feedforward compensation.
For all of the applied steps in Figure 56 and Figure 57, there is a few degrees of overshoot but the controller
(blue) is able to reach its setpoint in most of the cases. One can verify this by looking at the control effort. When
the control effort (blue) becomes constant within a 5-seconds-step-interval, the system has reached its setpoint
within the 0.3 degree margin. On the other hand, when the setpoint isn’t reached, the integral action tries to
correct this by increasing the control effort. Consequently, if the setpoint isn’t reached, the control effort displays a
ramp function instead of a constant value. This happens in the following time intervals (see the blue line): 0-5s,
25-30s, 40-45s and 50-55s. Note that for the latter, the error is very small, making it hard for the integrator to
correct this error.
The difference between flexion and extension is smaller than for the PD controller. Additionally, the system’s
motions are smoother than with the PD controller.
0 5 10 15 20 25 30 35 40 4520
25
30
35
40
45
50
t [s]
Beta
[°]
Effect feedforward (FF) on PI controller
45 50 55 60 65 70 7520
25
30
35
40
45
50
t [s]
Beta
[°]
SetPoint
PI without FF
PI with FF
© Thesis: Control of knee flexion in a knee simulator p 60 / 86
Figure 56 :PI controller (small setpoint steps)
Figure 57: PI controller (large setpoint steps)
0 5 10 15 20 25 30 35 40 4510
20
30
40
50
t [s]
Beta
[°]
PI controller small steps
Setpoint
PI
PI loaded
0 5 10 15 20 25 30 35 40 45-3
-2
-1
0
1
2
3
t [s]
Contr
ol E
ffort
[V
]
PI
PI loaded
45 50 55 60 65 70 7520
25
30
35
40
45
50
t [s]
Beta
[°]
PI controller large steps
Setpoint
PI
PI loaded
45 50 55 60 65 70 75-3
-2
-1
0
1
2
3
t [s]
Contr
ol E
ffort
[V
]
PI
PI loaded
© Thesis: Control of knee flexion in a knee simulator p 61 / 86
If weight is added on the hip (red line) to test robustness then worse results are obtained for the smaller steps: the
overshoot and the amount of oscillations increase. For the larger steps the differences are less pronounced.
Notice that, however the small difference, the overshoot is decreased in contrast to the small steps.
In Figure 58 the disturbance rejection of the PI controller is tested. A weight of 4.9 kg is added at approximately 8
seconds. The controller needs about 1.25 seconds to correct this disturbance.
Figure 58 :PI controller: disturbance rejection
7.4.2.3 PID controller
The PID controller parameters are:
• Kp = 0.25
• Ti = 0.96 s
• Td = 0.18 s
• Offset: +0.4 V flexion / -0.55 V extension
For the PID controller (blue line) all setpoints are reached in a timespan of maximum 2.5 seconds. In case of the
small steps there is always a small overshoot present, but when considering larger steps, the overshoot seems to
diminish and even vanish in some of the cases. In addition the difference between flexion and extension is
negligible in contrast to the previous controllers.
When the setup is loaded (red line) to test robustness, overshoot and settling time seem to increase slightly for
the small steps. For the larger steps the difference is even less significant. Hence this PID controller is the most
robust one amongst all the discussed controllers.
So, at first sight the PID controller seems to perform quite well but important to mention is that this controller
expressed severe motion shocks. Although this isn’t visible in the output data, this can be seen by regarding the
0 2 4 6 8 10 12 1415
20
25
30
35
40
t [s]
Beta
[°]
PI controller disturbance
Setpoint
PI
0 2 4 6 8 10 12 14-2
-1
0
1
2
3
t [s]
Contr
ol E
ffort
[V
]
© Thesis: Control of knee flexion in a knee simulator p 62 / 86
spikes present in the control effort. These spikes are not pure derivative kicks since the derivative action is
already implemented on the process variable instead of on the error.
.
Figure 59:PID controller (small setpoint steps)
Figure 60: PID controller (large setpoint steps)
0 5 10 15 20 25 30 35 40 4520
25
30
35
40
45
50
t [s]
Beta
[°]
PID controller small steps
Setpoint
PID
PID loaded
0 5 10 15 20 25 30 35 40 45-3
-2
-1
0
1
2
3
t [s]
Beta
[°]
PID
PID loaded
45 50 55 60 65 70 7520
25
30
35
40
45
50
t [s]
Beta
[°]
PI controller large steps
Setpoint
PID
PID loaded
45 50 55 60 65 70 75-3
-2
-1
0
1
2
3
t [s]
Beta
[°]
PID
PID loaded
© Thesis: Control of knee flexion in a knee simulator p 63 / 86
Again the controller’s performance regarding disturbance rejection is tested by suddenly adding a weight of 4.9 kg
to the system. Figure 61 shows that the controller is able to reject it in about 1.5 seconds.
Figure 61: PID controller: disturbance rejection.
7.4.2.4 Comparison PD,PI and PID
In order to compare the performance of the different controllers against each other, the results for the PD, PI and
PID are plotted together in Figure 62 and Figure 63. In addition, Table 2 is added to summarize and facilitate their
mutual comparison. Note that a ‘+’ does not necessarily mean that the controller scores good regarding a certain
criterion. It means it scores a better result than the other controllers. The same holds for ‘-‘ sign.
The PD controller can be tuned so that it gives good results for the mechanical knee. The PD controller is the only
controller that consistently has no overshoot and has the shortest settling time. However, it has a limited
robustness and it can’t handle disturbances, consequently it isn’t much of use for in-vitro testing where changing
circumstances may occur.
0 1 2 3 4 5 6 7 8 915
20
25
30
35
40
t [s]
Beta
[°]
PID controller disturbance
0 1 2 3 4 5 6 7 8 9-2
-1
0
1
2
3
4
t [s]
Contr
ol E
ffort
[V
]
Setpoint
PID
© Thesis: Control of knee flexion in a knee simulator p 64 / 86
Figure 62: Comparison PD, PI and PID (small setpoint steps)
Figure 63: Comparison PD, PI and PID (large setpoint steps).
0 5 10 15 20 25 30 35 40 4520
25
30
35
40
45
50
t [s]
Beta
[°]
PD, PI, PID controller small steps
Setpoint
PD
PI
PID
0 5 10 15 20 25 30 35 40 45-3
-2
-1
0
1
2
3
t [s]
Conto
l E
ffort
[V
]
PD
PI
PID
45 50 55 60 65 70 7520
25
30
35
40
45
50
t [s]
Beta
[°]
PD, PI, PID controller large steps
Setpoint
PD
PI
PID
45 50 55 60 65 70 75-3
-2
-1
0
1
2
3
t [s]
Conto
l E
ffort
[V
]
PD
PI
PID
© Thesis: Control of knee flexion in a knee simulator p 65 / 86
PD PI PID
Overshoot + - +/-
Settling time + +/- +
Steady state error - + +
Robustness - - +
Shocks +/- + -
Table 2: Mutual comparison of the PD, PI and PID controller.
When comparing the PID to the PI controller, the PID leads to smaller overshoot (no overshoot in some cases),
shorter settling time, and more robustness for both flexion and extension movements. Hence, the PID is the better
controller at first sight. However the PID causes the system to move in serious shocks which is unacceptable for
in-vitro testing. As these motion discontinuities mainly occur for the PD and PID controller, one can conclude they
are caused by the D-action of the controller. This is strange since the derivative action is implemented on the
process variable instead of on the error.
Designing a better PID controller would imply reducing the D-action. Although the discontinuities may decrease,
the overshoot and settling time will increases as predicted by the PI test results. All in all, the PI controller has the
most acceptable result. However, when taking a closer look at the PI controller, then there is still the overshoot to
be considered which is unwanted in case of repetitive testing. The overshoot could be reduced by lowering the
influence of the integral action, however this would lead to larger settling times.
Since the PI controller already struggles to reach its setpoint in a 5 second interval, a longer settling time would
certainly not improve the controller.
Now let’s assume that the PI can be tuned for certain setpoint stepsizes without exhibiting overshoot and a large
settling time. This idea seems reasonable when looking at Figure 55 where the PI controller without feed forward
has no overshoot for small setpoint steps. However, for the larger steps overshoot suddenly occurs. The different
dynamical behavior between small and large setpoint steps is also visible in the PID controller results and can be
explained by the nonlinearity of the system.
Considering all of this, it is obvious that the system can’t be perfectly controlled with a single linear controller.
Consequently, more advanced control techniques will need to be considered in order to deal with the nonlinearity
of the system. For static testing, where the trajectory is of lesser importance, the PI controller could be used.
© Thesis: Control of knee flexion in a knee simulator p 66 / 86
7.4.3 Setpoint tracking controller
In the following the aptness of a single linear controller for setpoint tracking is evaluated. The test signal consists
of a sinusoidal setpoint trajectory resembling a squatting motion of the knee. Although this doesn’t mirror
psychological circumstances as such, it provides insight in the possibilities of the observed controller. The
controller needs to be tuned in such a way that the output has the same amplitude and frequency of the setpoint
trajectory. In addition -although less important than previous mentioned objectives- the tracking error should be as
small as possible. Once again the robustness will be checked by adding weight to the hip joint.
The setpoint fluctuates between 25 and 41 degrees, with a period of 4 seconds. This is the same period used in
the calculation of the kinematics and dynamics during the design phase of this thesis (see chapter 4) and should
therefore be of no problem. The data used to create the upcoming figures is collected after the system has settled
down into a regime.
In Figure 64 the same PID controller as used for disturbance rejection (§ 7.4.2.3) has been applied to setpoint
tracking. It is observed that a clear deformation in the sinusoidal shape and a change in amplitude are present.
Consequently, a controller designed for disturbance rejection is not intrinsically ideal to follow a setpoint
trajectory. In the remaining of this chapter, a PI and PID controller are manually tuned in order to obtain better
results.
Figure 64: Setpoint tracking with PID controller for disturbance rejection.
0 1 2 3 4 5 620
25
30
35
40
45
t [s]
Beta
[°]
PID disturbance rejection for setpoint tracking
Setpoint
PID
0 1 2 3 4 5 6-2
-1
0
1
2
t [s]
Contr
ol E
ffort
[V
]
© Thesis: Control of knee flexion in a knee simulator p 67 / 86
7.4.3.1 PI controller
The controller parameters are:
• Kp = 0.1
• Ti = 4.8 s
• Offset: +0.4 V flexion / -0.43 V extension
Figure 65 shows that a PI controller (blue line) can be tuned such that the sinusoidal setpoint is approximately
duplicated. However, a significant tracking error or delay is present. Applying additional weight to the hip joint
deforms the sinusoidal output (red line). Also the amplitude is reduced, mainly for small angles (thus at maximum
extension), and the delay is slightly increased.
As can be expected from the significant delay between the setpoint trajectory and the output, the controller will
have a hard time following higher frequency trajectories. This effect is demonstrated in Figure 66, where a
setpoint trajectory with a period of 2 seconds leads to a significant reduction of the amplitude at the output.
Figure 65: PI controller: setpoint tracking (period of 4s).
Figure 66: Setpoint trajectory with a period of 2s.
0 1 2 3 4 5 6 725
30
35
40
45
t [s]
Beta
[°]
PI for setpoint tracking
Setpoint
PI
PI loaded
0 1 2 3 4 5 6 7-2
-1
0
1
2
t [s]
Contr
ol E
ffort
[V
]
0 1 2 3 4 5 6 7 825
30
35
40
45
t [s]
Beta
[°]
PI for setpoint tracking
Setpoint
PI
0 1 2 3 4 5 6 7 8-2
-1
0
1
2
t [s]
Contr
ol E
ffort
[V
]
© Thesis: Control of knee flexion in a knee simulator p 68 / 86
7.4.3.2 PID controller
The controller parameters are:
• Kp = 0.25
• Ti = 4.8 s
• Td=0.12 s
• Offset: +0.35 V flexion / -0.35 V extension
The PID-controller produces similar results as the PI controller. A significant difference is the smaller tracking
error as a consequence of the higher gain Kp, and the D-action. On the other hand, adding the D-action induces
shocks in the flexion motion of the knee. Once again this is indicated by the unsmooth curve of the control effort.
When loading the knee simulator with additional weight, the output still resembles the original one, proving the
controller to be quite robust. In contrast to the PI controller, the angle range and the delay between I/O stays
identical. The only notable difference occurs at maximum angles where the system switches from flexion to
extension. As the system needs to move against gravity, the controller experiences some resistance because of
the extra weight. Consequently a greater control effort is required in order to evoke motion of the system. This
causes the slower reaction at maximum angles.
Figure 67:: PID controller: setpoint tracking.
7.4.3.3 Conclusion
The discussed results show that it is possible to tune a controller that can reproduce a certain sinusoidal setpoint
trajectory. The controller can also be made robust enough to manage with changing circumstances generally
present in in-vitro testing, for example anatomical differences in knee joints. However, the presence of motion
shocks should be avoided as much as possible and this is not straightforward. Furthermore, both observed
controllers display a reasonably large tracking error making it difficult to follow fast changing trajectories. More
elaborate control strategies that take into account the repetitive nature of the tests, such as ‘iterative control’,
would be more suitable for this purpose.
0 1 2 3 4 5 6 7 820
25
30
35
40
45
t [s]
Beta
[°]
PID for setpoint tracking
Setpoint
PID
PID loaded
0 1 2 3 4 5 6 7 8-2
-1
0
1
2
t [s]
Contr
ol E
ffort
[V
]
© Thesis: Control of knee flexion in a knee simulator p 69 / 86
Chapter 8: Conclusions and future work
8.1 Summary
The elaboration of the Ghent Knee Rig with a control system would allow for more accurate experiments which
moreover could be repeated for different knee joints. Furthermore it would be possible to mimic kinematic
behavior that occurs during every day activities such as walking or stair climbing.
To allow the testing of different control strategies a scaled and simplified version of the Ghent Knee Rig was
developed. The experience gained here will in the future be used to design an appropriate controller for the setup
in the University Hospitals of Ghent.
So, first of all a mechanical design was made with the aid of Solidworks. 2-D drawings were derived from it such
that the individual parts could be manufactured by the EELAB department of UGent. Together with the
mechanical assembly, this part of the thesis required a lot of hand labour and hence took a very long time.
The electrical part was pretty straight forward with the exception of the hip sensor. The original choice of the
magnetic encoder turned out to be a wrong decision. Its malfunctioning is probably due to the changing
tolerances when the setup is loaded. Furthermore, the sensor requires the soldering of five leads. As they were
only 1.27 mm apart from one each other, it required a lot of effort and time to get it right. In addition the wiring was
very fragile. Therefore this sensor was replaced by a rotary potentiometer. This latter has the additional
advantage that it is capable of a higher sampling rate as it requires less programming resources.
The data acquisition part is created around the NI-6008 card and programmed with Labview 2010. The interface
allows the user to apply various kinds of open loop inputs to the simulator, e.g. steps, ramps, etc. It is also
possible to switch to closed loop control by means of a P(I)(D) controller. Furthermore, the import and export of
data and signals to and from Matlab/Simulink is made available.
The development of a suitable P(I)(D) controller was mainly challenged by the presence of the large dead band:
the system does not react to any input between -1V and +0.6V. This phenomenon first of all hinders a sufficiently
accurate parametric system identification. Consequently it is hard to design an appropriate controller that fulfills
certain specifications.
Also a theoretical model was derived and implemented in Matlab/Simulink. The required parameters which were
unknown were estimated based on catalogue specifications of similar components.
8.2 Conclusion
This thesis delivers a scaled and simplified setup of the Ghent Knee Rig. It allows the simulation of knee squats
on a mechanical knee with one degree of freedom. As demanded, the knee simulator is compact enough to be
moved relatively easily within office buildings.
The last part of this thesis was devoted to the development of a suitable PID controller, both for disturbance
rejection as for setpoint tracking. The controller for disturbance rejection was not only assessed on the classical
points of overshoot, robustness and steady state error, but also on the presence of motion shocks. A controller
that scored well on all four criteria in the entire setpoint range was not found. For setpoint tracking, the PID
controller was robust enough to reproduce the sinusoidal trajectory with or without the presence of an additional
weight. However, motion shocks were clearly present. Furhtermore, a considerable delay between input/output
remained making it difficult to accurately follow faster changing trajectories.
© Thesis: Control of knee flexion in a knee simulator p 70 / 86
Therefore it is concluded that due the presence of nonlinearities it is hard to satisfactory control the system with a
single linear controller. More advanced control strategies are advised.
8.3 Future work
The first thing that must be done in the future is the replacement of the hip sensor. Currently this is a traditional
rotary potentiometer and hence not designed to be turned that frequently. This makes it very susceptible to wear.
Further research is necessary to test the performance of more advanced control strategies. Taking into account
that biomechanical experiments mainly require setpoint tracking, the following suggestions can be made: Local
Model Network, iterative and adaptive control.
The principle of Local Model Network (LMN) consists of dividing the whole operating range in subintervals for
which a linearization or identification can be performed. This renders a sequence of local models that depict the
nonlinear system. For each linear model a controller can be designed which allows the plant to be controlled
throughout the whole operating range by switching between the controllers in accordance to the current operating
point. Important to note is that LMN gets harder to implement as the required number of local models increases.
Iterative control is a technique especially developed for the tracking of a setpoint trajectory, and thus making it
ideal for the repetitive biomechanical experiments that mimic human movements. The basic principle is rather
simple. For an initial input vector, the output is recorded and the error with respect to the setpoint trajectory is
determined. The original input vector is then corrected by adding the error multiplied with a design variable.
Although these optimizations to the input are generally calculated offline, there also exist online algorithms.
A last control strategy that will most likely achieve nice results as well is adaptive control. The initial parameters of
the controller (i.e. a PID) are iteratively updated such that the error becomes minimal. Therefore the system is
recursively identified as more data becomes available, often using the Recursive Least Squares (RLS) algorithm.
For more elaborate controller strategies the knowledge of the motor torque can be very interesting. It can be
measured with the aid of a shunt resistor in series with the motor leads. The voltage across this shunt can be
measured by the DAQ card and is a measure for the current. As the actuator is driven by a permanent magnet
motor, to the current and motor torque are related to each other via the motor constant. One can also
approximately calculate the load torque as a function of the hip angle. The difference between motor torque and
load torque is available for acceleration.
8.4 Epilogue
At the moment of publication, many injuries related to a malfunctioning of the knee joint still remain
incomprehensible. An adequate treatment requires a thorough understanding of how the different anatomical
structures collaborate and how they are influenced by forces and movements. Consequently, up to date additional
research to this complex joint is a necessity.
Therefore, we would like to end this thesis with the following quotation:
“Though there were many giants of old in physic and philosophy, yet I say with Didacus Stella, ‘A dwarf
standing on the shoulders of a giant may see farther than a giant himself;’ I may likely add, alter, and see
farther than my predecessors …” [Robert Burton,[8]
In the hope that this thesis may assist future research dedicated to the prevention and medical treatment of knee
related injuries.
© Thesis: Control of knee flexion in a knee simulator p 71 / 86
Appendix A: financial overview
During the design and realization of this knee simulator, constant attention was paid to the budget. For the
purchase of new products the price was always carefully traded off first and foremost against specifications.
However, also quality and shipping time were taken into consideration. A list of the items that had to be bought
together with their price and desired amount is given in Table 3. This resulted in a total cost of € 1010.98.
Not all components needed for this thesis had to be bought. Many of them were already available, i.e. bolts, nuts,
frame profiles, limit switches, electrical wiring, etc. Their price is unknown and is therefore not taken into account.
Component Enterprise Required amount Price/piece (€) Total price (€)
Motor driver MD03 Antratek 1 74.05 74.05
DAQ NI USB-6008 National Instruments 1 221.42 221.42
Actuator Industrial Devices UK 1 368.24 368.24
Magnetic encoder 12-Bit RS Components 1 31.87 31.87
Thermal circuit breaker (5A) RS Components 1 4.38 4.38
Automotive fuse (15A) RS Components 1 1.71 1.71
Fuseholder in-line RS Components 1 2.33 2.33
Power supply Siemens PSU100D RS Components 1 95.00 95.00
HIWIN guiding rail HIWIN 1 90.39 90.39
HIWIN guiding blocks HIWIN 3 36.78 110.35
Pulley Brico 1 2.69 2.69
Cable 2mm, 1.5m Brico 1 2.58 2.58
Cable clamps Brico 3 x 2 1.99 5.97
Total cost 1010.98
Table 3: the total cost of the newly purchased components.
© Thesis: Control of knee flexion in a knee simulator p 72 / 86
Appendix B: Matlab code to determine design
parameters for actuator
%% FORCES KNEE SIMULATOR - THESIS %% % -----------------------------------% % -----------------------------------%
clear all;
close all;
%parameters:
Mact = 2; %mass actuator (kg)
Mh = 10; %mass heup (kg)
Mt = 1; %mass tibia (kg)
Mf = 1.5; %mass femur (kg)
Lt = 0.175; %Length tibia (m)
Lp = 0.020; %Length patella hefboom (m)
Lf = 0.220; %Length femur (m)
Lpees = Lt/3; %distance between knee pulley and the attachment of the cable at the tibia (m)
g = 9.81; %gravity acceleration m/s²
r4= 0.045; %vertical distance between pulley center and hip (m)
r5 = 0.045; %horizontal distance between pulley center and base plate (m)
CCkp0 = 0.0066; %manually calculated initial Covered Circumference of the Knee Pulley (m)
L0 = 0.2658; %manually calculated initial cable length between hip and knee pulley (m)
%simulation
time_samples=400; t=0; i=1; a_h=ones(1,time_samples);Fq=a_h;Fq2=a_h;Theta=a_h;stroke_length_matrix=a_h;
for tijd = 0:0.01:4,
%It is assumed that the hip follows a given sinusoidal trajectory.
r_heup = 0.2682+0.1268*cos(pi/2*t); %flexion angle of 140°
alfa_accent=acos((-Lf^2 + r_heup^2 + Lt^2)/(2*r_heup*Lt));
%Determining angles
alfa = pi/2-alfa_accent;
beta = asin(Lt/Lf*sin(alfa_accent));
gamma = pi-beta-alfa_accent;
theta = pi-gamma; theta_graden = theta*180/pi;
© Thesis: Control of knee flexion in a knee simulator p 73 / 86
Theta(i)= theta_graden;
phi=asin(Lp/Lpees);
%Determining the accelerations for the different masses for a maximum flexion angle of 140°
a_heup = -0.1425000000e-1*cos((1/2)*pi*t)*pi^2;
a_femur = -0.7125000000e-2*cos((1/2)*pi*t)*pi^2+0.4061250000e-3*sin((1/2)*pi*t)^2*pi^2/(.338+0.57e-
1*cos((1/2)*pi*t))+(0.4061250000e-3*(-Lf^2+Lt^2-(.338+0.57e-
1*cos((1/2)*pi*t))^2))*sin((1/2)*pi*t)^2*pi^2/(.338+0.57e-1*cos((1/2)*pi*t))^3+(0.3562500000e-2*(-Lf^2+Lt^2-
(.338+0.57e-1*cos((1/2)*pi*t))^2))*cos((1/2)*pi*t)*pi^2/(.338+0.57e-1*cos((1/2)*pi*t))^2;
a_tibia = -(0.7125000000e-2*(Lt+Lp))*cos((1/2)*pi*t)*pi^2/Lt-(0.4061250000e-
3*(Lt+Lp))*sin((1/2)*pi*t)^2*pi^2/((.338+0.57e-1*cos((1/2)*pi*t))*Lt)-(0.4061250000e-3*(Lt+Lp))*(Lf^2-Lt^2-
(.338+0.57e-1*cos((1/2)*pi*t))^2)*sin((1/2)*pi*t)^2*pi^2/((.338+0.57e-1*cos((1/2)*pi*t))^3*Lt)-(0.3562500000e-
2*(Lt+Lp))*(Lf^2-Lt^2-(.338+0.57e-1*cos((1/2)*pi*t))^2)*cos((1/2)*pi*t)*pi^2/((.338+0.57e-1*cos((1/2)*pi*t))^2*Lt);
a_act = a_heup;
%Determining forces with additional acceleration
F1 = Mh*(g+a_heup); %force acting on the hip joint
F2 = Mf*(g+a_femur); %force acting on the femur F3 = Mt*(g+a_tibia); %force acting on the tibia Fact = Mact*(g+a_act); %force acting on the actuator
F4=F1+F2+F3+Fact;
Fquad = ((F4*Lt*cos(alfa))-(F3*Lt/2*cos(alfa))) / (Lpees*sin(phi)); Fq(i)=Fquad;
%Determining forces without additional acceleration a_heup=0;a_femur=0;a_tibia=0;a_act=0;
F1 = Mh*(g+a_heup); F2 = Mf*(g+a_femur); F3 = Mt*(g+a_tibia);
Fact = Mact*(g+a_act);
F4=F1+F2+F3+Fact;
Fquad = ((F4*Lt*cos(alfa))-(F3*Lt/2*cos(alfa))) / (Lpees*sin(phi));
Fq2(i)=Fquad;
%determining stroke length
r7 = sqrt((-Lf*sin(beta)+r5)^2 +(Lf*cos(beta)+r4)^2); %distance between knee and hip pulley centers (m)
L = 2*sqrt((r7/2)^2-Lp^2); %cable length between hip and knee pulleys (m)
delta = atan(L/2/Lp); %angle (rad)
zeta = acos((r5^2+r4^2-r7^2-Lf^2)/(-2*Lf*r7)); %angle (rad) epsilon = acos(Lp/Lpees); %angle (rad)
© Thesis: Control of knee flexion in a knee simulator p 74 / 86
CCkp = Lp*(2*pi-delta-zeta-epsilon-gamma); %Covered Circumference of the Knee Pulley (m) CChp = Lp*beta; %Covered Circumference of the Hip Pulley (m)
stroke_length = CChp+(CCkp-CCkp0)-(L0-L); %determining the required stroke length stroke_length_matrix(i) = stroke_length;
i=i+1; t=0.01+t; %increment loop counter end
%Making figures t=0:0.01:4;
figure; subplot(1,1,1);plot (Theta,stroke_length_matrix,'b','lineWidth',2);xlabel('flexion angle (°)');ylabel('Stroke length
(m)');grid on;
figure; plot(t,Fq,'r','lineWidth',2);hold on; plot(t,Fq2,'b','lineWidth',2);
xlabel('t [s]');ylabel('F_q [N]');grid on;
© Thesis: Control of knee flexion in a knee simulator p 75 / 86
Appendix C: Matlab code for the theoretic model
clear all; close all;
%Actuator constants: R=0.4; %Ohm L=0.85*10^-3; %Henry
Kt=0.52*(10^-2)*9.81; %0.52 kg*cm/A==> Nm/A Kb=6/1000*(60/(2*pi)); %V/Krpm ==> V/rad/s Jm=0.00011; %kg*m²
Jact=0.00015; %kg*m² B=0.011; %Assumed value (Nm/(rad/s)) - normally between 0.01-0.003 according to the
catalog of HIWIN
Gear_ratio = 1/5; %transmission ratio Lead = 12*10^-3; %Not given, assumed value (mm) (based on catalog values of similar actuators)
%Model constants: Mact = 2; %mass actuator (kg)
Mhip = 5; %mass heup (kg) Mtibia = 1; %mass tibia (kg) Mfemur = 1.5; %mass femur (kg)
Lt = 0.175; %Length tibia (m) Lp = 0.020; %Length patella leverage (m)
Lf = 0.220; %Length femur (m) Lpees = Lt/3; %distance from knee pulley center to attachment at the tibia (m)
r = Lp; %radius pulleys (m) r4 = 0.045; %vertical distance between pulley center and hip (m) r5 = 0.045; %horizontal distance between pulley center and base plate (m)
r7 = 0.08; %distance between 'small pulley' center and hip pulley when knee is fully stretched (m) r8 = 0.015; %the height above the femur until the 'small pulley' center (m) r9_0=sqrt((r5-r8)^2+(r4+r7)^2); %distance between hip- and movable pulley when the leg is in the upright
position (m)
g = 9.81; %Gravitational acceleration (m/s²)
phi=asin(Lp/Lpees); %constant angle (rad) Epsilon = acos(r/Lpees) %constant angle (rad)
CCkp_0=Lp*(pi/2-Epsilon) %Covered Circumference of the Knee Pulley at the initial upright position (m)
%Spring constant cable:
Ecable=3.0*10^10; %cable’s Youngs Modulus [N/m²], dimension of value found in e.g.
http://www.s3i.co.uk/wire-rope-technical.php Lcable=Lf-r7+CCkp_0+sqrt(Lpees^2-Lp^2); %length cable (m)
Acable=pi*10^-6; %area cross section cable (m²) Kk=Ecable*Acable/Lcable %spring constant cable (N/m)
© Thesis: Control of knee flexion in a knee simulator p 76 / 86
%Load parameters into Simulink simulation:
load_system('simulation_knee_simulator_V14') sim('simulation_knee_simulator_V14');
© Thesis: Control of knee flexion in a knee simulator p 77 / 86
Appendix D: Labview program
i. Introduction
The Labview 2010 [59] program fullfils the role of Human Machine Interface. It allows the user to apply open loop
voltage steps, ramps, sines or other externally defined inputs to the system. Also closed loop control by means of
a PID controller is available. The setpoint can be given either manually or externally and can be a fixed value or a
trajectory. All these features are directly available from the front panel together with indicators showing the motor
movements and state of the limit switches. This is depicted in Figure 68. Also present on the front panel are two
graphs showing the current value of the voltage reference signal (manipulated variable) and the hip angle
(controlled variable).
If during a movement a limit switch is activated then the reference voltage will be set to zero. It will no longer be
possible to move the actuator further in that direction regardless of the input you generate.
Figure 68: front panel of the Labview HMI
PID Controller parameters Voltage output
(always positive)
Indicators motor
movements
Open loop test
voltage inputs
Indicators limit
switches
Apply sine or external input as open loop
voltage or setpoint
Manually apply
voltage
General commands
and settings
© Thesis: Control of knee flexion in a knee simulator p 78 / 86
ii. Warnings and considerations
Before you use the knee simulator and the accompanied HMHI, please read first the followings warnings.
Firstly, the voltage converter is a switched power supply. It contains a lot of capacitors and hence if its
connection to the grid is interrupted with the emergency button, the voltage across its DC output terminals
decreases only slowly. This implies that the actuator not suddenly stops his movements when the emergency
button is pressed. A resistor across the DC terminals to dissipate the remaining power faster was only a minor
improvement to this issue.
If you want to stop the actuator immediately, toggle the small switch at the side of the setup. This will set the
reference voltage towards the motor driver to zero and has an immediate result!
The execution of the Labview program is completely software timed and as such its cycle time is influenced
greatly by background process in the operating system of the PC. This implies that the control system can react
relative slowly to new information. In example, the actuator’s movements are bounded by limit switches. When a
limit switch is hit, the Labview program will turn off the actuator. If however during the motion of the actuator a
background process on the pc starts (i.e. a software update) then the execution of Labview is slowed down
considerably. The program will not react fast enough when a limit switch is hit and the actuator may move beyond
its boundaries. This can be dangerous!
Another consideration is the cable. During the design phase it was considered that hip assembly would
maximum weigh 12 kg. This includes all components fixed to the base plate and additional body weight. Before
the base plate was mounted in the setup its weight was measured at 7kg. This implies that an additional weight of
5 kg is allowed.
If in the future additional weight of more than 5 kg is required then it is advisable to replace the current cable with
a stronger one to be sure it will not fail. Also regularly check the cable for damages which may be caused by
friction or by too small turn radius’.
It is not easy to firmly attach the cable such that it cannot slip while putting enough initial tension on it. The
following procedure is advised when the cable is replaced or tensioned again. First use the Labview program to
bend the knee until its lower limit switch. Turn of the program and manually stretch the knee. This will cause the
cable to loosen and hence can be tensioned by hand. If all clamps are securely fixed, bend the knee back down
(still manually). Meanwhile ensuring that the cable stays in the therefor provided slots. Now, use Labview again to
stretch the knee. If the cable is completely replaced then it might be necessary to repeat this procedure a few
times until the desired tension is achieved. Finally, it might be required to recalibrate the potentiometer.
Finally, in the power circuit high DC currents can flow. These are potentially deadly! Make sure that it is
impossible to accidently touch a blank contact point If you want to change something to the electrical part,
disconnect the setup from the gird and from the PC and wait until the power supply has dissipated all of its
remaining power.
iii. Preparation of the setup
To use the knee simulator follow this procedure:
1. Make sure the machine is connected to the gird via the plug.
2. Insert the USB cable that connects the DAQ card to the PC.
Attention: make sure that the USB cable is plugged in a full USB-gate and not a USB hub. When the
emergency button is released peak currents may occur causing the PC to crash if the cable is plugged
into a USB-hub. Therefore, the USB-cable is inserted at the back of the PC (a full USB-gate).
3. Release the emergency button.
4. Toggle the small switch situated at the side of the setup (probably at your left hand) to the back.
© Thesis: Control of knee flexion in a knee simulator p 79 / 86
5. Continue with a functionality described in the section ‘short tutorial’.
6. Set on the front panel of the HMI a value for ‘delay loop’ and for ‘sample period’. The latter must be a
multiple of the former. Standard they are both set to 20.
iv. Short tutorial
Manually control the actuator: if you want the actuator to extend (to bend the knee) then slide the ‘Manually
controlling voltage’ (the big vertical bar) slowly downwards. For a knee stretching movement, slide the bar slowly
upwards.
Apply open loop impulse of 2V during 500ms : first set the ‘Amplitude’ to 2. Next set the ‘Duration of step’ to 500.
Subsequently, choose if the knee should stretch or bend by pointing the toggle switch respectively up-or
downwards. Finally press the ‘Apply step’ button.
Apply open loop step of 2V: execute the same procedure as for an impulse but change the duration of the step to
e.g. 100000.
Apply open loop ramp: first set in ‘Ramp’ how much you want the voltage to increase per sample period, i.e.
0.001. Next, choose whether the knee should stretch or bend by pointing the toggle switch respectively up- or
downwards. Finally push the ‘Apply ramp’ button.
Apply open loop sine: fill in values for the sine’s period (in milliseconds), amplitude (in V) and offset (in V). Then
make sure that the toggle switch ‘setpoint | input’ in front of this block is set to ‘Input’. Finally press ‘apply sine’.
Example values: period: 8000, amplitude: 1, offset: 0. If a limit switch is activated then only one halve of the
period will be transferred to the system (unidirectional movement).
Apply external input: this feature is very handy when more complicated inputs are required, i.e. a prbs or
sinesweep signal. The external signal should be generated in Matlab or Simulink and saved as a .txt file. From
that .txt file only one value will be applied every sample period. Therefore, if the signal is generated in Simulink
then a fixed step size equal to the one set in Labview via the front panel input box ‘Sample period (ms)’ must be
used. This can be done in Simulink’s ‘Configuration Parameters’ dialog box (short key: Ctrl + E) as depicted in
Figure 69.
Figure 69: necessary settings in Simulink if signal is to be used in Labview:
solver type = fixed step and step size = same as entered in front panel of Labview HMI.
© Thesis: Control of knee flexion in a knee simulator p 80 / 86
As an example we would like to apply a sinesweep signal to the system. First we create this signal in Simulink as
illustrated in Figure 70. We would like to use a sample period of 20ms. This value is entered in both the Simulink
model ‘Configuration Parameters’ (see Figure 69) and in the Labview front panel (situated at the upper right
corner). Next we run the Simulink model and copy the values stored in ‘Out 1’ to a .txt file and save the latter.
Before Labview is ran, the push button ‘read external input’ has to be activated. This is because that piece of the
code is executed before the main program. So after we pressed that button we run Labview. It will immediately
show a dialog box that lets us choose the file we wish to read in. So select the .txt file that we just created and
press OK. Next make sure that the toggle switch ‘setpoint | input’ in front of this block is set to ‘Input’. Finally press
‘Apply external input’.
Figure 70: creating a sinesweep signal in Simulink
Bring system to a manually defined setpoint: if you want to move the system in a controlled way to a given
setpoint then first the controller parameters have to be entered in the HMI. This can be done before the Labview
is ran or during runtime. These parameters are situated just below the ‘Stop’ button. Ti and Td are expressed in
minutes in contrary to seconds usually. The offsets have to be entered without their sign. For example fill in Kp =
0.25, Td = 0.002 and offsets: 0.4 | 0.55. Next enter a setpoint (expressed in degrees) within the system’s range
(can also be changed at runtime). Finally press the button ‘Controller On/Off’.
Sinusoidal setpoint trajectory: this time the sine’s amplitude and offset are expressed in degrees instead of volts.
Next, make sure the toggle switch ‘setpoint | input’ in front of the block is set to ‘Setpoint’. Finally press ‘apply
sine’. Example values: period: 8000, amplitude: 10, offset: 30.
Externally defined setpoint trajectory: follow the same procedure as mentioned just above for an external input
signal, but now the values in the .txt file should resemble angular values (expressed in degrees). Put the toggle
switch ‘setpoint | input’ in front of this block to ‘Setpoint’. Finally press ‘Apply external input’.
Collect and write data to file: if the push button ‘Collect data’ is activated then the voltage reference signal,
setpoint, hip angle and time are registered. If you want to export this data to an external .txt file then activate the
push button ‘Write data’ before stopping the program. The data is stored in four columns, from left to right: input
voltage (V), the hip angle (°), time (s) and the setpoint (°).
© Thesis: Control of knee flexion in a knee simulator p 81 / 86
v. The program code
Although it is known that the code can be grouped in so called ‘sub VI’s, the HMI is completely programmed in a
single VI. As inexperienced Labview users it was felt more convenient when changes had to be made.
To keep an overview of the program, the code of the different HMI functionalities are grouped together. In Figure
71 the program layout is graphically sketched together with the most important connections between the several
parts of code. Some of the more complicated or special blocks are explained in more detail.
Block 18 is very important. It ensures that the while loop is iterated at a constant time rate. This is obtained by
adding a delay block which the user can adjust via the front panel (‘delay loop (ms)’). At the moment a single
iterations takes between 12 and 17 ms. Therefore the delay must be chosen larger than 17ms but on the other
hand not too large since one desires a high reactiveness of the program to its limit switch inputs. Therefore in this
thesis a delay of 20ms was used.
Data is collected at discrete moments specified by the HMI input ‘Sample time (ms)’ situated on the front panel.
The sample time must be an even multiple of the delay. This thesis used a sample time of 20ms.
Block 2 is crucial for a safe use of the knee simulator. It initializes the different buttons and inputs on the front
panel to a neutral value (generally zero/off) such that when the HMI is started, the settings of the previous run are
not suddenly applied.
Block 10 summarizes all the different voltages that can be generated. This summation allows even more freedom
to create specific voltage signals. Furthermore it can be used to apply a voltage disturbance when the system is
working in closed loop control.
Block 12 contains some logic building blocks and decides what the reference signal towards the motor should be
(always positive) and in which way it should turn. If a limit switch is hit then further movement in that direction is
prohibited: the reference voltage is set to zero regardless of the signal leaving ‘Block 12’. Also pressing the stop
button sets the output voltage to zero.
Block 15 is responsible for reading and converting the angular sensor. The rotary potentiometer gives a variable
voltage which is linearly converted to an angle. A 4-bit shift register is used to obtain a moving average of the hip
angle and as such reduces the influence of noise slightly. When the HMI is turned on, this shift register initially
contains four zeros. That explains the parabolic convergence towards the real angle observed at the startup of the
HMI.
© Thesis: Control of knee flexion in a knee simulator p 82 / 86 p 82 / 97
Figure 71: schematic illustration of the internal layout of the HMI. It indicates where the different functionalities are programmed.
Block 2:
Initialize
Block 1: read in text
file and put the values
in a array
Blo
ck 1
7:
Save d
ata
to text file
Block 4: Offset Block 5: Controller
Block6: apply external input
Block 7: apply ramp input
Block 8: apply step input
Block 9: generate sine
Block 14: DAQ –
create reference
signal
Block 11: DAQ –
read limit switches
Block 15: DAQ – read
hip sensor + convert
to angle
Blo
ck 1
0:
Sum
mation
Block 16:
Collect data
Block 18: define program
cycle time + sample time
Stop
button
Block 13: DAQ –
choose motor
direction
or
or
Block 3:
Setpoint
selection
Manual voltage
control via slide
Block 12:
Logic unit
Manual
SP
© Thesis: Control of knee flexion in a knee simulator p 83 / 86
References
i. Books
[1] W. Platzer, Color Atlas of Human Anatomy. Vol I-Locomotor System, 6th Ed, 2009, 480 p.
[2] P. Hannon, K. Knapp, Forensic biomechanics. Lawyers & Judges Publishing Company, 2006, 320 p.
[3] L. Williams, K. M. Knutzen, Biomechanical Basis of Human Movement. Lippincott Williams & Wilkins,
2006, 470 p.
[4] A. Faller, M. Schünke, G. Schünk, The Human Body. An introduction to structure and function. Thieme 2004.,
720 p.
[5] V.van Os, Anatomie van het bewegingsapparaat in beeld. Houten: Bohn Stafleu van Loghum, 2013
[6] E.N. Marieb, Essentials of Human Anatomy and Physiology, 10th edition, Pearson/Benjamin Cummings, 2012,
656 p.
[7] K. S. Saladin, Anatomy and Physiology. The unity of form and function. McGraw-Hill Higher Education, 5th
edition, 2010.
[8] Burton, R., The Anatomy of Melancholy. Published in 1621 under the pseudonym: Democritus Junior.
ii. Papers
Anatomy and Knee Rigs
[9] S. Claes, Anatomy of the anterolateral ligament of the knee. Journal of anatomy (2013) 223, p 321—328.
[10] A. B. Zavatsky, A kinematic-freedom analysis of a flexed-knee-stance testing rig. University of Oxford, 1997
Elsevier Science, 4 p.
[11] J. Navik, Pilot study using Oxford Rig, customized MATLAB Program, and Vicon System to study the stifle
joint. The University of Georgia, 2011, 102p.
[12] L. P. Maletsky, B. M. Hillberry, Simulating Dynamic Activities Using a Five-Axis Knee Simulator. Journal of
Biomechanical Engineering, 2005, Vol. 127.
[13] M. Wünschel, U. Leichtle, J. Lo, N. Wülker, O. Müller, Differences in tibiofemoral kinematics between the
unloaded robotic passive path and a weightbearing knee simulator. Orthopedic Reviews 2012, vol. 4, ed. 2.
[14] M. Wünschel, J. M. Leasure, P. Dalheimer, N. Kraft, N. Wülker, O. Müller, Differences in knee joint
kinematics and forces after posterior cruciate retaining and stabilized total knee arthroplasty. 2013 Elsevier.
[15] J. Victor, L. Labey, P. Wong, B. Innocenti, J. Bellemans, The influence of muscle load on tibiofemoral knee
kinematics. Journal of orthopaedic research, april 2010.
[16] S. L-Y. Woo, R. E. Debski, J. D. Withrow, M. A. Janaushek, Biomechanics of knee ligaments. the American
journal of sports medicine, vol. 27, no. 4, 1999.
© Thesis: Control of knee flexion in a knee simulator p 84 / 86
[17] G. Li, E. Most, P. G. Sultan, S. Schule, S. Zayontz, S. E. Park, H. E. Rubash, Knee kinematics with a high-
flexion posterior stabilized total knee prosthesis: an in vitro robotic experimental investigation. The journal of bone
& joint surgery, volume 86, number 8, august 2004.
[18] K. M. Varadarajana, R. E. Harrya, T. Johnsonc, G. Li, Can in vitro systems capture the characteristic
differences between the flexion–extension kinematics of the healthy and TKA knee?. Medical Engineering &
Physics, 2009.
[19] C. Browne, J. C. Hermida, A. Bergula, C. W. Colwell Jr., D. D. D’Lima, Patellofemoral forces after total knee
arthroplasty: effect of extensor moment arm. The Knee 12 (2005), pages 81–88.
[20] C. W. Clary, A. M. Mane, A. N. Reeve, K. A. Dodd, L. P. Maletsky, Knee kinematics during an in vitro
simulated deep flexion squat. Proceedings of the ASME 2007 Summer Bioengineering Conference, Keystone –
Colorado – USA.
[21] A.M.J. Bull, A.A. Amis, Knee joint motion: description and measurement, Proc Instn Mech Engrs, 1998, p.
357 - 372.
[22] J. Quintelier, P. De Baet, F. Almqvist, Contact pressure distribution in postmortem human knee during
dynamic flexion-extension movement. FMBE Proceedings 22, pp. 1798–1802, 2008.
[23] J. Quintelier, F. Lobbestael, P. Verdonk, P. De Baets, F. Almqvist, Patellofemoral contact pressures. Acta of
Bioengineering and Biomechanics, Vol. 10, No. 2, 2008.
[24] W. Sampers, T. Sierens, Kinematics of the knee joint. Ghent University - Belgium, 2011, 7 p.
Modeling, System Identification and Control
[25] R. Isermann, U. Raab, Intelligent Actuators Ways to Autonomous Actuating Systems. Automatica, Vol. 29,
No. 5, pp. 1315-1331, 1993.
[26] R. Salloum, M. R. Arvan, B. Moaveni, Identification, Uncertainty Modelling, and Robust Controller Design for
an Electromechanical Actuator. International Conference on Control, Automation, Robitcs and Embedded
Systems (CARE), 2013, 6p.
[27] Hessam Kalbasi Shirvani, Veli-Matti Järvenpää, Lihong Yuan, Dynamic Modeling and Simulation of a
Cylindrical Grinder in Presence of Non-linear Friction Effect. Research Conference In Technical Disciplines,
November 2013, 6 p.
[28] R. Grepl, Modelling and Control of Electromechanical Servo System with High Nonlinearity. InTech, 2010, 16
p.
[29] K.K. Varanasi, A. S. Nayfeh, Modeling, Identification and control of ballscrew drives, Massachusetts Institute
of Technology, Cambridge, 2001 (?), 4p.
[30] K. Tolgay, E. IIlyas, Nonlinear modeling and identification of a DC motor for bidirectional operation with real
time experiments. Energy Conversion and Management, Elsevier, 2003, 20p.
© Thesis: Control of knee flexion in a knee simulator p 85 / 86
[31] K. Min-Seok, C. Sung-Chong Chung, Integrated design methodology of ball-screw driven servomechanisms
with discrete controllers. Part I: Modelling and performance analysis. Elsevier 2006, 12p.
[32] M. Maboodi, M.H. Ashtari Larki, M. Aliyari Shoorehdeli, H. Bolandi, An under Load Servo Actuator
Identification. 18th IFAC World Congress Milano, Italy, August–September 2011, 5p..
[33] S.n., Development of a Leg Prosthesis Test Robot: Controls-Oriented Modeling and Parameter Estimation.
Cleveland State University, Control, Robotics and Mechatronics Lab, 15p.
[34] Flixan, Flight Vehicle Modeling. Chapter 4: Actuator models. 2010.
[35] P. Wellstead, M. Readman, Engine Speed Control. Control system principles.co.UK, 2004, 12p.
iii. Websites
[36] Joint Structure of the Knee Complex. http://www.pt.ntu.edu.tw/hmchai/Kinesiology/KINlower. Last update
25/12/2008, Huei-Ming Chai.
[37] MediStart BV, Anatomie van de knie. http://www.knie.nl/knie/anatomie-van-de-knie.asp, last update
03/08/2012.
[38] http://www.knee-pain-explained.com, consulted at 7th November 2013.
[39] Dr. H. Mortelé, Anatomie van de knie, http://www.mortele.info/patienteninfo/knie/anatomie.asp, consulted at
October 2013.
[40] Torrance Strength & Conditioning, Relive your knees. http://www.crossfitsouthbay.com/about-us/, 2012,
consulted at November 2013.
iv. Master’s theses
[41] K. Dockers, V. Stevens, Onderzoek naar de krachtswerking van het patellofemoraal gewricht en ontwerp en
constructie van een experimenteel belastingsmodel. Thesis University of Ghent - Belgium, 2005-2006, 218 p.
[42] C.A. McLean, Design, development and performance evaluation of a dynamic knee simulator. Thesis, McGill
University, Montreal (Quebec), July 1990, 141p.
[43] Pouyan Taghipour Bibalan, Running Robots: Modeling, Control and Energy Efficiency. The Australian
National University, June 2009, 85p.
v. Datasheets
[44] National Instruments Corporation, NI-USB 6008/6009. User Guide and Specifications, 2012, 30p.
[45] National Instruments Corporation, NI-USB 6008/6009 datasheet. 2013, 7p.
[46] Industrial Devices, IDM 8B Series Actuator. www.industrialdevices.co.uk, 3p.
[47] HIWIN, Ballscrews. Technical information catalogue. 2012, 193p.
© Thesis: Control of knee flexion in a knee simulator p 86 / 86
[48] HIWIN, Linear Guideway Catalog, 2013, p20-40.
[49] Avago Technologies, AEAT-6010/6012 Magnetic Encoder. Datasheet, 2007, 4p.
[50] ] Avago Technologies, AEAT-601x. Magnetic Encoder Compnents Kit Assembly Guideline, 2010, 3p.
[51] Robot electronics, MD03 – 24 Volt 20 Amo H Bridge Motor Driver. Technical Documentation, www.robot-
electronics.co.uk/htm/md03tech.htm, 2014, 6p.
[52] Tyco Electronics, W58 series. P&B Push To Reset Only Thermal Circuit Breaker. 2003, 3p.
[53] Siemens, PSU 100 D 24V/12.5A Stabilized Power Supply. Product datatsheet. 2012, 4p.
[54] Littelfuse, ATOF Blade Fuse Rated 32V, datasheet. 2012, 2p.
[55] Igus GmbH Germany, Polymer Bearings, 53p.
vi. Software
[56] The MathWorks Inc, Matlab, R2013a, 64-bit.
[57] The MathWorks Inc, Simulink, R2013a, 64-bit.
[58] De Keyser, R., Ionescu, C.M. (2006), FRtool: a frequency response tool for CACSD in Matlab, IEEE Conf. on
Computer Aided Control Systems Design, Munich, 2275-2280.
[59] National Instruments Corporation, Labview 2010, 32-bit.
[60] Dassault Systèmes SolidWorks Corporation, SolidWorks Premium 2012, 64-bit.
[61] Microsoft, Windows XP professional, SP3, 32-bit.