Thesis Redacted
Thesis Redacted
net/publication/340296957
CITATIONS READS
0 388
1 author:
Matthew Watson
Opteran Technologies
5 PUBLICATIONS 34 CITATIONS
SEE PROFILE
All content following this page was uploaded by Matthew Watson on 01 June 2021.
August 2019
This thesis focuses on the modelling, analysis, and control of a novel robot lo-
comotion system known as the Collinear Mecanum Drive (CMD). The CMD
utilises three or more collinear Mecanum wheels to generate omnidirectional mo-
tion, whilst simultaneously dynamically balancing. By dynamically balancing,
the ground footprint of a robot utilising a CMD can be designed to be arbitrarily
thin, only lower bounded by choice of wheel diameter. The omnidirectional ma-
noeuvrability of the CMD in combination with this narrow footprint allows for
the navigation of much smaller gaps between obstacles than existing omnidirec-
tional locomotion methods, achieved by translating directly along the common
wheel rotation axis. This provides improved manoeuvrability in confined or clut-
tered environments. Being a dynamically balanced system, the height of the
center of mass of a robot driven by a CMD can be increased without requiring a
proportional increase in the width of the ground footprint so as to avoid toppling
during acceleration or disturbance, as would be the case for existing statically
stable omnidirectional locomotion methods. The CMD therefore promises to en-
able the creation of tall, space-efficient robots of more human-like form factors,
that are better able to navigate the confined and cluttered environments com-
monly encountered in the home, office, and retail personal robotics sectors, and
in the manufacturing and warehousing mobile industrial robotics sectors. This
thesis derives and analyses the CMD’s kinematics and dynamics models, explores
a variety of control approaches, and develops the trajectory planning methods
necessary for the autonomous navigation of an environment. It is hoped that this
locomotion technology will see application across a range of existing and future
mobile robotics sectors.
i
Acknowledgements
Firstly, I would like to thank my supervisor Dr Daniel Gladwin for his unwaver-
ing support and belief in me throughout the past six years of my education, for
the freedom with which he has provided me during this PhD, and for his inspi-
rational work ethic. Dr Gladwin has gone far beyond his expected supervisory
duties to facilitate my development as both a researcher and a professional. I
would also like to express my gratitude to Consequential Robotics and Sebastian
Conran for supporting this project, and for exposing me to further interesting
work during this PhD. I hope we can continue to work together to apply this
research. Thank you to the University of Sheffield’s Department of Electronic
and Electrical Engineering, and in particular the Electrical Machines and Drives
group, for their support throughout the past eight years of my education. Thank
you to Tony Prescott, and to the staff and researchers of Sheffield Robotics for
their support and companionship, and in particular thank you to Michael Port,
whose machining and manufacturing experience greatly improved the quality of
the prototype developed during this PhD. Finally, I would like to thank my won-
derful partner Lucy for her boundless love and encouragement over the past six
years, and I hope many more to come!
iii
Contents
1 Introduction 1
1.1 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Novel Contributions . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
v
Contents
vi
Contents
4.5.3 Accelerometers . . . . . . . . . . . . . . . . . . . . . . . . 88
4.5.4 Omitted Sensors . . . . . . . . . . . . . . . . . . . . . . . 89
4.6 State Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5 Nonlinear Control 99
5.1 Partial Feedback Linearisation . . . . . . . . . . . . . . . . . . . 100
5.2 Nonlinear Control of the Partially Feedback Linearised CMD . . 104
5.3 Backstepping Control of Local Body Frame Velocities . . . . . . 106
5.4 Backstepping Inertial Frame Velocity Control . . . . . . . . . . . 121
5.5 Backstepping Global Position Control . . . . . . . . . . . . . . . 128
5.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
vii
Contents
8 Conclusion 209
8.1 A Comparison of Controllers . . . . . . . . . . . . . . . . . . . . 210
8.1.1 Aggressiveness of Control . . . . . . . . . . . . . . . . . . 210
8.1.2 Computational Requirements . . . . . . . . . . . . . . . . 211
8.1.3 Actuation Power Requirements . . . . . . . . . . . . . . . 212
8.1.4 Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
8.1.5 Smoothness and Grace of Motion . . . . . . . . . . . . . . 213
8.1.6 Map Navigation . . . . . . . . . . . . . . . . . . . . . . . 213
8.1.7 A Ranking of Controllers & Application Suitability . . . . 214
viii
Contents
ix
List of Figures
3.1 Collinear Mecanum Drive coordinates and parameters for the ex-
perimental prototype shown in Figure 4.3 . . . . . . . . . . . . . 31
3.2 Contribution of each wheel torque to acceleration v̇x over varying
roller orderings and angles . . . . . . . . . . . . . . . . . . . . . . 51
3.3 Contribution of each wheel torque to acceleration v̇y for the nw = 3
case over varying roller orderings and angles . . . . . . . . . . . . 52
3.4 Contribution of each wheel torque to acceleration v̇x for the nw = 4
case over varying roller orderings and angles . . . . . . . . . . . . 53
3.5 Sets of feasible body accelerations with wheel torque constraints
τ = 0.1 N m for varying orderings of α, calculated at the stationary
upright equilibrium with nw = 3 . . . . . . . . . . . . . . . . . . 55
3.6 Sets of feasible body accelerations with wheel torque constraints
τ = 0.1 N m for varying orderings of α, calculated at the stationary
upright equilibrium with nw = 4. . . . . . . . . . . . . . . . . . . 56
3.7 Translational power requirements over body relative translation
direction and roller angle α, with nw = 4 and α = [a, −a, −a, a]. 58
3.8 Translational power requirements over body relative translation
direction and roller angle α, with nw = 3. . . . . . . . . . . . . . 60
xi
List of Figures
xii
List of Figures
xiii
List of Figures
xiv
List of Figures
xv
List of Figures
xvi
List of Tables
4.1 Motor parameters for that used in the prototype in Figure 4.3 . . 71
4.2 Table of experimentally and CAD derived parameters for the pro-
totype depicted in Figure 4.3. . . . . . . . . . . . . . . . . . . . . 85
xvii
Nomenclature
αi Roller angle of rotation of wheel i relative to the wheel rotation axis and
about a vertical axis running through the center of the wheel
b̂x A unit vector along the x axis of the coordinate system B, or similar.
L Lagrangian
xix
Nomenclature
~m
Ω A vector of angular rates about the three pendulum axes as measured by
the onboard accelerometers Ω~ m = Ωm,p Ωm,q Ωm,r T
~am A vector of angular rates about the three pendulum axes as measured by
the onboard accelerometers ~am = am,p am,q am,r
T
Cn The set of functions for which derivatives exist and are continuous up to
the nth order
H A Hessian matrix
hcm Height of overall system center of mass along p̂z and relative to B
J A cost function
xx
Nomenclature
nc Control horizon
nw Number of waypoints
nw Number of wheels
P Power
p, p(t) A polynomial in t
Q Q in a QR decomposition
R R in a QR decomposition
xxi
Nomenclature
rw Wheel radius
Rbp The rotation matrix that rotates a vector from coordinate frame P into
B, or similar.
Sn Flat output n
t Time in seconds
Ts Sampling period
xxii
Chapter 1
Introduction
This chapter introduces the broad robotics problem that is to be addressed by the
work in this thesis, and gives an outline of the structure of the thesis and the
content of the chapters to follow. It concludes with a statement of the novel
contributions to the literature made by the work presented in this thesis, and a
list of publications.
It is a widely accepted belief that robots will continue to see ever increasing
application across a wide variety of industries, ranging from industrial ware-
housing and manufacturing applications to personal robotics in the home and
office. Whilst in previous decades this growth has been largely centered around
fixed-base manipulator robots, over the past number of years there has been sig-
nificant growth in the field of mobile robotics, robots which are able to freely
navigate their environments whilst performing inspection, manipulation, and
human-interaction tasks.
The environments in which mobile robots have to operate can be divided into
two categories: structured, man-made environments, such as that found within
indoor spaces, and the unstructured environments encountered in the natural
world, with each possessing significantly different properties and challenges from
a mobile robotics perspective. Indoor environments are typically designed around
their human users; ground surfaces are usually smooth and solid, with the ex-
ception of stairs, and obstacles such as walls, doors, and furniture are sized and
located as to be comfortably navigated and worked around by humans. This sets
a lower bound on the minimum width of free space left between obstacles that
a mobile robot must navigate. Compared to the height of a human this may be
1
Chapter 1 Introduction
This thesis is split into two introductory chapters, five novel contribution chap-
ters, and one concluding chapter.
Chapter 2 aims to familiarise the reader with some of the key concepts ex-
plored in this thesis, and gives an overview of the generalised methods used to
approach these problems. Chapter 3 introduces the invention that is the focus of
this thesis, the Collinear Mecanum Drive (CMD). Generalised CMD kinematic
2
1.2 Novel Contributions
and dynamic models are derived, and are analysed with respect to the CMD’s
underactuation and nonholonomy properties, nonlinear controllability, and the
size of the maximum feedback linearisable subsystem. Chapter 4 describes the
reasoning and methodology behind the design and development of a CMD ex-
perimental prototype, which is later used for control validation throughout this
thesis. Experimental methods for the measurement of model parameter are pre-
sented, and an online full-state estimator is derived and demonstrated. Chapter
5 partially feedback linearises the CMD, and then demonstrates three nonlinear
controllers for the regulation of local frame body translational velocities, inertial
frame translational velocities, and global inertial frame positions, all with Lya-
punov stability guarantees. Chapter 6 addresses the problem of wheel traction
and the generation of toward minimum-time trajectories by the development and
implementation of a constrained dual-mode model predictive controller, capable
of enforcing velocity, lean angle, and wheel torque constraints. Finally, Chapter
7 shows how the dynamics model of a CMD can be made to be differentially flat,
allowing the generation of approximately dynamically feasible state and input
trajectories from sufficiently smooth geometric Cartesian paths. These methods
are demonstrated using existing polynomial trajectory planning techniques, al-
lowing for the fast online generation of trajectories through multiple successive
Cartesian waypoints. Finally, a novel approach to this polynomial optimisation
problem is demonstrated, in which sum-of-squares programming is used to en-
force trajectory constraints in continuous time, yielding a significant reduction
in computation time over the state-of-the-art.
3
Chapter 1 Introduction
4
1.3 Publications
6.
1.3 Publications
• M. T. Watson, D. T. Gladwin, and T. J. Prescott, ”The Collinear Mecanum
Drive: Modelling, Analysis, Partial Feedback Linearization, and Nonlinear
Control,” IEEE Transactions on Robotics, (preprint), 2020. doi.org/10.
1109/TRO.2020.2977878.
5
Chapter 1 Introduction
6
Chapter 2
This chapter aims to introduce and frame some of the key concepts used in
this thesis. It then introduces some alternative existing solutions to the problem
outlined in Chapter 1, along with a brief review of some common approaches to
their control and trajectory planning.
A number of key concepts are now introduced to provide background and context
for the rest of the thesis.
2.1.1 Manoeuvrability
AT (q)q̇ = 0 (2.1.1)
in which each row represents a single Pfaffian constraint aTi (q)q̇ = 0, where each
aTi is smooth and independent.
A Pfaffian constraint is referred to as a nonholonomic constraint if it is nonin-
tegrable, i.e. if it cannot be integrated to an equivalent set of configuration con-
straints h(q) = c where ∂h(q)
∂q = λ(q)aT (q), with some integrating factor λ(q) =
6 0
7
Chapter 2 Wheeled Robot Locomotion
1
Mecanum wheels, invented by Swedish engineer Bengt Erland Ilon in 1972, are named after
the Swedish company Mecanum AB who originally patented the concept. This patent was
bought by the US Navy for logistics applications on aircraft carriers, and was later sold
to KUKA for use on warehouse vehicles and robots. Mecanum wheels are also commonly
referred to as Ilon or Swedish wheels.
8
2.1 Related Concepts
actuated and steered regular wheels, this requires a delay before motion can be
commenced whilst the wheels are aligned with the desired direction of motion.
Omnidirectional wheels provide intentional directional slip orthogonal to their
direction of traction by the use of a ring of unactuated rollers affixed about the
circumference of the wheel. For an omniwheel these rollers have axes of rotation
offset from that of the parent wheel by a rotation of 90° about an axis orthogonal
to that of the parent wheel’s axis of rotation, whereas for a Mecanum wheel an
angle of 45° is used2 . The rollers on both wheel types are shaped such that the
projection of the wheel onto a plane normal to its rotation axis forms a perfect
circle, which for omniwheels necessitates the use two separate rows of rollers,
visible in Figure 2.1c. Gfrerrer derives the parametric equations required to de-
fine the desired shape of an omnidirectional wheel’s rollers [4]. Ferriere compares
Mecanum and omniwheels of varying construction with regards to horizontal
and vertical vibration, load capacity, and step climbing ability [5], arguing that
Mecanum wheels advantageously offer a continuous roller contact transition and
a reduction in vertical vibration over omniwheels, but introduce a parasitic yaw
torque due to the discontinuous movement of the ground contact point along
each roller during wheel rotation. Dickerson shows that frictionless Mecanum
wheels achieve half the traction of regular wheels [6], as half of the net ground
force generated by each wheel acts along the direction of intentional slip and can
therefore do no work. Systems using Mecanum wheels therefore require greater
2
While roller angles other than 45° or 90° can also be used, no examples of wheels of any
alternative angles could be found, and no name appears to be ascribed such wheels.
9
Chapter 2 Wheeled Robot Locomotion
drive torques to achieve the same body accelerations as a similar system with
regular wheels. This is exacerbated by the discontinuous ground contact point
during wheel rotation, as each transition from one roller to the next provides an
opportunity for the wheel to slip.
Any deviation of a Mecanum wheel’s rotation axis from parallelism with the
ground results in a non-circular projection, meaning they are best operated on
hard flat surfaces3 , and suspended such that their rotation axis always remains
parallel to the ground. Whilst the degree of imperfection in ground flatness
that can be tolerated is wheel, application, and specification specific, in general
any variation in wheel geometry or ground surface would manifest as a vertical
vibration and a variation in wheel diameter, preventing smooth rolling. Omni-
directional wheels must be used in sets of three or more, appropriately oriented
to define a unique inverse kinematic mapping. Mecanum wheels are often used
in sets in which roller angles of both π/4 and −π/4 are used, allowing the defi-
nition of a unique inverse kinematic mapping whilst keeping all wheel rotation
axes parallel. Provided a unique kinematic mapping and thus full controllability,
any omnidirectional acceleration can be instantaneously achieved by appropriate
actuation of the wheels, without requiring any prior steering to align with the
desired direction of motion. This allows for omnidirectional motion using only
three actuators, compared to a steered system with regular wheels that requires
at least four actuators and a delay whilst its wheels are steered to their new
required heading. For solutions using any kind of omnidirectional wheel, care
must be taken to ensure that all of the roller rotation axes do not intersect at a
single point, as this allows for uncontrolled rotation about the intersection point.
10
2.1 Related Concepts
stable equilibrium from any attitude under the force of gravity alone4 , provided
a vertical line drawn through its center of mass (CoM) intersects this ground
contact polygon. This means tall systems with small footprints are more easily
toppled than short, wide systems, and so there exists a minimum ratio of CoM
height to minimum footprint dimension for a system to possess a given degree of
disturbance rejection in all directions. If such a system is to operate on sloped
surfaces or carry objects at a horizontal offset from the system’s center of mass
as in Figure 2.2 this ratio must be increased further, as both of these tasks act
to move the system’s CoM towards the edge of its footprint, reducing the margin
that is left to ensure stability under disturbance. This upper bounds the degree
of slope angle and mass of payload that can be tolerated without falling, even in
the absence of disturbance. Similarly, this approach to attaining stability limits
the maximum accelerations that can be generated by the system changing its
direction of motion, requiring tall systems to always move at a sufficiently slow
speed if they are required to quickly react to dynamic obstacles without falling.
Static stability can be increased by using more than three wheels to increase the
minimum footprint width, though this comes at a cost of requiring the inclusion
of suspension if all wheels are to maintain simultaneous ground contact. This,
along with inevitable flex in the robot’s structure present even in three-wheeled
systems, introduces further coupled dynamics into the system. This is evident
when a tall statically stable robot drives quickly over an imperfect surface, as the
top of the robot tends to shift and oscillate due to excitation by perturbations
from the ground. While static stability can actually be achieved using only two
wheels in a differential drive configuration with a CoM below the wheel axle, this
requires impractically large wheel diameters for robots of any significant height,
and so are not a viable locomotion solution for human form factored indoor
robotics.
Dynamically stable systems attain stability by a degeneration of this ground
contact polygon into a line or point, achieved either by a collinear arrangement
of contact points, or by reducing the number of contact points to two or one.
Dynamically stable systems instead use active actuation to apply forces to the
ground that allow them to dynamically balance about what is now an unstable
4
Though depending on the exact shape of the footprint the CoM may still overshoot the
opposite side of the footprint provided insufficient damping, so this is a necessary but not
sufficient condition for static stability.
11
Chapter 2 Wheeled Robot Locomotion
(a) (b)
Figure 2.2: A demonstration of how statically stable systems become less stable
when carrying off-axis loads or operating on sloped surfaces.
upright equilibrium. Such systems are often referred to as mobile inverted pen-
dulums, with a common example of this being two-wheeled inverted pendulums
(TWIPs) such as the Segway5 . This elimination of a footprint dimension allows
the robot to be designed to be arbitrarily thin in this dimension, allowing the cre-
ation of robots with the same height and resilience to disturbance as a statically
stable robot, whilst possessing a much thinner form factor and subsequently more
lightweight construction. As a dynamically balancing system is able to control
the position of its CoM relative to its contact point(s) it can adapt to changes
in its CoM position due to the carrying of additional loads, without the same
associated reduction in stability that is experienced in statically stable systems.
Similarly, as a dynamically stable system has a one or two dimensional ground
contact polygon it can climb ramped surfaces without an associated change in its
attitude, provided in the 2D case that the ground contact line is kept sufficiently
perpendicular to the direction of slope. These two operations are exampled in
Figure 2.2.
As a dynamically balanced robot must be sensitive to changes in its attitude
in order to balance, intentional attitude perturbations can be used as a user
input from which to control the robot. For example, a balancing robot that is
controlled to regulate its velocities to zero can be guided to a new location by
a gentle continuous push from a user. This is potentially a more natural way of
5
Though technically a Segway requires a rider to become dynamically balanced, as the system
alone has a CoM below its wheel axle and is therefore statically stable.
12
2.1 Related Concepts
From Chapter 1 it is known that the optimal mobile indoor robot form factor and
locomotion characteristics are similar to that attained by a human. This requires
a larger ratio of height to footprint size than attainable using statically stable
locomotion methods, necessitating the use of a dynamically balanced solution.
This is to be achieved whilst also possessing omnidirectional manoeuvrability,
allowing this reduced footprint to be used to achieve improved navigation of
confined environments, better position regulation during manipulation and en-
vironment interaction tasks, and increased gracefulness of motion. To maintain
low complexity and cost this is to be achieved using a wheeled solution, rather
than a bipedal legged approach.
13
Chapter 2 Wheeled Robot Locomotion
models, some models may contain fewer terms or fewer uses of transcendental
functions. Comparisons of these methods typically show Kane’s method yields
the most numerically simple models, shortly followed by the Lagrangian method,
and with the Newton-Euler method yielding a significant increase in complex-
ity [8, 9]. The results of these studies, however, ignore the potential benefits of
compiler-level optimisation, and so may not be representative of real-time imple-
mentations.
The Lagrangian is defined as the difference of the system’s total kinetic energy
K(q, q̇) and potential energy U(q) as
d ∂L ∂L
M (q)q̈ + C(q, q̇)q̇ + G(q) = − = Qf (2.1.4)
dt ∂ q̇ ∂q
d ∂L ∂L
− = Qf + A(q)T λ (2.1.5)
dt ∂ q̇ ∂q
where A(q)T denotes the matrix defining the k Pfaffian constraints in (2.1.1),
and λ ∈ Rk a vector of Lagrange multipliers.
14
2.1 Related Concepts
defined in a new minimal coordinate vector p, where now p ∈ Rn−k , and q̇ = Φṗ
[10].
where m = rank(B(q)), n = dim(q), and m < n, i.e. systems which have fewer
independent control inputs than degrees of freedom [12]. This means the in-
put u cannot be used to independently generate forces on all q, and the system
cannot be exactly linearised by feedback. Assuming by suitable choice of in-
put and coordinates a system can be described in the form (2.1.7) in which
B(q) = Im , 0n−m , the first m equations can be referred to as the fully ac-
T
15
Chapter 2 Wheeled Robot Locomotion
the step, with the position state of the base of an inverted pendulum forming
a classic example. These systems cannot track arbitrary trajectories in config-
uration space, as their dynamics must evolve according to one or more second
order nonholonomic constraints. This is in contrast to holonomic systems, which
can track arbitrary trajectories in configuration space, greatly simplifying their
control and trajectory planning. A number of techniques for the approximation
of a desired trajectory by a trajectory that satisfies dynamic constraints and can
thus be exactly tracked using an inversion of the system dynamics have been
shown [17–19]. This non-minimum phase property limits the bandwidth of any
controller, and prevents perfect tracking of dynamically feasible trajectories in the
presence of disturbance. This greatly limits the control performance achievable
for such systems.
16
2.1 Related Concepts
deviations of the system’s lean angle from the unstable equilibrium and safely
handling actuator saturation. This is useful in applications where a human user
is expected to generate the reference velocity trajectory, such as when used as a
personal vehicle or teleoperated platform. The integration of local frame body
velocity trajectories to inertial frame position trajectories is easily performed by
the human user rather than the controller, providing a more intuitive input to
the user and simplifying control design.
An inertial frame position controller instead aims to iteratively generate input
trajectories to yield asymptotic tracking of a time-varying Cartesian position
reference, allowing the robot to be commanded to move to a particular location
in an obstacle-free environment. This must be performed while enforcing lean
angle and actuator constraints as above, but must also enforce constraints on
system velocities so as to generate a safe evolution toward the target position.
This form of controller is required for autonomous navigation tasks, such as
moving through a series of waypoints.
Trajectory planning is the process of calculating system state and input trajec-
tories that yield a desired transition from an initial to terminal state, potentially
passing through a number of intermediate states. This allows entire complex
state trajectories to be planned at once, as opposed to achieving such a tran-
sition using just closed-loop control, in which the resulting time evolution of
the system states are instead defined by the dynamics of the closed-loop system.
Planning entire trajectories at once allows the minimisation of some cost function
along the entire trajectory, whilst potentially also enforcing constraints on system
states and inputs. The planning of trajectories is typically a more computation-
ally intensive process than the calculation of a controller feedback, meaning the
resulting trajectories can only respond to large disturbances, so small deviations
from a planned trajectory must be corrected by a low-level tracking controller
instead.
For some systems the planning of trajectories can be broken down into two
parts: planning a geometric path q(s), s ∈ [0, 1] from an initial configuration
q(0) to a new configuration q(1), and defining a smooth monotonic timing law
s(t), ṡ(t) ≥ 0 that describes the rate at which the system is to progress along the
17
Chapter 2 Wheeled Robot Locomotion
path by the mapping of s to t ∈ [0, T ], s : [0, T ] → [0, 1], see [10]. This splitting
of trajectory planning allows velocity constraint satisfaction by uniformly slowing
the trajectory through a linear scaling of the timing law. It is also possible to
plan paths directly in the time domain to define trajectories q(t), though this
prevents the same linear time scaling of trajectories. For holonomic systems it is
sufficient for q(s) to possess bounded first order derivatives to represent dynam-
ically feasible configuration trajectories, whereas for systems with nonholonomic
kinematic constraints q(s) must also have bounded second order derivatives to
avoid instantaneous changes in direction. For systems with second-order non-
holonomic constraints the resulting time domain trajectories q(s(t)) or q(t) must
satisfy these dynamic constraints in order to represent feasible configuration tra-
jectories. Depending on the system this could require bounded derivatives up to
much higher orders, tightly coupling the planning of the path and timing laws,
meaning these are often derived simultaneously. These differing requirements ne-
cessitate the use of significantly different planning techniques depending on the
kinematic and dynamic constraints acting on the system.
For some systems the mapping of Cartesian and heading trajectories to the
dynamically feasible state space trajectories required for the exact tracking of a
sufficiently smooth Cartesian path can be performed using the concept of dif-
ferential flatness [20, 21]. This is a property exhibited by a number of common
mobile systems, including holonomic vehicles [10] and quadrotors [22,23]. A non-
linear input-affine system ẋ = f (x) + G(x)u is differentially flat if there exists a
set of outputs y = h(x) such that all system states x and inputs u can be defined
algebraically in terms of the flat outputs and their time derivatives up to a finite
order r. For the systems listed above the Cartesian position and heading states
are found to be flat outputs, allowing dynamically feasible state trajectories to be
calculated by an algebraic function of trajectories in the Cartesian position and
heading states, provided they are continuously differentiable up to the necessary
order r. The required degree of smoothness r is entirely dependent on dynamic
model structure, with r = 2 for holonomic systems and r = 4 for quadrotors.
For some systems this differential flatness property can also exist partially [24].
This technique partitions the system state vector as x = xTs xTr , in which the
T
xs states and input can be algebraically defined in terms of some flat outputs,
allowing trajectories in these states to be algebraically derived from a sufficiently
18
2.1 Related Concepts
smooth output trajectory. The remaining xr state trajectories must then be de-
rived by numerical integration of the system dynamics from initial conditions,
though this integration now only need be performed on a lower dimensional sys-
tem. Nonlinear trajectory optimisation techniques can then be used to optimise
trajectories in the flat outputs to yield some optimal evolution of both the xs
and xr states, potentially a less complex problem than optimising trajectories in
the system’s inputs. As the correct choice of output to yield partial or full differ-
ential flatness is not always obvious for some systems, methods for numerically
searching for these outputs have been demonstrated [25].
The complexity of the path planning problem varies greatly depending on the
inclusion or exclusion of obstacles, and the presence of any other state or input
constraints. A number of methods exist for planning dynamically unconstrained
paths in the presence of obstacles, such as RRT-Connect [26], A* [27], PRM [28],
and artificial potential fields [29]. Methods also exist for the planning of trajecto-
ries in the presence of obstacles that are subject to kinematic and dynamic con-
straints, such as kinodynamic RRT* [30] and non-convex nonlinear optimisation
techniques such as various shooting and transcription methods [31], all forming
searches of higher-dimensional spaces. However, through this high-dimensionality
and the potential presence of non-convex constraints due to obstacles, these prob-
lems can be hard to solve in real-time for real-world navigation tasks, and are
strongly susceptible to local minima. The planning of dynamically feasible tra-
jectories through 2D or 3D occupancy grids is therefore usually approached by
splitting the problem into two parts: first finding the shortest continuous path to
a goal through the occupancy grid using a 2D or 3D search, and then convexifying
the obstacle constraint set along this path or sampling the path into an appropri-
ate set of waypoints and performing a second optimisation to find dynamically
feasible trajectories through this constraint tube or set of waypoints.
19
Chapter 2 Wheeled Robot Locomotion
This class includes a variety of configurations of fixed and steered standard wheels
that allow for motion subject to nonholonomic kinematic constraints, with the car
being a classic example of this class. Research into the control of these systems
is typically concerned with finding solutions to the parallel parking problem in
mobile robotics, as again from Brockett’s theorem a system with nonholonomic
kinematic constraints cannot be stabilised to a given equilibrium by smooth time
invariant feedback [2,32]. Furthermore, as nonholonomic statically stable mobile
robots are not subject to any constraints on their dynamics, the paths of their
trajectories can be planned independently of the path timing law, allowing the
separation and simplification of these tasks. The bulk of this research therefore
has limited relevance to the system explored in this thesis, and that which is rele-
vant is also applicable to omnidirectional statically stable systems; these relevant
topics are therefore reviewed in the next section.
20
2.2 Existing Solutions
As through their inherent static stability these systems are not subject to any
second-order nonholonomic constraints, and as through the use of omnidirectional
wheels also do not possess kinematic constraints, these systems are said to be
holonomic, reflecting the lack of nonholonomic constraints of any order acting on
the system. In practice, holonomic systems are able to instantaneously generate
sustained acceleration in any direction, yielding a maximally controllable system.
Through this lack of kinematic constraints these systems can be asymptotically
stabilised in configuration space by a linear feedback of the form u = −Kx, with
suitable gain K, allowing for simple and high-bandwidth control.
Kinematic and dynamics modelling of holonomic systems is straightforward
[10, 33–35], and various approaches to modelling and identifying friction effects
in the omnidirectional wheels used in these systems have been demonstrated [36].
Han introduces a calibration method to account for dead reckoning error intro-
duced by roller slippage, bearing play, and friction [37], showing a 50% improve-
ment in dead reckoning accuracy during lateral translation. Purwin models and
analyses the effects of weight transfer on traction during acceleration [38].
Trajectory planning for holonomic systems is an easier task than for systems
with kinematic or dynamic constraints, as arbitrary continuous paths can be fol-
lowed, requiring no bounded derivatives. As with kinematically nonholonomic
systems, arbitrary smooth and monotonic timing laws may be chosen, again al-
lowing the separation of these two planning tasks. This path planning is typically
achieved by defining paths using low order splines [39, 40], upon which heuristic
based timing laws can be defined to satisfy acceleration and velocity constraints.
This has been extended to shape-aware planning around obstacles for robots of
complex 2D geometries [41].
The most common configuration of robot that dynamically balances whilst be-
ing subject to nonholonomic kinematic constraints is the two-wheeled inverted
pendulum (TWIP). This configuration utilises two differential drive wheels at-
tached to the robot body, with a center of mass located above the wheel axle,
dynamically balancing about the wheel rotation axis. Just as in a statically stable
differential drive robot, the full configuration space is accessed by combinations
21
Chapter 2 Wheeled Robot Locomotion
Figure 2.3: Typical omnidirectional statically stable mobile robots, also referred
to as holonomic robots.
22
2.2 Existing Solutions
(a) EPFL’s JOE, an early mobile in- (b) Boston Dynamic’s Handle, a two-
verted pendulum [46]. wheeled inverted pendulum robot for
package handling [67].
23
Chapter 2 Wheeled Robot Locomotion
24
2.2 Existing Solutions
(a) OmnUR robot from UCLA’s (b) Honda’s UNI-CUB personal mobil-
RoMeLa [79] ity device [80]
25
Chapter 2 Wheeled Robot Locomotion
techniques have been used to plan dynamically feasible trajectories through mul-
tiple fixed state waypoints [73, 81] using a decoupled 2D dynamics model. This
optimisation can be performed very quickly, planning long trajectories in < 1 ms,
but does require some model simplification in order to achieve differential flat-
ness, making planned trajectories less dynamically feasible with deviation from
the vertical. This model simplification can be avoided by utilizing partial dif-
ferential flatness, in which a sufficiently smooth parametrised trajectory in the
fully differentially flat outputs is optimised to yield a desired trajectory in the
non-differentially flat states [24]. This method is able to plan very aggressive
trajectories that remain dynamically feasible for arbitrary lean angles, however,
the trajectories of non-differentially flat states must still be determined by in-
tegration of the system dynamics from initial conditions, so this remains a slow
and computationally expensive method. Nagarajan [74] plans trajectories in con-
figuration space by describing trajectories in the lean angle states of the robot in
each planar axis using a series of parametrised hyperbolic secant functions, with
parameters optimised subject to the system’s planar dynamic constraints. These
trajectories are then tracked using a zero moment point (ZMP) technique and
PID controller. Nagarajan [82] also generates dynamically feasible trajectories
through state waypoints by performing a nonlinear optimisation subject to the
nonholonomic dynamic constraint imposed by the system’s underactuation to
optimise a linear map between some sufficiently smooth desired trajectory and a
subset of the system dynamics, performed using a full 3D coupled model. This
optimisation takes in the region of 1 s for typical trajectories, and can therefore
feasibly be used for some real-time planning applications. Pardo implements
direct transcription to generate optimal trajectories in the presence of simple ob-
stacles using nonlinear programming [83]. While producing optimal trajectories,
this technique is too computationally expensive to be implemented in real-time
for complex trajectories or multiple obstacles. Neunert [84] demonstrates ef-
fective unconstrained optimal model predictive control for planning trajectories
through multiple temporally fixed waypoints. This is performed by minimising
a quadratic input and state error cost function over a receding horizon by opti-
misation of a linear time-varying feedback and feedforward controller, using the
full nonlinear coupled model for prediction. This optimisation can be performed
very quickly, taking 20 ms to plan trajectories of 4 s duration, and with solve time
26
2.2 Existing Solutions
27
Chapter 3
This chapter introduces the Collinear Mecanum Drive (CMD), the locomotion
system that is to be studied in this thesis. It begins with the derivation of the
kinematic and dynamic models of the CMD, and then analyses the underactu-
ation properties of the dynamics model, its controllability, and the size of the
maximum feedback linearisable subsystem. An analysis of parameter selection is
then performed to provide insight into the optimal CMD design.
The Collinear Mecanum Drive (CMD) utilizes three or more collinear Mecanum
wheels to enable omnidirectional locomotion, whilst simultaneously dynamically
balancing about the wheel rotation axis. By dynamically balancing, the ground
footprint of a robot utilising a CMD can be designed to be arbitrarily thin, only
lower bounded by choice of wheel diameter. The omnidirectional manoeuvrability
of the CMD in combination with this narrow footprint allows for the navigation
of much smaller gaps between obstacles than existing omnidirectional locomo-
tion methods, achieved by translating directly along the common wheel rotation
axis. This is in contrast to two-wheeled inverted pendulum systems, which would
have to instead perform a parallel-parking style manoeuvre to achieve the same
translation. Being a dynamically balanced system, the height of the center of
mass of a robot driven by a CMD can be increased without requiring a pro-
portional increase in the width of the ground footprint so as to avoid toppling
during acceleration or disturbance, as would be the case for existing statically
stable omnidirectional locomotion methods.
Omnidirectional dynamically balanced motion has previously only been demon-
strated using ball-balancing robots, which possess a number of disadvantages
29
Chapter 3 The Collinear Mecanum Drive
compared to the CMD. By only balancing about a single axis, as opposed to the
two dimensional balancing required in a ball-balancing robot, the CMD retains
greater control authority over the statically stable subsystem, and less energy is
required to maintain balance. The CMD also retains significant control author-
ity over its rotational dynamics about the vertical by virtue of multiple ground
contact points, allowing for greater control performance and environment inter-
action.
This new locomotion system allows for the creation of omnidirectional systems
of the same height as existing statically stable omnidirectional platforms, whilst
requiring a fraction of the ground footprint and overall system size, and with
a much smaller minimum navigable gap. This enables the creation of tall and
slender robots that are better able to navigate cluttered environments such as
those encountered in personal robotics in the home, retail, and office sectors.
This is achieved with a fraction of the complexity of existing ball-balancing or
legged solutions, requiring only three actuators and three moving parts1 , allowing
for increased reliability and reduced unit cost.
Only a single example of a CMD existed in the literature prior to this research,
in which a three wheeled CMD demonstrated the possibility of omnidirectional
movement whilst simultaneously dynamically balancing [85]. However, this CMD
demonstrates poor performance, taking 60 s to perform a 10 cm translation along
its wheel axis, and no attempt is made to model or analyse the system dynamics.
30
Chapter 3 The Collinear Mecanum Drive
Considering a single Mecanum wheel, let µ̂p represent the unit vector running
parallel to r̂i through the ground contact point, expressed in the local body
attached frame, let W represent the wheel’s centre, and let the roller contact
the ground directly under W at C as C = W − rw b̂z , where rw denotes the
wheel radius measured to the roller contact point and perpendicular to the wheel
rotation axis.
For no slip to occur, the component of the roller’s velocity at the contact point
along µ̂p must always be zero, so
~vEC,B can be expressed as the body frame velocity of the wheel at W relative
to E summed with the tangental velocity due to wheel angular velocity θ̇i as
Similarly, ~vEW,B can be defined in terms of the body frame velocity of B relative
to E as
~vEW,B = ~vEB,B + φ̇li b̂y (3.1.3)
T
~vEB,B = REB ~vEB,E (3.1.4)
Combining (3.1.1)-(3.1.4) and splitting ~vEB,E into its components along êx and
êy , denoted x and y, yields the nonholonomic no-slip constraint
Similarly, the angular velocity of the roller Ω̇i is proportional to its velocity along
the vector µ̂t , where µ̂t is perpendicular to µ̂p and parallel to the ground, so
32
3.2 Dynamics Model
Here the generalised CMD dynamics model is derived using the Lagrangian
method, chosen for its systematic incorporation of nonholonomic constraints and
straightforward derivation. This is derived both in terms of the generalised co-
ordinates and their derivatives, and in terms of generalised positions and local
body frame velocities, a more useful formulation for control development later in
this thesis.
There exist two methods of deriving a dynamics model subject to these non-
holonomic constraints using the Lagrangian method; Lagrange multipliers can be
used to directly incorporate the nonholonomic constraints, or the constraints can
be approximately ’holonomised’ using the psuedo-inverse of the inverse kinematic
transformation matrix. Zimmerman showed both methods to be equivalent in the
context of Mecanum wheeled vehicles [86]. Here the former approach is taken.
The system’s dynamics equations are derived by use of the Euler-Lagrange
equation in terms of the Lagrangian L(q, q̇), generalised coordinates q, generalised
33
Chapter 3 The Collinear Mecanum Drive
The Lagrangian L(q, q̇) is found as the difference of kinetic and potential energy
in the system L(q, q̇) = K(q, q̇) − U(q), where K(q, q̇) represents the sum of
translational and rotational kinetic energy, and U(q) the total potential energy.
The rotational kinetic energy of the system is defined as the sum of rotational
energy of the pendulum mass and four wheel masses. As wheel torques act about
the b̂x axis, pendulum inertia Ip must be redefined about P−hp p̂z as Ip,b , achieved
h iT
using the parallel axis theorem with translation vector rp = 0 0 −hp as
34
3.2 Dynamics Model
where ⊗ denotes the outer product. The wheel rotation axes ŵx,i are already
aligned with τi , so Iw remains unchanged.
wn
1 T 1X
Kr (q̇) = ω~ p Ip,b ω
~p + ω
~wT
I ω
~
i w wi
(3.2.5)
2 2
i=1
where
ω
~ b = φ̇b̂z (3.2.6)
ω T
~ p = Rbp ω
~ b + θ̇p p̂x (3.2.7)
ω T
~ w,i = Rbw ω
~ + θ̇i ŵx
i b
(3.2.8)
w n
1 1
(3.2.9)
X
Kt (q̇) = ~vpT mp~vp + mw T
~vw,i ~vw,i
2 2
i=1
where
h iT
T T
~vp = Rbp Reb ẋ ẏ 0 + ω ~ p × hp̂z (3.2.10)
h iT
T
~vw,i = Rbw i
T
Reb ẋ ẏ 0 + ω~ wi × li ŵx (3.2.11)
Finally, potential energy is purely that due to the action of gravity on the pen-
dulum body, defined as
U = mp ghp cos(θp ) (3.2.12)
The generalised forces Q capture all non-conservative forces acting on the system,
which here are motor torques Qτ and both rolling and viscous friction forces
Qf for Q = Qτ + Qf . The nw motor drive torques τ = τ1 . . . τnw act
T
35
Chapter 3 The Collinear Mecanum Drive
defines Qτ as
03×1
Pnw
(−τi )
Qτ = i=1 (3.2.13)
τ
0nw ×1
Viscous friction is modelled at two interfaces for this system: at the body-
to-wheel revolute joints, with coefficient kvw , and at the wheel-to-roller revolute
joints, with coefficient kvr . It is assumed that kvw is also able to approximate the
various motor phenomena that sum to yield a non-zero no-load current. Linear
rolling friction is modelled at the roller-to-ground interface as a torque about ŵx
proportional to wheel angular velocity θ̇i , with coefficient krw . While there will
also exist a rolling friction force acting along b̂x , there does not exist a simple
experimental approach to allow the independent measurement of this coefficient
and kvr , so it is assumed that this can be sufficiently captured by the existing
kvr coefficient. Tractive friction forces between the roller and ground are already
assumed to be infinite in the definition of the nonholonomic constraints in (3.1.5)
and (3.1.7). It is assumed that kinetic friction in the wheel bearings can be fully
compensated by application of a discontinuous torque offset to the wheel actu-
ators, allowing its exclusion from the dynamics model, and it is assumed that
static friction is negligible for model simplicity. Kinetic friction in the roller bear-
ings cannot be compensated in such a manner, and cannot easily be modelled
without introducing a discontinuity, so is therefore treated as a external distur-
bance. Again, static friction in this interface is also assumed to be negligible for
model simplicity.
Viscous friction in the wheel-to body-revolute joint acts proportionally to the
difference between each wheel angular velocity θ̇i and the pendulum’s angular
velocity θ̇p , applying a torque of kvw (θ̇p − θ̇i ) to each θi generalised coordinate
nw
and a torque of (kvw (θ̇i − θ̇p )) to the pendulum body θp . Viscous friction in
P
i=1
the wheel-to-roller revolute joint acts proportionally to −Ω̇i , applying a torque
of −kvr Ω̇i to each Ωi generalised coordinate. The counter-torque from this fric-
tion force acts about two axes on the wheel. That about the ŵx axis acts to
rotate the wheel, applying a torque of kvr b̂x · Rbr Ω̇i 0 0 to each of θi . That
T
orthogonal to ŵx and parallel to the ground imparts an axial load on the wheel,
36
3.2 Dynamics Model
1
h i −rw +rr nw kvr Ω̇i
(3.2.14)
X
I2×2 02×1 Reb 0 b̂y · Rbr,i 0
0 i=1 0
lution of (3.2), giving a system of 4 + 2nw ODEs. These can be arranged into
the matrix form
with symmetric positive semidefinite2 inertia matrix M (q), Coriolis and cen-
tripetal matrix C(q, q̇), derived using the Christoffel symbols of M (q) such that
2
Usually for Lagrangian systems M (q) is positive definite, however, in choosing to model the
wheel roller as being massless and inertialess eigenvalues of zero are introduced into M (q).
37
Chapter 3 The Collinear Mecanum Drive
4+2n
1 Xw ∂Mij (q) ∂Mik (q) ∂Mjk (q)
ci,j = + + q̇k (3.2.17)
2 ∂ q̇k ∂ q̇j ∂ q̇i
k=1
and with gravity matrix G(q), viscous and rolling friction matrix F , and input
matrix B. These matrices are defined in full in Appendix A.1.
Provided the conditions set out in Remark 1 are met, examining rank(A) = 2nw
indicates that 2nw of the model’s 4+2nw degrees of freedom are fully constrained
by A, meaning 2nw generalised coordinates can be made redundant by elimination
of the Lagrange multipliers. Defining the nullspace of A as Φ, such that AΦ = 0
and therefore ΦT AT = 0, it is evident that λ can be eliminated from (3.2.16) by
premultiplication with ΦT .
As the choice of Φ must satisfy AT q̇ = 0, there exists a minimal vector of
generalised velocities ṗ that map back to q̇ as q̇ = Φṗ. As there are infinite
solutions for Φ and therefore choices of ṗ, it is possible to choose Φ such that
the rows mapping ṗ to ẋ ẏ φ̇ θ̇p in q̇ form the rows of an identity matrix,
T
Φ as
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
− cos(α1 +φ) − sin(α1 +φ)
− rlw1 0
rw sin(α1 ) rw sin(α1 )
.. .. .. ..
. . . .
Φ= (3.2.18)
− cos(αnw +φ) − sin(αnw +φ)
− lrnww 0
rw sin(αn ) rw sin(αnw )
w
2 cos(φ) cos(α1 ) 2 sin(φ) cos(α1 )
rr rr 0 0
.. .. .. ..
. . . .
2 cos(φ) cos(αnw ) 2 sin(φ) cos(αnw )
rr rr 0 0
38
3.2 Dynamics Model
in which Mp (p) is now both symmetric and positive definite, and Ṁp (p)−2Cp (p, ṗ)
remains skew symmetric. These matrices are defined in full in Appendix A.2.
As det(Mp (p)) =
6 0 ∀ p ∈ R4 for sensical parameter choices Mp (p) is invertible,
allowing (3.2.19) to be solved for p̈ as
thus allowing integration of the system dynamics over time from an initial state
(p0 , ṗ0 ) and with input trajectory u(t).
As rank(Bp ) < dim(τ ) when nw > 3, as in the experimental prototype in this
thesis, the input τ does not represent a linearly independent set of inputs. This
means there exists a linear map Λ : τ → u that maps τ onto a new minimal set
of independent inputs u, written in matrix form as u = Λτ , in which there exist
infinite choices for u. Separating Bp (p) into its nonlinear and linear components
and defining B̂p,l as a basis for the column space of Bp,l , one suitable map can
39
Chapter 3 The Collinear Mecanum Drive
be found as Λ = B̂p,l
+
Bp,l , where
1 0 0
cot α1 cot α2 . . . cot αnw
0 1 0
B̂p,l = Λ=− 1
rw 1 1 ... 1 (3.2.28)
0 0 1
l1 l2 ... lnw
0 rw 0
giving the overall input matrix Bp (p) = Bp,nl (p)B̂p,l Λτ . Replacing Bp (p) in
3.2.19 with B̂p (p) = Bp,nl (p)B̂p,l and using u = Λτ as the new input yields the
new system
Mp (p)p̈ + Cp (p, ṗ)ṗ + Gp (p) = Fp (p)ṗ + B̂p (p)u (3.2.29)
in which dim(u) = rank(B̂p ). Intuitively, the elements of this new input represent
force on the body parallel to êx , force on the body parallel to êy , and torque on
the body about êz .
A known input u can be mapped back to a choice of τ in which is
Pnw 2
i=1 τi
minimised as τ = Λ+ u. If wheel torques are to be constrained this can be enforced
by the solution of the constrained least-squares minimisation
40
3.2 Dynamics Model
and
Mv (p)v̇ + Cv (p, v)v + Gv (p) = Fv v + B̂v u (3.2.35)
in which again Mv (p) is symmetric positive definite, Ṁv (p) − 2Cv (p, v) is skew
symmetric, and matrices Fv , Bv , and B̂v no longer depend on p. Again, det(Mp )
6 0 ∀ p ∈ R4 for sensical parameter choices. These matrices are defined in full
=
in Appendix A.3.
As in (3.2.25), the model (3.2.34) can be solved for v̇ as
It is this model which is to be used for simulation of CMD throughout the rest
of this thesis, with numerically integration performed using MATLAB’s ode45,
an explicit Runge-Kutta (4,5) solver [87], with absolute and relative tolerances
of 1 × 10−9 .
1. The shape and external variables are ps = (φ, θp ) and px = (x, y) respec-
tively.
41
Chapter 3 The Collinear Mecanum Drive
2. Both the shape and external variables are actuated, in that all rows of B
are nonzero, meaning the shape and external variables are coupled.
πs = ṗx + m−1
sx (ps )mss (ps )ṗs (3.2.40)
which for brevities sake are not shown, are not integrable due to the exis-
tence of singularities, that is @ h(px , ps ) : ḣ = πs .
Surprisingly, these properties make this system unclassified by the system set out
by Saber [16], as this author states never to have found a system with this com-
bination of having actuated shape variables, coupled inputs, and nonintegrable
momentums, therefore this combination is not considered nor analysed. This
means the literature at present provides no expected normal form for which it
should be possible for the system to be rearranged into.
42
3.2 Dynamics Model
3.2.2 Controllability
The controllability of a system describes its ability to move from any initial point
in its state space x0 ∈ Rn to any other point xT ∈ Rn within finite time T < ∞
by manipulation of its inputs u ∈ Rm . The global controllability of linear systems
in the form ẋ = Ax + Bu, x ∈ Rn , u ∈ Rm is easily proven by determining if the
Kalman controllability matrix Co is of full rank, i.e. rank(Co ) = n, where
h i
Co = B AB . . . An−1 B (3.2.41)
Linear systems satisfying this condition can always be globally stabilised to the
origin by a feedback of the form u = −Kx.
Such a proof does not exist for nonlinear systems. A weaker form of this proof is
to instead show that a nonlinear system is small-time locally controllable (STLC),
and a further weaker form is to show that a nonlinear system is small-time locally
accessible (STLA).
Letting W represent an infinitely small region in state space centered around
x0 , i.e. the local neighbourhood of x0 , define RW as the set of configurations xT
that can be achieved by manipulation of u in an infinitely small time T without
leaving W . A STLC system will be able to use sequences of control input to
affect change in x0 in all directions in W , meaning x0 will be an interior point
within RW , p0 ∈ int(RW ), and therefore RW = W .
A STLA system, whilst still able to locally access a space with the same di-
mension as W , is restricted to accessing a subset RW ⊂ W , in which p0 is on the
boundary of RW and so p0 ∈
/ int(RW ) [88].
Theorem 1. The CMD is STLC from its equilibrium states for sensical model
parameters.
The set of equilibrium states Xe is defined as the set of states x with constant
input u = 0m×1 at which ẋ = 0n×1 , given for the state space x = p v as
T
Xe = {x | ẋ = f (x, u) = 0, u = 0}
nh iT
= x1 x2 . . . x8 | (x1 , x2 , x3 ) ∈ R3 ,
o (3.2.42)
x4 = πk, k ∈ Z, xj = 0, j = [5 . . 8]
43
Chapter 3 The Collinear Mecanum Drive
(3.2.43)
A = 0 0 0 b 0 c 0 d B =
0 j 0
0 0 0 0 0 0 e 0 0 0 k
0 0 0 f 0 g 0 h 0 l 0
in which A possesses some positive eigenvalues, meaning the upright equilibrium
is unstable. Likewise, linearising about any x ∈ {Xe : x4 = π} yields a negative
semidefinite A, meaning the lowest pendulum position is a stable equilibrium, as
would be expected.
Examining the Kalman controllability rank condition yields rank(Co ) = 8 = n,
indicating controllability of the linearised model at the equilibrium states.
Given the complexity of A and B for the fully parametrised model it is not
possible to directly examine their structure to ascertain the effect of parameter
choice on controllability, so the effect of exceptional parameter values is examined
instead. Physically impossible parameter choices, such as rw = 0, l1 = l2 etc. are
not considered. The conditions on αi and li set out in Remark 1 must be met for
the model to remain defined. Setting hp = 0 yields rank(Co ) = n − 1 and thus a
reduction in controllability, meaning the pendulum CoM must not lie inline with
the wheel axis.
A nonlinear system that is controllable when linearised at its equilibrium states
is STLC from the equilibrium states for the full nonlinear system [89, p. 74-75],
meaning the CMD is STLC for x ∈ Xe given sensical parameter choices.
For comparison a two-wheeled inverted pendulum moving on a 2D plane yields
rank(Co ) = 6, as the nonholonomic constraints imposed by the use of regular
wheels prevent translation parallel to the wheel axis. A TWIP on a 2D plane
therefore does not satisfy the KCRC, and is therefore not STLC, though a number
of authors claim the TWIP to be STLC by analysis of the TWIP’s model in
joint space [90], which ignores a dimension of the configuration space required to
uniquely locate the TWIP on a 2D plane.
44
3.2 Dynamics Model
3
(3.2.44)
X
ẋ = f (x) + gj (x)uj
j=1
where x = p v , the drift vector field f (x) and input vector fields gj (x) take
T
the form
x5 cos(x3 ) − x6 sin(x3 )
x5 sin(x3 ) + x6 cos(x3 )
x7
x8
(3.2.45)
f (x) =
f5 (x4 , x5 , x6 , x7 , x8 )
f6 (x4 , x5 , x6 , x7 , x8 )
f (x , x , x , x , x )
7 4 5 6 7 8
f8 (x4 , x5 , x6 , x7 , x8 )
04×3
T
g1 (x) g51 (x4 ) 0 g53 (x4 )
(3.2.46)
g2 (x) = 0 g (x ) 0
62 4
g3 (x) g71 (x4 ) 0 g73 (x4 )
0 g82 (x4 ) 0
∂f2 ∂f1
[f1 , f2 ](x) = f1 (x) − f2 (x)
∂x ∂x
45
Chapter 3 The Collinear Mecanum Drive
46
3.2 Dynamics Model
vector fields as
4
(3.2.52)
X
ṗ = Ψv = gj (p)v
j=1
G = {g1 , g2 , g3 }
Gf = f + G = {f + g : g ∈ G}
n o (3.2.54)
adjf ∆ = adjf X : X ∈ ∆
[∆1 , ∆2 ] = {[X, Y ] : X ∈ ∆1 , Y ∈ ∆2 }
Q0 , adf Q0 (3.2.56)
Q1 = = h{g1 , g2 , g3 , [f, g1 ], [f, g2 ], [f, g3 ]}i
Q1 = h{g1 , g2 , g3 , [f, g1 ], [f, g2 ], [f, g3 ], [g1 , [f, g1 ]], [[f, g1 ], [f, g3 ]]}i (3.2.57)
47
Chapter 3 The Collinear Mecanum Drive
48
3.3 Collinear Mecanum Drive Design Considerations
This section aims to explore how the selection of a number of CMD parameters
affects the overall CMD dynamics and properties, with the aim of drawing some
conclusions as to help guide good CMD design practices.
force components along b̂x do no work. Similarly, generating a net force along
b̂x requires wheels of opposing sgn(α) to be rotated against one another whilst
ensuring ni=1 τi = 0, meaning force components along b̂y due to wheel torques
P w
do no work. While doing no work, these forces still require the existence of
an equal and opposite tractive force between the roller and ground, meaning
the CMD is more likely to experience wheel slip than a conventional wheeled
vehicle when generating the same net force on the body [5]. This is compounded
by the requirement of the Mecanum wheels to present a circular projection, as
this necessitates manufacture of the rollers using hard rubber compounds, and
prevents the inclusion of a tread pattern as in a typical vehicle tire, reducing wheel
traction. An ideal Mecanum wheel has only a single contact point, compared to
a cylindrical wheel that has a contact line.
The introduction of a fourth wheel therefore helps to prevent loss of control
when a wheel slips due to a transient change in wheel traction, for example
when slipping on debris or when moving over small gaps or bumps between floor
surfaces. However, this does not reduce incidence of loss of traction due to overly
aggressive control, meaning this must be addressed in the control design.
49
Chapter 3 The Collinear Mecanum Drive
One definition of the optimal roller ordering could be that which yields equal
contributions to body accelerations v̇x and v̇y from each wheel torque. This can
be determined by analysing the first and second rows of the matrix
Mv (p)−1 Bv (3.3.1)
that multiplies onto τ to yield contributions to v̇x and v̇y due to a wheel input
torque in (3.2.34). As from Remark 1 nw ≥ 3 is required for controllability, the
nw = 3 case is considered first. The wheels are assumed to be evenly spaced,
3
While omniwheels (α = π/2) are also available off-the-shelf, they cannot be used in a CMD
arrangement as cot(π/2) = 0, and thus no quantity of wheels are able to generate a unique
inverse kinematics mapping.
50
3.3 Collinear Mecanum Drive Design Considerations
20 20
δ v̇x (m s−2 )
δ v̇x (m s−2 )
0 0
−20 −20
0 π/4 π/2 0 π/4 π/2
a (rad) a (rad)
(a) α = [a, −a, a] (b) α = [a, a, −a]
Figure 3.2: Contribution of each wheel torque τi to v̇x for the nw = 3 case in
(3.3.1) over a ∈ [0, π/2] with nw = 3, where α takes the form α = [a, −a, a] (a)
and α = [a, a, −a] (b). All others parameters are taken from Table 4.2.
placing the middle wheel directly under the CoM, i.e. l2 = 0 and l3 = −l1 , and
roller angles are set to α = [a, −a, a], for which the first row of (3.3.1) is found
to take the form
T
− sin(a) γ + Iwx rw cos(a)(2mp h2p − mp rw hp + 2Ipbx )
1
sin(a) γ + Iwx rw cos(a)(4mp h2p − mp rw hp + 4Ipbx ) (3.3.2)
Γ
− sin(a) γ + Iwx rw cos(a)(2mp h2p − mp rw hp + 2Ipbx )
where γ and Γ are known scalar functions. This shows that the central wheel
is able to generate greater acceleration in v̇x than the outer two wheels. The
α = [a, a, −a] case is too complex to show, but yields a very similar relationship,
with an additional imbalance between the two wheels of identical handedness.
These two cases are shown in Figure 3.2 for a ∈ [0, π/2], with all other param-
eters taken from Table 4.2. It is found that the α = [a, −a, a] case yields 3.7%
more total acceleration in v̇x than the α = [a, a, −a] case for appropriately signed
wheel torques of equal magnitude. For the α = [a, −a, a] case it is found that
the central wheel is able to generate 6.3% more v̇x acceleration than the outer
two for the same input torque. In both cases maximum acceleration is achieved
with roller angles of ±14°, a significantly shallower angle than used in Mecanum
wheels.
51
Chapter 3 The Collinear Mecanum Drive
δ v̇y (m s−2 )
−22 −22
0 π/4 π/2 0 π/4 π/2
a (rad) a (rad)
(a) α = [a, −a, a] (b) α = [a, a, −a]
Figure 3.3: Contribution of each wheel torque τi to v̇y in (3.3.1) over a ∈ [0, π/2]
with nw = 3, where α takes the form α = [a, −a, a] (a) and α = [a, a, −a] (b).
All others parameters are taken from Table 4.2.
Performing the same analysis for contributions of each wheel torque to v̇y
yields a similar variation between roller orderings, with the α = [a, −a, a] case
yielding two wheels with identical contributions, and with the α = [a, a, −a]
case introducing a small variation. This also shows that in both cases the single
uniquely angled wheel is again able to generate greater v̇y acceleration than the
two wheels of identical handedness.
where Γ(a) is a large scalar function. This shows a torque bias toward the inner
two wheels when accelerating along b̂x .
Considering the same scenario but now with rotational symmetry about b̂z ,
52
3.3 Collinear Mecanum Drive Design Considerations
δ v̇y (m s−2 )
0 0
−20 −20
0 π/4 π/2 0 π/4 π/2
a (rad) a (rad)
(a) α = [a, −a, a, −a] (b) α = [a, −a, −a, a]
Figure 3.4: Contribution of each wheel torque τi to v̇x in (3.3.1) over α ∈ [0, π/2]
with nw = 4, where α takes the form α = [a, −a, a, −a] (a) and α = [a, −a, −a, a]
(b). This shows uneven torque distribution in (a), and equal distribution in (b).
All others parameters are taken from Table 4.2.
such that α = [a, −a, −a, a], all elements of this row become equivalent as
rw sin(2a)
(3.3.4)
2(4Iwx − 4Iwx sin(a)2 2 sin(a)2 + 4m r 2 sin(a)2 )
+ mp rw w w
This shows that only when α takes the form α = [a, −a, −a, a] do each of the
input torques contribute equally to v̇x . This goes against the intuition that the
optimal platform configuration would be symmetrical about the (b̂y , b̂z ) plane;
the optimal platform configuration for distribution of torques when generating
acceleration v̇x instead possesses 2-fold rotational symmetry about b̂z . Obviously
this analysis would be more complex with asymmetrical wheel spacings, for which
this conclusion would likely not hold. The variation of these coefficients in each
case is shown in Figure 3.4 for the parameters in Table 4.2 over a ∈ [0, π/2].
Maximum acceleration is found to occur at roller angles of ±15.5°, a slightly
greater angle than the three-wheeled case.
Analysis of the second row of (3.3.1) that multiplies onto τ to yield the con-
tribution of wheel torques to v̇y shows this to be independent of a for the two
considered wheel orderings, so contribution of each wheel torque to v̇y is invariant
in the selection and ordering of roller angles, provided all roller angles possess
53
Chapter 3 The Collinear Mecanum Drive
a subset of this space defined by the set of accelerations for which the inverse
dynamics least-squares solution yields constraint satisfying wheel torques, defined
as
v̇ ∈ R3 : B + M (p)v̇ ≤ τ (3.3.5)
These sets are visualised in Figure 3.6, in which the inner dark space represents
the inverse dynamics least-squares solution set, and the outer lighter space the
less-efficient maximal achievable acceleration set. While the least-squares solu-
tion sets retain a similar form to the three wheeled case, the maximal accessible
acceleration spaces exhibit shapes much closer to an ideal spherical or ellipsoidal
distribution. Examining the intersection of the red (v̇x , v̇y ) plane with both ac-
celeration sets shows the α = [π/4, −π/4, −π/4, π/4] case yields greater accessible
sets of v̇x and v̇y accelerations when φ̈ = 0.
54
3.3 Collinear Mecanum Drive Design Considerations
The CMD’s rate of energy dissipation due to viscous and rolling friction can be
calculated from (3.2.34) as
P = −v T Fv v (3.3.6)
Similarly, the rate of energy dissipation due to motor resistive losses can be
calculated as
nw nw 2
τi 2 (Bv+ Fv v)i
(3.3.7)
X X
P = Rw = Rw
Kt Kt
i=1 i=1
where (B + F v)i denotes the ith element of the vector Bv+ Fv v, Kt the motor torque
constant, and Rw the motor terminal resistance.
As these are the only dissipative elements in the model, the total power required
to maintain a given velocity v is therefore the sum of (3.3.6) and (3.3.7), an
expression from which it is possible to analyse the efficiency of motion for any
given wheel configuration. Figure (3.7) shows this function evaluated for a unit
body frame velocity in all directions over a range of roller angles for nw = 4
and α = [a, −a, −a, a], performed for both the motors used in the prototype in
this thesis (Kt = 0.037 N m A−1 , Rw = 0.61 Ω) and for a smaller motor (Kt =
0.01 N m A−1 , Rw = 1.2 Ω) as a comparison. A similar analysis is not performed
for the α = [a, −a, a, −a] case, as (3.3.6) and (3.3.7) are found to be relevantly
invariant in roller ordering, and so this figure would be nearly identical to the
α = [a, −a, −a, a] case. This analysis yields optimal roller angles of a = ±74°
for the motor used in the prototype in this thesis, and a = ±65° for the smaller
motor. For the larger motors used in this thesis, a roller angle of a = ±56°
allows for equally efficient motion in all directions. Interestingly, both of these
figures again show that the standard Mecanum wheel roller angle of α = ±45° is
suboptimal with respect to this metric.
For the three-wheeled case translational efficiency is found to depend heavily on
choice of roller ordering. Figure 3.8 shows a comparison between the two possible
orderings α = [a, −a, a] and α = [a, a, −a], using the same motor parameters as
that used on the prototype in this thesis. Interestingly, this shows around a
10° variation in the optimal roller angle between the two orderings, and the
most efficient choice of a for the α = [a, −a, a] configuration in Figure 3.8a
requires 45% less power to translate along b̂x than the most efficient choice of a
57
Chapter 3 The Collinear Mecanum Drive
90 3 a = ±36°
120 60 a = ±40°
2 a = ±44°
150 30 a = ±48°
1 a = ±52°
a = ±56°
a = ±60°
180 0 a = ±64°
a = ±68°
a = ±72°
a = ±76°
210 330 a = ±80°
240 300
270
(a) Kt = 0.037 N m A−1 , Rw = 0.61 Ω
90 15 a = ±36°
120 60 a = ±40°
10 a = ±44°
150 30 a = ±48°
5 a = ±52°
a = ±56°
a = ±60°
180 0 a = ±64°
a = ±68°
a = ±72°
a = ±76°
210 330 a = ±80°
240 300
270
(b) Kt = 0.01 N m A−1 , Rw = 1.2 Ω
Figure 3.7: CMD translation power requirements over body relative translation
direction and roller angle α, with nw = 4 and α = [a, −a, −a, a], using motor
parameters from that used on the prototype in this thesis (a) and a smaller
motor with Kt = 0.01 N m A−1 and Rw = 1.2 Ω (b). All other CMD parame-
ters are taken from Table 4.2. This demonstrates a strong relationship between
locomotion efficiency and both choice of roller angle and motor selection.
58
3.3 Collinear Mecanum Drive Design Considerations
for the α = [a, a, −a] configuration in Figure 3.8b. Both configurations show a
substantial decrease in efficiency for translation along b̂x compared to b̂y , even for
the most efficient choices of a. This is in significant contrast to the four-wheeled
case with identical motors, for which there exists choices of a that yield more
efficient translation along b̂x than along b̂y .
Analysis of losses purely due to the viscous and rolling friction term (3.3.6)
finds this function to be invariant in roller ordering, and of significantly lower
magnitude than the overall losses in Figure 3.8. This function is shown in Figure
3.9. This means that the substantial change in power requirements with direction
visible in Figure 3.8 originates in the motor losses term (3.3.7), which is larger
due to the increased torque requirement imposed on the single unique wheel. The
efficiency of a three-wheeled configuration can therefore be greatly increased by
driving the single unique angled wheel using a larger motor than the other two
as to minimise resistive losses.
As one would expect, maximum yaw authority is achieved by spacing the wheels
as widely as possible, with symmetry across the (b̂y , b̂z ) plane. Less obviously,
it should also be considered that the opposing forces generated by each wheel
in directions parallel to b̂y when moving along b̂x generate a net torque on the
ground between wheels of opposing handedness, with this torque proportional
to wheel spacing. On a hard surface this torque is inconsequential, but on soft,
movable, surfaces this could result in an undesirable rotation of the surface under
the platform. This torque can be minimised by reducing the distance between
wheels of opposite handedness, meaning a good configuration of four wheels is
an arrangement of two pairs of wheels with opposite handedness within each
pair, with minimal distance between the wheels within each pair. These can be
arranged such that the inner two wheels 2 and 3 share the same roller handedness,
preventing the generation of a net torque between these two wheels. As the two
pairs are to be widely spaced as to provide maximum yaw control authority, it
is these two inner wheels that can potentially generate the largest net ground
torque when vx =
6 0, which is eliminated by this choice of α = [a, −a, −a, a].
While the pairs (1,2) and (3,4) will also each generate a net ground torque, as
the wheels in each pair are tightly spaced this torque is minimised.
59
Chapter 3 The Collinear Mecanum Drive
90 8 a = ±36°
120 60 a = ±40°
6
a = ±44°
150 4 30 a = ±48°
a = ±52°
2 a = ±56°
a = ±60°
180 0 a = ±64°
a = ±68°
a = ±72°
a = ±76°
210 330
240 300
270
(a) α = [a, −a, a]
90 10 a = ±36°
120 60
8 a = ±40°
6 a = ±44°
150 30 a = ±48°
4 a = ±52°
2 a = ±56°
a = ±60°
180 0 a = ±64°
a = ±68°
210 330
240 300
270
(b) α = [a, a, −a]
Figure 3.8: CMD translation power requirements over body relative translation
direction and roller angle α, using motor parameters for the prototype, with
nw = 3, l = [d, 0, −d] for both figures, and with roller angles α = [a, −a, a] (a)
and α = [a, a, −a] (b). All other CMD parameters are taken from Table 4.2.
60
3.3 Collinear Mecanum Drive Design Considerations
90 6 a = ±34°
120 60 a = ±38°
4 a = ±42°
150 30 a = ±46°
2 a = ±50°
a = ±54°
a = ±58°
180 0 a = ±62°
a = ±66°
a = ±70°
a = ±74°
210 330 a = ±78°
a = ±82°
240 300 a = ±86°
270 a = ±90°
Figure 3.9: CMD rate of energy dissipation due to viscous friction for nw = 3
and l = [d, 0, −d]. This choice of wheel spacings makes F invariant in d, so all
choices of d produce identical friction profiles. All other CMD parameters are
taken from Table 4.2.
The effect of a varying center of mass height is studied by examining the v̇y
acceleration achieved when maintaining a constant θp , i.e. θ̇p = θ̈p = 0. As a
varying center of mass would usually also be associated with a varying Ipbx , the
pendulum body is approximated as a solid thin rod with inertia Ipbx = 31 (2h2p )mp .
This relationship for hp ∈ [0, 2]m is shown in Figure 3.10, in which all other states
and inputs remain at zero. This shows the relationship one would intuitively
expect, with higher CoMs yielding greater accelerations for the same non-zero
θp , reaching an asymptote as hp → ∞. This function shows strong linearity over
small accelerations up to around 5 m s−2 . Two considerations must be balanced
in choosing hp ; a higher CoM allows for greater acceleration for a given θp ,
allowing the system to follow Cartesian trajectories with reduced deviation from
the upright pose, though with diminishing returns for hp ' 0.3 m. However,
a higher CoM in turn requires larger translations of the base to move under
the CoM for a given nonzero θp , and a higher CoM increases the inertia of the
pendulum, reducing the ability of the system to control θ̈p directly through the
61
Chapter 3 The Collinear Mecanum Drive
20
hp =0
hp = 0.008
10 hp = 0.02
hp = 0.04
v̇y (m s−2 )
hp = 0.07
0 hp = 0.12
hp = 0.19
hp = 0.31
−10 hp = 0.5
hp = 0.8
hp = 1.3
−20
−π/2 −π/4 0 π/4 π/2
θp (rad)
Figure 3.10: v̇y over θp for varying positive hp , with wheel torques controlled
such that θ̈p = 0.
body reaction torque applied by the wheel motors. These effects result in the
pendulum base having to make greater corrective movements to maintain balance
during disturbance.
62
3.4 Conclusion
shown that motor selection can have a significant impact on overall translational
efficiency, and that there exists complex coupled interactions between the selec-
tion of each parameter and these differing views of optimality. The conclusion
to be drawn is therefore that the robot designer should perform a simultaneous
end-to-end optimisation of all CMD and motor parameters for each specific CMD
application.
As all of these conclusions are subject to modelling accuracy, a future effort
should be made to undertake a full system identification of a Mecanum wheel in
order to ensure that the linear friction models used in this thesis are of sufficient
accuracy for the analyses in this section to remain accurate. It may be that
friction in other interfaces yield significant unmodelled dynamics that would alter
these results, such as friction between the roller and its mounting during axial
roller loading.
3.4 Conclusion
This chapter has introduced the Collinear Mecanum Drive, a novel dynamically
balancing omnidirectional locomotion system. It has derived the CMD’s inverse
kinematic and dynamics models, analysed the CMD in terms of controllability
and accessibility, has analysed the CMD’s underactuation characteristics, and has
determined the size of the largest feedback linearisable subsystem. It has then
explored the effect of parameter selection on control authority, achievable accel-
erations in the presence of wheel torque constraints, and translation efficiency,
granting insight toward good CMD design practice.
63
Chapter 4
This chapter serves to detail the reasoning and methodology behind the design and
construction of a Collinear Mecanum Drive prototype, which is to be used for the
experimental validation of the control and trajectory planning techniques developed
throughout the rest of this thesis. Where necessary, experimental methods are
described for the measurement of unknown model parameters, and an online
nonlinear full-state estimator is derived and demonstrated.
65
Chapter 4 A CMD Experimental Prototype
Figure 4.1: The proof-of-concept prototype created at the beginning of this PhD.
This did not incorporate any form of suspension, and so suffered from constant
wheel slip, used geared brushed motors with a large amount of backlash, and
used external encoders with a custom coupling, introducing measurement error.
invention, but suffered from many undesirable nonlinearities, preventing this pro-
totyping from achieving good performance or being accurately described by the
derived dynamics model.
• No backlash between the wheel and motor, and purely viscous motor bear-
ing friction.
• Mecanum wheels with perfectly circular profiles, and with minimal roller
bearing friction that is purely viscous.
66
4.2 Prototype 2 - An Ideal Research Platform
67
Chapter 4 A CMD Experimental Prototype
Figure 4.3: The Collinear Mecanum Drive experimental prototype used in this
thesis. This features passive weight-distributing suspension and direct-drive
brushless motors with integrated high precision encoders, overcoming the main
actuation and sensing shortcomings of the proof-of-concept prototype. Compute
is provided by both a National Instruments myRIO for low-level control, and an
Intel NUC with an i7-8650U processor for high-level planning.
68
4.2 Prototype 2 - An Ideal Research Platform
Figure 4.4: A close-up image of the drive assembly of the prototype in Figure 4.3.
Visible in each of the four wheel assemblies is a brushless DC motor, attached to
a suspended mounting plate and bearing assembly, with its shaft directly coupled
to a 60 mm Mecanum wheel.
69
4.2 Prototype 2 - An Ideal Research Platform
Table 4.1: Motor parameters for that used in the prototype in Figure 4.3
Parameter Value Unit
Nominal voltage 24 V
No-load speed 6110 rev/min
Nominal speed 4860 rev/min
Nominal torque 128 mN m
Nominal current 3.21 A
Stall torque 1460 mN m
Stall current 39.5 A
Terminal resistance 0.608 Ω
Torque constant 36.9 mN m A−1
Speed constant 259 rev/min/V
Number of pole pairs 8
Encoder precision 2048 steps/rev
error. As this application requires operation around zero speed Hall effect sensors
are also required. Finally, given the collinear arrangement of wheels a low motor
length is desirable to reduce the overall size of the prototype.
This specification makes external rotor brushless motors attractive, as this
topology yields a higher torque-to-weight ratio than internal rotor motors, typical
exhibits low torque ripple due to a larger number of pole-pairs, are more efficient
at the low speeds used in this application, and often have larger diameter to
length ratios. An external rotor brushless sensored motor from Maxon Motor is
chosen, with model number 397172 and specification given in Table 4.1.
71
Chapter 4 A CMD Experimental Prototype
Motor controllers are required to drive the phase currents of each of the motors to
that specified by given setpoints, along with performing electronic commutation.
This control is to be as aggressive and with as little transport delay as possible
so as to allow for maximum control bandwidth. Whilst this will come at an
expense of increased power consumption, gains can be reduced for a particular
application and desired control performance if necessary. As similar systems such
as quadcopters perform control at update rates of around 400 Hz [94], a motor
current loop update rate of at least an order of magnitude greater frequency is
required. The controller must have a rated current of at least the nominal current
of the chosen motor.
Maxon ESCON 50/5 controllers are therefore chosen, rated at 5 A. These take
an analogue reference signal with 12 bit resolution, and perform PI current control
with a loop rate of 54 kHz. Motor current response to small and large reference
signals is shown in Figure 4.6, using proportional gain Kp = 250 and integral
time constant τi = 350 µs. Whilst ideally these results would demonstrate a
worst case rise time of less than 10% of the system’s maximum control update
rate, in practice this cannot be achieved without introducing excessive noise
into the motor phase currents. As the absolute worst case rise time is close
to this target at 20% of the control period, and as the more typical smaller
setpoint change achieves a rise time of 5% of the maximum control update rate,
it is decided that this controller demonstrates sufficiently high bandwidth torque
setpoint tracking to validate the assumption of instantaneous torque setpoint,
with the knowledge that the maximum achievable system control aggressiveness
will be slightly reduced.
72
4.2 Prototype 2 - An Ideal Research Platform
Im Iref Im Iref
0.4
2 0.2
Current (A)
Current (A)
0 0
−2 −0.2
−0.4
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
t (s) ·10−2 t (s) ·10−2
(a) τr = ±0.1 N m (b) τr = ±0.01 N m
Figure 4.6: Motor current setpoints Iref and tracked trajectories Im for ±0.1 N m
(a) and ±0.01 N m (b) 100 Hz square wave torque setpoints, showing a constant
130 µs transport delay within the motor controller and a 486 µs worst case rise
time.
4.2.7 Compute
Data acquisition, state estimation, low-level control, and telemetry are performed
using a National Instruments myRIO [96]. This features an ARM A9 processor
and a field programmable gate array (FPGA), interfaced by a high speed inter-
connect. Data acquisition and filtering is performed entirely on the FPGA for
minimum jitter, with all remaining tasks performed within Labview RT, running
73
Chapter 4 A CMD Experimental Prototype
74
4.3 Motor Cogging Torque and Kinetic Friction Compensation
Intel
NUC
Ethernet
WiFi
Desktop & ROS myRIO ARM
PC Cortex-A9
AXI Interconnect
SPI MPU9250
myRIO FPGA
IMU
A/D IO
Wheel
Motors
θe
~ ~a, θe
Ω,
State
τ Control
p̃, ṽ Estimation
pr , vr
Figure 4.8: Control diagram for the Collinear Mecanum Drive prototype
75
Chapter 4 A CMD Experimental Prototype
·10−3
τc,1 (θ1 ) fτc,1 (θ1 ) τc,1
5 10 τc,2
τc,4
5
0
0
0 π/2 0 20 40 60 80
θ1 (rad) θ−1 (rev−1 )
(a) (b)
Figure 4.9: Raw cogging torque τc,1 data for θ1 ∈ [0, π/2] (a, blue), the Fourier
transform of this data for all four wheels (b), and the resulting cogging torque
prediction function derived by the selection of dominant frequency components
from the FFT for τc,1 (a, red).
3.5
Velocity (rad s−1 )
2.5
θ̇
2 θ̇r
0 2 4 6 8 10 12 14 16
t (s)
Figure 4.10: Wheel angular velocity whilst running a closed-loop PI speed con-
troller, with proportional gain Kp = 1, integral time constant τi = 6 s, and con-
stant setpoint θ̇r = 3 rad s−1 , in which cogging torque compensation is enabled
until t = 8 s.
76
4.3 Motor Cogging Torque and Kinetic Friction Compensation
The angular position setpoint is slowly ramped through θ ∈ [0, 2π], such that mo-
tor dynamics have minimal effect on the output response, and so that a steady
state is achieved for every encoder position. The resulting steady state torque
achieved is therefore that required to hold the rotor in position against the cog-
ging torque, providing a measurement at each encoder position. This is averaged
over equal numbers of forward and backward rotations to eliminate static and
kinetic friction effects, and to reduce the impact of tracking error on fitting ac-
curacy, with the resulting function for wheel 1 shown in Figure 4.9a, and in the
frequency domain for all wheels in Figure 4.9b. The FFT shows a frequency
component at 48 cycles/rev with equal magnitude for all wheels, representing six
cogging steps per electrical revolution multiplied by the eight pole pairs of the
motors. A number of other components exist at factors of this frequency with
varying amplitudes, capturing unique variations in motor construction, neces-
sitating individualised cogging torque models. The cogging torque function is
determined by selecting only the dominant frequencies from the FFT. No effort
is made to compensate for friction at this point, as this is dependent on direc-
tion of rotation and wheel loading. Figure 4.10 shows motor angular velocity
under a closed-loop PI controller, with a slow constant setpoint of θ̇r = 3 rad s−1 .
Cogging torque compensation is enabled until t = 8 s, from which a decrease in
tracking performance. This serves to demonstrate the effectiveness and value of
this compensation.
Once cogging torque can be assumed to be eliminated, it is possible to com-
pensate for kinetic friction in the motor bearings, modelled as the discontinuous
torque
τk = − sgn(θ̇)FN µk (4.3.1)
where FN denotes the normal force acting through the wheel, and µk the coeffi-
cient of kinetic friction.
Measurement of this torque can be performed by applying an increasing drive
torque to a free-spinning wheel, with τk identified as the torque at which an
initially slowly spinning wheel exhibits only a very slow exponential deceleration.
In order to correctly approximate FN whilst allowing the wheel to spin free, a
mass of mp/4 is attached to the motor in the place of the wheel. This finds a
kinetic friction torque of τk = 3.5 mN m, a 3.5% error over the full torque range,
proportionally a much larger error over the small range of torques required to
77
Chapter 4 A CMD Experimental Prototype
78
4.4 Parameter Estimation
100 θ̇1
θ̇2
|θ̇i | (rad s−1 ) 80
θ̇3
60 θ̇4
40
20
0.5 1 1.5 2 2.5 3
|τss | (N m) ·10−3
Figure 4.11: Steady state wheel angular velocities over a slowly ramping torque
input for both rotation directions. The gradient of this data represents the wheel
viscous friction coefficient kvw .
4
rw X
krw = −kvw + τi (4.4.2)
4vy
i=1
which using the steady state data from the experiment shown in Figure 4.12 and
the previously measured value for kvw yields krw = 1.97 × 10−4 N s.
With krw known, this procedure can be completed for a constant velocity
79
Chapter 4 A CMD Experimental Prototype
τ1 τ2
vy θp τ3 τ4
·10−2
vy (m s−1 ), θp (rad)
1 5
τ (N m)
0 0
−1 −5
0 5 10 0 5 10
t (s) t (s)
(a) (b)
Figure 4.12: Velocity (a) and torque data (b) for a translation y = [0, 3, 0], in
which a constant velocity is attained for the majority of each movement.
to calculate kvr as
80
4.4 Parameter Estimation
τ1 τ2
vx τ3 τ4
·10−2
1
0.05
vx (m s−1 )
τ (N m)
0 0
-0.05
−1
0 2 4 6 8 10 0 2 4 6 8 10
t (s) t (s)
(a) (b)
Figure 4.13: Velocity (a) and torque data (b) for a translation x = [0, 3, 0], in
which a constant velocity is attained for the majority of each movement.
somewhere along b̂z . This assumption has already been included in the derivation
of the dynamics model, with the position of the center of mass on b̂z parametrised
as hp .
Suspending the prototype from a single point will therefore yield a vector that
intersects b̂z , allowing measurement of the overall system’s center of mass hcm .
This experiment is performed twice for two different suspension points, shown in
Figure 4.14, with both experiments yielding hcm = 0.072 m.
Knowing the mass and location of the wheels, it is then possible to calculate
the location of the pendulum’s center of mass hp as
4mw hcm
hp = + hcm (4.4.6)
mp
Rigidly fixing the prototype’s wheels and inverting it to allow free rotation of
the body about and beneath the wheel axis allows the dynamics model to be
simplified to that of a physical pendulum as
81
Chapter 4 A CMD Experimental Prototype
(a) (b)
As accurate identification of Ipy and Ipz is a less critical requirement for good
control performance, these are simply estimated by modelling the prototype as
a solid cuboid as
1 1
Ipy = mp (w2 + h2 ), Ipz = mp (w2 + d2 ) (4.4.8)
12 12
where w, d, h denote the bounding width, depth, and height of the prototype
respectively, given in Table 4.2.
82
4.4 Parameter Estimation
θp
θp (rad) 0.5 θ̃p
−0.5
Figure 4.15: Experimental data θp (t) from physical pendulum experiment (blue),
with the response predicted by the fitted physical pendulum model (4.4.7) θ̃p
(red), achieving a 99.1% fit. θp is normalised about the pendulum stable equilib-
rium.
τ + τv + τk
θ̈w = (4.4.9)
Iwx
to be used for estimation. Figure 4.16 shows a dataset generated by this method,
in which measurements taken around θ̇ = 0 are removed due to inaccurate speed
measurement at this point. The gradient of a linear fitting of this data represents
−1 , yielding I −5 kg m2 .
Iwx wx = 5.12 × 10
The resulting experimentally estimated parameters and their CAD derived values
are given in Table 4.2. The CAD model, shown in Figure 4.17, includes all
83
Chapter 4 A CMD Experimental Prototype
1,300
1,100
Figure 4.16: Wheel angular acceleration over viscous and kinetic friction com-
pensated torque for τ = ±0.06 N m, along with the linear fit representing an
estimate of Iwx , in which intersection with the origin is enforced.
of the main system components, but omits minor complex parts such as cable
assemblies. This results in an overall mass difference of 0.1 kg, with similar
differences in center of mass height and pendulum inertia. A comparison of these
values shows a close fit, which is assumed to sufficiently verify the validity of the
experimental methods used.
4.5 Sensing
None of the system states (p, v) are directly measurable, meaning they must be
estimated using available sensor data. This data is provided by the following
sources:
Each Mecanum wheel motor is equipped with a 2048 count/rev incremental quad-
rature encoder. This provides two square waves in quadrature that can be used to
measure a relative change in angular position. These sensors exhibit no drift, and
only a small amount of quantization error. This angular position measurement
θei is relative to the pendulum body as
θei = θi − θp + ωi (4.5.1)
84
4.5 Sensing
Table 4.2: Table of experimentally and CAD derived parameters for the prototype
depicted in Figure 4.3.
Experimentally Measured CAD Derived
Parameter Unit
Value Value
α1 , α 3 rad N/A π/4
4.5.2 Gyroscopes
85
Chapter 4 A CMD Experimental Prototype
Figure 4.17: CMD CAD model from which parameter verification values are
derived. Only components which are straightforward to model are included, i.e.
parts such as cabling are omitted.
additive Gaussian white noise of variance σg2 . These sensors also suffer from axis
misalignment, meaning the gyroscope axes are only approximately orthogonal to
one another, along with the IMU package axes not being perfectly aligned with
that of the body, presenting as a ‘cross-talk’ when performing rotations exactly
about each of the body axes. For the MPU9250 this cross-axis sensitivity is
reported as typically ±2 % [95], which combined with package mounting error
can yield a significant overall misalignment. A scale error is also present, for the
MPU9250 reported as ±3 % at 25 ◦C. Combining these error sources gives the
linear sensor model mapping measured angular rates Ω
~ m to true rates Ω
~ as
Ωp 1 Mpq Mpr 1/Sp 0 0 Ωm,p − bp
~ = Ωq = Mqp
Ω 1 Mqr 0 1/Sq 0 Ωm,q − bq (4.5.2)
86
4.5 Sensing
3π θb
ψb
Position (rad) 2π φb
θa
π ψa
φa
0
−π
−2π
0 50 100 150 200
t (s)
ture, largely follow a random walk about zero, and therefore cannot be calibrated
offline. Scale and cross-axis misalignment errors, however, are relatively time in-
variant, and can be measured by rotating the sensor at known angular rates
exactly about each of the body frame axes. This requires the use of a rate table,
an expensive piece of test equipment, so this could not be performed. Instead,
the system is rotated exactly about its body axes whilst recording angular rate
data, which is then integrated to provide a measurement of each rotation an-
gle. Comparison of this with knowledge of the exact angle through which the
system was rotated allows an estimation of these scale and misalignment error
matrices. This experiment is shown in Figure 4.18, with measured angles pre-
and post-calibration. A significant misalignment error is visible in the ψ angle,
corresponding to the Ωq gyroscope, and small scale errors are visible in all three
sensors. The calibrated data shows these errors have been eliminated, with no
visible cross-coupling remaining.
87
Chapter 4 A CMD Experimental Prototype
1.08
kam k
1.06 kak
Acceleration (gm/s2 )
1.04
1.02
0.98
0.96
0 10 20 30 40 50 60 70 80
t (s)
Figure 4.19: The norms of a set of acceleration data pre- (blue) and post-
calibration (red). This data was gathered by slowly rotating the platform through
a wide range of angles to provide a measurement of g from all orientations, The
data is normalised to g and smoothed for readability.
4.5.3 Accelerometers
noisy due to mechanical vibration of the system when in motion, with this noise
source modelled as an additive white noise of variance σa2 . Accelerometers are
also affected by cross-axis misalignment, scale, and bias errors. These errors are
relatively time and temperature invariant, allowing a fixed compensation. The
measured accelerometer reading ~am is therefore mapped to the true reading ~a
using a similar linear sensor model
ax 1 Mxy Mxz 1/Sx 0 0 am,x − bx
~a = ay = Myx 1 Myz 0 1/Sy 0 am,y − by (4.5.3)
88
4.6 State Estimation
89
Chapter 4 A CMD Experimental Prototype
For these reasons, these approaches are typically superseded by observer and
estimation methods [33]. These methods model wheel velocity as an internal
state, which is continuously integrated to give a position estimate that can be
compared with the true measurement returned by the encoder. An error in this
comparison indicates an incorrect estimate of θ̇i , which can be used to recursively
update θ̇i until this error is eliminated. These methods are able to provide
estimates at a fast fixed update rate, and are able to provide high resolution
estimates even at very low or zero speed.
Rather than directly estimating each of θ̇i , here body velocities vx , vy , and φ̇
are modelled as internal states instead, which can then be integrated with each
iteration to give estimates of x, y, and φ. By the inverse kinematics model (3.1.8)
these body velocities can be uniquely mapped to equivalent wheel velocities, that
can in turn be integrated to give an expected change in wheel position over
each estimator timestep ∆θei . This can then be compared with the measured
difference in wheel position between this and the previous iteration, providing an
error signal that can be used to correct the estimate of (vx , vy , φ̇).
90
4.6 State Estimation
φb k
φbk−1 + δtk φ̇k−1
However, this method is found to yield excessive position estimate drift unless a
very short velocity estimator time constant is used, which in turn yields excessive
velocity estimate noise. A position estimate with less drift can instead be derived
by discrete integration of the inertial frame inverse kinematics model evaluated
91
Chapter 4 A CMD Experimental Prototype
at a time-varying φ as
The wheel encoders and inverse kinematics model alone are not able to provide
an estimate of θp . Biased measurements of φ̇ and θ̇p can be obtained by rotation
of Ω by Rbp , and it is known that no rotation occurs about b̂y when assuming
92
4.6 State Estimation
φ̇ br
Ωp − bp
= cos(θp )(Ωq − bq ) − sin(θp )(Ωr − br ) (4.6.7)
While φ̇ and θ̇p could be modelled as internal states to allow for filtering of
gyroscope noise, this is instead assumed to be sufficiently performed by the FPGA
low-pass filter, leaving a noise-free but biased signal.
Determination of gyroscope biases and elimination of integral drift in the esti-
mates of φ and θp each require the incorporation of an additional measurement.
A measurement of θp can be calculated by comparison of the measured body
T . From (4.6.6),
acceleration vector with that expected by a rotation of ~g by Rbp
when θp = 0 a measurement of bq is available, distorted by noise due to non-level
terrain. No measurement of φ is available to eliminate integral drift when θp = 0,
and the inverse kinematics derived measurement of φ̇ is found to suffer from a
greater time varying bias than Ωr , so this cannot be used to improve the estimate
of br . This bias is therefore unobservable, and must be set to a constant value
measured while the system is stationary, and so the estimate of φ will always be
93
Chapter 4 A CMD Experimental Prototype
94
4.7 Conclusion
Rows of R that map to wheel encoder angular positions are chosen to reflect
encoder quantization noise and uncertainty in the inverse kinematics model due
to imperfect wheel geometry and unmodelled effects such as backlash in the
roller mountings and wheel slip. This is therefore chosen by trial and error until
desirable body velocity estimates are achieved. Rows of R that map to ãy and
ãz partially represent intrinsic sensor noise in the accelerometers, but are mostly
dominated by noise due to vibration and dynamic acceleration of the system.
These are therefore tuned in tandem with Q to ensure suitable time constants
for the estimation of the gyroscope biases and sufficiently fast correction of drift
of the estimate of θp , whilst avoiding the coupling of any noticeable amount of
accelerometer noise into these estimates. These elements are scaled by the factor
1 + eK kak2 −g , where K 1, such that the accelerometer is trusted less when
acceleration other than that due to gravity is measured. Finally, the element of
R mapping to bbq is chosen to ensure a desirable rate of convergence of bbq → bq .
Figure 4.20 shows the output of this estimator for a set of experimental data.
This experiment starts with the system lying down, with a movement at t = 3.5 s
to a known upright position. This is maintained until t = 20 s, before random
movements in all states are performed until t = 68 s, ending at the same location
as at t = 20 s. This shows a total position drift due to dead reckoning error of
0.073 m. This increases to 0.094 m if φ is derived from the inverse kinematics
model rather than the gyroscopes. The plot of φ contains a second trajectory
φb , representing the φ estimate generated when assuming bq = 0, demonstrating
the value in estimating this bias. θp is seen to quickly converge to the correct
estimate from the origin, with all of the integral drift visible in the raw integral
of Ωp eliminated. Gyroscope bias estimates bbp and bbq show mostly monotonically
decreasing variances, converging to nearly constant values as intended.
4.7 Conclusion
This chapter has described the reasoning and methodology behind the design
and construction of a Collinear Mecanum Drive prototype. Methods for the
compensation of undesirable actuation nonlinearities are presented, allowing the
assumption minimal input model mismatch. A methodology for the experimental
measurement of all model parameters for a given CMD has been demonstrated,
95
Chapter 4 A CMD Experimental Prototype
x
0.4 y
Position
(m)
0.2
0
−0.2
φ
Heading
0 φb
(rad)
−2
−4
0.4 vx
vy
Velocity
(m s−1 )
0.2
0
−0.2
−0.4
2
θp
Pitch (rad)
R
1 Ωp
0
Bias (rad s−1 )
bp
Gyroscope
0.2 bq
101 Var(θbp )
rad2 s−2 )
Variance
(rad2 ,
Var(bbp )
10−2
Var(bbq )
10−5
0 10 20 30 40 50 60 70 80
t (s)
Figure 4.20: State estimation data gathered by moving the system through a
range of random trajectories, with the same real-world position and pose main-
tained at t = 20 s and t ≥ 68 s to allow a measurement of dead reckoning drift.
φb shows an estimate of φ generated whilst forcing bq ≡ 0, demonstrating the
value of estimating bq . Similar, plot 4 shows both θbp and an estimate achieved
by integration of Ωp , demonstrating rapid divergence due to gyroscope bias and
integral drift. All states are initialised at the origin, and the EKF covariance
matrix is initialised to P0 = I5×5 × 102 to represent unknown initial conditions.
96
4.7 Conclusion
with the results of this verified by comparison with that expected from a CAD
model of the prototype. Finally, the sensor calibration and state estimation
methods necessary for the accurate online estimation of the full system state
from distorted sensor data has been derived and demonstrated experimentally.
It is therefore assumed that the prototype developed in this chapter accurately
fits the model derived in Chapter 3. This will allow for the meaningful experi-
mental evaluation of control and trajectory planning techniques developed in the
remainder of this thesis.
97
Chapter 5
Nonlinear Control
This chapter introduces the first of three control methods explored in this thesis.
The CMD is first locally partially feedback linearised by a local state space diffeo-
morphism and nonlinear feedback, expressing the system dynamics as five linear
and three nonlinear ODEs with three new inputs. Three nonlinear controllers are
then derived using a backstepping approach, controlling system local body frame
velocities, inertial frame body velocities, and global Cartesian position. Lya-
punov functions are derived for all three controllers to guarantee stability, and
asymptotic convergence to the desired references from a bounded set of initial
states is proven. These controllers are evaluated in both simulation and on the
experimental prototype.
99
Chapter 5 Nonlinear Control
yield systems that contain zero dynamics, new states and dynamics that are
unobservable from the new outputs, which may be unstable. In practise it can
be dangerous for these unobservable states to be allowed to grow unboundedly,
so their behaviour must be considered during control design.
These techniques have been applied to various forms of inverted pendulum,
such as the single and double cart-pole inverted pendulums [99,100], the reaction
wheel inverted pendulum [101], the acrobot [102, 103], and most relevantly, the
two-wheeled inverted pendulum [51, 56, 104]. Partial feedback linearisation has
also been utilised in the control of quadrotors [105, 106]. These methods have
never been applied to a ball-balancing system. As all of these systems are under-
actuated only partial feedback linearisation is achieved, with nonlinear controllers
subsequently designed to control the remaining nonlinear dynamics.
is nonsingular for |θp | . 2.39 rad using the parameters in Table 4.2, and is there-
fore invertible under this condition, allowing the definition of the new input vector
fields
03×4
T
g˜1 1 0 0
(5.1.2)
g˜2 =
g̃16 g̃26 g̃36
g˜3 0 1 0
0 0 1
where
T T
g̃16 g16
g̃26 = g26 P
−1
(5.1.3)
g̃36 g36
100
5.1 Partial Feedback Linearisation
in which (g̃16 , g̃26 ) = 0 for the parameters in Table 4.2, and g̃36 is scalar valued
function that is again smooth for |θp | . 2.39 rad. The ẋ5 , ẋ7 , and ẋ8 subsystems
can then be linearised by the feedback
v1 = w1 − f5 (x)
v2 = w2 − f7 (x) (5.1.4)
v3 = w3 − f8 (x)
in which w = w1 w2 w3 is used as the new input, yielding the new drift and
T
(5.1.6)
g˜2 (x4 ) =
g̃16 (x4 ) g̃26 (x4 ) g̃36 (x4 )
g˜3 (x4 ) 0 1 0
0 0 1
In order for the coordinates x to fully span R8 they must be linearly indepen-
dent, meaning their gradients ẋ must be linearly independent of one another [89].
Clearly in (5.1.5) this property has been lost, as ẋ6 is now a linear function of ẋ5 ,
ẋ7 , and ẋ8 . A state transformation T : x → z is therefore required to transform
x into some new set of linearly independent coordinates z as z = T(x). As ẋi for
i = [1 . . 5, 7, 8] are already linearly independent, these can be mapped as zi = xi .
101
Chapter 5 Nonlinear Control
T
g˜1 (x4 )
∂z6
g˜2 (x4 ) = 0 (5.1.7)
∂x
g˜3 (x4 )
α5 + α6 g̃16 = 0
α7 + α6 g̃26 = 0 (5.1.8)
α8 + α6 g̃36 = 0
102
5.1 Partial Feedback Linearisation
which when substituted with differentials of x from (5.1.5) yields the new set of
dynamic equations
ż1 = cos(z3 )z5 − sin(z3 )(z6 + z5 g̃16 (z) + z7 g̃26 (z) + z8 g̃36 (z)) (5.1.14)
ż2 = sin(z3 )z5 + cos(z3 )(z6 + z5 g̃16 (z) + z7 g̃26 (z) + z8 g̃36 (z)) (5.1.15)
ż3 = z7 (5.1.16)
ż4 = z8 (5.1.17)
ż5 = w1 (5.1.18)
ż6 = f6 (z) − g̃16 (z4 )f5 (z) − g̃26 (z4 )f7 (z) − g̃36 (z4 )f8 (z)
∂g̃16 (z) ∂g̃26 (z) ∂g̃36 (z)
− z5 − z7 − z8 (5.1.19)
∂z4 ∂z4 ∂z4
ż7 = w2 (5.1.20)
ż8 = w3 (5.1.21)
where all f (x) and g̃(x) have been rewritten in terms of z using x = T−1 (z).
Under this state transformation and feedback it is evident that w has been elim-
inated from the expression for ż6 , meaning ż6 , ż1 , and ż2 now represent internal
dynamics, and in which ż5 , ż7 , and ż8 are now independent of the drift vector,
and are linear and decoupled in the new input w.
The internal dynamics (5.1.19) are found to contain zeroth to second time
derivatives of θp , and cannot be integrated to eliminate either of these velocity or
acceleration terms. This expression therefore forms a second order nonholonomic
constraint, also referred to as a dynamic constraint.
103
Chapter 5 Nonlinear Control
in which it is clear that the zero dynamics do not have a stable equilibrium for
6 0, and so the system is non-minimum phase [107].
z4 =
To summarise, through input transformation, coordinate transformation, and
nonlinear feedback, the nonlinear system (3.2.35) has been transformed into an
equivalent system of five linear and three nonlinear ODEs, with new input w ≡
v̇x φ̈ θ̈p . Actual motor torques are retrieved by the mapping w → v → u → τ .
T
The simulated response of this system to a 0.25 Hz square wave input of unit
amplitude to each of w is shown in Figure 5.1, demonstrating the correct linear
response of the feedback linearised subsystems vx , φ̇, and θ̇p , and unbounded
growth of vy as expected.
104
5.2 Nonlinear Control of the Partially Feedback Linearised CMD
1 vx
0.5
0 φ̇
−0.5 θ̇p
−1
0 1 2 3 4 5 6 7 8 9 10
0 vy
−10
−20
0 1 2 3 4 5 6 7 8 9 10
1 τ1
τ2
0 τ3
τ4
−1
0 1 2 3 4 5 6 7 8 9 10
t (s)
Figure 5.1: Simulated state trajectories of the partially feedback linearised CMD,
initialised at the origin and with each of w driven by a 0.25 Hz square wave of
unit amplitude. This demonstrates the expected triangular velocity profile in the
vx , φ̇, and θ̇p states, while vy grows unboundedly. τ remains defined throughout
the simulation, as the singularity in (5.1.2) is avoided.
105
Chapter 5 Nonlinear Control
This controller is required to drive the system local body frame velocities (vx , vy , φ̇)
to setpoints (vxr , vyr , φ̇r ). This must be performed whilst bounding deviation of
θp from zero as to avoid attempting to translate using slip-inducing lean angles,
and accelerations v̇x and φ̈ must be bounded to again avoid inducing wheel slip.
By using a backstepping design approach each subsystem can be proven to be
stable by ensuring it can be formulated as a Lyapunov function following loop
closure. With appropriate embedding of constraints and bounding of reference
inputs this allows the design of a controller with an asymptotic stability guarantee
for the full bounded set of references and states.
Control is to be split into two layers. Aggressive control of the θp state is de-
sired to provide resistance to disturbances, especially those generated by varying
106
5.3 Backstepping Control of Local Body Frame Velocities
friction forces when translating in the b̂x direction, so the linear controller
with suitable gains Kθ̇p and Kθp is used to provide global exponential conver-
gence of θp → θpr , where θpr represents a new internal reference signal. As this
subsystem has relatively fast dynamics, and as low-noise measurements of θ̇p and
θp are available, high gains can be used to allow rapid convergence in the region
of 100 ms for large step changes. While linear controllers could also be used to
control the feedback linearised vx and φ̇ subsystems, these are instead to be con-
trolled by the outer loop as to allow the embedding of acceleration constraint
enforcement.
The goal of the outer controller is to generate w1 , w2 , and θpr trajectories that
result in convergence of (vx , vy , φ̇) → (vxr , vyr , φ̇r ) within finite time. Unlike a
TWIP, cross coupling between the (θp , vy ) subsystem and the vx and φ̇ subsys-
tems, for example acceleration forces acting on θp when vx φ̇ 6= 0, means that
θpr 6→ 0 may be required for v̇y → 0 in steady state.
From (5.1.5), acceleration v̇y can be expressed as
v̇y = fv̇y (x, w) = f6 (x) − ĝ16 (x)f5 (x) − ĝ26 (x)f7 (x) − ĝ36 (x)f8 (x)
+ ĝ16 (x)w1 + ĝ26 (x)w2 + ĝ36 (x)w3 (5.3.2)
107
Chapter 5 Nonlinear Control
where cos−1 (−i) = 2.14 rad for the prototype parameters in Table 4.2. By the
intermediate value theorem as long as for a given {x, w3 , v̇y } ∈ R7 × R × R these
two expressions are of opposite sign, there must exist some intermediate value of
θp for which f (x, w, v̇y ) = 0, i.e. a solution to (5.3.3) must exist. This condition
is necessary for there to exist an inverse function θp = fv̇−1
y
(x, w3 , v̇y ) that can be
used to determine the lean angle required to achieve a given v̇y for some state x
and input w, though the existence of this inverse also requires a unique mapping.
The condition under which at least one solution exists can be written as
aw3 − dvy − iv̇y − (i − h) φ̇vx ≤ (bi − e) φ̇2 + f θ̇p2 + g |θp | ≤ π/2 (5.3.6)
It is apparent that the large constant term g on the rhs means this inequality
is satisfied for a large set of accelerations v̇y and w3 , of which the origin is con-
tained strictly within the interior, provided the φ̇vx and vy terms are not driven
excessively large. Satisfaction of this condition can therefore be guaranteed by
suitably bounding the user reference inputs v̇xr and φ̇r , whilst ensuring controller
selection as to apply a suitable bound to w3 and v̇y . While technically a larger
108
5.3 Backstepping Control of Local Body Frame Velocities
feasible set could be achieved by allowing |θp | < cos−1 (i), as this requires inter-
section with the pendulum CoM and the ground this bound on θp is sensible, and
simplifies analysis.
It is found that
∂ v̇y cos(θp ) −eφ̇2 + f θ̇p2 + g
=− − bφ̇2 cos(θp )
∂θp i + cos(θp )
sin(θp )2 −eφ̇2 + f θ̇p2 + g − cw3 + dvy − hφ̇vx
− (5.3.7)
(i + cos(θp ))2
cos(θp ) f θ̇p2 + g sin(θp )2 f θ̇p2 + g + dvy
+ bφ̇2 cos(θp ) +
i + cos(θp ) (i + cos(θp ))2
cos(θp )eφ̇2 sin(θp )2 eφ̇2 + cw3 + hφ̇vx
> + (5.3.8)
i + cos(θp ) (i + cos(θp ))2
109
Chapter 5 Nonlinear Control
40
20
v̇y (m s−1 )
0
−20
−40
−π/2 −π/4 0
θp (rad)
Figure 5.2: Forward acceleration v̇y over θp = [−2.14, 2.14] for 20 samples of
x and w3 taken from a zero mean normal distribution of standard deviation 3.
Note how some curves do not intersect v̇y = 0 within θp ∈ [−π/2, π/2], meaning a
steady state value of vy cannot be achieved for these particular choices of x and
w. The monotonicity of (5.3.2) demonstrated in (5.3.7) is clearly visible in all
curves.
110
5.3 Backstepping Control of Local Body Frame Velocities
For this controller it is desired for the system’s local frame body velocities
to converge to some user controlled reference velocities vxr , vyr , and φ̇r , with
no interest in position states other than θp . Defining the reduced state vector
and examining x̃˙ = 0 in (5.1.5) shows these equilibria
T
x̃ = θp vx vy φ̇ θ̇p
exist at any w = 0, θ̇p = 0, {vx , vy , φ̇} ∈ Ass , where Ass is defined as the set of
{vx , vy , φ̇} for which solutions to fv̇y,ss (x) = 0 exist. A cross-section of this set
is shown in Figure 5.3, taken through vx and φ̇ for vy = 0, with parameters from
Table 4.2. Note while a vy term does feature in fv̇y,ss , it vanishes when friction
is negated and has a very small coefficient, and so does not represent significant
dynamics. This cross-section is therefore relatively invariant in vy , and in reality
a sufficiently large vy φ̇ term would result in rotation of the system about b̂y and
a subsequent loss of traction long before the shape of this figure is significantly
altered.
To summarise, a steady state equilibrium can be obtained for any {vx , vy , φ̇} ∈
Ass , where Ass is a large set centered about the origin. It is therefore feasible for
this controller to achieve {vx , vy , φ̇} → {vxr , vyr , φ̇r } as t → ∞, i.e. asymptotic
tracking of local body frame velocity references is feasible.
111
5.3 Backstepping Control of Local Body Frame Velocities
by inspection is radially unbounded for states within the constrained set, but
is bounded for θpr → ∞ as the first term of (5.3.11) converges to 1. As these
conditions are not met for states outside of the constraints, care must be taken
to initialise the system with constraints satisfied, i.e. the controller is not able
to recover from a constraint violation. However, as the constrained signals exist
purely internally this will never occur. The inverse function f˙−1 (0) in (5.3.12) v̇y,ss
can be calculated as
dfv̇y,ss
f˙v̇−1 (0) = (5.3.13)
y,ss
dt θp =fv̇−1 (0)
y,ss
This represents the rate of change in the target steady state lean angle θp,ss due
to time variation of vx , vy , and φ̇.
113
Chapter 5 Nonlinear Control
10
V (θpr )
5
(5.3.15)
2
ẇ1 = −Kw1 w1 + Kv (vxr − vx ) w21 − w12
(5.3.16)
2
ẇ2 = −Kw2 w2 + Kφ̇ (φ̇r − φ̇) w22 − w22
2
2 2
−Kr θpr − fv̇−1
y,ss
(0) f −1
v̇y,ss (0)θpr − θ p
V̇Σ = 2
2 2
θp − θpr
−Kw1 w12 −Kw2 w22
+ 2 + 2 (5.3.17)
w21 − w12 w22 − w22
114
5.3 Backstepping Control of Local Body Frame Velocities
from which it is clear that V̇Σ ≤ 0 for (Kr , Kw1 , Kw2 ) > 0, thus proving closed-
loop stability. This stability proof does, however, require {vxr , vyr , φ̇r } ∈ Ass ,
x0 ∈ Ass , and x ∈ Ass : |θp | ≤ θp ∀ t. While the first two conditions can
115
Chapter 5 Nonlinear Control
dfv̇−1 (0)
θp,ss , so = 0, and clearly − dθpr = −1, therefore
y,ss dθ
dθpr pr
df
v̇y,ss (θpr )
dθpr dfv̇y,ss (θpr )
lim ! = lim −
dθpr
θpr →fv̇−1
y,ss
(0) −1
d fv̇y,ss (0)−θpr θpr →fv̇−1
y,ss
(0)
dθpr (5.3.22)
dfv̇y,ss (θpr )
=−
dθpr θpr =fv̇−1 (0)
y,ss
which is clearly a smooth function over the usual interval θpr ∈ − cos−1 (−i),
cos−1 (−i) , therefore (5.3.19) is convergent as θpr → fv̇−1 (0), and thus the
y,ss
Finally, all that remains to be proven is that (5.3.19) does not converge to zero
within the operating region of interest, as if this were the case the third term of
(5.3.14) would vanish at θpr = fv̇−1
y,ss
(0), even if vy 6= vyr . As the first term of this
control law vanishes when w1 = w2 = 0, and the second term also vanishes when
θpr = fv̇−1
y,ss
(0), this would force θ̇pr = 0 ∀ t → ∞, and thus prevent any further
control action even when vy =
6 vyr .
ing that (5.3.23) is either positive or negative definite. This would ensure that
(5.3.23) never evaluates to zero, avoiding the above problem.
116
5.3 Backstepping Control of Local Body Frame Velocities
−5
dfv̇y,ss (θpr )
dθpr
−10
−15
−20
−π/2 −π/4 0 π/4 π/2
θpr (rad)
Figure 5.5: Plot of (5.3.23) over θpr ∈ [− π2 , π2 ] for 1000 uniformly random samples
{vx , vy , φ̇} ∈ Ass . This shows that in practice this function appears to be negative
definite for |θp | / 1.2 rad, {vx , vy , φ̇} ∈ Ass
which is clearly negative definite for θpr ∈ [− π2 , π2 ], indicating that the origin is
contained within the unknown set of {vx , vy , φ̇} for which this condition holds.
The effect of nonzero vx , vy , and φ̇ is examined by evaluating (5.3.23) over θpr ∈
[− π2 , π2 ] for 1000 uniformly random samples {vx , vy , φ̇} ∈ Ass , shown in Figure
5.5. This shows that in practice this function appears to be negative definite for
|θp | / 1.2 rad. This controller therefore remains well defined for all {vx , vy , φ̇} ∈
Ass , |θp | / 1.2 rad. This is a tighter bound on θp than found previously, but still
far larger than is expected to be attained in practice.
As this stability proof relies on the assumption of prior convergence of the
inner θp → θpr control loop, update of the control law (5.3.14) should be avoided
when |θp − θpr | 0. This can be achieved by multiplication of (5.3.14) by the
expression
e−K|θp −θpr | (5.3.25)
117
5.3 Backstepping Control of Local Body Frame Velocities
1 w1
10 w2
0.5
5
vx
0 vy 0
0 1 2 3 4 5 0 1 2 3 4 5
4 0 θp
θpr
−0.2 fv̇−1 (0)
2 yss
−0.4
0 φ̇
−0.6
0 1 2 3 4 5 0 1 2 3 4 5
Figure 5.7: Simulated system state trajectories for a reference (vxr , vyr , φ̇r ) =
(1, 1, 4), initialised at the origin with θp = 0.6, w1 = 2, and w2 = 4. This
shows asymptotic convergence to the reference whilst satisfying θp , w1 , and w2
constraints, with θp correctly converging to the required steady state θp = θp,ss =
fv̇−1
yss
(0). The error θp − θpr remains small, indicating that (5.3.25) functions as
intended and thus the assumption of convergence of this inner loop holds, with
full convergence achieved in steady state.
will always be imperfect and therefore not fully converge. This manifests as a
steady state tracking error θe , i.e. θp → θpr + θe , which due to the propor-
tional feedback term in this controller results in a non-zero steady state w3 , i.e.
6 0. This invalidates the assumption in (5.3.9), yielding the steady
w3 → Kθp θe =
state bias in the solution to fv̇−1
y,ss
, visible in this figure. A significant steady-state
tracking error is visible in the vx → vxr controller, and w1 6→ 0. This again
indicates an error in the feedback linearisation, as while w1 6= 0 the velocity vx
reaches a steady state. This could be addressed by improved friction modelling
in the underlying model, as to predict this force resisting w1 in steady state, or
by some form of integral action.
119
Chapter 5 Nonlinear Control
0.8
vx 10 w1
0.6 vy w2
0.4
5
0.2
0
0
−0.2
0 2 4 6 8 10 0 2 4 6 8 10
0.1
2 θp
0 θpr
1 fv̇−1
y,ss
(0)
−0.1
0 φ̇
−0.2
0 2 4 6 8 10 0 2 4 6 8 10
Figure 5.8: Experimental system state trajectories for a reference (vxr , vyr , φ̇r ) =
(1, 0, 2), initialised at the origin with θp = 0.4, w1 = 3, and w2 = 15. This shows
good tracking of θp → θpr , however, now θpr 6→ fv̇−1 y,ss
(0). This is found to be due
to imperfect tracking within the inner loop yielding a steady state bias in w3 ,
which is in turn due to imperfect feedback lineariisation. A combination of this
and further model error yields a steady state tracking error of the vxr and vyr
references, though in reality this is visually imperceptible.
120
5.4 Backstepping Inertial Frame Velocity Control
For an inertial frame velocity controller it is desired that the inertial frame body
velocities {ẋ, ẏ, φ̇} asymptotically converge to the references {ẋr , ẏr , φ̇r } within
finite time. In steady state the local frame body accelerations must therefore be
purely that due to rotation of inertial frame velocities into the local body frame,
i.e. v̇x = φ̇vy , v̇y = −φ̇vx , and local frame body velocities must be simply a rotation
of the time invariant inertial frame velocity reference into the local frame, so
" # " # " #
vx ẋ cos(φ)ẋ + sin(φ)ẏ
T
= REB = (5.4.1)
vy ẏ − sin(φ)ẋ + cos(φ)ẏ
In steady state it is therefore required that ẋ = ẋr and ẏ = ẏr , which for time
invariant references implies (ẍ, ÿ) → 0. It is also required that φ̇ = φ̇r , so
φ = φ̇r t + φ0 in steady state.
Substituting v̇y in (5.4.2) with (5.3.3), solving again for ẍ ÿ , and equating
T
121
Chapter 5 Nonlinear Control
where
Γ(t) = w3 (c + ai + a cos(θp )) − sin(θp ) g − f θ̇p2 + φ̇2r (e − bi − b cos(θp ))
+ φ̇r ẏr h sin(φ̇r t) − ẏr d cos(φ̇r t) + φ̇r ẋr h cos(φ̇r t) + ẋr d sin(φ̇r t) (5.4.4)
For φ̇r =
6 0 these equalities clearly require Γ(t) = 0, which allows a unique
solution for the required w3 dynamics as
1
w3 = sin(θp ) g + f θ̇p2 + φ̇2r (bi − e + b cos(θp ))
c + a cos(θp ) + ai
!
+ cos(φ̇r t) −φ̇r ẋr h + ẏr d + sin(φ̇r t) −ẋr d − φ̇r ẏr h (5.4.5)
term, which given that this expression is invariant in θp cannot be the case. An
unstable equilibrium can be achieved for the φ̇r = 0 case, as this makes the latter
expression time invariant, allowing a time invariant solution for w3 . The overall
dynamics are therefore unstable for θp ∈ [− π2 , π2 ], meaning that for ẍ = ÿ = 0
to be maintained when φ̇r =
6 0 the system is is forced to violate the constraint
|θp | < π2 , making the asymptotic tracking of constant ẋr and ẏr trajectories with
a time varying heading impossible.
122
5.4 Backstepping Inertial Frame Velocity Control
totic tracking of constant inertial frame velocity references is not possible, and
thus a degree of tracking error is to be expected. As in the body frame velocity
controller it is desired that θp → fv̇−1
y,ss
(−vx φ̇), so a similar energy function to that
in (5.3.11) can be used, though now this will never be perfectly tracked in steady
state. Quadratic energy functions are defined with unique minimums at ẋ = ẋr
and ẏ = ẏr . However, as these minimums no longer represent equilibria of the
system it is expected that the controlled system will follow a periodic trajectory
about these references in steady state, with the characteristics of this limit cycle
tunable by manipulation of control gains. Identical energy functions to that in
(5.3.11) are used to describe a quadratic cost on |φ̇ − φ̇r | and a barrier function
on w2 . A similar barrier function is used to constrain w1 . As the purpose of
this barrier is to constrain wheel torque demands, it makes more sense in this
application to only apply the barrier to forced body acceleration, rather than
also constraining acceleration due to rotation of inertial frame velocities into the
local body frame. The barrier function is therefore chosen to instead enforce
w1 − vy φ̇ < v xf .
These new constraints and quadratic reference tracking costs can be captured
by the Lyapunov function candidate
2
θpr − fv̇−1 (−vx φ̇) Kv (ẋr − ẋ)2 + (ẏr − ẏ)2 Kφ̇ (φ̇r − φ̇)2
y,ss
VΣ =
2
+ +
2 θp − θpr 2 2 2
(w1 − φ̇vy )2 1
+ 2 + (5.4.7)
2 v̇ xf − (w1 − φ̇vy )2 2 w22 − w22
123
Chapter 5 Nonlinear Control
Substituting inertial frame accelerations (ẍ, ÿ) and velocities (ẋ, ẏ) for their body
frame equivalents using
" # " # " #
ẋr vxr cos(φ)vxr − sin(φ)vyr
= REB = (5.4.9)
ẏr vyr sin(φ)vxr + cos(φ)vyr
" # " # " #
ẋ vx cos(φ)vx − sin(φ)vy
= REB = (5.4.10)
ẏ vy sin(φ)vx + cos(φ)vy
" # " #! " #
ẍ d vx (v̇x − vy φ̇) cos(φ) − (v̇y + vx φ̇) sin(φ)
= REB = (5.4.11)
ÿ dt vy (v̇x − vy φ̇) sin(φ) − (v̇y + vx φ̇) cos(φ)
124
5.4 Backstepping Inertial Frame Velocity Control
2
2 2
−Kr θpr − fv̇−1
y,ss
(−vx φ̇) f −1
v̇y,ss (−vx φ̇)θ pr − θ p −Kw2 w22
V̇Σ = 2 + 2
w22 − w22
2 2
θp − θpr
2
−Kw1 v̇ xf (w1 − φ̇vy )2
+ 2 2 (5.4.16)
v̇ xf + φ̇vy − w1 v̇ xf − φ̇vy + w1
from which it is clear that V̇Σ ≤ 0 ∀ {Kr , Kw1 , Kw2 } > 0, thus proving stability
under the assumption that non-zero inertial frame velocities are attainable in
6 0. As from Remark 5 this is not possible, this stability
steady state while φ̇ =
proof is invalidated, though as the necessary resulting limit cycle is expected
to be small it is assumed that this stability proof is still relevant to some de-
gree. Control gains are tuned as to achieve a desirable trade-off between control
performance and minimisation of this periodic error trajectory.
As in the body velocity controller this controller also relies on the assumption
θp = θpr , so update of the control is slowed by multiplying the second and third
terms of (5.4.13) by
e−K|θpr −θp | K1 (5.4.17)
such that the control law is slowed when the inner loop has not converged, but
without affecting the first term of (5.4.13) that is required to feedforward a nec-
essary variation in θp due to rotation of inertial frame velocities into the local
body frame.
125
Chapter 5 Nonlinear Control
1.5 4
w1 − vx φ̇
w2
1
2
0.5
ẋ
0
0 ẏ
0 2 4 6 0 2 4 6
6 0
4
−0.1 θp
2 θpr
φ̇ fv̇−1
yss
0 −0.2
0 2 4 6 0 2 4 6
Figure 5.10: Simulated system state trajectories for a reference (ẋr , ẏr , φ̇r ) =
(1, 1, 6), with the system initialised at the origin and with θp = 0.4, v̇ xf = 2, and
w2 = 4. w1 − vx φ̇ is shown rather than w1 , as this represents acceleration in the
vx subsystem not due to rotation, and is the value that is constrained. θp is seen
to converge towards fv̇−1yss
(0), though a small tracking error is now observed. This
is due to the infeasibility of asymptotically tracking inertial velocity references,
as well as the now invalid assumption of θp converging to a constant value, i.e.
now θ̇p =6 0, w3 6= 0 in steady state. ẋ and ẏ are seen to converge to a small limit
cycle about the target reference.
Figure 5.10 shows the simulated response of the controlled system to a reference
(ẋr , ẏr , φ̇r ) = (1, 1, 6) with constraints θp = 0.4, v̇ xf = 2, and w2 = 4, with the
system initialised at the origin. This demonstrates convergence to an acceptable
velocity trajectory limit cycle with an RMS error of 4.1%, and satisfaction of
the constraints |θpr | < θpr , |w1 − vx φ̇| < v̇ xf , and |w2 | < w2 . In steady state
θp is seen to closely track fv̇−1
y,ss
(−vx φ̇). Controller parameters are selected to
best demonstrate the controller; more aggressive gains can obtain faster tracking
without significantly altering the limit cycle.
Figure 5.11 shows the experimental response of the prototype to a reference
(ẋr , ẏr , φ̇r ) = (0, 1, 3). Wheel traction limitations necessitate a less aggressive
126
5.4 Backstepping Inertial Frame Velocity Control
15
1 w1 − vx φ̇
10 w2
0.5
0 5
−0.5 ẋ 0
ẏ
−1 −5
0 2 4 6 8 0 2 4 6 8
t(s) t(s)
4
θp
θpr
0.2
2 fv̇−1
yss
(−vx φ̇)
0 0
φ̇
0 2 4 6 8 0 2 4 6 8
t(s) t(s)
Figure 5.11: Experimental system state trajectories for a reference (ẋr , ẏr , φ̇r ) =
(0, 1, 3), with the system initialised at the origin and with θp = 0.4, v̇ xf = 2, and
w2 = 15. w1 − vx φ̇ is shown rather than w1 , as this represents acceleration in the
vx subsystem not due to rotation, and is the value that is constrained. RMS ẋ
and ẏ tracking errors of 4.2% and 7.1% are visible, due to a combination of the
infeasibility of perfect tracking, imperfect feedback linearisation, and modelling
error in the outer control laws.
reference than that in Figure 5.10. This experiment highlights a weakness in this
controller; just as selection of controller gains affects the system’s resulting limit
cycle, this is also influenced by imperfect feedback linearisation and modelling
error in the control laws, yielding larger periodic velocity tracking errors, with
RMS errors of 10.8% and 7.8% respectively. From observation it is believed that
the main influencing unmodelled dynamic is related to friction in the Mecanum
wheel rollers, which in practise will not be perfectly modelled by the linear friction
models used in this thesis. Figure 5.12 uses a long exposure image to demonstrate
this experiment.
127
Chapter 5 Nonlinear Control
Figure 5.12: A long exposure image of the trajectory in Figure 5.11, in which
two blue LEDs are used to capture the experimentally tracked path.
128
5.5 Backstepping Global Position Control
in which convergence of the lower velocity controller is assumed such that ẋ = ẋr ,
ẏ = ẏr , φ̇ = φ̇r . The first two terms of (5.5.1) define a cost quadratic in position
error, the third term forms a barrier function enforcing the constraint ẋ2r +ẏr2 < v 2 ,
with a unique minimum at ẋr = ẏr = 0, and the last term enforces |φ̇| < φ̇r with
a unique minimum at φ̇r = 0.
(5.5.3)
2
ẍr = −Kvr ẋr + v 2 − ẋ2r − ẏr2 Kp (pxr − x)
(5.5.4)
2
ÿr = −Kvr ẏr + v 2 − ẋ2r − ẏr2 Kp (pyr − y)
2
φ̈r = −Kφ̇ φ̇r + (φ̇2r − φ̇r )2 Kφ (pφr − φ) (5.5.5)
from which is it clear that V̇Σ ≤ 0 ∀ {Kvr , Kφ̇r } > 0, and that V̇Σ = 0 has
a unique solution at the desired steady state, proving stability. Similar to the
velocity controller, update of each control law is slowed by multiplication with
terms of the form
e−K|ẋr −ẋ| K1 (5.5.7)
Figure 5.13 shows the simulated response of the above controller to the ref-
erence (pxr , pyr , pφr ) = (2, 2, 2π), with the system initialised at the origin and
with θp = 0.6, v = 1, v̇ xf = 2, and w2 = 4. w1 − vx φ̇ is shown rather than
w1 , as this represents acceleration in the vx subsystem exclusive of that due to
rotation; it is this value that is constrained by the lower velocity controller. This
demonstrates asymptotic position reference tracking with minimal overshoot, and
129
Chapter 5 Nonlinear Control
5.6 Conclusion
This chapter has demonstrated a novel partial feedback linearisation of the CMD,
transforming its dynamics from a system of six nonlinear and two linear ODEs
to a system of three nonlinear and five linear ODEs. Backstepping control design
is then used to create novel constrained local frame body velocity, inertial frame
body velocity, and inertial position controllers, all with Lyapunov derived stabil-
ity guarantees. While these stability proofs are not robust to model uncertainty,
in practise this controller is found to exhibit significantly robust behaviour, and
so it is expected that with more work a robust controller and stability proof
could also be derived. These controllers have been demonstrated both in simu-
lation and experimentally on a CMD prototype, with their performance in each
evaluated.
130
5.6 Conclusion
15
x
2 y
10
1
5
0 0 φ
0 2 4 6 8 10 0 2 4 6 8 10
·10−2
5 1
ẏ
ẏr
0
0.5
−5 ẋ
ẋr 0
0 2 4 6 8 10 0 2 4 6 8 10
6 0.8
φ̇ kvr k
4 0.6
φ̇r
2 0.4
0 0.2
−2 0
0 2 4 6 8 10 0 2 4 6 8 10
·10−2
10
w1 − vx φ̇
5 w2
5
0
0
−5 θp
θpr
−5
0 2 4 6 8 10 0 2 4 6 8 10
131
Chapter 5 Nonlinear Control
x
2 y 10
1
5
0 φ
0
0 2 4 6 0 2 4 6
1
ẋ 1 ẏ
0.5 ẋr ẏr
0 0.5
−0.5
0
−1
0 2 4 6 0 2 4 6
6 0.8
φ̇ kvr k
0.6
4 φ̇r
0.4
2
0.2
0 0
0 2 4 6 0 2 4 6
0.2
10 w1 − vx φ̇
0.1 w2
5
0
0
−0.1 θp
θpr −5
−0.2
0 2 4 6 0 2 4 6
132
5.6 Conclusion
Figure 5.15: A long exposure image capturing a trajectory from the origin to
(xr , yr , φr ) = (1, 2, 4π), in which two blue LEDs are used to capture the experi-
mentally tracked path, progressing from the bottom to top of the figure.
133
Chapter 6
This chapter describes the development of the second CMD controller presented
in this thesis, an input and output constrained dual-mode model predictive po-
sition controller. Like the backstepping controllers developed in the previous
chapter, this controller is able to enforce lean angle and velocity constraints,
whilst guaranteeing stability and convergence. However, this controller enforces
these constraints in an optimal rather than asymptotic fashion, allowing for the
generation of closer to time-optimal trajectories. This controller is also able to
optimally enforce wheel torque constraints, providing a guarantee of wheel slip
prevention for a given degree of traction whilst maintaining stability during actu-
ator saturation. In a further advantage over the previous chapter, this controller
is able to make optimal use of advance reference trajectory knowledge, allowing
for improved tracking of complex Cartesian paths. The controller is demonstrated
in both simulation and on a CMD experimental prototype, and its performance
and shortcomings are evaluated. This chapter marks the first implementation of
such a controller on a mobile balancing robot of any wheel configuration, and
is therefore novel in a more general sense than just to the CMD on which it is
applied.
135
Chapter 6 Model Predictive Control
surface and the ground, i.e. torques that could cause wheel slip, especially when
simultaneously accelerating in other dimensions. As slip is likely to result in in-
stability or loss of control, a hard constraint must be observed on the magnitude
of tractive force required at the roller-ground interface. Assuming a constant
coefficient of static friction, this can be achieved by enforcing a hard constraint
on the torque generated by each wheel motor. Here a ‘hard’ constraint refers
to a constraint for which no violation is acceptable, as opposed to a ‘soft’ con-
straint, which may be violated during disturbance, and after which the controller
is required to re-establish constraint satisfaction and resume tracking. While the
backstepping controllers developed in Chapter 5 incorporated hard constraints
on body accelerations v̇x , φ̈, and θ̈p , these only act to approximately constrain
wheel torques, and therefore in order to avoid wheel slip these constraints must
be sized such that slip does not occur for the worst case combination of constraint
satisfying accelerations. These constraints are therefore conservative for the vast
majority of the constrained acceleration set. Furthermore, the enforcement of
acceleration and velocity constraints in Chapter 5 is performed in an asymptotic
rather than exact manner, meaning the resulting state trajectories are always
suboptimal w.r.t. the constraints. In practice it would instead be desirable if
the system’s inputs could be saturated for long durations in order to sustain the
greatest accelerations possible, and if the system could make maximum use of
its constrained accessible velocity set in order to achieve the quickest possible
translations. This must all be achieved without detrimentally affecting system
stability, as would often occur in a rudimentary controller when its actuators
saturate.
Rather than attempting to define a fixed control law such that the system’s
input and state trajectories iteratively evolve in a desirable manner, as demon-
strated in Chapter 5, these trajectories can instead be calculated in an optimal
fashion by minimisation of a suitable cost function subject to some constraints,
an approach referred to as model predictive control (MPC).
Model predictive control typically uses a model of the plant to predict the
system’s response to a piecewise constant sequence of future control moves over
a receding horizon, which can be optimally chosen to reduce a cost function that
captures the controller’s desired performance over a receding or infinite prediction
horizon. This online optimisation allows for the systematic and exact handling
136
of constraints, making MPC well suited to this application. However, these ap-
proaches are computationally demanding due to their need to numerically solve
a constrained minimisation problem for every control iteration, making their
real-time implementation on systems with fast unstable dynamics such as the
TWIP or CMD challenging. The complexity of this minimisation problem de-
pends heavily on the prediction model and constraint structure; those with linear
prediction models and constraints can usually be formulated as convex quadratic
programs (QPs), which can be efficiently solved to global optimality. Those with
nonlinear prediction models and constraints require the solution of a nonlinear
program (NLP), typically a more computationally expensive undertaking. Non-
linear MPCs often possess nonconvex cost functions and constraints, meaning a
guarantee of convergence to global optimality may not exist. Despite this, NMPC
has been successfully applied to the cart-pole inverted pendulum [112]; however,
this system possesses simpler and substantially slower dynamics than that in this
thesis, and a fixed control delay is used to allow for a lengthy computation time,
at a cost of a significant reduction in high frequency disturbance rejection. Com-
plexity also varies greatly with choice of discretisation period, prediction and
control horizons, and constraint quantity, meaning there is often value in tailor-
ing each MPC implementation to its particular plant. Linear MPC formulations
exist which allow for the straightforward derivation of proofs of convergence and
stability, though similar techniques can sometimes also be applied to NMPC.
This is typically achieved by minimising the cost function over an infinite rather
than receding horizon, in which the control actions are used to drive the state
into an invariant terminal constraint set, after which a fixed closed-loop control
is implemented over the infinite horizon. These methods are often referred to
dual-mode MPC, and are the de-facto standard for MPC implementations in
which convergence and stability guarantees are required [113, 114].
Model predictive controllers with linear prediction models and constraints have
been well studied in the context of cart-and-pole inverted pendulums [112, 115–
117], but their application to TWIPs has been limited. Dini [60] implements a
finite horizon MPC, but only for the control of the yaw and pitch states. Hi-
rose [61] and Yue [59] also control a TWIP’s forward velocity, incorporating
both pitch and velocity constraints. However, both rely on an externally gener-
ated reference velocity trajectory in order to avoid infeasibility when performing
137
Chapter 6 Model Predictive Control
where the output is chosen as C = I3×3 03×5 . This linearisation ignores the
138
6.1 Controller Derivation
can be mapped into body frame position trajectories at the start of every control
iteration, and replanned if excessive deviation occurs.
A dual-mode controller is chosen for its systematic design approach, its a priori
stability guarantee, and its improved numerical conditioning in the prediction of
open-loop unstable plants [114]. This controller uses the control law
for prediction timestep i ≥ 0, i.e. i = 0 denotes the state at the current timestep
k, K represents an unconstrained optimal feedback, and ck represents the first
element of an optimised sequence of nc future perturbations from the uncon-
strained optimal, denoted →k
c . The notation →k
c represents the column vector
formed by stacking future values of cj for j = [k . . k + nc − 1], i.e. →k
c =
ck ck+1 . . . ck+nc −1 .
T
139
Chapter 6 Model Predictive Control
Substituting (6.1.2) into (6.1.1) and applying the above change of variables gives
where Φ = A − BK, which can then be substituted with (6.1.4) to give new
closed-loop prediction model and control law
Instead of continuing with two separate control laws as in (6.1.2), analysis can be
simplified by the formation of an all-encompassing autonomous prediction model
of the form Zk+1 = Ψ Zk . This allows constraints of the form Gx ≤ f to be
applied to predicted step Zk+n as GΨ n Zk ≤ f .
140
6.1 Controller Derivation
Similarly, the matrix Dc captures the change in the future perturbation vector
c over one prediction step
→k
0 I 0 ... 0
ck+1 ck
. 0
0 I . . . 0
.. .
.. .. . . ..
ck+1
= .. . . . . (6.1.11)
.
..
ck+nc
0
0 0 0 I
0 ck+n
| {z } 0 0 0 0 0 | {z c }
c
→k+1
| {z } → ck
Dc
141
Chapter 6 Model Predictive Control
A quadratic cost function that drives the state and input towards their desired
steady state values can be defined as
∞
X
J= (xk+i − xss|k+i )T Q(xk+i − xss|k+i )
i=1
where Q and R are diagonal matrices scaling the quadratic cost of each state and
input error where Q 0, R 0.
The terms xk+i − xss|k+i and uk+i−1 − uss|k+i−1 can be redefined in terms of
the autonomous model state Zk as
h i
xk+i − xss|k+i = I 0 −Mx Drk+1 Zk+i−1 (6.1.14)
| {z }
Kxss
T
−K
uk+i−1 − uss|k+i−1 = Dck Zk+i−1 (6.1.15)
−Mu Drk+1
| {z }
Kuss
From the autonomous model it is then seen that Zk+i = Ψi Zk , allowing substi-
142
6.1 Controller Derivation
The discrete Lyapunov equation can then be used to convert this convergent
infinite series into the form
T
xk Sx Sxc Sxr xk
J = ZkT SZk = →k (6.1.20)
T
c Sxc c
Sc Scr →k
r T
Sxr T
Scr Sr r
→k+1 →k+1
∂J
=0 (6.1.21)
∂ →k
c
143
Chapter 6 Model Predictive Control
h iT h i
ĉ − Sc−1 Scr →k+1
min J = →k r ĉ − Sc−1 Scr →k+1
Sc →k r
ĉ
→k
h iT
ĉ − Sc−1 Scr →k+1
+ 2 →k r Scr →k+1
r (6.1.23)
For this controller to be practically useful it must be able to drive the platform
to any reference position and heading {xr , yr , φr } ∈ R3 from any initial position.
However, the nature of the dual mode controller means that there must exist a
feasible perturbation sequence →k
c that takes the platform into the set of states
from which the closed-loop system at k > nc will not violate any constraints over
the infinite horizon, referred to as the maximal admissible set (MAS, SMAS ) [114].
This is an invariant set, meaning once the underlying closed-loop system enters
this set it will never leave, and will therefore never violate constraints. This lies
within a set of states from which there exists a sequence of feasible control moves
c that drive the initial state into the MAS without constraint violation, referred
→k
to as the maximal controlled admissible set (MCAS, SMCAS ), SMAS ∈ SMCAS . For
144
6.1 Controller Derivation
any initial state outside SMCAS there does not exist a sequence of control moves
that can guide the state into SMAS within k ≤ nc without violating constraints,
rendering the QP infeasible. For this application this limits step translations
to approximately 0.1m for nc = 10, dependant on initial state and choice of
quadratic cost function matrices Q and R, rendering the controller impractical
for real-world implementation.
Multiple approaches exist to address this problem. Simon [120] replaces r with
a pseudo-reference r̃ as an additional degree of freedom, penalising deviation of
this from the true reference, making the QP feasible for all possible references.
Dughman [121] introduces an extra perturbation term c∞ to the end of the
control sequence →k
c , which acts as a constant perturbation to the input for
k > nc . This constant perturbation has the same effect as a pseudo-reference,
with the equivalent pseudo-reference calculable as r̃ = C(I −Φ)−1 Bc∞ +r. These
methods ensure that SMCAS spans all {x, y, φ} ∈ R3 .
Here the latter approach is taken, introducing a c∞ term for k > nc . The
opportunity is also taken to introduce a vector of slack variables →k
s that will
be later used to soften the controller’s output constraints, giving an updated
autonomous model Ψ and state Z
xk+1 Φ BDck 0 Γ 0 xk
c 0 Dc Ec 0 0 →k c
→k+1
(6.1.27)
c∞ = 0 0 I 0 0 c∞
r 0 0 0 Dr r
0 →k+1
→k+2
s
→k+1
0 0 0 0 Ds s
| {z } | {z } | →k{z }
Zk+1 Ψ Zk
T
ĉ
Sc
→k
0 0 ĉ
→k
min J = c∞ 0 W Sc∞ 0 c∞ (6.1.28)
ĉ ,c∞ ,→k
s
→k s
→k
0 0 Ss s
→k
145
Chapter 6 Model Predictive Control
effect on →k
c , whilst ensuring c∞ → 0 as k → ∞ and feasibility ∀→k+1
r . Ss is
a diagonal matrix of large slack weights used to heavily penalise deviation of
s from 0, such that its elements are only optimised to be substantially larger
→k
than zero if feasibility of the QP would be otherwise lost. This means that the
output constraints are only significantly violated if this is necessary to maintain
feasibility of the QP.
Hard input wheel torque constraints |τ | ≤ τ are required in order to avoid wheel
slip. Output constraints are required on the θp state in order to prevent the
controller from attempting to translate using an unrealistic lean angle, as well as
to keep the system near the model operating point. The vx , vy , and φ̇ states must
be constrained in order to maintain a safe margin from the edge of SMCAS for
the controller to be able to handle disturbances, as well as to bound the system’s
kinetic energy as to ensure the controller generates safe and sensible velocity
profiles.
Hard constraints on the input |uk | ≤ u and softened output constraints |xk | ≤
146
6.1 Controller Derivation
where ncon > nc , and ncon is sufficiently large as to fully define SMAS , as from
Section 6.1.4 membership of SMAS at k + nc + 1 is necessary to guarantee con-
straint satisfaction over the infinite horizon. However, this approach to defining
SMAS can result in redundant constraints, and provides no systematic method
for selection of ncon .
Fortunately, algorithms for deriving the minimal set of constraints required to
define SMAS are well studied in the literature [122,123]. Generally these function
as follows. First, the initial set S0 = {Zk : GZk − t ≤ 0} is defined. Linear
programming is then used to maximise each row of GZk − t ≤ 0 subject to the
other remaining constraints. If any row can be made to be larger than zero, then
there exists a Zk such that Zk ∈ S0 but ΨZk+1 ∈
/ S0 , meaning S0 is not invariant.
The next set " #
GZk − t
S1 = {Zk : ≤ 0} (6.1.31)
GΨZk − t
1
Note the rows of the G entry in F that constrain xk serve no purpose and can be removed.
147
Chapter 6 Model Predictive Control
1 ẋ2 + ẏ 2 ≤ v 2
M = 16
M =8
0.5 M =4
0
ẏ
−0.5
−1
−1 −0.5 0 0.5 1
ẋ
is then defined, and the above procedure is repeated until there exists no choice
of Zk that is able to force a constraint violation, so Zk ∈ Sn =⇒ Zk ∈ Sn+1
and thus Sn is invariant. This procedure always converges if the state asymptote
lies within SMAS , i.e. limi→∞ Zk+i ∈ GΨi Zk ≤ t [114]. Typically a number of
redundant constraints will be introduced, which can be eliminated by various
pruning methods.
2
Quadratic constraints must be implemented using second-order cone programming if appli-
cable, otherwise using semidefinite programming. These are both significantly more compu-
tationally expensive than quadratic programming.
148
6.1 Controller Derivation
For the prototype used in this thesis with nc = 10, SMAS can be defined using
65 individual output constraints. Softening each of these constraints individually
requires an equal number of slack variables, increasing the QP DoF from 44 to
109, a significant increase in complexity. To lessen this, the number of slack vari-
ables can be reduced by the sharing of slack variables across multiple timesteps
through a redefinition of Fs and removal of diagonal entries from Ss , provided this
does not reintroduce the possibility of output constraint infeasibility. Multiple
slack variable sharing approaches were considered:
2. One slack variable per constraint per timestep for k ≤ nc , with no constraint
softening for k > nc .
3. Sharing a single slack variable per constraint over the entire horizon.
5. Allocating one slack variable per constraint per timestep for k ≤ nc , with
a single slack variable per constraint shared for k > nc .
6. Allocating one slack per constraint per nblock timesteps, with a single slack
per constraint shared for k > nc .
149
Chapter 6 Model Predictive Control
0.4
ni = 1
0.2 ni = 2
θp (rad)
0 ni = 3
±θp
−0.2
−0.4
0 0.5 1 1.5 2 2.5 3 3.5 4
2 ni = 1
vy (m s−1 )
ni = 2
1 ni = 3
0 ±v y
−1
0 0.5 1 1.5 2 2.5 3 3.5 4
t (s)
7. Allocating one slack variable per constraint per timestep for k ≤ ni , and
a single shared slack variable per constraint for k > ni , with ni chosen by
trial and error.
8. Allocating one slack per constraint per timestep for k ≤ ni , one slack per
constraint per nblock timesteps for ni < k ≤ nc , and a single slack variable
per constraint shared for k > nc .
150
6.1 Controller Derivation
Slack weights in (6.1.28) for non-shared slack variables are set to near zero
to allow the controller to worsen constraint violation over a short horizon to
improve the rate of convergence to SO over the infinite horizon. For example, for
an initially upright system with |vy | > 2v y , the non-minimum phase nature of this
system means that the desired control response is for the controller to first briefly
increase vy , driving θp < 0 in order to start generating sustained deceleration
v̇y < 0. A large slack weight for the slacks at i ≤ 3 penalises this type of quick
correction, preventing the system from correcting the violation as aggressively as
is desired. The infinite horizon slack weights are made very large to ensure that
all resulting trajectories bring the state towards SO as quickly as possible. The
cost associated with non-zero s∞ must also be much greater than that practically
encountered due to tracking error, otherwise a distant reference trajectory will
cause the controller to purposefully generate an undesirable constraint violation.
While the output constraints enforced on vx , vy , φ̇, and θp are softened to main-
tain feasibility during disturbance, the hard input constraints applied to →k
u ef-
fectively apply a second set of output constraints, albeit with a larger constrained
range in this particular application. This is due to the requirement for the con-
troller to direct the state into SMAS at k + nc + 1, in which the underlying control
law must not violate the hard input constraints as i → ∞. Given the range of
output constraints acting on this system, this could take a reasonably long time
from some choices of xk ∈ SO ; for example, a system initialised with vy = v y and
θp = θp with xk ∈
/ SMAS will require a large control horizon to give the controller
enough time to manipulate the plant toward the origin and into SMAS using its
constrained input. This can lead to parts of the output constraint set SO be-
ing infeasible, despite using output constraint softening. Care must therefore be
taken to ensure nc and u are sufficiently large when specifying SO in order to
ensure SO ⊆ SMCAS . Additionally, a large margin must be allowed due to the
use of softened output constraints, otherwise an anticipated constraint violation
could result in infeasibility. For this application the maximum possible vy and
θp values for which the controller must remain feasible are expected to be in the
region of ±3 m s−1 and ±0.5 rad respectively, with minimal disturbance expected
in the open-loop stable vx and φ̇ states.
151
Chapter 6 Model Predictive Control
6.2 Results
This section now aims to demonstrate the efficacy and efficiency of the proposed
controller in simulation and on an experimental prototype. The quadratic pro-
gram is solved using qpOASES [126], an online active set solver, implemented on
an Intel i7-4720HQ processor for simulated results and an Intel i7-8650U for ex-
perimental results. In single threaded benchmarks the latter achieves 17% greater
performance than the former. Simulation is performed by numerical integration
of the continuous time nonlinear model using MATLAB’s ode45. In simulation
the controller is updated at a rate of 1/Ts , whereas on the experimental proto-
type it is updated as continuously as execution time allows in order to improve
disturbance rejection, with a typical control update rate of around 500 Hz.
154
6.2 Results
τ1 τ2 τ3
τ4 ±τ
0.2
0.1
0
0 ck,1
−0.2
ck,2
ck,3
−0.1 −0.4 ck,4
0 2 4 6 0 2 4 6
0.1
J
2
0
−0.1 c∞,1
c∞,2 1
c∞,3
−0.2 c∞,4
0
0 2 4 6 0 2 4 6
0.4
1 θp
0.2 ±θp
0.5 0
y −0.2
0 ry
−0.4
0 2 4 6 0 2 4 6
·10−3
4
vy texec
1 ±v y 3
0 2
1
−1
0
0 2 4 6 0 2 4 6
Figure 6.5: Simulated MPC response to a step reference of y = [0, 1]m, showing
asymptotic convergence, minimal overshoot, and sensible preemption of the ref-
erence change. The i = 0 perturbation c0,i and infinite horizon perturbation c∞
terms correctly increase at the moment of the reference step to maintain feasi-
bility, and tend to zero as x ∈ SMAS and x ∈ SMCAS respectively. The controller
shows satisfaction of all constraints, saturating the input for a number of samples
and producing toward minimum-time vy and θp trajectories.
155
Chapter 6 Model Predictive Control
τ1 τ2 τ3
τ4 ±τ
0.2
0.1
0
−0.2
0 ck,1
−0.4 ck,2
−0.6 ck,3
−0.1 ck,4
−0.8
0 2 4 6 0 2 4 6
J
0 2
c∞,1
−0.2 c∞,2 1
c∞,3
c∞,4
0
0 2 4 6 0 2 4 6
0.4
1 θp
0.2 ±θp
0.5 0
y −0.2
0 ry
−0.4
0 2 4 6 0 2 4 6
·10−3
3
vy texec
1 ±v y
2
0
1
−1
0
0 2 4 6 0 2 4 6
Figure 6.6: Experimental response to a step reference of ry = [0, 1]m. This shows
a strong similarity to that predicted in Figure 6.5, with only minor increases
in constraint violation due to external disturbance. Execution time is found
to be slightly faster, demonstrating the real-world feasibility of applying online
constrained optimal control to this highly dynamic system.
156
6.2 Results
157
Chapter 6 Model Predictive Control
τ1 τ2 τ3
τ4 ±τ
1
0.1
0.5
0 0 ck,1
ck,2
−0.5 ck,3
−0.1 ck,4
−1
0 2 4 6 0 2 4 6
vx
1 1 ±v x
0.5 0
x
0 rx −1
0 2 4 6 0 2 4 6
Figure 6.7: Simulated MPC response for a step reference of rx = [0, 1]m. This
shows close to bang-bang control without, any constraint violation. This demon-
strates both the advantageous ability of this optimal control approach to produce
close to minimum-time trajectories in the presence of constraints, and how by
directly controlling wheel torques this controller is able to optimally saturate
all four inputs for a large number of timesteps without any negative impact on
closed-loop stability.
Figure 6.10 shows a similar scenario, though real-world initial conditions are
somewhat harder to control, and so contain some visible error. Despite this, a
very similar response is observed, again showing fast re-establishment and main-
tenance of constraint satisfaction, before asymptotically re-converging to the ori-
gin.
158
6.2 Results
τ1 τ2 τ3
τ4 ±τ
1
0.1
0.5
ck,1
0 0 ck,2
−0.5 ck,3
−0.1 ck,4
−1
0 1 2 3 4 5 0 1 2 3 4 5
1
J
0.5 1
c∞,1
0 c∞,2
c∞,3 0.5
−0.5
c∞,4
−1 0
0 1 2 3 4 5 0 1 2 3 4 5
·10−2
2
1 y
ry
1
0.5
x 0
0 rx
0 1 2 3 4 5 0 1 2 3 4 5
1 1 vy
±v y
0 0
−1 vx ±v x −1
0 1 2 3 4 5 0 1 2 3 4 5
·10−3
0.4 2
θp ±θp texec
0.2 1.5
0 1
−0.2 0.5
−0.4 0
0 1 2 3 4 5 0 1 2 3 4 5
τ1 τ2 y
0.1 τ3 τ4 1 ry
±τ
0 0.5
−0.1 0
0 2 4 6 0 2 4 6
0.4
θp 2 vy
0.2 ±v y
±θp 1
0 0
−0.2 −1
−0.4 −2
0 2 4 6 0 2 4 6
this would bring is instead incorporated via the reference previewing mechanism,
meaning tracking performance is related to choice of nr . Figure 6.11 shows sim-
ulated position tracking error for a ramping y reference signal over increasing nr .
This shows a steady state tracking error for short reference previewing horizons,
with this error vanishing around nr ≈ 18. This effect highlights a drawback of
the dual-mode MPC approach; the use of a closed-loop prediction model means
that when given a previewed section of a continuously changing reference the
controller is optimising its future trajectory to come to rest at rk+nc +1 , meaning
it must plan for its state at k = nc + 1 to lie within SMAS . In practise this
means that the system can only increase vy to a value from which it can enter
SMAS in nc timesteps, which for the value of nc used in the previous figures is
160
6.2 Results
τ1 τ2 y
0.1 τ3 τ4 1 ry
±τ
0 0.5
−0.1 0
0 2 4 6 0 2 4 6
0.4
θp 2 vy
0.2 ±v y
±θp 1
0 0
−0.2 −1
−0.4 −2
0 2 4 6 0 2 4 6
insufficient to correctly track the given ramping reference trajectory. This results
in the system lagging behind the desired trajectory, which in turn increases the
effective stopping distance from the target steady state that the controller is able
to use to enter SMAS at k = nc + 1. This position lag increases until the system
has accumulated sufficient distance from rk+nc +1 to be able to safely reach the
velocity required to keep up with the moving reference.
This tracking error can be addressed by ensuring a reference previewing period
that is of sufficient length to fully capture the transition of the system from any
state within SO into SMAS without constraint violation. This value of nc can
be approximated by examining the system response in the regulation case to
an initial forward velocity of vy = v y , which indicates a stopping distance of
0.53 m, taking 0.56 s for the system to enter SMAS . Two approaches exist to
ensure this; the reference previewing and control horizons can be increased to
match the stopping time at nr = nc = 28, at a cost of greater computational
161
Chapter 6 Model Predictive Control
0.6
nr =1
nr =2
0.4 nr =3
ry − y
nr =5
0.2 nr =8
nr = 12
nr = 18
0 nr = 25
0 1 2 3 4 5
nr = 35
4
3
y
2
1
0
0 1 2 3 4 5
Figure 6.11: Simulated MPC ry tracking error (top) for a linearly ramping posi-
tion setpoint over varying nr , with corresponding ry reference (dashed) and state
trajectories (bottom). This demonstrates how an insufficient reference previewing
horizon can prevent asymptotic tracking of a time-varying ry , with convergence
only achieved for nc ' 18.
complexity, or the underlying gain K can be increased and the output constraint
set enlarged in order to allow the system to reach the required steady state in less
time. However, increasing K in turn decreases the size of SMCAS , as discussed
in Section 6.1.9, as well as increasing sensitivity to noise and the excitation of
unmodelled dynamics. Enlarging the output constraint set is also ineffective,
as the same problem occurs, only at a larger velocity. For demonstration nc
and nr are increased to nc = nr = 28, with the response to the same figure-of-
eight trajectory also shown in Figure 6.12. This also allows a reduction of R in
contrast to Section 6.1.9, as this larger control horizon already enlarges SMCAS to
encompass SO with sufficient margin. However, this increase in control horizon
increases worst case execution time to texec = 6.4 ms, which in practise is close
to being too slow for the real-time control of this particular system. The control
horizon is therefore left unchanged, and a small amount of steady state tracking
162
6.2 Results
0.5
−0.5
−1 nc = 10
nc = 28
r
163
Chapter 6 Model Predictive Control
τ1 τ2 τ3
τ4 ±τ
0.1 0.5
0
0 −0.5
ck,1 ck,2
−1 ck,3 ck,4
−0.1
0 2 4 6 8 10 12 0 2 4 6 8 10 12
0.4 4
0.2 J
3
0
2
−0.2
c∞,1 c∞,2 1
−0.4 c∞,3 c∞,4
−0.6 0
0 2 4 6 8 10 12 0 2 4 6 8 10 12
2 0.5
1
0
0
−0.5
−1 x y
rx −1 ry
−2
0 2 4 6 8 10 12 0 2 4 6 8 10 12
1 vx vy ±v y
±v x 1
0
0
−1
−1
0 2 4 6 8 10 12 0 2 4 6 8 10 12
·10−3
0.4 texec
θp ±θp 2
0.2
0 1
−0.2
0
0 2 4 6 8 10 12 0 2 4 6 8 10 12
Figure 6.13: State trajectories for the figure-of-eight trajectory in Figure 6.12
with nc = 10. An ry tracking error is observed as in Figure 6.11, resulting in the
system following a distorted figure-of-eight path. As expected, increasing nc to
nc = 28 eliminates this error. A small rx tracking error is also observed at the
extremes of this reference due to the controller optimising a trade-off between
perfect tracking and the increased control effort required to achieve this.
164
6.3 Conclusion
Figures 6.12 and 6.15 shows the experimental response to the same figure-of-
eight trajectory with nc = 12. This shows the same expected phase lag in the
y state as in simulation, along with the same x error as in Figure 6.8, now also
presenting as a lag behind the desired trajectory. A large spike in computation
time occurs at the start of the experiment to texec = 20 ms. This is due to the
significant change in optimal solution that occurs at this point, requiring a large
number of solver iterations to re-converge. Once this is solved subsequent control
iterations are ‘warm started’, meaning the solver is initialised with the solution
to the previous control iteration. Increasing the control horizon to nc = 28 as
in simulation in practice makes this initial computation time too large, causing
instability, and hence this is not shown.
This scenario demonstrates the combined advantages of this MPC approach,
in that both constraint satisfaction and stability are maintained throughout the
correction of the large initial tracking error, where a rudimentary controller would
yield significant constraint violation and loss of control, before continuing to yield
good tracking of time varying references.
6.3 Conclusion
165
Chapter 6 Model Predictive Control
0.5
−0.5
−1
nc = 10
r
decision variables, along with exploring the size and distribution of these blocks.
The development of a high level planner capable of generating reference trajec-
tories for this controller to follow would enable the navigation of a known map.
This reference could be a series of discontinuous position waypoints, or it could
be a 2D path returned by a sampling based planner such as RRT*, with some
simple heuristic-derived timing law. In contrast with polynomial-based trajectory
generation methods [73] this removes the requirement for the outer planner to
specify a dynamically feasible and constraint satisfying trajectory between way-
points; here the dynamically feasible and constraint satisfying state and input
trajectories are instead derived iteratively by the MPC. The MPC demonstrated
here is better suited to this task than existing TWIP MPC implementations, as
by maintaining feasibility across the full reference set waypoints can be placed at
arbitrarily sparse intervals, rather than needing to consider the controller’s feasi-
ble reference set. The embedding of input and output constraint satisfaction into
the low level controller also improves safety and robustness in the event of delay
166
6.3 Conclusion
τ1 τ2 τ3
τ4 ±τ
0.1
0
ck,1
0 ck,2
−0.5 ck,3
−0.1 ck,4
−1
0 2 4 6 8 10 12 0 2 4 6 8 10 12
0.2 100 J
0
−0.2 50
c∞,1 c∞,2
−0.4 c∞,3 c∞,4
−0.6 0
0 2 4 6 8 10 12 0 2 4 6 8 10 12
2 0.5
1
0
0
−0.5
−1 x y
rx −1 ry
−2
0 2 4 6 8 10 12 0 2 4 6 8 10 12
1 vx 1
±v x
0 0
−1 −1 vy ±v y
0 2 4 6 8 10 12 0 2 4 6 8 10 12
·10−2
0.2 2 texec
0
1
−0.2
θp ±θp
−0.4 0
0 2 4 6 8 10 12 0 2 4 6 8 10 12
167
Chapter 6 Model Predictive Control
or error in the high level planner, with the system guaranteed to safely come to
rest at the end of the last specified reference. This also improves recovery in the
event of significant disturbance, with tracking safely resumed whilst satisfying
constraints, as opposed to relying on the high level planner to quickly generate a
suitable ‘recovery’ trajectory. This is all achieved with a proof of convergence and
stability for the linearised model, which given the small degree of nonlinearity
over the constrained operating region can reasonably be assumed to extend to
the full nonlinear system.
168
Chapter 7
This chapter demonstrates the final control approach of this thesis, in which a
concept known as differential flatness is used to generate dynamically feasible
state trajectories from optimally smooth geometric paths between waypoints. A
differentially flat model of the CMD is derived, and the suitability of this method
for the generation of state trajectories between waypoints is demonstrated. A
novel approach to the generation of toward minimum-time velocity constrained
trajectories is then developed, allowing the generation of dynamically feasible and
velocity constrained state trajectories through multiple waypoints. This is again
demonstrated in both simulation and on an experimental CMD prototype. Finally,
a novel approach to polynomial trajectory optimisation is demonstrated, in which
a concept known as sum-of-squares programming is used to yield an average 40%
reduction in constrained polynomial optimisation time over the state-of-the-art.
169
Chapter 7 Fast Online Trajectory Optimisation
170
this too is a computationally expensive method, taking seconds to minutes to
plan simple trajectories between waypoints for similar nonlinear systems [129].
An approach used in trajectory generation for ball-balancing robots optimises
lean angle trajectories comprised of piecewise summed parametrised hyperbolic
secant and cubic spline functions [74], forming a single shooting trajectory opti-
misation problem. However, this choice of basis function requires the solution of a
relatively complex constrained nonlinear program, again at high computational
cost, and through this basis can only optimise over a limited set of solutions.
Nagarajan presents a further method for the planning of ball-balancing robot
trajectories in which desired Cartesian trajectories in the external variables are
defined using high-order polynomials p(t). In recognising that in a neighbour-
hood of the origin there exists a linear mapping of steady state external variable
accelerations p̈(t) to the shape variables q(t), i.e. the body lean angles, a linear
... ....
mapping p̈(t) = K1 q(t), p (t) = K2 q̇(t), p (t) = K3 q̈(t) can be optimised to min-
imise the error J = kp̈(t) − p̈∗ (t)k22 , where p∗ (t) represents the external variable
acceleration trajectory derived from evaluation of the second order nonholonomic
constraint imposed by the system’s underactuation along q(t) [82]. This optimi-
sation forms a nonlinear program, with computation times of around 1 s for short
trajectories, so can feasibly be implemented in real-time on slow moving systems.
This method yields exactly dynamically feasible trajectories, at the expense of
a small deviation from the infeasible desired Cartesian trajectory. As this linear
map only exists in a neighbourhood of the origin it will decrease in validity for
larger lean angles. This method is also applied to a system with a pair of 2-DOF
arms, with minimal increase in problem complexity [130].
Despite this plethora of trajectory optimisation methods, none are able to
provide sufficiently fast execution times so as to allow for the real-time planning
required in this application, preventing fast reaction to dynamic obstacles and
large disturbances.
A less computationally demanding alternative applies the concept of differen-
tial flatness to the planning problem, a technique that allows for state trajectories
to be calculated algebraically from sufficiently continuously differentiable geomet-
ric trajectories in some possibly fictitious system outputs [20]. This is similar to
Nagarajan’s shape-space planner, but instead of optimising a linear mapping of
external to shape variables to minimise tracking error, this map is instead model-
171
Chapter 7 Fast Online Trajectory Optimisation
derived, constant, and potentially nonlinear. This allows the planning problem
to be addressed in a top down manner by optimising trajectories in the system’s
outputs rather than its inputs, yielding less computationally demanding prob-
lem formulations than shooting or transcription methods. This subset of the
trajectory planning literature mainly focuses on quadrotors, which are naturally
differentially flat systems [22, 23], and therefore well suited to this type of plan-
ning, though some research has been undertaken into applying these techniques
to ball-balancing robots [73, 81], in which smooth trajectories between position
waypoints are generated for a single planar direction of a ballbot.
Differential flatness based trajectory planning techniques are therefore more
suitable for this application. As no differential model of a CMD exists in the
literature this is first derived.
From Chapter 3 the dynamic model of a Collinear Mecanum Drive can be de-
scribed in terms of inertial frame positions p and local frame body velocities v in
the form
M (p)v̇ + C(p, v)v + G(p) + F v = Bτ (7.1.1)
This contains multiple orders of derivative of θp , and therefore does not allow an
expression of θp as an algebraic function of the system’s Cartesian positions and
their derivatives, meaning the CMD’s Cartesian positions and heading are not
differentially flat outputs.
Shomin [73] showed that a single planar axis of a ball-balancing robot can be
approximately differentially flattened by a combination of model simplification
and a flat output of the form S = y + λθp . This technique can be applied to a
CMD and extended to the fully coupled nonlinear model by choosing the system’s
172
7.1 Differentially Flat Model Derivation
flat outputs as
with some time invariant λ. The system states x, y, vx , vy , v̇y , and all derivatives
of φ can be trivially derived by differentiation and rotation of the flat outputs as
where a to h are time invariant positive constants1 . θ̈p can be eliminated from this
expression by selection of λ = −g/d. It is a safe assumption that the centripetal
force acting on the θp generalised coordinate due to θ̇p will always be small
relative to other forces, so the term cθp θ̇p2 can be omitted. Finally, the term
−bθ̇p λ is found to vanish when rolling friction is not considered, i.e. vrw = 0,
so from the knowledge that rolling friction has only a small effect on system
dynamics it is assumed that this term can be omitted without significant impact
1
redefined from the definitions in previous chapters
173
Chapter 7 Fast Online Trajectory Optimisation
on the accuracy of the differentially flat model. This allows for solution of θp as
sin(S3 ) bṠ1 + dS̈1 + hṠ2 Ṡ3 − cos(S3 ) bṠ2 + dS̈2 − hṠ1 Ṡ3
θp = (7.1.6)
a + eṠ32 − f (g/d) Ṡ32
in which all differentials of θp have been eliminated, converting this from an ODE
to a simple algebraic equation.
and is divergent as Ṡ3 → ± e−f (g/d) , which for the parameters in Table 4.2 occur
q
−a
at Ṡ3 = ±23.8 rad s−1 . Fortunately this rate of rotation is unlikely to occur in
any real-world scenario.
174
7.2 Closed Loop Trajectory Tracking
1 0.4
0.2
0.5 0
y −0.2
0 S2 −0.4 θp
0 0.5 1 1.5 2 0 0.5 1 1.5 2
1.5 2
vy
θ̇p
1 Ṡ2 1
0.5 0
0
−1
0 0.5 1 1.5 2 0 0.5 1 1.5 2
0.1
τ
−0.1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
While perfectly dynamically feasible state and input trajectories can in theory be
tracked in open-loop, in reality the system will quickly deviate from the target
trajectory. This is due to model parameter uncertainty, unmodelled dynamics,
external disturbances, and in this case the simplifications required in the deriva-
tion of the differentially flat model, all compounded by the unstable dynamics of
the open-loop system about the upright equilibrium. A fast tracking controller
is therefore required to regulate the error between the current state and time
175
Chapter 7 Fast Online Trajectory Optimisation
Consider the error dynamics obtained by rotating Cartesian position error and
its integral into the local body frame
R
e1 (xr − x) dt
R
e2 (yr − y) dt
R
e3 (φr − φ) dt
e4 xr − x
T
e5 REB 0 0 0
0 yr − y
1 0 0
e = e6 = φr − φ (7.2.1)
T
e7 0 0 REB 0
θpr − θp
0 0 0 I6×6
e8 vxr − vx
e9 vyr − vy
e10 φ̇r − φ̇
with derivative
ė1 e2 φ̇ + e4
ė2 −e1 φ̇ + e5
ė3 e6
ė4 e5 φ̇ + vxr − vx
ė5 −e4 φ̇ + vyr − vy
ė = ė6 = φ̇r − φ̇ (7.2.2)
ė7
θ̇pr − θ̇p
ė8 v̇xr − v̇x
ė9
v̇yr − v̇ y
ė10 φ̈r − φ̈
ė11 θ̈pr − θ̈p
Substituting system dynamics of the form ẋi = fi (x, u), i ∈ [1 . . 8] yields the
176
7.2 Closed Loop Trajectory Tracking
error dynamics
ė = F (xr , ur , e, eu , ei ) (7.2.4)
where
Z t
xr − x
ei = yr − y dt (7.2.5)
0
φr − φ
in which the error dynamics are linearised about the desired trajectory.
The goal of the controller is to regulate e → 0, ei → 0, eu → 0. As xr (t) and
ur (t) are to be derived from the differentially flat model they can be assumed
to be dynamically feasible, meaning e = 0 can be maintained in steady state
and therefore represents an equilibrium. This allows the design of a time-varying
infinite-horizon LQR, and thus the optimal algebraic definition of K in the control
law u = Ke + ur . While this linearisation decreases in accuracy with deviation
from the desired trajectory, it is assumed that any substantial deviation would
177
Chapter 7 Fast Online Trajectory Optimisation
With a differentially flat model, it is now possible to calculate feasible state tra-
jectories from any geometric paths in the flat outputs satisfying (S1 , S2 ) ∈ C 4 ,
S3 ∈ C 3 . This is typically achieved by representing the transition of a flat out-
put from one state to another using parametrised univariate polynomial basis
functions, such as representing a path between two waypoints or a change in
velocity. While from the unisolvence theorem [131] it is known that there al-
ways exists a unique polynomial of at most degree nw − 1 that can be used to
describe a path between nw waypoints in the absence of constraints, the large
monomial powers required for paths through more than a handful of waypoints
quickly lead to poor numerical conditioning. It is therefore better to describe
trajectories through multiple waypoints in a piecewise continuous fashion using
multiple chained polynomials of lower degree, with equality constraints enforced
on a finite number of derivatives at the boundaries between these polynomial
segments.
178
7.3 Trajectory Generation using Optimally Smooth Polynomials
w −1 Z Ti
nX 2
dk pi (t)
J= dt (7.3.2)
0 dtk
i=1
179
Chapter 7 Fast Online Trajectory Optimisation
1
2
θp
y 0
1
0 −1
0 1 2 3 4 0 1 2 3 4
4
4
2 2
θ̇p
vy
0
0
−2
−4 −2
0 1 2 3 4 0 1 2 3 4
0.2 k=3
k=4
k=5
τ
−0.2
0 0.5 1 1.5 2 2.5 3 3.5 4
Figure 7.2: A comparison of choices of k in the cost function (7.3.2) for a tra-
jectory through six random waypoints with k = 3 (blue), k = 4 (red), and k = 5
(yellow). The differentially flat model is used to derive state and input trajecto-
ries from these polynomials, demonstrating the effect of polynomial smoothness
on the actual system trajectories. Clearly k = 3 yields non-smooth τ trajectories,
and k = 4 yields lower peak lean angles than k = 5.
that θ̈p ∝
∼ sin(θp ), minimising the snap of S1 and S2 also acts to reduce the peak
lean angle of the trajectory. Both of these schemes are compared in Figure 7.2,
along with k = 3. As predicted, a choice of k = 4 shows reduced peak θp and τ
trajectories over k = 5, whilst maintaining relatively smooth state trajectories.
However, a large reduction in smoothness is apparent in reducing k further to
k = 3, so by this metric k = 4 appears to be the most suitable choice.
180
7.3 Trajectory Generation using Optimally Smooth Polynomials
with limits
2n + 1
d for nw = 2
deg(p) ≥ (7.3.4)
n + 1
d for nw → ∞
7.3.3 QP Formulation
181
Chapter 7 Fast Online Trajectory Optimisation
and with H 0. The constraints (7.3.1) can be rewritten in the linear form
Ax = b where A ∈ Rn×m , m < n, rank(A) = m, defining the problem in the
standard quadratic program form
This allows a unique solution for the globally optimally smooth piecewise contin-
uous trajectory using iterative quadratic programming techniques such as MAT-
LAB’s quadprog.
x can then be split into its fixed and free DoF u and v as
x = Q̂u + QN v (7.3.12)
u = R̂−T b (7.3.13)
x = QN v + Q̂R̂−T b (7.3.14)
Substituting this into the original quadratic cost function then allows solution of
182
7.3 Trajectory Generation using Optimally Smooth Polynomials
v as
−1
v = − QTN HQN Q̂R̂−T bHQN (7.3.15)
which by substitution into (7.3.14) yields a numerical solution for x with a sub-
millisecond execution time, even for very large numbers of waypoints. This
method is also numerically more robust than iterative solvers, typically achieving
a higher degree of optimality.
To demonstrate the accuracy of the differentially flat model, and the suitability
of describing flat output trajectories using polynomials, the trajectory shown in
Figure 7.1 is tracked in simulation, with the resulting state and input trajecto-
ries shown in Figure 7.3. These trajectories are generated from a single nonic
polynomial in S2 , with constraints enforced up to the fourth derivative, uniquely
defining the polynomial. In simulation there is clearly minimal deviation from the
planned state trajectories, indicating that they are nearly exactly feasible, and
thus the differentially flat model is of sufficient accuracy for this application. The
same trajectories are then tracked experimentally, with state and input trajecto-
ries given in Figure 7.4. This shows more deviation from the planned trajectories
than in simulation, though this is to be expected given the complex unmodelled
dynamics acting on the system. Despite these errors, minimal position overshoot
is observed, and the experimental trajectories strongly resemble that which was
planned.
A more complex trajectory is shown in Figure 7.5, in which a pirouetting path
is followed from (x, y, φ) = 0 at t = 0 to (x, y, φ) = (0, 2, 2π) at t = 4. This
shows good tracking of the x, y, vx , vy , φ, and φ̇ states, though while their
shapes are similar the θp and θ̇p state trajectories are poorly tracked. This is
both acceptable and expected; the system’s non-minimum phase property means
that any deviation of vy or its integral from the planned dynamically feasible
trajectory necessitates a significant deviation of θp from its reference if tracking
is to be resumed. It is therefore through this θp tracking error that good position
tracking of the remaining states is achieved. This experiment demonstrates how
this planning approach is able to generate complex coupled state trajectories
from a simple polynomial basis in the decoupled flat outputs.
183
Chapter 7 Fast Online Trajectory Optimisation
1
0.2
0.5 0
y θp
yr −0.2 θpr
0
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
1
1 vy
vyr θ̇p
0.5
θ̇pr
0.5 0
−0.5
0
−1
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
·10−2
5 τ
τff
0
−5
Figure 7.3: Simulated tracking of the trajectory in Figure 7.1. The near-absence
of tracking error indicates that the differentially flat model generates close to
exactly dynamically feasible state and input trajectories for the isolated θp and
vy subsystems, at least for the range of θp angles present in this trajectory. All
τ and τff trajectories are equal, so only one of each is shown.
The choice of segment durations Ti has a large effect on the resulting shape of the
optimised trajectories. This is demonstrated in Figure 7.6, in which the second
segment duration of a trajectory through three waypoints is varied from half of
to equal to the duration of the first segment, showing how elaborate paths can be
taken as segment durations are varied. This is undesirable, as while smoothness is
important, it is still desired that the robot chooses somewhat direct and energy
efficient paths. Also, arbitrary choices of Ti may lead to uneven distribution
184
7.3 Trajectory Generation using Optimally Smooth Polynomials
1 θp
0.2
θpr
0.5 0
y
yr −0.2
0
0 1 2 3 4 5 0 1 2 3 4 5
1
1 vy
vyr 0.5
0.5 0
−0.5 θ̇p
0 −1 θ̇pr
0 1 2 3 4 5 0 1 2 3 4 5
·10−2
5 τ1
τ2
τ3
0 τ4
τr
−5
0 1 2 3 4 5
Figure 7.4: Experimental tracking of the trajectory in Figure 7.1. This shows
more deviation from the planned trajectories than in simulation, though this is
to be expected given the complex unmodelled dynamics acting on the system.
Despite these errors, minimal position overshoot is observed, and the tracked
trajectories strongly resemble that which was planned.
of cost along the trajectory, making some segments smoother than others and
producing step changes in the perceived ‘aggressiveness’ of the overall trajectory.
A cost function [22] used in the quadrotor trajectory planning literature to
optimise for Ti across n flat outputs is defined as
w −1 Z
n nX Tj 2
dk p
i,j (t)
X
min dt + Kt Tj (7.3.16)
Tj 0 dpi,j (t)k
i=1 j=1
185
Chapter 7 Fast Online Trajectory Optimisation
·10−2
5 1
vx
0.5 vxr
0
0
−5 x −0.5
xr −1
0 1 2 3 4 0 1 2 3 4
2
0
1
y −1 vy
0 yr vyr
0 1 2 3 4 0 1 2 3 4
4
6 φ̇
3
4 φ̇r
2
2 φ 1
φr
0 0
0 1 2 3 4 0 1 2 3 4
0.2
1 θ̇p
0.1
θ̇pr
0
0
−0.1
θp θpr
−0.2 −1
0 1 2 3 4 0 1 2 3 4
0.1 τ1
τ2
τ3
0 τ4
τr1
τr2
τr3
−0.1 τr4
0 0.5 1 1.5 2 2.5 3 3.5 4
186
7.3 Trajectory Generation using Optimally Smooth Polynomials
2
T2 = 1.5 s
T2 = 1.75 s
1.5 T2 = 2s
T2 = 2.25 s
T2 = 2.5 s
y (m)
1 T2 = 2.75 s
T2 = 3s
0.5
0
−0.5 0 0.5 1 1.5 2
x (m)
This cost function can be globally minimised by gradient descent, which when
performed using the QR decomposition solution method in Section 7.3.3 can
be performed with sub-second execution times for tens of waypoints using an
Intel i7-4720HQ processor. If the QR decomposition method cannot be used,
for example if any inequality constraints are to be included, iterative quadratic
programming solvers make the process of numerically calculating gradients ex-
cessively expensive. This is compounded by the requirement to solve each QP
to a high degree of optimality, as too lax of an optimality tolerance can intro-
duce noise into the numerical gradient estimates. Figure 7.7 shows trajectories
through a set of waypoints with both identical segment durations and with op-
timised durations, in which Kt is chosen to yield an equivalent total duration.
This demonstrates how such an optimisation can yield more sensical and direct
paths, whilst also providing a ten-fold reduction in total trajectory cost.
187
Chapter 7 Fast Online Trajectory Optimisation
1 1
0.5 0.5
0 0
Figure 7.7: Flat output (red) and state trajectories (blue) through five Carte-
sian waypoints (black markers) with constant segment durations of 1 s (a) and
optimised durations (b), in which Kt is chosen to yield equal total duration. The
initial QP has cost J = 6507, whilst the QP with optimised durations has cost
J = 629, a ten-fold reduction.
188
7.4 Velocity Constrained Trajectory Generation
1.5
1 p(t) ṗ(t)
1
0.5
0.5
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
t (s) t (s)
10 ...
p̈(t) p (t)
5 100
0
0
−5
−10 −100
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
t (s) t (s)
This desired trajectory shape can instead be achieved by splitting all polynomial
segments into three separate polynomial subsegments, whilst enforcing the same
continuity of derivatives between subsegments, and without any intermediary po-
189
Chapter 7 Fast Online Trajectory Optimisation
p(t)
1 ṗ(t)
p̈(t)
0
−1
Figure 7.9: A point-to-point trajectory split into three subsegments, with a linear
polynomial describing the middle subsegment. Dotted vertical lines represent
subsegment boundaries. This demonstrates how this description of point-to-point
trajectories in the presence of velocity constraints can be better parametrised by
three concatenated polynomial subsegments.
sition constraints. This is exampled in Figure 7.9. Whilst for distant waypoints
the middle of these three subsegments should be optimised to represent a con-
stant velocity, and could therefore be represented by a linear polynomial, such
a parametrisation will yield less smooth solutions for closely spaced waypoints
where the velocity constraint is not reached. The degrees of the three new sub-
segments are therefore chosen to be equal. This parametrisation is demonstrated
in Figure 7.9 for a 1 m point-to-point trajectory with equal segment durations of
1 s.
with limits
4(nd +1) − 1 for nw = 2
deg(p) ≥ 3
(7.4.3)
n + 1
d for nw → ∞
190
7.4 Velocity Constrained Trajectory Generation
191
Chapter 7 Fast Online Trajectory Optimisation
1 ẋ2 + ẏ 2 ≤ v 2
M = 16
M =8
0.5 M =4
0
ẏ
−0.5
−1
−1 −0.5 0 0.5 1
ẋ
192
7.4 Velocity Constrained Trajectory Generation
2
Unconstrained
1 Constrained
p(t) (m)
Waypoint
0 Subsegment
−1 Boundary
−2
0 0.5 1 1.5 2 2.5 3 3.5 4
t (s)
2 Unconstrained
Constrained
ṗ(t) (m s−1 )
1
±v
0 Subsegment
Boundary
−1
infeasible.
An example of this trajectory planner is shown in Figure 7.11, along with the
original QP solution without enforcement of velocity constraints. Subsegment
durations are selected by a method introduced later in this chapter.
193
Chapter 7 Fast Online Trajectory Optimisation
if Ak = Ak−1 then
Ak is invariant, therefore constraints are satisfied;
return x
end
end
return Failed to iteratively constrain trajectory, problem is infeasible.
whilst maintaining both the same guarantee of optimality and the same solution
space as the recursively constrained approach.
A polynomial p(t) of degree 2d that is a sum-of-squares polynomial can be
written in the Gram matrix form
194
7.4 Velocity Constrained Trajectory Generation
sum-of-squares polynomials, meaning this basis retains the same set of solutions
as that achieved by recursively enforcing non-negativity as in the previous section
[132].
Furthermore, the constraint p(t) ≥ 0 can be enforced on just the interval
t ∈ [a, b] if p(t) can be decomposed in the form
s(t) + (t − a)(b − t)q(t), if deg (p(t)) is even
p(t) = (7.4.8)
(t − a)s(t) + (b − t)q(t), if deg (p(t)) is odd
where s(t) and q(t) are SOS. For even deg (p), deg (p) = 2d, deg (s) ≤ 2d, and
deg (q) ≤ 2d − 2. For odd deg (p), deg (p) = 2d + 1, deg (s) ≤ 2d, deg (q) ≤ 2d
[133]. Similarly, all univariate polynomials that are non-negative on an interval
can be decomposed in this way, so again this basis does not yield a reduced
polynomial set.
It is therefore possible to enforce the constraint −p ≤ p(t) ≤ p ∀ t ∈ [a, b] by
considering the necessary equivalence
195
Chapter 7 Fast Online Trajectory Optimisation
and using the Schur complement test for positive semidefiniteness, with positive
definite H decomposed as H = P T P by eigendecomposition, allows (7.4.19) to
be written in the linear matrix inequality form
Iρ Px 0ρ×m
(7.4.20)
T T
x P t 01×m 0
196
7.4 Velocity Constrained Trajectory Generation
0.25
Recursively Constrained QP
0.2 SOS Constrained SDP
0.15
texec (s)
0.1
0.05
nw = 10
nw = 2
nw = 3
nw = 4
nw = 5
nw = 6
nw = 7
nw = 8
nw = 9
Figure 7.12: Monte Carlo analysis of the distribution of solve time over waypoint
quantity for velocity constrained trajectories, solved using both the recursively
constrained QP and SOS constrained SDP methods. Each value of nw is eval-
uated using a 1000 point Monte Carlo simulation, where each set of waypoints
are drawn from a standard normal distribution. Subsegment durations are se-
lected as the minimum time solution to a constrained trapezoidal profile. This
shows that the new SOS constrained SDP trajectory optimisation method yields
a significant decrease in computation time over the recursively constrained QP
method.
197
Chapter 7 Fast Online Trajectory Optimisation
The globally optimal solution with a similar cost function as (7.3.16) can be
found by gradient descent as in Section 7.3.5, with velocity constraint violation
included using inequalities with a quadratic cost on violation. Using the recursive
QP method in Section 7.4.3 this optimisation takes tens of seconds for trajectories
through five random waypoints, and is therefore impossible to perform in real-
time.
While it is impossible to optimise segment and subsegment durations for the
full problem in real-time, it is possible to optimise a simplified problem suffi-
ciently quickly for real-time implementation. Noting the similarity between the
velocity constrained trajectories in Figure 7.11 and a piecewise constant accelera-
tion trapezoidal profile, every middle subsegment of each segment is simplified to
a linear polynomial, and all other subsegments are simplified to quadratic poly-
nomials. This reduced basis is then optimised for minimum time whilst enforcing
velocity and acceleration constraints. This simplified formulation also allows the
exact enforcement of the quadratic velocity constraint ẋ2 + ẏ 2 ≤ v 2 without a
significant increase in problem complexity, which by lengthening the durations of
segments during combined motion along x and y effectively acts to approximately
enforce the full quadratic velocity constraint on any subsequent full-degree op-
timisation. This alleviates some of the potential constraint violation introduced
in Section 7.4.2.
Defining subsegment polynomials as pi,j (t), waypoints as wi,j , and subsegment
durations as Ti,j , where i ∈ [1 . . 3] specifies the flat output index, and j ∈
[1 . . 3(nw − 1)] specifies the subsegment index, this nonlinear program can be
defined as
3 3(nw −1)
(7.4.22)
X X
min Ti,j
x,T
i=1 j=1
k+2
X k+2
X
s.t. Ti,j = Ti+1,j ∀ i ∈ [1 . . 2], k ∈ [1, 4, . . 1 + 3(nw − 1)]
j=k j=k
(7.4.23)
(n) (n)
pi,j (Ti,j ) = pi,j+1 (0) ∀ i ∈ [1 . . 3], j ∈ [1 . . 3(nw − 1)],
n ∈ [0 . . 1]
(7.4.24)
198
7.4 Velocity Constrained Trajectory Generation
(7.4.25)
(n) (n)
pi,1 (0) = wi,1 ∀ i ∈ [1 . . 3], n ∈ [0 . . 1]
pi,3j (Ti,3j ) = wi,j+1 ∀ i ∈ [1 . . 3], j ∈ [1 . . nw − 1] (7.4.26)
2 2 2
(ṗ1,j (0)) + (ṗ2,j (0)) ≤ v ∀ i ∈ [1 . . 3], j ∈ [2, 5, . . 3(nw − 1) − 1] (7.4.27)
|ṗ3,j (0)| ≤ φ̇ ∀ j ∈ [2, 5, . . 3(nw − 1) − 1] (7.4.28)
|p̈i,j (0)| ≤ v̇ ∀ i ∈ [1 . . 2], j ∈ [1, 3, 4, 6, 7 . . 3(nw − 1)] (7.4.29)
|p̈3,j (0)| ≤ φ̈ ∀ j ∈ [1, 3, 4, 6, 7 . . 3(nw − 1)] (7.4.30)
199
Chapter 7 Fast Online Trajectory Optimisation
0.2
0
2 3 4 5 6 7 8 9 10
nw
five waypoints is shown in Figure 7.15, showing nearly identical solutions. This
two-stage duration selection scheme is found to yield trajectories that are close
to the globally optimal solution for smoothness over time, whilst achieving a 100
to 1000 fold reduction in execution time.
200
7.4 Velocity Constrained Trajectory Generation
0 0
−2 −2
0 5 10 15 20 0 5 10 15 20
0 0
−1 −1
0 5 10 15 20 0 5 10 15 20
1 1
0 0
−1 −1
0 5 10 15 20 0 5 10 15 20
Figure 7.14: Minimum time trapezoidal (blue) and full degree optimally smooth
(red) trajectories through nine waypoints (black markers) with constraints v = 1,
a = 1. The trajectory in S3 is left at rest and not shown. Vertical dashed lines
denote subsegment boundaries.
ment are shown in Figure 7.18, demonstrating good tracking, further validating
the accuracy of the differentially flat model.
Figure 7.17 shows a rest-to-rest pirouetting trajectory from the origin to (x, y,
φ) = (0, 2, 4π), in which two blue LEDs are used to capture the tracked trajec-
tory. This again demonstrates smooth transitions between different body relative
directions of motion, and shows zero overshoot. Corresponding state trajectories
are shown in Figure 7.19. While a small tracking error is observed, this error
201
Chapter 7 Fast Online Trajectory Optimisation
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Figure 7.15: Optimally smooth flat output (blue) and state (red) trajectories
for trapezoidal optimised polynomial durations (solid) and gradient descent op-
timised polynomial durations (dashed) through five waypoints (black markers),
with equal total duration between the two schemes.
Figure 7.16: Navigation of a gap narrower than the robot’s width, demonstrating
one of the advantages of the Collinear Mecanum Drive. This trajectory passes
through four waypoints, spaced over 2 m and progressing right across the figure
in a total of 3 s, in which a 90° φ angle is enforced at the middle two waypoints.
202
7.5 Conclusion
7.5 Conclusion
This chapter has shown that through the selection of suitable fictitious flat out-
puts and model simplification the dynamic model of a CMD can be differentially
flattened, allowing the derivation of dynamically feasible state trajectories from
any sufficiently smooth trajectories in the flat outputs. The accuracy of this
203
Chapter 7 Fast Online Trajectory Optimisation
·10−2
vx
5 1 vxr
0
0.5
−5
x xr
0
0 1 2 3 0 1 2 3
1
2 vy vyr
0.5
1
y
yr 0
0
0 1 2 3 0 1 2 3
1.5 φ 2 φ̇ φ̇r
φr
1
0
0.5
0 −2
0 1 2 3 0 1 2 3
2
0.2 θ̇p θ̇pr
1
0
0
−0.2 θp θpr
−1
0 1 2 3 0 1 2 3
0.1 τ1
τ2
τ3
0 τ4
τff ,1
τff ,2
τff ,3
−0.1 τff ,4
0 0.5 1 1.5 2 2.5 3 3.5
Figure 7.18: State trajectories for the gap navigation experiment shown in Figure
7.16, in which a 2 m translation is performed through a gap narrower than the
CMD’s width, achieved by rotating the CMD to translate along its wheel axle.
204
7.5 Conclusion
·10−2
5 1
vx
0.5 vxr
0
0
−5 x −0.5
xr
−1
0 1 2 3 4 0 1 2 3 4
2 1 vy
vyr
0.5
1 0
y −0.5
0 yr
−1
0 1 2 3 4 0 1 2 3 4
6 φ̇ φ̇r
10
4
5
φ 2
0 φr
0
0 1 2 3 4 0 1 2 3 4
0.4 2
θp θ̇p θ̇pr
0.2 θpr 1
0
0
−1
−0.2
0 1 2 3 4 0 1 2 3 4
0.1 τ1
τ2
τ3
0 τ4
τff ,1
τff ,2
τff ,3
−0.1 τff ,4
0 0.5 1 1.5 2 2.5 3 3.5 4
Figure 7.19: State trajectories for the pirouetting trajectory experiment shown in
Figure 7.17, in which the CMD translates from the origin to (x, y, φ) = (0, 2, 4π)
in 4 s.
205
Chapter 7 Fast Online Trajectory Optimisation
Figure 7.20: A long exposure image of a circular trajectory passing through the
four corners of a 1.5 m square whilst performing a rotation in φ of 6π rad. This
is intended to demonstrate the complete freedom of motion achievable using the
CMD.
model has then been demonstrated both in simulation and on the experimental
prototype, showing it generates nearly exactly dynamically feasible trajectories
that are closely tracked in real-world testing.
Two novel velocity constrained trajectory planners have then been demon-
strated, allowing for the online derivation of optimally smooth and constrained
trajectories through large numbers of waypoints. Finally, a method for the se-
lection of the timing properties of these waypoints as been demonstrated, which
is again sufficiently computationally efficient for real-time implementation. To-
gether, these methods allow for a CMD to smoothly navigate complex environ-
ments in a close to time-optimal fashion.
Future work would explore the autonomous selection of minimal sets of way-
points required to describe paths between locations in an occupancy map, allow-
ing the navigation of environments with obstacles. This problem has been well
addressed in the quadrotor trajectory planning literature [22, 137, 138]. In this
206
7.5 Conclusion
2 1
x vx
xr 0.5 vxr
1 0
−0.5
0
−1
0 2 4 6 8 10 0 2 4 6 8 10
2
y 1 vy
yr vyr
1 0
0 −1
0 2 4 6 8 10 0 2 4 6 8 10
4
φ̇ φ̇r
10 3
2
5
φ 1
0 φr
0
0 2 4 6 8 10 0 2 4 6 8 10
0.1 τ1
τ2
τ3
0 τ4
τff ,1
τff ,2
τff ,3
−0.1 τff ,4
0 2 4 6 8 10
Figure 7.21: State trajectories for the same experiment as shown in Figure 7.20,
but whilst only performing a rotation of 4π rad in φ in order to improve clarity.
207
Chapter 7 Fast Online Trajectory Optimisation
208
Chapter 8
Conclusion
This concluding chapter serves to summarise and present the work of this thesis
as a whole, performs a qualitative comparison of the CMD control and planning
techniques developed within, and sets out proposals for future work building on
that detailed in this thesis.
209
Chapter 8 Conclusion
210
8.1 A Comparison of Controllers
though gains must be chosen as to avoid excessive actuator saturation and sub-
sequent instability.
Chapter 6’s model predictive controller is the most aggressive developed in this
thesis, capable of optimally saturating the wheel torque setpoints for prolonged
durations without any negative effect on system stability, along with exactly
enforcing velocity and lean angle constraints. Decreasing R in the underlying cost
function effectively tends this controller towards the generation of minimum-time
bang-bang trajectories for the linearised plant.
The differential flatness based polynomial planner of Chapter 7 does not in-
corporate input constraint enforcement, and so segment durations must be con-
servative as to avoid actuator saturation. The tracking TVLQR controller is also
unable to enforce wheel torque constraints, so again gains must be conservatively
chosen as to maintain stability for a given degree of trajectory deviation and
input constraint.
211
Chapter 8 Conclusion
sponsible for closed-loop stability and high bandwidth disturbance rejection, real
time operation is required, which for this simple control formulation can be triv-
ially performed by a low-power microcontroller. The outer trajectory planner has
much greater computational requirements, but only needs to plan new trajecto-
ries during large disturbances or a change in objective, potentially allowing this
planning to be performed in parallel with other high-level tasks such as SLAM
and communication.
torque, so E ∝ kτ k22 dt. The most power efficient controller would therefore
R
be that which uses the least energy to perform some point-to-point manoeuvre,
provided equivalent total duration and aggressiveness of disturbance rejection.
This latter property is difficult to quantify, and so therefore an experimental
comparison is difficult to fairly perform.
The backstepping derived controllers all asymptotically constrain v̇x , φ̈, and θ̈p
accelerations, which will in turn act to indirectly minimise kτ k22 . This controller
does not incorporate any mechanism for the planning of the most efficient tra-
jectories through multiple waypoints. The MPC approach, on the other hand,
is able to both directly optimally minimise kτ k22 , whilst using advance reference
knowledge to optimise for minimal control action over a receding horizon. The
differential flatness based trajectory planning approach is able to perform this
minimisation in a more global sense, finding the smoothest possible path achiev-
able using the given polynomial basis between any number of waypoints. This
optimal smoothness is, however, only an analogue to minimising kτ k22 .
8.1.4 Safety
The safety of a controller is considered here in terms of the ability to maintain
closed-loop stability in the presence of input and output constraints. The nonlin-
ear backstepping control approach provides stability and convergence guarantees
for the full nonlinear plant, though conservative acceleration constraint selection
is required in order to avoid wheel slip. The MPC approach maintains a stabil-
212
8.1 A Comparison of Controllers
ity proof whilst directly observing wheel torque constraints, though this proof
only holds for a linearisation of the CMD dynamics. The TVLQR controller
in Chapter 7 provides no such constrained stability guarantee, and can there-
fore only operate for small deviations from the planned trajectory, meaning large
deviations much be addressed by sufficiently fast trajectory replanning.
213
Chapter 8 Conclusion
Table 8.1 aims to roughly assign a ranking to each of the presented controllers
against the above qualitative metrics. Conclusion as to controller suitability for
likely applications are then drawn. For use as a personal vehicle or teleoperated
platform, safety and smoothness of motion are of greatest importance, making
the backstepping controller of Chapter 5 the most suitable choice. For a fast
reactive or local planning application, such as an autonomous robot that is to
track a moving reference, the MPC controller of Chapter 6 is most suitable,
achieving fast setpoint tracking through optimal constraint satisfaction and to-
ward bang-bang control. Finally, for fully autonomous applications requiring
the navigation of an obstacle filled map, the differential flatness and polynomial
based planning techniques of Chapter 7 are most suitable, as these allow for
straightforward incorporation of obstacle avoidance whilst producing maximally
smooth trajectories.
214
8.2 Future Work
Table 8.1: A qualitative ranking of the three presented controllers against a num-
ber of metrics, where a value of 1 denotes the most suitable controller for a given
metric.
Metric Feedback MPC Differential
Linearised Flatness Based
Nonlinear Control Planning
Aggressiveness 3 1 2
Computational 1 2 3
Complexity
Power requirements 3 1 2
Safety 1 2 3
Smoothness of Motion 2 3 1
Map Navigation 3 2 1
8.2.1
215
Chapter 8 Conclusion
8.2.2
8.2.3
216
Bibliography
[3] B. E. Ilon, “Wheels for a course stable selfpropelling vehicle movable in any
desired direction on the ground or some other base,” Patent US3 876 255,
1975. [Online]. Available: https://patents.google.com/patent/US3876255
219
Bibliography
HRI ’09. New York, New York, USA: ACM Press, 2009, p. 205. [Online].
Available: http://portal.acm.org/citation.cfm?doid=1514095.1514176
220
Bibliography
[17] S. Devasia and B. Paden, “Exact output tracking for nonlinear time-
varying systems,” in Proceedings of 1994 33rd IEEE Conference on
Decision and Control, vol. 3. IEEE, 1994, pp. 2346–2355. [Online].
Available: http://ieeexplore.ieee.org/document/411465/
221
Bibliography
[22] C. Richter, A. Bry, and N. Roy, “Polynomial trajectory planning for ag-
gressive quadrotor flight in dense indoor environments,” in Springer Tracts
in Advanced Robotics, vol. 114, 2016, pp. 649–666. [Online]. Available:
https://link.springer.com/chapter/10.1007{%}2F978-3-319-28872-7{_}37
[25] C. Sferrazza, D. Pardo, and J. Buchli, “Numerical search for local (partial)
differential flatness,” in IEEE International Conference on Intelligent
Robots and Systems, vol. 2016-Novem, 2016, pp. 3640–3646. [Online].
Available: https://ieeexplore.ieee.org/document/7759536
[27] P. Hart, N. Nilsson, and B. Raphael, “A formal basis for the heuristic
determination of minimum cost paths,” IEEE Transactions on Systems
Science and Cybernetics, vol. 4, no. 2, pp. 100–107, 1968. [Online].
Available: http://ieeexplore.ieee.org/document/4082128/
[29] C. Warren, “Global path planning using artificial potential fields,” in 1989
222
Bibliography
223
Bibliography
Proceedings Volumes, vol. 45, no. 22, pp. 7–12, 2012. [Online]. Available:
https://doi.org/10.3182/20120905-3-HR-2030.00002
224
Bibliography
[45] Z. Li, C. Yang, and L. Fan, Advanced control of wheeled inverted pendulum
systems. Springer, 2013. [Online]. Available: https://link.springer.com/
book/10.1007/978-1-4471-2963-9
225
Bibliography
Transactions on Robotics, vol. 21, no. 3, pp. 505–513, Jun. 2005. [Online].
Available: http://ieeexplore.ieee.org/document/1435497/
226
Bibliography
systems,” IEEE Transactions on Robotics, vol. 26, no. 4, pp. 750–758, aug
2010. [Online]. Available: http://ieeexplore.ieee.org/document/5512655/
[59] M. Yue, C. An, and J.-Z. Sun, “An efficient model predictive control for
trajectory tracking of wheeled inverted pendulum vehicles with various
physical constraints,” International Journal of Control, Automation and
Systems, vol. 18, no. 1, pp. 265–274, 2018. [Online]. Available: http:
//dx.doi.org/10.1007/s12555-016-0393-zhttp://www.springer.com/12555
[63] C.-H. Huang, W.-J. Wang, and C.-H. Chiu, “Design and implementation
of fuzzy control on a two-wheel inverted pendulum,” IEEE Transactions
on Industrial Electronics, vol. 58, no. 7, pp. 2988–3001, Jul. 2011. [Online].
Available: http://ieeexplore.ieee.org/document/5556004/
227
Bibliography
vol. 25, no. 11, pp. 2004–2016, Nov. 2014. [Online]. Available:
http://ieeexplore.ieee.org/document/6762995/
[68] Ralph L. Hollis, “Dynamic balancing mobile robot,” Patent US7 847 504B2,
Oct., 2007. [Online]. Available: https://patents.google.com/patent/
US7847504B2/en
228
Bibliography
[76] A. Bonci, “New dynamic model for a ballbot system,” in MESA 2016 -
12th IEEE/ASME International Conference on Mechatronic and Embedded
Systems and Applications - Conference Proceedings. IEEE, aug 2016, pp.
1–6. [Online]. Available: http://ieeexplore.ieee.org/document/7587176/
229
Bibliography
230
Bibliography
[92] R. Marino, “On the largest feedback linearizable subsystem,” Systems and
Control Letters, vol. 6, no. 5, pp. 345–351, Jan. 1986. [Online]. Available:
https://doi.org/10.1016/0167-6911(86)90130-1
231
Bibliography
Automatica, vol. 45, no. 1, pp. 265–269, Jan. 2009. [Online]. Available:
https://doi.org/10.1016/j.automatica.2008.07.004
[100] Wei Zhong and H. Rock, “Energy and passivity based control of
the double inverted pendulum on a cart,” in Proceedings of the
2001 IEEE International Conference on Control Applications (CCA’01)
(Cat. No.01CH37204). IEEE, 2002, pp. 896–901. [Online]. Available:
http://ieeexplore.ieee.org/document/973983/
[102] M. W. Spong, “The swing up control problem for the acrobot,” IEEE
Control Systems, vol. 15, no. 1, pp. 49–55, Feb. 1995. [Online]. Available:
https://ieeexplore.ieee.org/document/341864/
232
Bibliography
Systems, VSS’06, vol. 2006. IEEE, 2006, pp. 365–372. [Online]. Available:
http://ieeexplore.ieee.org/document/1644545/
233
Bibliography
234
Bibliography
235
Bibliography
[136] M. ApS, The MOSEK optimization toolbox for MATLAB manual. Version
8.1., 2017. [Online]. Available: http://docs.mosek.com/8.1/toolbox/index.
html
236
Bibliography
237
Appendix A
m1,1 = mp + 4mw
m1,3 = hp mp cos(φ) sin(θp ) − l2 mw sin(φ) − l3 mw sin(φ) − l4 mw sin(φ)
− l1 mw sin(φ)
m1,4 = hp mp cos(θp ) sin(φ)
m2,2 = mp + 4mw
m2,3 = l1 mw cos(φ) + l2 mw cos(φ) + l3 mw cos(φ) + l4 mw cos(φ)
+ hp mp sin(φ) sin(θp )
m2,4 = −hp mp cos(φ) cos(θp )
m3,1 = hp mp cos(φ) sin(θp ) − l2 mw sin(φ) − l3 mw sin(φ) − l4 mw sin(φ)
− l1 mw sin(φ)
m3,2 = l1 mw cos(φ) + l2 mw cos(φ) + l3 mw cos(φ) + l4 mw cos(φ)
+ hp mp sin(φ) sin(θp )
m3,3 = 4Iwyz + Ipby sin(θp )2 + l12 mw + l22 mw + l32 mw + l42 mw − Ipbz (sin(θp )2 − 1)
+ h2p mp sin(θp )2
239
Appendix A CMD Model Matrix Definitions
0 0 c1,3 c1,4
0 0 c2,3 c2,4
04×8
(A.1.2)
C(q, q̇) =
0 0 c3,3 c3, 4
0 0 c4,3 0
08×4 08×8
where
03×1
G(q) = −ghp mp sin(θp ) (A.1.3)
08×1
240
A.1 Matrices for CMD Dynamics Model in (q, q̇)
0 0 0 0 0 f1,9 f1,10 f1,11 f1,12
0 0 0 0 0
f2,9 f2,10 f2,11 f2,12
0 0 0 0 0 0 0 0 0
f4,4 kv w k v w k v w k v w 0 0 0 0
08×3
(A.1.4)
F =
kvw f5,5 0 0 0 f5,9 0 0 0
kvw 0 f6,6 0 0 0 f6,10 0 0
kvw 0 0 f7,7 0 0 0 f7,11 0
kvw 0 0 0 f8,8 0 0 0 f8,12
04×3 04×9
where
03×4
−11×4
B=
I
(A.1.5)
4×4
04×4
241
Appendix A CMD Model Matrix Definitions
242
A.2 Matrices for CMD Dynamics Model in (p, ṗ)
c1,1 c1,2 c1,3 c1,4
c2,1 c2,2 c2,3 c2,4
Cp (p, ṗ) =
c
(A.2.2)
3,1 c3,2 c3,3 c3,4
0 0 c4,3 0
2
c1,1 = − (Iwx sin(2α4 + 2φ)φ̇)/(2rw sin(α4 )2 )
− (Iwx φ̇(sin(α1 )2 sin(α2 )2 sin(2α3 + 2φ) + sin(α1 )2 sin(α3 )2 sin(2α2 + 2φ)
+ sin(α2 )2 sin(α3 )2 sin(2α1 + 2φ)))/(2rw
2
sin(α1 )2 sin(α2 )2 sin(α3 )2 )
c1,2 = − (Iwx cos(α1 + φ)2 φ̇)/(rw
2
(cos(α1 )2 − 1))
− (Iwx cos(α2 + φ)2 φ̇)/(rw
2
(cos(α2 )2 − 1))
− (Iwx cos(α3 + φ)2 φ̇)/(rw
2
(cos(α3 )2 − 1))
− (Iwx cos(α4 + φ)2 φ̇)/(rw
2
(cos(α4 )2 − 1))
c1,3 = hp mp cos(φ) cos(θp )θ̇p − l2 mw cos(φ)φ̇ − l3 mw cos(φ)φ̇ − l4 mw cos(φ)φ̇
− l1 mw cos(φ)φ̇ − hp mp sin(φ) sin(θp )φ̇
243
Appendix A CMD Model Matrix Definitions
" #
03×1
Gp (p) = (A.2.3)
−ghp mp sin(θp )
f1,1 f1,2 f1,3 f1,4
f2,1 f2,2 f2,3 f2,4
Fp (p) =
f
(A.2.4)
3,1 f3,2 f3,3 f3,4
f4,1 f4,2 f4,3 f4,4
244
A.2 Matrices for CMD Dynamics Model in (p, ṗ)
where
245
Appendix A CMD Model Matrix Definitions
2
f2,1 = (sin(2α1 + 2φ)(krw + kvw ))/(rw (cos(2α1 ) − 1))
2
+ (sin(2α2 + 2φ)(krw + kvw ))/(rw (cos(2α2 ) − 1))
2
+ (sin(2α3 + 2φ)(krw + kvw ))/(rw (cos(2α3 ) − 1))
2
+ (sin(2α4 + 2φ)(krw + kvw ))/(rw (cos(2α4 ) − 1))
+ (cos(φ)((kvr sin(φ) sin(α1 ))/(rr − rw )
− (kvr sin(α1 + φ) cos(α1 ))/(rw sin(α1 ))))/(rr sin(α1 ))
+ (cos(φ)((kvr sin(φ) sin(α2 ))/(rr − rw )
− (kvr sin(α2 + φ) cos(α2 ))/(rw sin(α2 ))))/(rr sin(α2 ))
+ (cos(φ)((kvr sin(φ) sin(α3 ))/(rr − rw )
− (kvr sin(α3 + φ) cos(α3 ))/(rw sin(α3 ))))/(rr sin(α3 ))
+ (cos(φ)((kvr sin(φ) sin(α4 ))/(rr − rw )
− (kvr sin(α4 + φ) cos(α4 ))/(rw sin(α4 ))))/(rr sin(α4 ))
f2,2 = (sin(φ)((kvr sin(φ) sin(α1 ))/(rr − rw )
+ (kvr sin(α1 + φ)(2 sin(α1 /2)2 − 1))/(rw sin(α1 ))))/(rr sin(α1 ))
+ (sin(φ)((kvr sin(φ) sin(α2 ))/(rr − rw )
+ (kvr sin(α2 + φ)(2 sin(α2 /2)2 − 1))/(rw sin(α2 ))))/(rr sin(α2 ))
+ (sin(φ)((kvr sin(φ) sin(α3 ))/(rr − rw )
+ (kvr sin(α3 + φ)(2 sin(α3 /2)2 − 1))/(rw sin(α3 ))))/(rr sin(α3 ))
+ (sin(φ)((kvr sin(φ) sin(α4 ))/(rr − rw )
+ (kvr sin(α4 + φ)(2 sin(α4 /2)2 − 1))/(rw sin(α4 ))))/(rr sin(α4 ))
− (sin(α1 + φ)2 (krw + kvw ))/(rw
2
sin(α1 )2 )
− (sin(α2 + φ)2 (krw + kvw ))/(rw
2
sin(α2 )2 )
− (sin(α3 + φ)2 (krw + kvw ))/(rw
2
sin(α3 )2 )
− (sin(α4 + φ)2 (krw + kvw ))/(rw
2
sin(α4 )2 )
2
f2,3 = − (l4 sin(α4 + φ)(krw + kvw ))/(rw sin(α4 ))
− ((krw + kvw )(l1 sin(α1 + φ) sin(α2 ) sin(α3 )
+ l2 sin(α2 + φ) sin(α1 ) sin(α3 )
2
+ l3 sin(α3 + φ) sin(α1 ) sin(α2 )))/(rw sin(α1 ) sin(α2 ) sin(α3 ))
246
A.2 Matrices for CMD Dynamics Model in (p, ṗ)
f2,4 = − (4kvw cos(φ))/rw − (kvw sin(φ) cot(α1 ))/rw − (kvw sin(φ) cot(α2 ))/rw
− (kvw sin(φ) cot(α3 ))/rw − (kvw sin(φ) cot(α4 ))/rw
2
f3,1 = − (l1 cos(α1 + φ)(krw + kvw ))/(rw sin(α1 ))
2
− (l2 cos(α2 + φ)(krw + kvw ))/(rw sin(α2 ))
2
− (l3 cos(α3 + φ)(krw + kvw ))/(rw sin(α3 ))
2
− (l4 cos(α4 + φ)(krw + kvw ))/(rw sin(α4 ))
− (kvr l1 cos(φ) cot(α1 ))/(rr rw ) − (kvr l2 cos(φ) cot(α2 ))/(rr rw )
− (kvr l3 cos(φ) cot(α3 ))/(rr rw ) − (kvr l4 cos(φ) cot(α4 ))/(rr rw )
2
f3,2 = − (l1 sin(α1 + φ)(krw + kvw ))/(rw sin(α1 ))
2
− (l2 sin(α2 + φ)(krw + kvw ))/(rw sin(α2 ))
2
− (l3 sin(α3 + φ)(krw + kvw ))/(rw sin(α3 ))
2
− (l4 sin(α4 + φ)(krw + kvw ))/(rw sin(α4 ))
− (kvr l1 sin(φ) cot(α1 ))/(rr rw ) − (kvr l2 sin(φ) cot(α2 ))/(rr rw )
− (kvr l3 sin(φ) cot(α3 ))/(rr rw ) − (kvr l4 sin(φ) cot(α4 ))/(rr rw )
f3,3 = − ((krw + kvw )(l12 + l22 + l32 + l42 ))/rw
2
247
Appendix A CMD Model Matrix Definitions
2 2
m1,1 = mp + 4mw − (4Iwx )/rw + Iwx /(rw sin(α1 )2 ) + Iwx /(rw
2
sin(α2 )2 )
2
+ Iwx /(rw sin(α3 )2 ) + Iwx /(rw
2
sin(α4 )2 )
2
m1,2 = (Iwx (cot(α1 ) + cot(α2 ) + cot(α3 ) + cot(α4 )))/rw
2
m1,3 = (Iwx (l1 cot(α1 ) + l2 cot(α2 ) + l3 cot(α3 ) + l4 cot(α4 )))/rw + hp mp sin(θp )
2
m2,1 = (Iwx (cot(α1 ) + cot(α2 ) + cot(α3 ) + cot(α4 )))/rw
2
m2,2 = mp + 4mw + (4Iwx )/rw
2 2
m2,3 = ((mw rw + Iwx )(l1 + l2 + l3 + l4 ))/rw
m2,4 = − hp mp cos(θp )
2
m3,1 = (Iwx (l1 cot(α1 ) + l2 cot(α2 ) + l3 cot(α3 ) + l4 cot(α4 )))/rw + hp mp sin(θp )
2 2
m3,2 = ((mw rw + Iwx )(l1 + l2 + l3 + l4 ))/rw
m3,3 = 4Iwyz + (Iwx l12 + Iwx l22 + Iwx l32 + Iwx l42 )/rw
2
+ Ipby sin(θp )2 + l12 mw + l22 mw
+ l32 mw + l42 mw − Ipbz (sin(θp )2 − 1) + h2p mp sin(θp )2
m4,2 = − hp mp cos(θp )
m4,4 = mp h2p + Ipbx
0 c1,2 c1,3 c1,4
c2,1 0 c2,3 c2,4
Cv (p, v) =
(A.3.2)
c c c c
3,1 3,2 3,3 3,4
c4,1 0 c4,3 0
248
A.3 Matrices for CMD Dynamics Model in (p, v)
" #
03×1
Gv (p) = (A.3.3)
−ghp mp sin(θp )
f1,1 f1,2 f1,3 f1,4
f2,1 f2,2 f2,3 f2,4
Fv =
f
(A.3.4)
3,1 f3,2 f3,3 f3,4
f4,1 f4,2 f4,3 f4,4
249
Appendix A CMD Model Matrix Definitions
2
f1,1 = (kvr rw sin(α1 )2 sin(α2 )2 − kvw rr2 sin(α1 )2 sin(α3 )2 − kvw rr2 sin(α2 )2 sin(α3 )2
− kvw rr2 sin(α1 )2 sin(α2 )2 + kvr rw
2
sin(α1 )2 sin(α3 )2
2
+ kvr rw sin(α2 )2 sin(α3 )2 − krw rr2 sin(α1 )2 sin(α2 )2
− krw rr2 sin(α1 )2 sin(α3 )2 − krw rr2 sin(α2 )2 sin(α3 )2
− kvr rr rw sin(α1 )2 sin(α2 )2 − kvr rr rw sin(α1 )2 sin(α3 )2
− kvr rr rw sin(α2 )2 sin(α3 )2 + kvw rr rw sin(α1 )2 sin(α2 )2
+ kvw rr rw sin(α1 )2 sin(α3 )2 + kvw rr rw sin(α2 )2 sin(α3 )2
+ 4krw rr2 sin(α1 )2 sin(α2 )2 sin(α3 )2 + 4kvw rr2 sin(α1 )2 sin(α2 )2 sin(α3 )2
+ krw rr rw sin(α1 )2 sin(α2 )2 + krw rr rw sin(α1 )2 sin(α3 )2
+ krw rr rw sin(α2 )2 sin(α3 )2 − 4krw rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2
+ 4kvr rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2
− 4kvw rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2 )
2
/(rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2 (rr − rw ))
− (krw rr2 sin(α1 )2 sin(α2 )2 sin(α3 )2 + kvw rr2 sin(α1 )2 sin(α2 )2 sin(α3 )2
2
− kvr rw sin(α1 )2 sin(α2 )2 sin(α3 )2 − krw rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2
+ kvr rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2
− kvw rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2 )
2
/(rr rw sin(α1 )2 sin(α2 )2 sin(α3 )2 sin(α4 )2 (rr − rw ))
2
f1,2 = − ((krw + kvw )(cot(α1 ) + cot(α2 ) + cot(α3 ) + cot(α4 )))/rw
2
f1,3 = − ((krw + kvw )(l1 cot(α1 ) + l2 cot(α2 ) + l3 cot(α3 ) + l4 cot(α4 )))/rw
f1,4 = − (kvw (cot(α1 ) + cot(α2 ) + cot(α3 ) + cot(α4 )))/rw
2
f2,1 = − ((krw rr + kvw rr + kvr rw )(cot(α1 ) + cot(α2 ) + cot(α3 ) + cot(α4 )))/(rr rw )
2
f2,2 = − (4(krw + kvw ))/rw
2
f2,3 = − ((krw + kvw )(l1 + l2 + l3 + l4 ))/rw
f2,4 = − (4kvw )/rw
f3,1 = − ((krw rr + kvw rr + kvr rw )(l1 cot(α1 ) + l2 cot(α2 ) + l3 cot(α3 )
2
+ l4 cot(α4 )))/(rr rw )
2
f3,2 = − ((krw + kvw )(l1 + l2 + l3 + l4 ))/rw
250
A.3 Matrices for CMD Dynamics Model in (p, v)
− cot(α
rw
1)
− cot(α
rw
2)
− cot(α
rw
3)
− cot(α
rw
4)
251
Appendix B
3 syms t real;
4 syms m_p m_w I_pbx I_pby I_pbz I_wx I_wyz h_p l_1 l_2 ...
l_3 l_4 r_w r_r g alpha_1 alpha_2 alpha_3 alpha_4 ...
k_vr k_vw K_rw real;
5 syms x(t) y(t) phi(t) theta_p (t) theta_1 (t) theta_2 (t) ...
theta_3 (t) theta_4 (t) omega_1 (t) omega_2 (t) omega_3 (...
t) omega_4 (t);
6 syms dx(t) dy(t) dtheta_p (t) dphi(t) dtheta_1 (t) ...
dtheta_2 (t) dtheta_3 (t) dtheta_4 (t) domega_1 (t) ...
domega_2 (t) domega_3 (t) domega_4 (t);
7 syms vx(t) vy(t);
8 syms ddx ddy ddphi ddtheta_p ddtheta_1 ddtheta_2 ...
ddtheta_3 ddtheta_4 ddomega_1 ddomega_2 ddomega_3 ...
ddomega_4 real;
9 syms dvx dvy real;
10 syms tau_1 tau_2 tau_3 tau_4 real;
11
253
Appendix B MATLAB Model Derivation and Analysis Code
254
pi/2 & alpha_2 > 0));
48 assumeAlso (( alpha_3 > -pi/2 & alpha_3 < 0) | ( alpha_3 <...
pi/2 & alpha_3 > 0));
49 assumeAlso (( alpha_4 > -pi/2 & alpha_4 < 0) | ( alpha_4 <...
pi/2 & alpha_4 > 0));
50
54 if nw == 3
55 theta_i = { theta_1 theta_2 theta_3 };
56 dtheta_i = { dtheta_1 dtheta_2 dtheta_3 };
57 ddtheta_i = { ddtheta_1 ddtheta_2 ddtheta_3 };
58 omega_i = { omega_1 omega_2 omega_3 };
59 domega_i = { domega_1 domega_2 domega_3 };
60 ddomega_i = { ddomega_1 ddomega_2 ddomega_3 };
61 l_i = [l_1 l_2 l_3 ];
62 alpha_i = [ alpha_1 alpha_2 alpha_3 ];
63 tau_i = [tau_1 tau_2 tau_3 ]';
64 elseif nw == 4
65 theta_i = { theta_1 theta_2 theta_3 theta_4 };
66 dtheta_i = { dtheta_1 dtheta_2 dtheta_3 dtheta_4 };
67 ddtheta_i = { ddtheta_1 ddtheta_2 ddtheta_3 ddtheta_4 };
68 omega_i = { omega_1 omega_2 omega_3 omega_4 };
69 domega_i = { domega_1 domega_2 domega_3 domega_4 };
70 domega_i = { ddomega_1 ddomega_2 ddomega_3 ddomega_4 };
71 l_i = [l_1 l_2 l_3 l_4 ];
72 alpha_i = [ alpha_1 alpha_2 alpha_3 alpha_4 ];
73 tau_i = [tau_1 tau_2 tau_3 tau_4 ]';
74 end
75 I_w = diag ([ I_wx I_wyz I_wyz ]);
76 I_p = diag ([ I_pbx I_pby I_pbz ]);
77
78
255
Appendix B MATLAB Model Derivation and Analysis Code
95 % pv generalised coordinates
96 v = {vx; vy; dphi; dtheta_p };
97 dv = [dvx; dvy; ddphi; ddtheta_p ];
98
99 % input
100 u = [tau_i ];
101
102
256
104 % correct , provided the correct sign is applied to l_i ...
in the constraint
105 % matrix. Kim and others use this convention , ...
autonomous mobile robots uses
106 % another.
107
257
Appendix B MATLAB Model Derivation and Analysis Code
258
165 %% Derivation of constraints , inverse kinematics , and M...
(q)
166 for i=1: nw
167 % Body frame velocity at center of wheel (W)
168 v_Wb{i} = v_b + [0; dphi*l_i(i); 0];
169
173 % Body frame roller rotation axis u_p and transverse ...
axis u_t
174 u_p{i} = R_BR{i }*[1;0;0];
175 u_t{i} = R_BR{i }*[0;1;0];
176
177 % Contraints
178 constraintNoSlip (i ,1) = dot( formula (v_Cb{i}),u_p{i});
179 constraintRolling (i ,1) = dot( formula (v_Cb{i}),u_t{i}) -...
-r_r* domega_i {i};
180 end
181
259
Appendix B MATLAB Model Derivation and Analysis Code
190
191 %% Energies
192 % Translational kinetic energy
193 K_trans = 0.5*m_p *( v_p. '* v_p);
194 for i=1: nw
195 K_trans = K_trans + 0.5*m_w *( v_w{i}.'* v_w{i});
196 end
197
213
260
222
223 if nw == 3
224 Q_fric = [
225 [eye (2) zeros (2 ,1) ]* R_EB*k_vr *[1/( - r_w+r_r) ;0;0]* dot...
([0;1;0] , formula (R_BR {1}*[ domega_1 ;0;0] + R_BR {2}*[...
domega_2 ;0;0] + R_BR {3}*[ domega_3 ;0;0]) );
226 0;
227 sum(k_vw *( dtheta_i - dtheta_p ));
228 -K_rw* dtheta_1 + k_vw *( dtheta_p - dtheta_1 ) + k_vr*dot...
([1;0;0] , formula (R_BR {1}*[ domega_1 ; 0; 0]));
229 -K_rw* dtheta_2 + k_vw *( dtheta_p - dtheta_2 ) + k_vr*dot...
([1;0;0] , formula (R_BR {2}*[ domega_2 ; 0; 0]));
230 -K_rw* dtheta_3 + k_vw *( dtheta_p - dtheta_3 ) + k_vr*dot...
([1;0;0] , formula (R_BR {3}*[ domega_3 ; 0; 0]));
231 -k_vr*domega_i ';
232 ];
233 elseif nw == 4
234 Q_fric = [
235 [eye (2) zeros (2 ,1) ]* R_EB*k_vr *[1/( - r_w+r_r) ;0;0]* dot...
([0;1;0] , formula (R_BR {1}*[ domega_1 ;0;0] + R_BR {2}*[...
domega_2 ;0;0] + R_BR {3}*[ domega_3 ;0;0] + R_BR {4}*[...
domega_4 ;0;0]) );
236 0;
237 sum(k_vw *( dtheta_i - dtheta_p ));
238 -K_rw* dtheta_1 + k_vw *( dtheta_p - dtheta_1 ) + k_vr*dot...
([1;0;0] , formula (R_BR {1}*[ domega_1 ; 0; 0]));
239 -K_rw* dtheta_2 + k_vw *( dtheta_p - dtheta_2 ) + k_vr*dot...
([1;0;0] , formula (R_BR {2}*[ domega_2 ; 0; 0]));
240 -K_rw* dtheta_3 + k_vw *( dtheta_p - dtheta_3 ) + k_vr*dot...
([1;0;0] , formula (R_BR {3}*[ domega_3 ; 0; 0]));
241 -K_rw* dtheta_4 + k_vw *( dtheta_p - dtheta_4 ) + k_vr*dot...
([1;0;0] , formula (R_BR {4}*[ domega_4 ; 0; 0]));
242 -k_vr*domega_i ';
243 ];
261
Appendix B MATLAB Model Derivation and Analysis Code
244 end
245
262
calls to
270 % functionalDerivative , i.e. no way no improve. Running...
this as a single
271 % thread profiled at 554s, running with the parfor at ...
212 s.
272 for i = 1: size( out.qdq.Mq ,1)
273 parfor j = 1: size( out.qdq.Mq ,1)
274 Cqdq(i,j) = sym (0); % Required to set type of cell
275 for k = 1: size( out.qdq.Mq ,1)
276 Cqdq(i,j) = Cqdq(i,j) + 0.5*( ...
277 functionalDerivative ( out.qdq.Mq (i,j),q{k}) ...
278 + functionalDerivative ( out.qdq.Mq (i,k),q{j}) ...
279 - functionalDerivative ( out.qdq.Mq (j,k),q{i}) ...
280 ) * dq{k};
281 end
282 end
283 end
284 out.qdq.Cqdq = Cqdq;
285 clear Cqdq;
286
263
Appendix B MATLAB Model Derivation and Analysis Code
315
264
324 if ¬isequal ( simplify (A* out.pdp.H ), sym(zeros(numel(q)-...
numel(p), numel(p))))
325 error('H is not a basis for the nullspace of A');
326 end
327
328 % Redefine Mp
329 out.pdp.Mp = simplify (out.pdp.H. '* out.qdq.Mq * out.pdp.H )...
;
330
265
Appendix B MATLAB Model Derivation and Analysis Code
266
373
374
395 % Rotate dx dy to vx vy
396 out.pv.Rv = blkdiag ( formula ( R_EB_2d ),sym(eye (2)));
267
Appendix B MATLAB Model Derivation and Analysis Code
403 % Redefine Mp
404 out.pv.Mp = simplify (out.pv.H. '* out.qdq.Mq * out.pv.H );
405
268
424
269
Appendix B MATLAB Model Derivation and Analysis Code
463
469
270
error
476 e = sym('e_ ' ,[8 ,1]); e_u = sym('e_u_ ' ,[nw 1]); xr = ...
sym('xr_ ' ,[8 ,1]); tau_r = sym('tau_r_ ' ,[nw ,1]);
477
271
Appendix B MATLAB Model Derivation and Analysis Code
502 ];
503
272
518 out.pv.P = out.pv.g ([5 7 8] ,:);
519
536 out.pv.fNew = [
537 out.pv.f (1:4);
538 0;
539 out.pv.f (6) - out.pv.gHat (6 ,1)* out.pv.f (5) - ...
out.pv.gHat (6 ,2)* out.pv.f (7) - out.pv.gHat (6 ,3)*...
out.pv.f (8);
540 0;
541 0];
542
273
Appendix B MATLAB Model Derivation and Analysis Code
548 x(3);
549 x(4);
550 x(5);
551 x(6) - x(5)* out.pv.gHat (6 ,1) - x(7)* out.pv.gHat (6 ,2) - ...
x(8)* out.pv.gHat (6 ,3);
552 x(7);
553 x(8);
554 ];
555
569
274
576 0;
577 out.pv.f (6) - out.pv.f (5)* out.pv.gHat (6 ,1) - out.pv.f...
(7)* out.pv.gHat (6 ,2) - out.pv.f (8)* out.pv.gHat (6 ,3) ...
- z(5)*diff( out.pv.gHat (6 ,1) ,t) - z(7)*diff(...
out.pv.gHat (6 ,2) ,t) - z(8)*diff( out.pv.gHat (6 ,3) ,t);
578 0;
579 0;
580 ], x, out.pz.Tinv );
581
582 out.pz.g = [
583 0 0 0
584 0 0 0
585 0 0 0
586 0 0 0
587 1 0 0
588 0 0 0
589 0 1 0
590 0 0 1
591 ];
592
598
275
Appendix B MATLAB Model Derivation and Analysis Code
276
622 % Define steady state ( constant dvy) derivative of dvy
623 % This should capture variation of dvy for a given ...
theta_p due to
624 % dvx and ddphi
625 syms dtheta_p_ss real;
626 out.pv.ddvy_ss = subs(diff( out.pv.dvy_ss ,t), diff(...
theta_p ), dtheta_p_ss );
627 out.pv.ddvy_ss = subs( out.pv.ddvy_ss , [diff(vx) diff(...
dphi)], [w(1) w(2) ]);
628
632 if nw ==4
633
277
Appendix B MATLAB Model Derivation and Analysis Code
651
278
abs(theta_p - theta_pr ))*( ...
656 - Kr*( theta_pr - fss_minus1_dvy_mvxdphi )*(...
fss_minus1_dvy_mvxdphi * theta_pr - theta_p_max ^2) ...
657 - (( theta_p_max ^2- theta_pr ^2) ^2 * (subs( out.pv.dvy_ss , ...
theta_p , theta_pr ) + vx*dphi)*Kv*(vyr -vy)) / ((...
fss_minus1_dvy_mvxdphi * theta_pr - theta_p_max ^2) *(...
theta_pr - fss_minus1_dvy_mvxdphi )) ...
658 );
659
669
279
Appendix B MATLAB Model Derivation and Analysis Code
676
280
fss_minus1_dvy_f_dvyp * theta_pr - theta_p_max ^2) ...
687 - (( theta_p_max ^2- theta_pr ^2) ^2 * (subs( out.pv.dvy_ss , ...
theta_p , theta_pr ) - dvyp)*Kvy *( vyr+vyp -vy)) / ((...
fss_minus1_dvy_f_dvyp * theta_pr - theta_p_max ^2) *(...
theta_pr - fss_minus1_dvy_f_dvyp )) ...
688 );
689
698
281
Appendix B MATLAB Model Derivation and Analysis Code
708
282
Optimize ', true);
725 end
726
742
747 Q_0 = g;
748 Q_0_closure = Q_0;
283
Appendix B MATLAB Model Derivation and Analysis Code
749 Q_1 = [ Q_0_closure lb(f,g(: ,1) ,x) lb(f,g(: ,2) ,x) lb(f,g...
(: ,3) ,x)];
750 Q_1_closure = [Q_1 lieBracket (Q_1 ,Q_1 ,x)];
751
756
769
284
778
786
790
285
Appendix B MATLAB Model Derivation and Analysis Code
800
801
286
817
287
Appendix B MATLAB Model Derivation and Analysis Code
842
288
868 % , 'outputs ', {'u '});
869
289
Appendix B MATLAB Model Derivation and Analysis Code
893
894 end
895
919
290
925
926 syms m_p m_w I_pbx I_pby I_pbz I_wx I_wyz h_p l_1 l_2 ...
l_3 l_4 r_w r_r g alpha_1 alpha_2 alpha_3 alpha_4 ...
k_vw k_vr K_rw real;
927 names ={}; values = {};
928 names{end +1} = alpha_1 ; values {end +1} = pi /4;
929 names{end +1} = alpha_2 ; values {end +1} = -pi /4;
930 names{end +1} = alpha_3 ; values {end +1} = pi /4;
931 names{end +1} = alpha_4 ; values {end +1} = -pi /4;
932 if ¬simplificationForInversion
933 names{end +1} = I_pbx; values {end +1} = 0.0315 ; % ...
Measured in pendulum experiment
934 names{end +1} = I_pby; values {end +1} = 0.0534 ;
935 names{end +1} = I_pbz; values {end +1} = 0.0271 ;
936 names{end +1} = I_wx; values {end +1} = 5.12e -5; %5.5e...
-05; % Thoroughly estimated at 500 Hz using ...
fit_wheel_inertia_model_accel
937 names{end +1} = I_wyz; values {end +1} = 0 .00011 ;
938 names{end +1} = h_p; values {end +1} = 4*0 .145 *0 .07 /(3...
.22 - 4*0 .145) + 0.07;
939 names{end +1} = m_p; values {end +1} = 3.22 - 4*0 .145;
940 names{end +1} = m_w; values {end +1} = 0.145;
941 names{end +1} = l_1; values {end +1} = -0.105;
942 names{end +1} = l_2; values {end +1} = -0.063;
943 names{end +1} = l_3; values {end +1} = 0.063;
944 names{end +1} = l_4; values {end +1} = 0.105;
945 names{end +1} = r_w; values {end +1} = 0.0595 /2;
946 names{end +1} = r_r; values {end +1} = 0.0055 ;
947 names{end +1} = g; values {end +1} = 9.81;
948 names{end +1} = k_vw; values {end +1} = 2.33e -5;
949 names{end +1} = k_vr; values {end +1} = 1.01e -4;% 9.7e...
-06;
950 names{end +1} = K_rw; values {end +1} = 1.97e -4;%(3e...
-04 - 1.5e -5) *0 .65;
291
Appendix B MATLAB Model Derivation and Analysis Code
951 else
952 names{end +1} = l_3; values {end +1} = -l_2;
953 names{end +1} = l_4; values {end +1} = -l_1;
954 end
955 out = subs(in , names , values );
956 end
957
292
View publication stats