Design and Implementation of an Active Simulator

HAN YUAN, VIRINCHI JOGLEKAR

Master of Science Thesis Stockholm, Sweden 2012 Design and Implementation of an Active Simulator

Han Yuan, Virinchi Joglekar

Master of Science Thesis MMK 2012:61 MDA 441 KTH Industrial Engineering and Management Machine Design SE-100 44 STOCKHOLM Sammanfattning

Detta projekt syftar till att utforma en aktiv h¨astg˚angsimulator samt att tillverka en prototyp och styrning. Syftet ¨aratt utbilda ryttare och ge dem en k¨anslaav att rida en riktig h¨ast.Den mekaniska strukturen samt kontrollen av denna anordning har utformats och genomf¨orts. Detta inkluderar en bakgrundsstudie om h¨astens stegr¨orelse,och trav, som ¨arden g˚angartsom ˚aterskapas av den aktiva stolen. Den inneh˚alleren analys av dessa g˚angarteroch en studie av hur man b¨ast˚aterskapar dessa r¨orelserp˚aett f¨orenklats¨attsamt minskar niv˚anav mekaniska komplexitet fr˚anen verklig h¨asttill en enklare mekanisk maskin. Systemet har modellerats f¨orkontrollsyfte som ett tv˚amasse-system f¨orbundetmed flexibla kopplingar. I projektet ing˚ar¨aven en studie av modelleringsmetoder f¨orframg˚angsrikmatematisk representering av systemet med tillr¨acklig noggrannhet. En ’Integral--Stepping’ kontrollalgoritm utvecklades f¨oratt kontrollera prototypen.

Den mekaniska strukturen kontrolleras med permanentmagnet synkrona v¨axelstr¨oms- motorer. Dessa motorer kontrollerades med hj¨alpav en Siemens S120 kontroll enhet. H¨ogniv˚a-kontroll genomf¨ordesocks˚amed dSPACE, med regleralgoritmer utvecklade i Matlab/Simulink.

Prototypens prestanda j¨amf¨ordesmed de f¨orv¨antade resultaten f¨oratt best¨amma noggrannhet och prestanda hos den slutliga produkten. Den observerades vara kon- trollerad med tillr¨acklig noggrannhet. Prototypen testades av verkliga ryttare, som bed¨omde att h¨astens r¨orelsehade ˚aterskapats v¨al.

1 Abstract

This project aims to design and prototype an active horse gait simulator device. The main objective is to train horse riders and give them the feeling of riding a real horse. The mechanical structure as well as the control of this device have been designed, implemented and tested. A background study of horse , and of the , which is the gait to be recreated by the active chair, was performed. It in- cludes an analysis of these gaits and a study of how best to recreate these motions in a simplified manner, reducing the level of mechanical complexity from that of a real horse to a simpler mechanical machine. The mechanical structure has been modelled as a lumped two mass system for the purpose of performing the design of a high level controller which commands the Siemens SINAMICS S120 AC drive system to drive the mechanical structure. The high level controller was designed in Matlab/Simulink environment on the basis of an Integral Backstepping control approach and automatically implemented on a dSPACE DS1104 R&D Controller Board. An electronics board was designed to integrate the eletronics hardware sys- tem and a simple physical HMI was also designed in support of the interaction with the device.

The prototype device was tested to determine its performance in terms of accu- racy and precision by comparing it with the simulation results. It was observed to be controlled to an acceptable performance by the designed controller. Testing with real riders showed that the motion of a horse’s trot had been well recreated by this prototype device.

2 FOREWORD

We would like to take this opportunity to express our thanks to Mats Hanson and Bengt Erikson, our supervisors at KTH during the period of this thesis work. We would also like to thank Lars Roepstorff of SLU for his guidance and ready support. Thanks also to Bj¨ornM¨ollerfor his design inputs and advice.

And last but not least, we are very much indebted to Staffan Qvarnstr¨omand Tomas Ostberg¨ for their invaluable help during the entire process.

-Han Yuan and Virinchi Joglekar KTH, September 2012

3 NOMENCLATURE

ωa Anti-resonant frequency of the mechanical system (rad/sec)

ωl Load equivalent rotational speed (rad/sec)

ωm Motor shaft speed (rad/sec)

ωr Resonant frequency of the mechanical system (rad/sec)

θl Load equivalent rotation position (rad)

θm Motor shaft position (rad)

ζa Relative damping coefficient for anti-resonant frequency (Nm/(rad/sec))

ζr Relative damping coefficient for resonant frequency (Nm/(rad/sec)) bs Total torsional damping viscous friction coefficient (Nm/(rad/sec))

2 Js Sum inertial of motor and load (kgm )

2 Jload Inertial of all loads imposed on the nuts (kgm )

2 Jmotor Motor inertial (kgm ) ks Total stiffness of all flexible connections (Nm/rad)

Tl Actual torque on load (Nm)

Tm Output torque from the motor (Nm)

Tld Equivalent torque of load disturbance (Nm)

Abbrevations

KTH Kungliga Tekniska h¨ogskolan SLU Sveriges lantbruksuniversitet AHGS Active Horse Gait Simulator HMI Human Machine Interface PMSM Permanent Magnet Synchronous Motor VFD Variable Frequency Drive

4 Contents

SAMMANFATTNING 1

ABSTRACT 2

FOREWORD 3

NOMENCLATURE 4

CONTENTS 5

1 INTRODUCTION 7 1.1 Background ...... 7 1.2 Purpose ...... 8 1.3 Delimitations ...... 8 1.3.1 Gait analysis ...... 8 1.3.2 Prototype development scope ...... 8 1.4 Method ...... 9 1.4.1 Horse biomechanics, essential and non-essential factors . . . .9 1.4.2 Mechanical design and actuator selection ...... 9 1.4.3 Control structure and trajectory design ...... 9 1.4.4 Implementation on hardware ...... 9 1.4.5 Total system overview ...... 10

2 FRAME OF REFERENCE 11 2.1 Horse Biomechanics and Types of Gaits ...... 11 2.2 Available Data for Trot Gait Analysis ...... 14 2.3 Available Horse Gait Simulator Designs ...... 15 2.4 Ball Screw Drive Modelling Methods ...... 15 2.4.1 Lumped modelling ...... 16 2.4.2 Hybrid modelling ...... 18 2.4.3 Friction modelling ...... 18 2.5 Ball Screw Drive Control Approaches ...... 20

3 DESIGN AND IMPLEMENTATION 23 3.1 Horse’s Raw Data Analysis ...... 23 3.2 Degrees of Freedom Needed ...... 28 3.3 Trajectory Design ...... 28 3.3.1 Trajectory function estimation ...... 28 3.3.2 Additional instability in trot functions ...... 30 3.3.3 Ramped trajectory amplitude for smooth transition ...... 31 3.3.4 Random horse trot generator ...... 33 3.4 Mechanical Design and Fabrication ...... 35 3.4.1 Vertical motion ...... 36 3.4.2 Horizontal motion ...... 36 3.5 Actuator Power Estimation ...... 37

5 3.6 Electrical Actuator Selection ...... 39 3.7 Hardware Implementation ...... 40 3.7.1 Electronics board ...... 41 3.7.2 AC drive system ...... 41 3.7.3 DS1104 R&D controller board ...... 47 3.7.4 HMI and limit switches ...... 47 3.8 System Modelling ...... 49 3.8.1 System behaviour modelling ...... 49 3.8.2 System dynamics modelling ...... 51 3.9 Control Design and Simulation ...... 58 3.9.1 Controller algorithm design ...... 58 3.9.2 System simulation ...... 62

4 RESULTS 64 4.1 Mechanical Fabrication ...... 64 4.2 Hardware Implementation ...... 64 4.3 Controller Performance ...... 64

5 DISCUSSION AND CONCLUSION 73 5.1 Discussion ...... 73 5.1.1 Mechanical deisgn ...... 73 5.1.2 Trajectory generator design ...... 73 5.1.3 Hardware implementation ...... 73 5.1.4 Modelling and controller design ...... 73 5.2 Conclusion ...... 74

6 FUTURE WORK 75 6.1 Mechanical Hardware Upgrade ...... 75 6.2 Multiple Gait Implementation ...... 75 6.3 Stand-alone System Implementation ...... 75

REFERENCES 76 Academic References ...... 76 Commercial References ...... 77

APPENDICES 79

A MECHANICAL DESIGN STRESS CALCULATION 79

B MECHANICAL STRUCTURE DETAILS 85

C DRIVE SYSTEM ELECTRICAL DRAWING 88

D DIVISION OF WORK 90

E OPERATING INSTRUCTIONS 91

6 1 INTRODUCTION

This section describes the necessity and aims of the thesis project, as well as the methodology used to carry out the work involved.

1.1 Background Sveriges lantbruksuniversitet (SLU) is currently working on a project related to ‘Improved horse and rider health by riding’, which is primarily concerned with a physiological study of rider and horse biomechanical properties, and their interaction with each other. More specifically, it is concerned with studying the posture of a rider and it’s effect on both the rider and horse’s back. This would also give riders much information about how to change their riding posture for the better. To this end, SLU is interested in prototyping and possibly manufacturing an ‘active chair’, meant to simulate the movement of a horse, and which can be used for training purposes. At present, SLU already have a ‘passive chair’, used for preliminary training of riders, as shown in figure 1. However, this chair does not provide the user with any of the dynamics which they will experience on a real horse. Although the passive chair is useful for training different muscles from a physiological point of view, it does not help to improve riding skills, which naturally contribute a lot to the physiological interaction between the rider and the horse. An active chair which moves like a horse would better suit this purpose, and could be used as a simplified horse to train for specific situations in.

Figure 1: Photograph of currently available passive chair

The passive chair, as shown in figure 1, is simply a stool with flexible supports attaching its axis to the support rim. The flexible supports serve to give it the ability to move freely in all directions in a horizontal plane. The nature of this movement is controlled to some extent by controlling the stiffness of the flexible supports, by tightening or loosening them. This chair serves as a very useful tool for training,

7 which provides movement and instability that the ‘rider’ has to counter against in all directions. This chair is further used by riders to perform certain movements on, to accustom themselves to translations in different directions.

The Active Horse Gait Simulator (AHGS) chair would certainly not have such a wide range of freedom as far as the rider is concerned. This can be thought of as similar to actually riding a horse. The horse would move in a particular way. And although this way of movement would be interactive with the rider in the case of a real horse, its nature would be much more restricted than that of the passive chair. The horse would not move in this many different horizontal directions, not to mention the fact that it would introduce vertical movements as well.

1.2 Purpose The goal of this project is to help acquire data for biomechanical research, to better define healthy riding postures for humans and . It also aims to provide a training tool for riders to use to improve their skills. This project would contribute towards the goal by making a prototype for the AHGS chair, and controlling it effectively to create the required motion of a horse, while attempting to minimise the weight and size of the machine. Horse gait simulators available today have a bulky size and are not considered very mobile. This project would attempt to create a functional AHGS with lower weight and more mobility. This would include the mechanical design and fabrication, the actuator selection, control algorithm design and implementation for the selected mechanics and actuators, as well as trajectory planning for the required movements. A user interface would also be developed, to allow manipulation of the AHGS by the user according to his needs, in order to vary its speed and range of movement.

1.3 Delimitations The AHGS may further have much more development, in order to implement dif- ferent gaits, as well as further reduce the size and cost of the whole machine. At present, however, the objective of the AHGS project was limited based on the fol- lowing criteria.

1.3.1 Gait analysis The AHGS chair was presently required only to simulate the ‘trot’ gait of a horse. (Different types of gait have been explained below, in section 2.1). The study of different gaits or and styles of the horse has not been considered as a priority during the design and implementation of this prototype.

1.3.2 Prototype development scope A future development of this project would include the migration of the control functions and the user interface onto a stand alone microcontroller, to create an in-

8 dependent active chair unit which could be transported and used in various locations. At present, however, this project aimed to prototype the system and implement a real-time feedback control loop using a PC equipped with the necessary software (dSPACE, STARTER) to interact with the actuators. The end result of this project would be a piece of laboratory equipment which would need its own dedicated com- puter for its operation.

1.4 Method The different tasks involved in the project can be outlined and classified into different categories as shown below.

1.4.1 Horse biomechanics, essential and non-essential factors The AHGS was required to be able to simulate the trot gait of the horse with acceptable accuracy, as judged by experienced riders. With this intent in mind, the horse gait characteristics and the biomechanical behaviour of the horse were studied, in order to analyse the movements required to be simulated. The biomechanics of an actual horse would be too complicated to mechanise, for the purpose of an active chair. Therefore, an initial step in the process was an analysis of the biomechanics of a horse while trotting, in order to ascertain which movements of the horse were necessary to be recreated. This would then dictate the degrees of freedom required in the machine, and would serve as a first pointer towards its conceptual mechanical design.

1.4.2 Mechanical design and actuator selection Once the degrees of freedom required were determined, a conceptual mechanical design was prepared. The forces acting on this structure due to the rider and the structure’s inertia were analysed, for the purpose of actuator selection. The actuator selection would be a necessary step before modelling the control algorithms required to control the movement of the chair with acceptable accuracy.

1.4.3 Control structure and trajectory design On completion of the mechanical design and actuator selection, the entire physical system could be modelled mathematically. This mathematical model was used for designing the control structure. The motion trajectories used to recreate the trotting horse with the AHGS were also then designed, and tested with the control structure.

1.4.4 Implementation on hardware The prepared control structure and trajectories were then to be implemented on real time hardware,which was selected and configured for this purpose. The system architecture design and human interface planning were also carried out.

9 1.4.5 Total system overview The final system integration was carried out to obtain an electromechanical system as shown in the system architecture in figure 2. It shows the mechanical design of the AHGS, along with the actuator control hardware blocks needed. It includes a PC with dSPACE for higher level control, as well as other software such as STARTER, MATLAB/Simulink etc. for development and commissioning purposes. It also in- cludes a dedicated control system for the synchronous motor current control for the chosen actuators. Finally, it also includes the Human-Machine-Interface (HMI) used to interact with the system. Further details about the selection and design criteria behind the various elements in the system architecture diagram are explained fur- ther on in this report, in section 3.

Figure 2: System architecture overview

10 2 FRAME OF REFERENCE

This section describes the research of available data, methodologies and technology, which was conducted at the beginning of the thesis project. It includes the back- ground study of horse gaits and nature of movement, existing horse gait simulators, and of modelling and control methods.

2.1 Horse Biomechanics and Types of Gaits Horses have many different methods of walking and running, known as ‘gaits’. Some of these gaits come naturally to horses, while others are taught to them with train- ing [1]. Generally speaking, horses are said to have three basic gaits: The walk, trot and canter. The gallop is often also considered a different gait, but can also be considered as a variation of the canter. These basic gaits are widely understood to be natural gaits for horses, and are assumed to come naturally to most horses, irrespective of breed.

Aside from these basic gaits, horses can also use other gaits such as the pace, amble etc. These are not considered natural gaits, since they need to be trained for and are not as universally adopted by horses.

The walk, trot, are distinguished from each other on the basis of the sequence of the different feet of the horse touching and leaving the ground. This is because the feet touching the ground is an easily observable, measurable phe- nomenon. However, aside from the footfall, the nature of movement of the horse’s whole body, and the forces experienced by the rider during these different gaits are also significantly different.

The four gaits mentioned above can be distinguished on the basis of footfall as follows:

Walk This is the slowest gait of a horse. As the name suggests, it most closely resembles the normal walking motion of humans in the nature of movement of the horse’s legs. It is the only gait in which all four legs of the horse are simultaneously on the ground, and there are always at least two legs of the horse touching the ground. A hind leg of the horse lifted and placed forward is always followed by the same foreleg being lifted and placed immediately afterwards. Thus, the sequence of footfall for a walking horse would be ‘Left hindleg-Left foreleg-Right hindleg-Right foreleg’. The walk, as with humans, is considered to be the most efficient mode of locomotion for the horse. It is a ‘four beat’ gait, meaning over one cycle of the horse’s legs performing the walk, four separate footfalls (or beats) can be heard. The different phases of the walk gait can be observed clearly in figure 3.

Trot The trot is termed a ‘two beat’ gait. This is because the movement of the horse’s

11 Figure 3: Phases in the walk [2] legs is synchronised between two pairs of diagonal legs, which always move together. The trot also has intermediate phases of complete suspension, when none of the horse’s legs are touching the ground. As with human running, or with any kind of transportation method using stiff elements for motion, when a gait involves complete suspension, it will always result in a drastic increase in the vertical movement and inertia forces acting on the transported body. Although the footfall of the horse is always the same in this gait, the nature of its movement can be different in dif- ferent horses. This is not only because of the many biomechanical differences in different horses, but also because different horses use their legs in different roles. For instance, some horses travel most during the suspension phase. Thus they use their legs mainly for propelling their body forward. Others travel significantly by pulling with their legs on the floor, instead. As a result of variances such as these, the nature of movement observed or felt on a trotting horse can be different for each horse. Figure 4 shows the different phases of the trot.

Canter The canter is a faster gait than the trot. It is a ‘three beat’ gait, in which one pair of diagonal legs of the horse move together, as one unit. The movement of the other two legs is not in sync. The diagonal pair represents the middle ‘beat’ in the cycle, which begins with the rear leg touching the ground. The phases of a canter are shown in figure 5. The canter, being faster, has a longer period of suspension (Phase 9) between two consecutive gait cycles.

Gallop The gallop is similar to the canter, except that the diagonal pair is no longer com- pletely synchronised. This results in a four beat gait. The gallop has the highest

12 Figure 4: Phases in the trot [2]

Figure 5: Phases in the canter [2] period of suspension of any of the horse’s gaits, and is also the fastest one. Con- sequently, it is also reasonable to assume that it has the most vertical movement as well, in order to sustain this high period of suspension. This means that the gallop would also have the highest inertia and impact forces acting on the horse and the rider. As seen in figure 6, the gallop has the most significant suspension phase (Phase 11) of the gaits discussed above.

Even though the different gaits of the horse can be distinguished most clearly based

13 Figure 6: Phases in the gallop [2] on their footfall, there are various movements in the horse’s body which change with different gait pattern. One of these variations, as explained above, is due to the sus- pension period of the horse. Other sources of variation include lateral movement of the horse’s mid-region, in order to maintain balance, based on the configuration of the forces acting on the horse at the moment. These forces are determined among other things, by the position and number of supporting legs at the moment, the ve- locity and acceleration of the horse and in the case of a ridden horse, by the position and acceleration of the rider as well. The flexion of different muscle groups on the horse’s back and his legs causes variation in his physical profile as well, which is a further source of movement for the rider.

In short, the horse represents a very complex mechanically linked structure, which, in order to be represented with an inorganic structure would need to be simplified. More information on this simplification can be found further, in section 3.1.

2.2 Available Data for Trot Gait Analysis Motion data of trotting horses was available from tests with mounted and unmounted horses, running on treadmills. This data was obtained from Lars Roepstorff, pro- fessor in equine functional anatomy at SLU. The motion of different parts of the horse’s body was tracked using optical markers placed at different points on the horse’s body, as well as with force sensors on the ground for its hooves. The motion was tracked with cameras with a frequency of 240 frames per second. Each frame was represented as 3 dimensional co-ordinates of position of each marker on the horse. This data was analysed to determine the magnitude of different movements that were actually taking place during the trot of the horse. The test setup de- scribed can be seen in figure 7. Data from similar test runs lasting 15 seconds each,

14 was available for seven different horses. These horses have been referred to by their abbreviated names in this project, as CHA, GRA, LAS, LLA, PAL, RAM and SCH.

Figure 7: Test setup

It is important to note, however, that there are some differences between the horse’s kinematic behaviour while trotting on land and on a treadmill. These differences are supposed to be due to factors such as a lower air resistance, different behaviour of the rider, psychological adaptation by the horse etc [3]. It has been observed in previous studies that there was a difference in workload between the two cases which could be compensated with a 3.5% incline of the treadmill, or a 10% increase in speed [4]. However, this difference in behaviour of the horse has not been taken into consideration for the purpose of this project.

2.3 Available Horse Gait Simulator Designs An extensive study of various devices currently available on the market was con- ducted during the background study phase of this project. Many different devices were found, which aim to recreate one or many of the horse’s gaits. However, it was observed that many of these devices provided only crude comparisons to an accurate horse’s gait. Some machines which provided more accuracy had very sophisticated designs. They also had very large interface equipment which made the machine very immobile.

2.4 Ball Screw Drive Modelling Methods In this application, ball screw feed drives are the mechanism adopted to provide linear motions. The reason for selecting ball screw drive has been further explained in section 3.4. A typical ball screw feed drive is made up of a motor, coupling, ball screw shaft, ball screw nut, guild rails and a frame as indicated in figure 8. The modelling techniques have been studied extensively. In terms of modelling methods, three common methods are observed, namely lumped modelling, hybrid modelling and distributed modelling. The choice of a suitable modelling method is dependent on the specific situation. In terms of characteristics of the ball screw drive, there

15 Figure 8: A typical ball screw drive composition [26] are three different types of vibration modes: axial, rotational and flexural or lateral [5]. All of these three modes have to be investigated with respect to their influences on the transmission accuracy and precision in applications, such as high speed and high precision machine tools. In such a high-end application, the dynamics in all the three dimensions are essential for the development of sophisticated control strategies [6]. However, they are not all equally influential. Typically, the axial and rotational modes have demonstrated a dominant influence on the overall dynamics while the flexual mode’s influence is rather small [7]. So in most applications axial and rota- tional mode dynamics are often investigated more thoroughly. They are normally dictated by the geometry of the ball screw drive, specifically the diameter and the length of the shaft and their operating conditions. A typical frequency response of a ball screw drive is shown in figure 9 [6]. The frequencies f1 and f2 represent the ax- ial resonant frequency and the rotational resonant frequency respectively with their values dependent on mechanical flexibilities, such as rigidity. These values dictate the closed loop bandwidth and tracking accuracy of the ball screw drive [9].

In the following subsections, the most frequently used modelling techniques, lumped modelling and hybrid modelling are presented.

2.4.1 Lumped modelling The lumped element model simplifies the description of the behaviour of spatially distributed physical systems into a topology consisting of discrete entities that ap- proximate the behaviour of the distributed system under certain assumptions [27]. The torsional rigidity of the coupling is regarded as uniformly distributed and simply denoted as kcoupling, the axial rigidity of the fixed bearing as kbearing and the axial rigidity of the nut as knut, which means the torsional rigidity of the coupling is un- varying along its axial dimension and the axial rigidity of the nut is constant along

16 Figure 9: Typical frequency response of a ball screw drive

its length. The screw shaft is simply modelled as rigid with a rotary intertia Js, mass ms, and pitch h which establishes the relation between the shaft’s rotational movement and the nut’s linear movement. The model is as shown in figure 10. The

Figure 10: A ball screw drive lumped model[6]. overall axial and rotational rigidity values of the screw shaft, the bearing and the coupling are caculated as follows:

17  1 1 −1 krot = + kshaftrot kcoupling  1 1 −1 kax = + kshaftax kbearing πd2E kshaftax = 4leff 2 kshaftrot = Js(2fsπ) s 1 G f = s 4l ρ where: E = Young modulus of the ball screw shaft (N/m2) d = Equivalent diameter (m) l = Total length (m) leff = Effective length (m) 2 Js = Rotational inertia (kgm ) G = Shear modulus (N/m2) ρ = Density (kg/m3)

2.4.2 Hybrid modelling Hybrid modelling is a combination of lumped and distributed modelling. A mechan- ical system contains components with different mechanical properties which have different magnitudes of impact on the overall dynamics. The choice of adopting a lumped model or a distributed model to represent each of the mechanical compo- nents is a tricky one. In the case of a ball screw drive, the ball screw is modelled in a distributed modelling fashion as a Timoshenko beam element [11] which recognizes the varying mechanical property of the ball screw at different positions along the ball screw. Other components like the coupling, bearing, and nut are modelled in a lumped modelling way. The torsional rigidity of the coupling is denoted as kcoupling, the axial rigidity of the fixed bearing as kbearing and the axial rigidity of the nut as knut as in the section 2.4.1. The Timoshenko beam element is modelled mathemat- ically as in [11]:

Figure 11 shows the hybrid model graphically where krot and kax are the same as in figure 10.

2.4.3 Friction modelling Friction is a very common phenomenon, occuring between two surfaces in contact. Its characteristics vary vastly from one situation to another depending on the con- ditions of the contact between the two surfaces and working conditions. It is so

18 Figure 11: A ball screw drive hybrid model [6]. nonlinear and dominant in system behaviours in some case that it has to be dealt with properly, otherwise it may cause steady state errors and continuous vibration, which deteriorate system’s performance. In the mechanical design stage, friction should be reduced as much as possible. The designed controller is supposed to be sufficiently robust to eliminate the friction effects. In the papers [16][33], fric- tion models were summarized comprehensively from static friction models, such as the Coulomb friction model, Stiction friction, Viscous friction and a combination of these three to dynamic friction models such as the Dahl model and the Bristle model. Those model can be found in papers, so details are not given here. However a detailed description of a friction model called the General Static friction model is presented here.Figure 12 clearly expresses this model graphically.

Figure 12: Relationship between sliding velocity and friction force [21].

This model can be mathematically represented as follows:

19   F (ν) if ν 6= 0 F = Fe if ν = 0 and |Fe| < Fs  Fssgn(Fe) if ν = 0 and |Fe| ≥ Fs

δ −(ν/νs) F (ν) = Fcsgn(ν) + (Fs − Fc)e sgn(ν) + kvν (N) where: ν = Sliding velocity (m/sec) Fe = External Force (N) Fs = Static (break away) friction force (N) Fc = Coulomb friction force (N) νs = Stribeck velocity (m/sec) kv = Viscous friction coefficient (N/(m/sec))

Besides these already-established friction models, the friction model in specific ques- tion can actually be identified by utilizing the parameter identification technique. In the paper [33], a friction observer was proposed to compensate for the actual friction. However in fact a friction model could be identified by analyzing the signal inputs and output of the friction observer block in figure 13. Since friction char- acteristics are highly dependent on a specific application and thus difficult to be captured by any available model, friction model parameter identification was a sug- gested technique to use if time was sufficient and control requirements were high.

Figure 13: Block diagram of the friction compensation based on a friction observer [33].

2.5 Ball Screw Drive Control Approaches Ball screw drive control is broadly studied because they are the most commonly used motion delivery mechanisms especially in high speed machine tools [9]. The

20 problems that controllers need to deal with include structural vibrations, unmodeled dynamics and external disturbances [12]. For the problem of structural vibrations, a notch filter was used to filter out the element of the control signal which may excite the vibrations [14]. A vibration suppression technique was also used to reduce the resonance by increasing the resonance frequency and decreasing the resonance am- plitude [16]. Sliding mode control is observed to be the most frequently used control approach to deal with the parameter variation and external disturbance problems. Feedforward control can be incorporated into the control structure to counteract disturbances such as friction if a good friction model can be achieved [15].

In applications without high requirements on system responses and positioning ac- curacy, a PID cascade control structure with feedforward control and disturbance observation and attenuation are often used [16]. In applications with high require-

Figure 14: Typical PID control structure with feedforward control and disturbance observer [16]. ments on system responses and positioning accuracy, for example high speed machine tools, sliding mode control has been proven effective and efficient. The basic idea is to drive the states onto a predefined sliding surface and then the states will be driven to the origin as illustrated in figure 15.

Pratical issues like chattering are the biggest drawback of the sliding mode control appraoch. The chattering phenomenon that can be observed in the sliding phase stems from the nature of the discontinuity of the control law due to the inclusion of a sign dependent term like sgn(s). In order to attenuate this problem, the disconti- nuity in the control law has to be removed. This is often done by replacing the term sgn(s) in the control law with a saturation function: ( s/ρ, if |s| ≤ ρ sat(s) = sgn(s), if |s| >ρ

Besides the classic PID control approach and the sliding mode control method,

21 Figure 15: Sliding mode control principle [18]. other methods such as LQG have also been used to control a ball screw drive. In the paper [16], comparisons between linear controllers and nonlinear controllers were drawn. The result is that the control performance of nonlinear controllers even without explicit friction compensation outstand that of linear controllers with friction compensation. And nonlinear controllers proved to be effective in dealing with nonlinear elements in the system in question and robust enough to withstand load disturbances and unmodelled dynamics. A back-stepping control approach is never used for controlling a ball screw drive according to the best knowledge of the authors and it will be applied in this project. Because of the complexity of the theory itself and its lengthy procedure, only the basic idea is given here. The detailed information about the theory background, motivation, proof, derivative lemma and examples can be found in the book [8]. Back-stepping control is a Lyapunov-based control approach and features a recursive design process. First of all, the system is described in a strict feedback state space form. Then a state is used as a fictitious controller to drive the first subsystem, which only contains the state that precedes this state, to be stable; the next state is used in the same way to drive a subsystem that contains all states preceding this state to be stable. This process is repeated until the final control law appears. This control law is able to drive all states, that is the whole system, to be stable. The controller design in the section 3.9.1 was performed exactly in this way.

22 3 DESIGN AND IMPLEMENTATION

This section describes in detail the process undertaken during the thesis project. It includes a description of the analysis and the resulting decisions made, as well as of the further mechanical and electronic design and software development performed to complete the project. It also describes the mathematical modelling and control algorithm development performed.

3.1 Horse’s Raw Data Analysis As can be expected with any biomechanical motion, there are many different move- ments involved, each with variations based on different circumstances. The horses back moves vertically with each step(Z), and along the X-direction (front and back from the rider’s point of view). However, the rider also experiences Y-axis (left and right) translational movement, due to the horse’s back curving either way depend- ing on the position of its legs. Along with this, the hind legs, which are the horse’s real power source, also tend to tilt the horse’s hind (and hence the ) with each step, as one leg after the other is flexed and relaxed. The horse’s back also reacts to the weight of the rider himself, and would thus behave differently under such conditions as compared to when the horse was riding free. The relative motion between the front and back legs would also cause the horse’s back to rock back and forth, adding another angular motion which the saddle and rider would be subjected to. The convention adopted for the co-ordinate system, regarding all 6 degrees of freedom (3 translational and 3 rotational) is shown in figure 16. It should be noted that the motions studied below have been normalised, to neglect absolute offsets in co-ordinates. The origin of the co-ordinate system can thus be assumed to be at the centre of the horse’s back.

Apart from these motions, the impact forces of the horse’s hooves on the ground, and of the rider bouncing on its back, would create other movements as well, due to the flexibility of the horse’s physiology. Some of these movements may be significant if they concern contraction and relaxation of large muscle groups in the horse’s body.

It was thus essential at an early stage to consider which movements of the horse were necessary to be recreated, in order to simulate a life-like riding experience. In other words, what was essential and what was superfluous?

The question of what is needed and what can be eliminated depends on which gait we are considering. This project deals with the trotting horse. It must be noted that significant additions or changes may be necessary before adapting the proposed design to other gaits.

In order to ascertain which movements could be eliminated, their relative mag- nitudes were examined, to determine which were small enough to be ignored. The magnitude and profile of motion of the horse’s back in different directions can be observed in the following figures. The motions, unless specified otherwise, were stud-

23 Figure 16: Co-ordinate system conventions for horse motion measurement ied at the ‘thoracic 13’ marker on the horse’s back. This is the 13th of the thoracic vertebrae, shown in figure 17, counted from the front. This marker was chosen for study because it most accurately represents the point on the horse’s spine directly below the rider, and would thus indicate the movement of the saddle as well. Ad- jacent markers have also been used where necessary, in order to evaluate angular motions.

Figure 18 shows the nature of the vertical motion of the thoracic 13 of one horse, (CHA). The amplitude of motion is observed to be roughly 100mm from crest to trough.

Figure 19 shows the X direction (front and back) motion of the thoracic 13 of the same horse, during the same test run. In this figure, a much larger disturbance at a low frequency compared to the trot frequency of the horse can also be observed. This is due to the horse moving backwards and forwards on the treadmill, during the test sequence for acquiring this data. To remove this disturbance noise, a high-pass filter was applied to the data, with a cutoff frequency of 1 Hz. The filtered data from the same marker, measuring motion in the same direction, can be seen in figure 20.

The displacement of the same point in the Y direction (left and right) can be seen in figure 21. The Y direction translation is observed to be roughly 20mm, neglecting

24 Figure 17: Horse anatomy overview

Figure 18: (CHA) thoracic 13 vertical displacement profile

Figure 19: (CHA) thoracic 13 horizontal (X) displacement profile the lower frequency disturbance. Aside from the motion of the thoracic 13 in these three directions, it is also necessary

25 Figure 20: (CHA) thoracic 13 (X) displacement profile, filtered

Figure 21: (CHA) thoracic 13 (Y) displacement profile to study the angular motion of the saddle, about different axes. For this purpose, the thoracic 10 and thoracic 17 markers have also been used, as well as markers on the rider’s hips, from mounted tests. The angular motion of the saddle, as measured from this data, can be seen in figures 22 and 23. As can be seen from figure 22, the

Figure 22: (CHA) angle made by the saddle with the horizontal plane, about Y axis roll angle of the saddle, as measured between the thoracic 10 and the thoracic 17 on the horse’s back, has a variation of approximately 5 degrees during its trot move- ment. Since the lateral angular deviation of the horse could not easily be measured,

26 Figure 23: (CHA) angle made by the saddle with the horizontal plane, about X axis the angle of the rider’s back, measured between the two femur markers (at the top of the thigh, near the hip) were used, to estimate the lateral angle of movement of the horse’s saddle. The variation in the pitch angle can be seen to be around 2 to 4 degrees, over the trot motion.

The same values and plots for seven different horses were studied, and it was con- cluded that although the different horses did indeed have their own unique styles of movement, which could be differentiated from one another, all showed consistent and similar types of motion. This can be best observed from the movement profiles of the thoracic 13 marker for different horses, as seen from the side. These profiles are shown in figure 24.

Figure 24: Thoracic 13 profile of different horses, observed from the side

27 3.2 Degrees of Freedom Needed The magnitude of movement observed along the different degrees of freedom is sum- marised in table 1. It can be seen that many of the movements are in fact of a much smaller magnitude as compared to the primary vertical (Z) and horizontal (X) movements. It is possible that some of these movements (for instance, the angu- lar motion of the saddle in the X-plane) would be very significant for other gaits. However, as far as the trot is concerned, from the data shown here, one can say that the primary movements to be recreated are the vertical (Z) and horizontal (X) translation of the horse’s saddle.

Direction/Sense Magnitude of Motion

X 35 mm Y 10 mm Z 100 mm ◦ ωx 2 ◦ ωy 5

Table 1: Movement ranges in trot gait

Hence, an initial prototype was aimed for, which would have two degrees of freedom, one vertical and one horizontal.

For such a 2 DOF prototype, the profile of motion required from the saddle would thus be similar to the profile curves shown in figure 24.

3.3 Trajectory Design This section describes the procedure and results of trajectory design, to obtain suit- able trajectories to imitate the horse’s movement.

3.3.1 Trajectory function estimation Initial simulations used for motor selection were carried out using sine wave trajec- tories, as these were judged to be quite similar to the movement of the thoracic 13, especially in the vertical direction.

For fine tuned trajectories, the MATLAB curve fitting toolbox was used to gen- erate periodic functions to represent the motions. Since the horse’s movement was always going to be periodic, Fourier functions were used for both degrees of move- ment [19]. As mentioned above, since the vertical motion was very similar to a simple sine wave, a first degree Fourier function was deemed sufficient for its repre- sentation. The vertical motion profile function was thus represented mathematically

28 as in equation (3.3.1.1):

y = a0 + a1 cos(ωt) + b1 sin(ωt) (3.3.1.1)

Where ω = angular velocity of periodic motion (rad/sec) t = time (sec)

A function of the above form fits the vertical profile of the horse motion well, as can be seen in figure 25

Figure 25: Vertical motion profile and fit curve for (LAS) over one gait cycle

The constants a0, a1 and b1 would thus define the simulated vertical motion profile, for a given frequency.

As an example, for figure 25, the function obtained had coefficients as shown in table 2: The horizontal motion of the horse was observed to be more irregular, and

Table 2: Vertical fourier coefficient examples

a0 a1 b1 ω V alues 1495 -33.22 23.4 15.71 was greater affected by the changing instantaneous velocity and acceleration of the horse, during different phases of the trot. From experimental data, through trial and error, it was observed that a third degree Fourier curve was sufficient to represent this horizontal motion with acceptable accuracy. The horizontal motion would thus be represented as in equation (3.3.1.2):

x = (a + a cos(ωt) + b sin(ωt) + a cos(2ωt) + b sin(2ωt) 0 1 1 2 2 (3.3.1.2) +a3 cos(3ωt) + b3 sin(3ωt))

The third order fit curve is compared to the observed data over one gait cycle in

29 figure 26

Figure 26: Horizontal motion profile and fit curve for (LAS) over one gait cycle

The coefficients obtained in the example curve shown in figure 26 are shown in table 3. In both profiles, a0 would represent the mean value of the displacement.

Table 3: Horizontal fourier coefficient examples

a0 a1 b1 a2 b2 a3 b3 ω V alues 669 -14.81 -2.657 -3.407 0.1458 0.7208 0.3544 15.13

That is, it would represent the distance of the point of measurement from the ref- erence origin. In our case, therefore, it can be said that a0 = 0, since we are only concerned with the nature of movement of the horse, and not its absolute position.

The example curves shown above can be plotted against each other over time, to give a two dimensional motion profile. However, it is important to note that when considering both curves together, it is necessary to use a single frequency of motion for both degrees of translation, in order to get a regularly repeating curve with each cycle of the gait. In this case, a frequency of 15 rad/sec has been used. The obtained motion profile is shown in figure 27

This profile compares favourably with the filtered profile obtained from our original data for the same horse (LAS), shown in figure 28

3.3.2 Additional instability in trot functions Aside from the single frequency Fourier expressions to represent the trajectory in two dimensions, a random element was also necessary to be introduced, to compensate for the effect of filtering which was carried out during data analysis in section 3.1.

30 Figure 27: Thoracic 13 profile for (LAS) from fit curves

Figure 28: Thoracic 13 profile for (LAS) from real data

This random instability was introduced by adding a sine wave of random frequency and amplitude, limited by fixed bounds to ensure realistic values. This random in- stability variable can be considered to represent irregularities in the horse’s motion, as well as in the ground profile on which an imaginary horse would be trotting. This instability is not truly random in our case, as it is simply a periodic motion with a frequency differing greatly from the motion profile frequency. The addition of this ‘instability term’ in the calculated trajectories can be observed in figure 29, which shows the new horizontal profile of the same horse (LAS) over a longer period of time:

3.3.3 Ramped trajectory amplitude for smooth transition Another factor to be considered during trajectory design was the start and stop phases of the trajectories. If the trajectory were to start immediately at its original amplitude, it would not only be an inaccurate representation of a horse’s movement, but more importantly, would be a possible source of injury for the rider.

The amplitude for the trigonometric functions in the Fourier series is therefore mod- elled as a variable gain, which ramps up with a second order curve from zero to one,

31 Figure 29: Generated horizontal profile with added instability at start up. It ramps down with a similar second order amplitude gain curve when stopping. These curves are obtained from constant ‘acceleration’ phases calculated to reach a gain of unity after a start-up phase of 3 seconds. Here acceleration refers to the second order rate of change of the amplitude gain. This time period of 3 seconds is based on estimation of the time taken for a horse’s acceleration to its normal speed. The gain profile curves are observed to be as shown in figure 30.

Figure 30: Gain profile for Fourier functions

This gain is then applied to the Fourier series functions for the profile trajectories, which are now represented as in equations (3.3.3.1) and (3.3.3.2):

Vertical displacement:

y = a0 + G(a1 cos(ωt) + b1 sin(ωt)) (3.3.3.1)

32 Horizontal displacement:

x = a + G (a cos(ωt) + b sin(ωt) + a cos(2ωt) + b sin(2ωt) 0 1 1 2 2 (3.3.3.2) +a3 cos(3ωt) + b3 sin(3ωt))

Where G = Variable gain for trajectory functions Applying this variable gain to the motion profile gives us a smooth varying move- ment profile, during starting and stopping of the movement, which can be observed in figures 31 and 32:

Figure 31: Ramped starting profile for generated trajectories

Figure 32: Ramped stopping profile for generated trajectories

3.3.4 Random horse trot generator The process described above provides us with a single defined trajectory for the two dimensional motion of the saddle, to represent a particular horse’s trot. However, as can be seen from the initial data analysis, different horses also exhibit different

33 profiles. Although these profiles follow a very similar pattern, they cannot be said to be identical, as each horse does have its own unique motion. This uniqueness has been attempted to be represented in the mathematically modelled horse trot trajectories, using a statistical analysis of the trajectories observed from the data available on seven different horses.

A trajectory database was created, fitting mathematical functions as described above to different horses, at different time intervals during the gait cycle. Even the same horse would have varying functions, when fitted at different instants of data. This is because a horse would not move in exactly the same manner over time, and would experience slight variations. Based on these fitted trajectory functions, the mean and standard deviation of the different constant co-efficients of the two Fourier functions were obtained. These were then used to generate random Fourier functions with slight variations from those obtained from the available data. This would theoreti- cally result in the generation of a new ‘horse’ every time a trajectory was generated, giving the horse simulator more life-like performance characteristics.

It should be noted that there were some fitted functions which showed vastly different constant co-efficients but exhibited similar performance over one step of the horse. All these functions were not considered when obtaining the mean and standard de- viation for the co-efficients. Although this meant that some data was excluded in the final random horse profile generation algorithm, it ensured more life-like results, due to elimination of erratic variation in the co-efficient values. This was equivalent to manually limiting the observed standard deviation in observed co-efficient values, to a reasonable amount.

Samples of randomly generated horse profiles, using the models built as described above, are shown in the figure 33:

Figure 33: Random generated trajectory profile samples

34 3.4 Mechanical Design and Fabrication This section of the report deals with describing the mechanical hardware used in the AHGS prototype. The prototype, as explained in section 3.1, deals with motion in two degrees of freedom, along the X and Z axes, as represented in the co-ordinate system shown in figure 16, section 3.1. As established in the same section, the proto- type design was desired to have a range of movement to accomodate a displacement of 100 mm (Z) and 35 mm (X). The power required for the actuation along these two axes was found to be 1.7 kW (Z) and 700 W (X). The power requirement calculation process has been described in section 3.5. The hardware layout and assembly can be seen in figure 34 below.

Figure 34: Mechanical structure of AHGS chair

Both directions of motion are controlled by rotational motors, using ball screws. The choice of this method of torque and motion transmission was coupled to the choice of actuators, which is further discussed in section 3.6. Ball screws were found to be a very compact and reliable solution to facilitate translational motion. As opposed to many linear actuators, they did not require the added space of an extra stroke length, which meant they were useful in applications such as this one, which needed to be as small as possible. The respective orientation of the motors, with the Z-translation motor above the X-translation one, is due to its higher power re- quirements. It was found to be more cost and energy efficient to minimise the load acting on the higher rated motor.

35 3.4.1 Vertical motion The vertical motion components and their functionality have been highlighted in figure 35.

Figure 35: Z-direction motion in the AHGS

According to the colour scheme in figure 35, the vertical ball screw nut (blue) is flanged, and is connected to the nut plate (transparent blue), which supports the saddle structure. The saddle structure (brass) consists of support beams connected to this Nut Plate. Stationary beams (grey) pass through the nut plate, with guide rails (violet) connecting them. These stationary columns prevent the nut plate and the nut from rotating with the screw. The guide rails do not carry any load other than the normal force from the torque on the nut. Miniature rails with sufficient load bearing capacity have been selected. The vertical screw is connected to its ac- tuating motor (black) throught a bevel gearbox (dark grey) and a co-axial coupling (cyan). The gearbox and coupling have been represented only by their outermost dimensions, for design purposes.

The entire vertical ball screw, nut, support beams and saddle assembly is responsible for one degree of freedom, in the Z direction.

3.4.2 Horizontal motion The horizontal motion components and their functionality have been highlighted in figure 36.

The vertical motion assembly’s support plate (brass) is further mounted on two hor- izontal guide rails (violet) as shown. These facilitate the movement of the saddle

36 Figure 36: X-direction motion in the AHGS and the rider in the X direction, controlled by another ball screw.

The horizontal screw nut (blue) is also flanged, and connected to its own nut plate (green). This plate is connected to the base plate for the Z direction motion assem- bly (brass), in order to transfer force and motion from the nut to the assembly.

The dimensions of the mechanical structure were designed based on the range of motion required, the frequency of the motion as ascertained in section 3.1 and the load bearing capacity and stress acting on the structural components. The structure is made of aluminium sheet metal. Aluminium was used because of its low weight, low cost and easy availability, which made it the ideal material for prototyping with. The load bearing support beams are 15 mm thick, while components not subjected to higher load are 10 mm thick. The support beams are made from two sheet metal components, to have a ‘T’ cross section which enables them to withstand higher mo- ments along either the X or Y axes. The stress analysis of the forces acting on the different components of the structure and the selection parameters and considera- tions for the guide rails, ball screws and couplings can be seen in appendices A and B.

3.5 Actuator Power Estimation This section documents the calculations undergone to estimate the power require- ments of the motors needed to actuate the mechanical structure of the AHGS, de- scribed in section 3.4.

Two motors were needed, to actuate the two ball screws. The torque from the motor would be translated to linear force, as needed to carry out the motion of the saddle and fulfill the trot gait requirements. As mentioned in section 3.1, the range of motion in the vertical direction (Z) would be 150 mm and in the horizontal direction (X) would be 50 mm.

37 From the data described in Section 2.2, obtained from Prof. Lars Roepstorff, the frequency of the motion was estimated to be around 2.4 Hz. The torque required to produce the required force to accelerate the saddle and rider was calculated as follows:

The efficiency of power transmission of the ball screw [28] is given by: 1 η = (3.5.0.1) 1 + πd0 µ Ph

Where µ = friction constant, depending on material and type of ball screw and nut (In our case 0.006) d0 = nominal diameter of screw shaft (m) Ph = of screw (m)

The practical efficiency can then be further calculated as:

ηp = 0.9η (3.5.0.2)

The nominal torque while accelerating the ball-screw nut for a vertical screw is given by: Ph[F + mLµf g] Ttotal = Tf + Tpr + +ω ˙ ΣI (3.5.0.3) 2000πηp

Where Tf = Torque from friction in support bearings, motors, seals etc. (Nm) Tpr = Preload torque (In our case, 0) (Nm) F = load (N) mL = mass of the load (kg) ω˙ = angular acceleration (rad/sec2) −9 ΣI = IM + IL + ISl10 2 IM = Inertia of motor (kgm ) 2 IS = Inertia of screw shaft per metre (kgmm /m) l = length of the screw shaft (m)

Similarly, the nominal torque for a horizontal screw is given by:

Ph[F + mLg] Ttotal = Tf + Tpr + +ω ˙ ΣI (3.5.0.4) 2000πηp

In our case, the parameters of the two different ball screws, and their loads are as follows:

38 Vertical ball screw parameters: Length of screw = 200 mm Pitch (Lead) = 25 mm Nominal diameter of screw shaft = 25 mm Mass of load = 100 kg

Horizontal ball screw parameters: Length of screw = 150 mm Pitch (Lead) = 10 mm Nominal diameter of screw shaft = 16 mm Mass of load = 150 kg

Since the gear ratio for the selected bevel gear for the vertical movement power train is 1:1, and the horizontal movement motor is co-axially connected to its ball screw, the torque received by the screw and the torque supplied by the motor are equal, aside from losses incurred by the real world efficiency of the transmission components.

Once the forces needed over the duration of the trot cycle were quantified, the torque profile over the trot cycle was calculated, from Equations (3.5.0.1), (3.5.0.2), (3.5.0.3) and (3.5.0.4) stated above, taking into consideration the efficiency of the transmission elements and motors as well. This torque profile was used to evaluate the RMS torque requirement for the motion.

Based on these calculations, the power requirement of the vertical and horizontal actuators was calculated to be 1.7 kW and 700 W respectively.

3.6 Electrical Actuator Selection The choice of actuators to use for the chair was a critical point of the design process. Various options were considered, before finalising a suitable set of actuators for the prototype. These options and their relative advantages and disadvantages are listed below:

DC motors: Brushed DC motors were the preferred choice of actuators for the described application. This was due to their ease and accuracy of controllability. However, the power requirements needed for the actuators were quite respectable. Assuming a rider mass of 100kg, and a frequency of motion of 2.4 Hz, as measured from the available data, the vertical motion motor would require a minimum power output capacity of 1.7 kW, and the horizontal motion motor would require 700 W of power. DC motors with such a high power output would have been very large, with an appreciable rotor inertia. Furthermore, at this high frequency, the fast dy- namic response needed with this high rotor inertia would add even further to the power requirement on the actuator. From the DC motor options considered, the ro- tor inertia always presented an obstacle to the required fast dynamics of the actuator.

39 Brushless DC Motors: Similar to the brushed DC motors, brushless DC motors also proved to present a difficult choice, for similar reasons. Although the rotor inertia for brushless motors was lower than the corresponding brushed motors, it was still a problem to select suitable actuators which would be able to respond with high enough dynamics for the required application. Aside from this drawback, the current requirement for the actuators considered was also high for such a power output, and a suitable driver circuit to supply the required current turned out to be prohibitively expensive.

AC permanent magnet synchronous motor: An AC PMSM would have significantly lower rotor inertia than the DC alternatives. As another result of this constructional advantage, they would also have a smaller size and weight compared to the earlier alternatives. However, such motors would require more complicated control, as they would require a variable frequency drive, controlling the inverter switching to supply voltage to the stator coils. Many PMSM providers also supplied their own compatible VFDs to run the motor. However, these were seen to be con- siderably expensive, and would have to be integrated with a higher level controller if necessary, to facilitate the required motion control applications.

Hydraulic/Pneumatic actuators: Hydraulic actuators were considered for the application at hand. However, hydraulic or pneumatic actuators would require a compressor/pump to provide the necessary high pressure working material which was not easily available. Pneumatics would not easily be able to satisfy the force and power requirements, whereas hydraulics would have been a very low efficiency choice, especially for the horizontal motion actuation which required much less force than the vertical motion.

Chosen actuators: Based on the above factors and considerations, it was finally decided to implement the AHGS chair using AC permanent magnet synchronous mo- tors. The motors and the corresponding control drives selected have been described in the following section.

3.7 Hardware Implementation This section introduces all five hardware components involved in this project, namely a dSPACE DS1104 Controller Board on which a high level controller designed in the section 3.9.1 would be implemented, Siemens SINAMICS S120 AC drive system(AC drive system for short in the following occurances), an HMI consisting of four but- tons, four limit switches for position calibration and safety as well as an electronic board which interfaces with all the other four components as shown in figure 37. The following subsections present those components with regard to the electronics design,hardware commissioning and hardware integration.

40 Figure 37: All hardware components used in this project

3.7.1 Electronics board As shown in figure 37 the eletronics board has connections with all the other four components for the purposes of adapting and transfering signals from or to those components. In this section an electronics board design and implementation is shown. It provides the mechanical and electrical interfaces to other components. In the electronics design, electrical properties of the interfaces on each component should be observed, for instance, input and output voltage level, high or low voltage level thresholds, current consumptions, and serial communication interface stan- dards particularly for encoder signals, in this case, RS422. This information can be easily tracked in the components’ datasheets, catalogs or manuals. The main electronic components used in this design are simple ones: capacitors, resistors, transistors, LEDs, and pins. The design was performed in CadSoft/EAGLE® and the schematics of the electronics design is shown in figure 38.

3.7.2 AC drive system This section describes the AC drive system used to drive the designed mechanical structure. It includes a description of the components as well as of the installation and commissioning process.

Drive system composition:

An AC drive system consists mainly of AC motors, power electronics conversion system with a controller attached, and an operator interface. Figures 39 and 40 show all the components of the drive system in detail. The different components of the drive system and their functionality are explained below:

41 Figure 38: Detailed electronics design for signal interfaces among dSPACE hardware, HMI, Drive system, and Limit switches

1. Terminal Modules: They particularly provide two analog input ports, used for interfacing the torque setpoint computed in the high-level controller with the drive system and two RS422 interfaces outputting TTL incremental encoder signals back to the high-level controller to form the feedback loop. In addition, they have extended digital input and output interfaces.

2. Control Unit: This module is designed especially for multi-axis operation and is in charge of communication among modules and the current loop control for motors. It is the central control of the drive system. Inside this unit, a CompactFlash card is inserted. It contains the firmware and allows system commissioning by means of provided software called STARTER. On this unit, a Basic Operator Panel is snapped, which provides an interface for the operator to observe and change the values of concerned parameters.

3. Smart Line Module: It is in effect a converter, converting 3 three phase AC power to adjustable DC voltage. It is able to work in infeed mode or regener- ative mode.

4. Double Motor Module: This module is essentially an inverter, transforming the DC power back to the AC power fed to the motors in figure 40, but with

42 Figure 39: Photograph of Siemens AC 3 phases synchronous motors drive system

Figure 40: Photograph of AC 3 phases synchronous motors and heat-dissipating resistor

varying voltage level and frequency with values dependent on the speed and torque required by the high-level controller.

5. Control Supply Module: It supplies 24V DC voltage for electronic circuits in the drive system to work properly.

6. Braking Module: This module monitors the DC link voltage. If the regener- ative feedback function of the smart line module is deactivated and the DC link voltage becomes larger than the threshold voltage of 710V, it renders continuous energy dissipation through the resistor shown in figure 40.

7. Line reactor: It is used to prevent electromagnetic emissions from the drive

43 system when the smart line module works in regenerative mode.

8. Line filter: It prevents conducted electromagnetic interferences, which may be caused by equipment on the same power supply network, from entering the drive system.

9. Circuit breaker: This is a safety component with an adjustable break-current. It cuts off the power supply when the current conducted through rises over the threshold current.

10. Line contact: In essence, it is a relay which allows the operator to safely switch on or off the potentially dangerous high voltage from the 380V AC power supply by switching on or off a DC 24V circuit during normal operation or under emergency circumstances.

11. Main switch: It is used to switch on or off the 380V 3 phase AC power supply.

12. Miscellaneous parts: These include two power cables with quick connectors, two encoder signal cables and DRIVE-CLiQ signal cables dedicated for com- munication among modules in the drive system.

Important features of SINAMICS S120:

ˆ Easily integrated with a high-level controller for motion control;

ˆ Modular design, facilitating scalability and flexibility;

ˆ Easy sizing and friendly commissioning tools.

Drive system electrical installation:

A drawing showing how these components are electrically wired is placed in Ap- pendix C. Figure 41 shows all the AC drive system’s signals which are interfaced with external hardware components, specifically the electronics board.

Drive system commissioning:

The STARTER software was used for parameterizing, commissioning and trou- bleshooting the drive system. It has the capacity of recognizing the connected components and reading their parameters automatically, thereby avoiding incorrect manual entries. It offers a graphic commissioning interface and display of param- eter values. Supported by the BICO technology implemented on the hardware the STARTER software enables easy connection of parameters. This flexibility allows users to configure the drive system according to their special applications. Con- sidering the scope of this work and the limited pages of this thesis report, not all commissioning steps are showed here. The figures 42, 43, 44 and 45 show the im- portant details of the system commissioning as examples.

44 Figure 41: AC drive system signal interfaces with external hardware components

Figure 42: The topology of the modules on DRIVE-CLiQ cables

Figure 43: The current control loop implementation in the drive system

45 Figure 44: Specify the torque setpoint signal sources

Figure 45: Important parameters setting in expert list

46 Figure 46: dSPACE DS1104 R&D controller board and its connectors

3.7.3 DS1104 R&D controller board In this thesis, the DS1104 R&D controller board shown in figure 46 is the hardware platform for implementations of the following functions (functions are designed in Matlab/Simulink® environment): ˆ Event-triggered control (state-flow chart)

ˆ Trajectory generator (lines of codes)

ˆ Position Calibration (lines of codes)

ˆ Controller for trajectory following (lines of codes)

Since the control system is implemented on the controller board, almost all signals are eventually transfered via the electronics board to the controller board. An I/O layout from the controller board point of view is provided here in figure 47.

3.7.4 HMI and limit switches In this section, the design of the last two harware components, HMI and a set of limit switches is covered. As shown in figure 48, an HMI consists of four buttons, START, STOP, EMSTOP, ACK, used for functions like starting the machine, stopping the machine in a normal operation, stopping the machine in an emergency situation and acknowledging possible faults appearing in emergency situations. This hardware component offers a means of interaction between the machine operator and the ma- chine. In figure 38, how the four buttons are connected with the electronics board can be easily reconized.

Four limit switches are used as indicated by their names, to detect the limits of the movements. The limits are imposed on the range of the movements by the limited lengths of screws. They can be used for two purposes. Specifically, one purpose is for position calibration. Incremental encoders were used in this project, therefore upon the power on of the machine, the positions of the nuts are unknown to the control system. In order to obtain this kind of information, the control system has to command the motors to drive the nuts to one end of the screws respectively

47 Figure 47: Detailed signal connections among dSPACE hardware, HMI, Drive sys- tem, and Limit switches from the point of view dSPACE hardware

Figure 48: HMI consisting of four buttons and then move them back upon hitting the corresponding limit switches to the mid- dle points of the screws to complete the position calibration process. The other purpose is for security’s sake. After the calibration process has been accomplished, the hitting of limit switches again would trigger the machine to stop immediately,

48 that is, emergency stop. As said above, in this case, the fault has to be removed and acknowledged in order to restart the machine. The limit switches used in this project are reused components. They are called photomicrosensor or slotted in- terrupter relying on the internal phototransistor detector. They were produced by two companies, therefore in figure 49 two schematics are presented here. So far,

Figure 49: Limit Switch Schematics the five hardware components design or/and their electrical interfaces design have been covered. The figure 50 shows the architecture of the five hardware compo- nents represented by five green boxes in the figure and reveals the relations between those components. As in figure 37, the electronics board is at the centre of this architecture, which indicates that all signals go through the electronics board to their destinations. A real hardware components implementation result is included in section 4.2.

3.8 System Modelling The system features both event-triggered system behaviour changes and continuous motion dynamics in the time domain. Events like pressing the buttons and toggling switches cause the system to jump from one state to another. In different states, the system behaviour varies to a significant extent. The system behaviour modelling aims at clearly presenting the implicit logical relations among those behaviours. Modelling in Matlab/Stateflow Chart is one good approach to do this. System dynamics modelling aims to capture how the system behaves with respect to time when given a certain input, for example a torque step. Usually the changes of the system’s state variables, for instance speed and position, with respect to time can be described fairly accurately in a mathematical way. This section deals with system behaviour modelling and system dynamics modelling.

3.8.1 System behaviour modelling In this project, the system required six states, namely “Standby1”, “Calibrate”, “Standby2”, “Running”, “Stop”, and “EmergencyStop”, ten transitions and eight events as shown in figure 51. Events are triggered by pressing buttons or when limit switches are crossed. Intuitively these names indicate what they mean. However

49 Figure 50: Detailed interfaces among dSPACE hardware, HMI, Drive system, and Limit switches further illustration is necessary to make it more comprehensible.

Figure 51: System behaviour modelling

50 When the machine is powered on, and both main power (3 phase 380V) and electron- ics working power (24V) are switched on for the AC drive system and the dSPACE Controller Board is working, the system immediately enters the state “Standby1”, which means the machine is ready to go and awaiting further commands. Trigger- ing the event “start” by pressing the button “start” moves the system to the state “Calibrate” where the motors drive the saddle to its origin or home position, mean- ing that both nuts on the screws are in the middle position of the screw, that is half stroke away from either end of the screws respectively. A “ready” signal would be sent from the system itself to move the system on to the “Standby2” state upon completion of the calibration process. Pushing “start” again, ramps up the trot gait. At this stage, if the “stop” button was pushed, the system would enter “Stop” state, and the trot of the AHGS would be ramped down. After 10 seconds, it automatically returns to “Standby2” state, from which the machine can be started running again without calibration first if the “start” button is pressed. In the state “Standby2” all control loops are still working and the position of the nuts are maintained at their home positions. If instead the “emstop” button was pressed, the system would transition to the “EmergencyStop” state and the movement of the AHGS would be stopped immediately. In addition, for safety reasons, four limit switches installed at both ends of the two screws could be the sources of the event as well, trigger- ing the system into the “EmergencyStop” state. The “acknowledge” button has to be pressed in order to move the system back to the “Standby1” state. The final designed system behaviour model is as shown in figure 51.

3.8.2 System dynamics modelling The system dynamics modelling aims to formulate the causes of the motion and the changes in the motion mathematically. In this section mechanical system dynamics modelling including kinematics will be handled. To a great extent, the kinematics depends on the mechanical system’s mechanism and dynamics is dictated by both mechanism and the nature of the system for instance the stiffness and the damping ratio. Figure 52 depicts the mechanical structure in question.

Figure 52: Mechanical structure representation [7].

The mechanical structure analysis: As shown in figure 52, besides servo motors, the mechanical system consists of

51 screws and nuts, couplings, bearings, guide-rails and a workbench for bearing the load. The stiffness of the material of these components and viscous effects in their relative movements result in mechanical flexibilities. Mechanical design could have a great impact on the total stiffness and damping ratio of the whole mechanical sys- tem. In this mechanical design, the following should be kept in mind when modelling and later designing the controller. 1. Rigidity is not well guaranteed. In the mechanical design, the screw shaft is mounted in a fixed-to-simple way. That means one end of the ball screw is rigidly mounted with respect to both axial and radial loads (fixed) while the other is rigidly mounted only with respect to radial loads (simple). This mounting method features degraded rigidity, but it reduces the average stress which the shaft may be subject to due to time-varying load and thermal ex- pansion effects.

2. The nut bears not only the axial force but also some effective radial force and moment. For the ball-screw application, in principle the nut should be pre- vented from any radial or bending load, because they will significantly reduce its life. For the horizontal movement, the nut is supposed to transmit only axial acceleration force and the force overcoming friction; and for the vertical movement, besides these two types of forces, the nut also bears all the weight of the load. The guide rail is supposed to be subject to the aforementioned radial and moment load. However, in practice the misalignment between the nut and the table or guide rail and the flexible connection between the nut and the table would contribute together to the introduction of unexpected forces or moments. However, apart from these effects, there are possibly a great number of factors which may unfavourably affect the mechanical system. Estimating these influences on the modelling accuracy is a very complicated process. These factors are reflected in the movement errors in three dimensions, namely lateral, axial and torsional [10]. Several modelling methods are described in section 2, which consider some of these factors. For a ball screw drive in this application, the lateral force is quite small and axial force and torsional torque are the two main sources contributing to the axial errors. ˆ Torsional stiffness gives rise to angular difference which further produces axial displacement error with its value dictated by the screw pitch.

ˆ Elongation of the shaft as a result of external axial load and thermal expansion contributes to the axial error as well. Those effects are well illustrated in the figure 53. where: Tm = System controlled input, representing motor torque, Nm; Tl = Driving torque on load, Nm; F = Axial forces on screw shaft, N;

52 Figure 53: Error sources

∆x = Axial strain (deformation), m; ∆θ = torsional deformation, rad.

Lumped modelling without non-linearity: In section 2, many kinds of ball screw modeling techniques are summarized. In this application, only torque is considered and a lumped model will be built since the stroke of the screw is comparably short in terms of the error accumulation rate along the screw and low precision requirements are imposed on the recreation of the gait. The dynamics of the system including the motor in this application are modeled as a lumped two-mass system connected by a spring and a damper. The spring and damper effects originate from mechanical flexibilities which have been explained above. The two-mass system model is depicted in figure 54. However, for simplicity sake the two-mass system modelling includes neither any non-linearity element such as instance friction nor any possible dynamic load disturbance and system parameter variation with respect to time. A friction model will be built later and model uncertainty and external disturbances will be handled when the controller is designed in the section 3.9.1.

Figure 54: Two-mass system model where: 2 Jmotor = motor inertia (kgm ) 2 Jload = load inertia on the motor side (kgm ) Tm = System controlled input, representing motor output torque (Nm) Tl = Driving torque on load (Nm) Tld = Equivalent torque of load disturbance (Nm) ωm = Motor shaft speed (rad/sec) θm = Motor shaft position (rad) ωl = Load equivalent rotational speed (rad/sec)

53 θl = Load equivalent rotation position (rad) ks = Flexible connection stiffness (Nm/rad) bs = Viscous damping friction coefficient (Nm/(rad/sec)) ∆θ = Torsional angular difference (rad)

The whole system can be divided into three parts as in equations (3.8.2.1), (3.8.2.2), (3.8.2.3) and (3.8.2.4). 1 G1 = (3.8.2.1) Jss + Kd 2 2 1 + 2ζa/ωas + 1/ωas G2 = 2 2 (3.8.2.2) 1 + 2ζr/ωrs + 1/ωr s

1 + 2ζa/ωas G3 = 2 2 (3.8.2.3) 1 + 2ζa/ωas + 1/ωas

G = G1G2G3 (3.8.2.4) where: 2 Js is the sum of the motor inertial and the load inertial on the motor side (kgm ) Kd is the damping constant of the motor (Nm/(rad/sec)) ωr and ωa are the resonant and anti-resonant frequencies of the system; ζr and ζa are the relative damping coefficients of the mechanical system.

s   r ks Jload ks ωr = 1 + ωa = Jload Jmotor Jload s s 2   2 bs Jload bs ζr = 1 + ζa = 4ksJload Jmotor 4ksJload where: ks is the total torsional stiffness of the mechanical complex; bs is the total viscous damping of mechanical complex;

It can be observed that the natural resonance frequency depends on the system’s total stiffness, motor inertia and load inertia.

The physical meaning of these four transfer functions can be interpreted as follows:

G1 can be interpreted as the transfer function from the input torque to the ideal speeds of both the motor and the load with the assumption that the connec- tion between them is totally rigid without any flexible elements. Under this assumption, the motor and the load share the same speed;

G2 can be interpreted as the transfer function from the ideal motor speed to the actual motor speed, taking the flexibile connection into consideration. In this circumstance, the motor speed is different from the load speed;

54 G3 can be interpreted as a transfer function from the actual motor speed to the actual load speed, taking the flexibile connection into consideration;

G thus represents the transfer function from input torque to actual load speed in reality.

The figures 55, 56, 57, and 58 show the bode diagrams for transfer functions from torque to motor speed and from torque to load speed.

From the bode diagram, the natural resonance frequency for the vertical movement is around 300Hz and for the horizontal movement is around 800Hz. The values of some important parameters are in table 4.

Table 4: The parameter estimates of the stationary motor model

Direction Jm Kt Kd Jl ks bs Horizontal 0.00032 1.86 0.0006 0.00032 180 0.006 V ertical 0.00122 2.83 0.004 0.0039 110 0.002

Table 5: The parameter estimates of the stationary motor model

Direction ωr ωa ζr ζa Horizontal 788.15 555.6 0.0079 0.0056 V ertical 327.8 159.62 0.0033 0.0016

Friction model: The choice of friction modeling techniques to be used was investigated. Some of them, for example the Coulomb friction model, are too simple to capture the suffi- cient characteristics of the friction in reality, while some of them, for instance the Dahl model, are too complicated to be implemented properly. The highly nonlinear but value-bounded friction is the main source of the load disturbance in figure 54. The friction in this application occurs between the sliders and the guiderails, to be exact between two lubricated metallic surfaces in contact. Therefore the viscous force, caused by the lubricant and dependent on the sliding velocity, could not be ignored especially in this application where the maximum velocity is more than 1 meter per second. The General Static friction model, which was adopted in the same application before in the paper [16], capatures this feature very well and at the same time incorporates other general friction phenomena, such as the static effect and the Stribeck effect. Both the graphic description and mathematical expression were presented in the section 2. Values of the parameters are given in the table 6. Those values are estimated values based on data in the paper [16]. A set of more

55 Figure 55: Bode diagram for transfer function from input torque to motor speed as output, vertical movement.

Figure 56: Bode diagram for transfer function from input torque to load speed as output, vertical movement.

56 Figure 57: Bode diagram for transfer function from input torque to motor speed as output, horizontal movement.

Figure 58: Bode diagram for transfer function from input torque to load speed as output, horizontal movement.

57 accurate values has to be acquired by performing a parameter identification process. Due to the limited time, this work was not carried out in this project. Instead, in simulation larger than usual values were used for the friction model to evaluate the robustness of the designed controller against load disturbance.

Table 6: The parameter estimates of the stationary motor model

Direction Fs Fc kv vs σ Horizontal 60 50 0.006 30 1.5 V ertical 40 30 0.001 35 1.5

The friction model is not included in the system transfer function for the controller algorithm design, but is included in the simulation model as in figure 59 when the controller performance was examined.

Figure 59: Dynamics model of the to-be-controlled ball screw drive system.

3.9 Control Design and Simulation In section 3.8, the designed mechanical structure analysis was presented, error sources were investigated and a dyamic model of the system was constructed. In this section a controller algorithm design and implementation in Matlab/Simulink and the integrated system model including the user inputs which simulate the event occurence sequences, system behaviour, trajectory generation, controller and the to-be-controlled process i.e. system dynamics will be presented.

3.9.1 Controller algorithm design Control problems can be generally classified into two categories, regulation problems and servo problems [22]. In the case of this application, it is a servo control prob- lem. The controller is expected to drive the motors to follow a trajectory which is predefined in section 3.3. Due to the nature of the mechanical flexibility, it is safe

58 to predict that the nut may oscillate around its position setpoint when it moves. The magnitude of the oscillation depends on the movement frenquency; while since the trajectory is composed of low frequency signals, nut oscillations may not be observed. In addition it should be noted that position sensors are mounted on the motor shafts and there are no sensors available for measuring the real position of the nuts. In other words, the actual nut position is unknown and the control struc- ture turns out to be what is called a semi-closed control loop. However, it is still possible to control the position of the nuts if the relationship between the motor shaft position and the nut position is well investigated. The static relationship is largely dependent on the geometrical construction, while the dynamic relationship is to a significant extent dependent on the mechanical properties such as stiffness. This relationship is ignored during controller design.

Therefore, the control objective is to find a control law represented by u in equa- tion(3.9.1.1) to drive the error denoted by z1 in equation(3.9.1.2) to converge to zero, with sufficient accuracy. At the same time, the possible oscillations ought to be reduced to a minimum and the controller is expected to be robust enough against model parameter uncertainties and variations which may be caused for ex- ample by mechanical wear. As investigated in section 2, control methods such as the sliding mode control, usually in combination with other control methods such as integral control and adaptive control are promising approaches. In this application, an Integral-Back-stepping approach is adopted and subsequent simulation results demonstrate its effectivess and robustness against parameter variations and uncer- tainties, load disturbances and other unfavorable nonlinearity effects such as highly nonlinear and time-varying friction.

The designed controller consists of two parts, one part integral control and the other back-stepping control. Here the back-stepping controller design steps are narrated:

Step 1: Simplify the model, define states and partially stabilize the sys- tem.

Let x1 = θ, x2 = ω

Then, the simplified model G1 as in the section 3.8.2 can be represented in state space form as follows:   x˙1 = x2 1 (3.9.1.1) x˙ = (u − K x )  2 J d 2

Let the desired position be x1d, and to indicate the position error let

z1 = x1 − x1d (3.9.1.2) Then

z˙1 = x2 − x˙1d (3.9.1.3)

59 Choosing the Lyapunov funtion candidate as 1 V = z2 1 2 1

The time derivative of V1 is then computed as ˙ V1 = z1z˙1 = z1(x2 − x˙1d) The virtual control law can be chosen as

φ1 = −k1z1 +x ˙1d (3.9.1.4)

Where k1 is a definite positive design parameter, that is k1 > 0 Let z2 = x2 − φ1

Then ˙ z˙2 =x ˙2 − φ1 ˙ And rewrite V1 in the form: ˙ 2 2 V1 = −k1z1 + z1z2 ≤ −k1z1 ≤ 0

So far, the first part of the system denoted by the equationz ˙1 = φ1 − x˙1d is well stabilized, with the virtual control law φ1 = −k1z1 +x ˙1d

˙ The next step is to stabilize the other part of the system,z ˙2 =x ˙2 − φ1 by find- ing a control law u which as will be seen, stabilizes the first part of the system as well.

Step 2: Differentiating z2 to find the control law u Differentiating z2 gives 1 z˙ =x ˙ − φ˙ = (u − K x ) − φ˙ 2 2 1 J d 2 1 Choosing the Lyapunov function candidate as: J V = V + z2 2 1 2 2

The time derivative of V2 is then computed as ˙ ˙ 2 ˙ V2 = V1 + Jz2z˙2 = −k1z1 + z2(z1 + u − Kdx2 − Jφ1) Thus, the control law u is defined as: ˙ u = −(k2z2 + z1 − Kdx2 − Jφ1) (3.9.1.5)

Where k2 is a definite positive design parameter, k2 > 0 and ˙ φ1 = −k1z˙1 +x ¨1d

60 ˙ Rewrite V2 in the following form:

˙ 2 2 V2 ≤ −k1z1 − k2z2 ≤ 0 so the states of the system are asymptotically stable, in other words, the tracking error converges to zero.

Step 3: Rewrite control laws in terms of x1 and x2 ˙ Substitute z1, z2, and φ1 in the equation (3.9.1.5) with the equations (3.9.1.2), (3.9.1.3) and (3.9.1.4) and add the integral control part for position control with integral gain denoted by pi and the sum of position denoted by sumerror giving the control law as a function of x1 and x2 as follows:

u = (1 + k1k2)(x1d − x1) + pisumerror + (Jk1 + k2)(x ˙1d − x2) + Kdx2 + Jx¨1d

Now, the control law has been obtained. k1 and k2 are the two design parameters. Their values have to be determined as a trade-off between tracking precision and control effort u, whose physical meaning in this case is torque, with its value lim- ited according to motor specifications. The term (x1d − x1) actually represents the position tracking error, and the term (x2 − x˙1d) is in effect the difference between the desired speed and actual speed. Therefore these two terms appearing in the control law indicate that position feedback and speed feedback controls are de facto included in the proposed control law. The term pipsumerror represents the integral control used to eliminate accumulated position control errors. The terms Jx¨1d and Kdx2 in the control law indicate that by the same token the feed forward control is incorporated in the control law as well. Therefore, basically the control structure would be a dual higly coupled feedback control plus one feedforward control as il- lustrated in the figure 60.

Figure 60: Control structure, a dual feedback plus one feedforward.

The selection of the values of the controller parameters is included in the section 5.1.4. Here only values are provided in table 7. The controller is implemented in both the continuous and discrete time domain. Figure 61 shows the implementation

61 Table 7: Controller parameters’ values for both motors

Direction k1 k2 pi Horizontal 10 0.2 1 V ertical 2 0.1 0.4 in continuous time domain; while the implementation in discrete time domain takes the form of lines of code.

Figure 61: Controller implementation in Simulink

Many criteria have been established for evaluating the controller performance, for example: internal stability from any of inputs to any output, low sensitivity to load disturbance, strong robustness against system parameter variations, and quick, ac- curate and stable response. Some of these criteria are contradictory and therefore control design is a trade-off between them. For a servo problem as in this case, the major trade-off is between response speed and model uncertainty. In the following design, the designed controller performance is evaluated. The discussion on this is included in section 5.1.4.

3.9.2 System simulation The controller algorithm has been designed in 3.9.1. A simulation of the whole control system including the final system model and controller block diagram is shown in figure 62.

The various modelled components observed are:

62 Figure 62: System modelling and controller design Simulink blocks diagram

1. User input model: This is to simulate the actions of a human who operates this machine, giving commands by pushing buttons or toggling the switches to trigger those events in the state-flow chart. All possible sequences of the occurrence of these events are included in this model.

2. System behaviour model: It is actually a state-flow chart. Its function has been described in section 3.8.

3. Initialization model: This is to simulate the process of initialization of the machine, aiming at finding the saddle’s origin or home position, which means that both nuts are in the position of the half stroke of the screws respectively.

4. Trajectory generator model: As described in section 3.3, it generates position, velocity and acceleration set-points for the controller.

5. Controller model: This represents the implementation of the designed con- troller in Matlab/Simulink.

6. Process model: This is the to-be-controlled system’s dynamics model.

These components represent the simulation model of the whole system. Simulation results are presented together with the experimental results in section 4.

63 4 RESULTS

4.1 Mechanical Fabrication Figure 63 shows the mechanical hardware manufactured according to the design desicions made during this project. It also shows the motors mounted and coupled to the horizontal and vertical motion ball screws. During initial testing, simple sta- bilising weights were used in place of mounting the base plate to a sturdier mounting surface. These weights have also been shown here. The mechanical design was ob- served to transmit motions as expected, and the designed structure was able to fulfill the required ranges of motion as well as the functions of crossing the limit switches at the appropriate position properly.

Figure 63: The fabricated mechanical structure

4.2 Hardware Implementation In section 3.7, the real implementation results of dSPACE hardware, AC drive sys- tem, physical HMI have been presented. In this section, only the remaining two hardware components are presented, electronics board and limit switches. In prac- tice they are as shown as in the figure 64 and the figure 65. And the final hardware integration is as shown in the figure 66.

4.3 Controller Performance This section describes the obtained results of the AHGS development project. It presents the accuracy of the controller performance, for the motors used.

64 Figure 64: The implemented electronics board

Figure 65: The implemented limit switch

65 Figure 66: Hardware integration in practice

Figures 67 and 68 show the simulated performance of the Integral-Back-Stepping controller, designed for both the vertical and horizontal motors, compared to the reference input to the control system. The simulations are performed without the mass of a rider being considered. Further test simulations were also run with a load of upto 70 kg rider weight. The simulation results are shown in figures 71 and 72. It can be observed that the controller performs adequately under no load as well as with the load of a rider, which demonstrates it’s robustness to varying rider mass, which can be considered to be one of the most unpredictable of the variables the controller must deal with.

66 Figure 67: Vertical motion motor position simulated performance, under no load

Figure 68: Horizontal motion motor position simulated performance, under no load

The simulated torque requirement from the motor, under no load conditions, for the trajectories plotted in figures 67 and 68 can be observed in figures 69 and 70. The simulated torque requirements from the motors for the trajectories plotted in figures 71 and 72 can be observed in figures 73 and 74. The actual Integeral-Back-Stepping controller performance for the vertical and horizontal motors under no load (i.e. with mechanical structure but without a rider on the saddle) is shown in figures 75 and 76. The torque requirements can be seen in figures 77 and 78.

The actual performance compares well with the simulated responses of the motor under no load conditions. The actual position performance of the motors and the controllers, with the weight of a rider (70 kg in the test) can be observed in figures 79 and 80. The higher level (dSPACE) control torque signal to the S120 system, and the re- sultant torque to the motors can be compared in figures 81 and 82. This shows an

67 Figure 69: Vertical motion motor simulated torque requirement, under no load

Figure 70: Horizontal motion motor simulated torque requirement, under no load

Figure 71: Vertical motion motor position simulated performance, 3 rad/sec with rider 70kg acceptable performance of the S120 control system, in interpreting the high level controller’s torque reference signal and controlling the motor accordingly.

68 Figure 72: Horizontal motion motor position simulated performance, 3 rad/sec with rider 70kg

Figure 73: Vertical motion motor simulated torque requirement, 3 rad/sec with rider 70kg

Figure 74: Horizontal motion motor simulated torque requirement, 3 rad/sec with rider 70kg

69 Figure 75: Vertical motion motor position performance, under no load

Figure 76: Horizontal motion motor position performance, under no load

Figure 77: Vertical motion motor torque performance, under no load

70 Figure 78: Horizontal motion motor torque performance, under no load

Figure 79: Vertical motion motor position performance, 3 rad/sec with rider 70kg

Figure 80: Horizontal motion motor position performance, 3 rad/sec with rider 70kg

71 Figure 81: Vertical motion motor torque performance, 3 rad/sec with rider 70kg

Figure 82: Horizontal motion motor torque performance, 3 rad/sec with rider 70kg

72 5 DISCUSSION AND CONCLUSION

5.1 Discussion 5.1.1 Mechanical deisgn The mechanical design manufactured for the first prototype of the AHGS has per- formed as required during initial testing. The parts which are subjected to the highest stress levels are observed to be the vertical screw’s nut plate (Part 17) and the vertical ball screw bottom bearing support (Part 13). These components still perform well. However, if a significant increase in rider weight or gait frequency is needed, it would be appropriate to replace them with stronger parts. The mechan- ical hardware also could use long term testing to identify which connections are in need of greater fastening strength.

5.1.2 Trajectory generator design The trajectories designed have been tested with experienced riders who have judged the AHGS to be an accurate representation of the feeling of riding a trotting horse in reality. These trajectories can be further modified by changing the Fourier coefficient parameters used in their generation. Aside from simply changing all the coefficients of a function with the same ratio, it remains to be seen whether a more specific desired change in trajectories, such as making the horse smoother or bumpier in its motion, can be realised by specific changes in the coefficients. This may be determined with further testing as well.

5.1.3 Hardware implementation The controller board possesses muliple varieties of signal interfaces: analog inputs and outputs, digital inputs and outputs, encoder channels of either single-ended sig- nal or differential signal, and serial interface of either RS232, or RS422, or RS485 standard. They facilitate the electrical integration of the controller board with other hardware components in this thesis project. The accompanying software RTI is well integrated with Matlab/Simulink® and as well it supports the graphic block programming for the application designed in Matlab/Simulink® environment. Loading the application on the controller board can be carried out automatically. Features of dSPACE R&D Controller Board facilitate the controller design process and hardware integration.

5.1.4 Modelling and controller design In the controller design, the controller parameters selection is not decided randomly, but based on rough calculation. An error of one radian to be eliminated within 0.1 second means that an acceleration of approximately 10 radian per square second is needed. Multiplying this acceleration with inertial gives the desired torque. The

73 coefficient of position error can be calculated through dividing the torque by posi- tion error. Of course, this method is not sufficiently accurate. However in practice, it is a good guidance on how to decide the reasonable range of values of controller parameters. In the implementation stage, however, only the value of the gain for integral control for horizontal motor was changed once from 1 to 0.4 and the other parameters hold the same values as in simulation. Due to time constraints, the robustness of the controller against system parameter variation, load disturbance and unmodelled dynamics has not been evaluated in a mathmatical way. However in simulation the situation was simulated by applying dynamic friction with values varying ten times and in practice testing was performed with different speeds and loads. Based on these, it is safe to say that the controller robustness is sufficiently strong.

5.2 Conclusion The AHGS development project carried out as described in this master’s thesis report fulfilled the requirements of recreating the horse trot, on a chair that riders could use to simulate riding a trotting horse, in a laboratory environment. The weight and mobility of the mechanical structure was judged to be within the required limitations, and the trajectories designed for the horse trot functioned smoothly and gave an accurate representation of the horse’s movement. This movement was judged by three experienced riders during the testing phase of the project. Furthermore, during these tests, the riders weights were significantly different, and the Integral- Back-Stepping controller performed satisfactorily under all conditions of testing. Based on these results of the AHGS development cycle, the master’s thesis project was deemed to be a success. As such, it presents a base product which further development and improvement as outlined in section 6 can be carried out on.

74 6 FUTURE WORK

This section describes the further development as well as possible improvement in the prototype of the AHGS.

6.1 Mechanical Hardware Upgrade The current mechanical hardware is a first prototype of the system. It requires extensive testing and long term fatigue analysis before it can be used in a real world application. At present, certain problems have arisen with play in the sliding carriages of the X axis movement, which will have to be rectified before heavy duty use of the machine. Some suggested improvements have been reinforcement of the carriages and the connections to the structural plates, as well as possible relocation of the X axis sliding rails to the outer extremities of the machine to provide greater stability to lateral imbalanced forces. The vertical sliding rail carriages could also then be reinforced, if it is observed to be necessary during further testing.

6.2 Multiple Gait Implementation At present, the AHGS is designed only to recreate the trot gait of a horse. Future improvements can include trajectory design for walk gaits of horses, as well as mod- ification of the machine to accommodate the canter and gallop. It is possible that at least one angular degree of freedom may then need to be introduced in the machine, about the Y axis. A study of the horse’s physiological movements will be needed, in order to determine whether this angular movement could be coupled directly to the vertical movement of the horse. If the two movements are in phase, and this is possible, the other gaits may be implemented simply with mechanical couplings between the two motions, while maintaining the present two actuator system. If not, an additional actuator for angular movement would also have to be added.

6.3 Stand-alone System Implementation The current system utilised a PC with dSPACE for higher level control, to provide a reference torque signal to the S120 current control loop. This is envisioned to be replaced in the future by a PC independent microcontroller which could then be attached to the S120, to make a stand-alone, transportable AHGS. This would include electronic hardware and controller selection, as well as importing the software to the new environment. Cabinet design for a revised S120+Microcontroller system would also be an area of future work. It would also be necessary to design a human- machine interface, for the rider to start, stop and control the speed and gait of the AHGS easily. The necessary panel and controls would need to be developed in the future.

75 References

Academic References [1] J. Moore, “General Biomechanics: The Horse as a Biological Machine”. Journal of Equine Veterinary Science, Vol. 20(7), 2010. [379-383]

[2] E. Muybridge, Descriptive Zoopraxography or The Science of made Poplular, University of Pennsylvania, 1893.

[3] C. Rogers, Kinematic analysis of the trot in CCI*** 3-day-event horses. Massey University, 1999.

[4] B. Auvinet, E. Barrey, P. Galloux and J.P. Valette, “Exercise tests in saddle horses- A comparison of step tests on a track and an inclined treadmill”. Journal of Equine Veterinary Science, Vol. 13(7), 1993. [417-421]

[5] Vicente A., Hecker R., Flores G., “Ball Screw Drive Systems: Evaluation of axial and torsional deformations”, Asociacion Argentina de Mecanica Computacional, Vol XXVIII. [3265-3277]

[6] S. Frey, A. Dadalau and A. Verl, “Expedient Modelling of Ball Screw Feed Drives”, Production Engineering, Vol. 6(2), 2012. [205-211]

[7] Y. Liu, T. Zhao and H. Zhang, “Hybrid Dynamic Modelling of a high-speed Ball- Screw Drive system”, Proceedings of the 2010 IEEE International Conference on Mechanic Automation and Control Engineering, 2010. [3049-3052]

[8] Hassan K. Khalil, Nonlinear Systems. Prentice Hall, Upper Saddle River, NJ, USA, 3rd Edition, 2002.

[9] K. Erkorkmaz and A. Kamalzadeh, “High Bandwidth Control of Ball Screw Drives”, CIRP Annals- Manufacturing Technology, Vol. 55(1), 2006. [393-398]

[10] C.E. Okwudire and Y. Altintas, “Hybrid Modelling of a Ball Screw Drives with coupled Axial, Torsional and Lateral Dynamics”, Journal of Mechanical Design, Vol. 131(7), 2009. [071002]

[11] T. Haukaas, “Timoshenko Beams”, University of British Columbia,

[12] Varanasi, K.K., Nayfeh, S.A., “Dynamics of Lead-Screw Drives: Low-Order Modeling and Experiments”, Transactions of ASME, Journal of Dynamic Sys- tems, Measurement, and Control, Vol. 126(2), 2004. [388-396]

[13] Z. Liu, J. Yang and R. Zhou, “Notch Filter Control for the Vibration Restraint of the Rotor”, Energy Procedia, Vol. 13, 2011. [10359-10363]

[14] Smith, A.D., “Dynamics of Lead-Screw Drives: Low-Order Modeling and Experiments”, University of Florida, Department of Mechanical Engineering, Florida, 1999.

76 [15] Armstrong, H.B., Dupont P., “A survey of Models, Analysis Tools and Com- pensation Methods for the Control of Machines with Friction”, Automatica, Vol. 30(7), 1994. [1083-1138]

[16] Yu feng Li, Bengt Eriksson and Jan Wikander, “Robust Position Control for a DC Servomechanism Subject to Friction and Compliance”, Proceeding of the 6th UK Mechatronics Forum International Conference, 1998.

[17] Johnson, C. T., and R. D. Lorenz, ”Experimental Identification of Friction and Its Compensation in Precise, Position Controlled Mechanism”, IEEE Transac- tion on Industrial Applications, Vol. 28(6), 1992. [1392-1398]

[18] M. Seong, S. Choi and K. Sung, “Control Strategies for Vehicle Suspension System Featuring Magnetorheological (MR) Damper”, Vibration Analysis and Control - New Trends and Developments, Francisco Beltran-Carbajal (Ed.)

[19] S. Thangavelu, “Fourier Series: The Mathematics of Periodic Phenomena”. Resonance, Vol. 1(10), 1996. [44-55]

[20] T. Seigler, A. Salehian, “Analysis of Friction Controlled Motion”, Journal of Vibration and Control, Vol. 17(12), 2011. [1893-1904]

[21] Kaan Erkorkmaz, Yusuf Altintas, “High speed CNC system design. Part II: modeling and identification of feed drives”, International Journal of Machine Tools and Manufacture 41, 2001. [1487-1509]

[22] B.Witternmark, K.H. Astr¨om˚ and K-E. Arzen,˚ “Computer Control: An Overview”, IFAC Professional Briefs.

[23] Y. Maeda, M. Iwasaki, M. Kawafuku and H. Hirai, “Nonlinear Modelling and Evaluation of Rolling Friction”, Proceedings of the 2009 IEEE International Con- ference on Mechatronics, 2009. [1-6]

[24] T. Takemura and H. Fujimoto, “Simultaneous identification of Linear Param- eters and Nonlinear Rolling Friction for Ball Screw driven stage”, Proceedings of the 2011 IECON - 37th Annual Conference on IEEE Industrial Electronics Society, 2011. [3424-3429]

[25] S. Daniel, N. Ryozo and S. Farrokh, “Tracking Control of Flexible Ball Screw Drives with Runout Effect and Mass Variation”, IEEE Transactions on Indus- trial Electronics, Vol. 59(2), 2012. [1248-1256]

Commercial References

[26] http://machinedesign.com/article/scanning-for-ideas-options\ -make-ball-screw-drive-flexible-and-versatile-1121

[27] http://en.wikipedia.org/wiki/Lumped_element_model

77 [28] http://www.skf.com/files/881719.pdf

[29] http://rollco.se/files/sysadmins/Indhold/Brochurer/PDF/Ball_ Screws_2012-06.pdf

[30] http://rollco.se/files/sysadmins/Indhold/Brochurer/PDF/Miniature_ 2011-10.pdf

[31] http://www.mekanex.se/pdf/pdfkat/306_327.pdf

[32] http://www.stscoupling.de/media/PDF/WKE-N.pdf

[33] http://www.gipsa-lab.grenoble-inp.fr/~carlos.canudas-de-wit/ publications/friction/dynamic_friction_EJC_98.pdf

78 APPENDICES A MECHANICAL DESIGN STRESS CALCU- LATION

This section describes the calculations involved in the structural dimensioning of the horse gait simulator components. For the purpose of stress analysis, it was essential to analyse the vertical support beams for their load bearing capabilities. In addi- tion, the vertical nut plate, as well as the vertical bearing support were considered points of possible failure in the structure. These are the parts which will be stress evaluated. In addition, the physical properties behind the selection of the motors, bearings and ball screws shall also be addressed.

Forces: The forces acting on the structure are considered to be in two primary directions, X and Z, along the direction of motion of the two ball screws. A factor of safety has been introduced, to compensate for impact forces in the Z direction which would result from the rider and the saddle movement being out of phase, and the rider bouncing on the saddle.

In the X direction, the force acting on the saddle will be as a result of the fric- tion between the rider and the saddle, when it tries to move him. This force, for design intentions, has been calculated at it’s maximum normal value of the vertical force, and with a co-efficient of friction 0.5. Aside from this, the inertia force of the accelerating rider in the X direction has also been considered, although in reality, this force would not exceed the restraining friction force without simply causing the rider to slide on the saddle.

The inertia forces are calculated considering the rider’s mass to be 100 kg, with the following motion profile characteristics: Vertical motion range: 150mm Horizontal motion range: 50mm Motion profile: Sine wave, frequency 2.4 Hz

Aside from these forces, an added moment, from the rider leaning to a side in an imbalanced manner (before falling off) has also been added. This force is calculated considering a human with the same mass of 100kg, who is leaning perpendicular to the saddle, with half his body overhanging it. The Centre of Mass of the overhang- ing part of the body is assumed to be a maximum distance of 0.5 metres from the centre of the saddle. Half of the human’s mass is assumed to be acting in this off- set position, with the remaining half still acting on the saddle as in normal operation.

Stress Calculations: Support beam stresses: The forces acting on the support beams are considered to be a compressive force

79 from the normal downward force of the rider and the force in the X direction causing a moment which will be maximum at the bottom section of the support beams. An overhanging moment has also been added about both the X and Z axes. The stress acting on the support beams has been calculated as a result of these forces, as follows:

Normal Compressive stress: F σ = z z A

Where Fz = Force acting downward on the saddle (N) A = Total cross-sectional area of support structure

We have, Fz = −2(mriderg + mrideraz(max)) and A = 2(w1t1 + w2t2)

Where mrider = Mass of the rider (kg) g = Acceleration due to gravity (m/sec/sec) az(max) = Maximum acceleration experienced in vertical direction during motion (m/sec/sec) w1, w2 = Width of support beam 1 and 2 respectively t1, t2 = Thickness of support beam 1 and 2 respectively

Substituting designed dimensions, and values of acceleration from observed motion, we have 5 2 σz = 3.725 × 10 (N/m )

Stress due to bending: We have

MT otal = FxHsb + Mimb

Where MT otal = Total bending moment on support structure (Nm) Fx = Maximum force acting on the saddle in X direction (N) Hsb = Height of support beams (m) Mimb = Moment due to imbalance, calculated as described above (Nm)

The bending moment experienced by each of the two support beams is assumed

80 to be half of this total bending moment, as both beams are symmetrical with each other about both the X and Z axes. This assumption may be slightly approximate, since the overhang moment will always be on one of the supports more than the other, but is valid for the present calculations. This is because the imbalance mo- ment was observed to be significantly lower that the inertia moment experienced by the beams.

Stress in the beam is then calculated as: My σz = INA

Where INA = Second Moment of Inertia of the beam cross section, about its neutral axis (N.m.m) y = Distance of element of beam from neutral axis (m)

The neutral axis is defined as the centroidal plane axis in the beam which does not undergo any normal stress as a result of bending. One side of this neutral axis will be in compression, and the other one in tension, under any kind of bending load.

The location of the neutral axis of the beam is calculated as follows:

Figure 83: Cross section of support beam structures

The cross section of the beam is considered as made of two rectangles, with sides a and b, b and c, as shown in figure 83. This convention can be used since the thickness of both components of the support beam is the same.

The area of each rectangle and its centroid distance from an arbitrarily selected reference plane (at the base, in this case) are then b A1 = bc at a distance of x1 = (a + 2 )

a and A2 = ab at a distance of x2 = 2

Consider the neutral axis to be at an undetermined distance xNA from the same

81 reference plane.

We have

AtotalxNA = A1x1 + A2x2

From this relation we can calculate, for the given dimensions of the support beam, that xNA = 35.08 mm.

The second moment of inertia (M.I.) of the combined support beam can be cal- culated as follows:

The M.I. of the two support beams, about their respective centroids are given by

cb3 I = 1 12 ba3 I = 2 12

The MI of the same beams, about the above calculated neutral axis can then be calculated as 2 I1−NA = I1 + A1(x1 − xNA) 2 I2−NA = I2 + A2(xNA − x2) The total MI of the combined beam about its neutral axis is then given by

INA = I1−NA + I2−NA

The maximum stress experienced by the support beam as a result of this bending moment will be observed at the cross-sectional element when y is maximum, that is, the element farthest from the neutral axis of the combined beam.

Thus, ymax = xNA 6 2 and we have σz(max) = 1.65 × 10 N/m

An additional moment of imbalance can be added along the Z axis to the same support beams, when the rider would be leaning off balance to his side. The stress due to this moment can be calculated in exactly the same manner as shown above. The neutral axis for this direction is clear, since it must lie on the axis of symmetry of the combined cross section. Another point of interest is that the maximum stress due to imbalance along the Z axis will not be in the same region of the cross section as that of the other two moments, and different regions will have to be evaluated, to check for the highest stress area. This can be accomplished simply by substi- tuting the appropriate values of y while computing the various elemental stresses. The total maximum stress as a result of both the normal compressive load and the inertial bending stress can be calculated by adding the two, assuming both are in a

82 compressive sense simultaneously.

6 2 Therefore, total compressive stress σc = 2.02 × 10 N/m

When the maximum bending moment is in tension, the two values will be subtracted, and the maximum stress on the support beam will be in tension, with a magnitude lower than the one calculated above. The maximum stress in the support beam, combining the normal stress, inertial bending stress, and overhang bending stress in two directions, is observed to be 2.57×106N/m2 at the base of the T cross section.

The guide beam stresses due to inertial bending forces, normal compressive forces, and imbalance forces can be calculated in exactly the same way. The orientation of axes will merely be inversed. That is to say, the neutral axis for the inertial bending stresses will be the axis of symmetry, while that for the lateral imbalance force will have to be calculated.

All components in the design were manufactured from Aluminium sheets. The reasons for this material selection for the primary prototype were low cost, easy availability and low manufacturing time. According to the stress analysis calcula- tions the mechanical structure was proven safe according to the limiting permissible stress values for commercial aluminium.

Bearing Support Stresses: The vertical bearing support (Part 13: parts list available in appendix B table 9) can be seen to take on itself the entire normal downward force of the rider, through the vertical ball screw. The stress acting on this element can be calculated considering it to be under the influence of three point loads, namely the load from the rider in its midpoint, and the two balancing reactions at the ends. It is important to note that this element (as well as the guide and support beams mentioned before) are also acted on by a shear force due to these loads. However, the resultant shear stresses can be neglected since they are of a much smaller magnitude than the bending mo- ments experienced.

The maximum moment acting on the bearing support can be calculated as: F M = z d max 2 Here d = distance from centre of bearing support to one end

Similar to the resultant stresses calculated above, the stress due to this moment is given by equation A.

Here y = Half the bearing support thickness

The maximum stress experienced by the bearing support as a result of this mo- ment is 1.12 × 107N/m2

83 The vertical nut plate stresses can be calculated in exactly the same way, with ac- commodation for its different dimensions.

Ball Screw selection parameters: The ball screws were selected based on their load bearing capacity, lead of thread, and rotational speed required. The rotational speed and ball screw lead were se- lected so as to facilitate the maximum velocity of the motion, which was derived from the above described motion profiles. Thus, for a vertical motion represented by z = 75 × 10−3 sin(2π(2.4)t) the maximum velocity would be

− − vz = 75 × 10 3 × 4.8π cos(4.8πt)max = 75 × 10 3 × 4.8πm/sec

It was found that the allowable rotational speed for a screw of certain precision, di- ameter and lead was the limiting factor in screw selection. For this reason, as far as axial load bearing capacity was concerned, both ball screws were over dimensioned, due to speed requirements.

Linear guide rail selection parameters: Linear guide rails were used in the mechanical design in two places. Between the X-direction translation plate and the support of the machine, and between the ver- tical nut plate and the guide rails. Both screws were designed based on the normal and moment loads acting on them, calculated using the same assumptions as used above, during stress analysis. Double carriages on the X-translation plate rails were used for their load bearing capacity, as the bearings would support the entire inertial and gravitational compressive load of the rider, as well as for stability.

The selected ball screws, guide rails and other components are specified in appendix B. Data for the selected components can be found in [29], [30], [31] and [32].

84 B MECHANICAL STRUCTURE DETAILS

Part Specifications This section provides production drawings for the components of the mechanical structure manufactured in house, at KTH. It also provides a list of mechanical com- ponents ordered from external suppliers, in table 8. Drawings of ordered components have not been provided. Data for these components is available in the commercial reference sources.

Sr. Description Part Number Supplier Qtt No.

X-1 Vertical Ball Screw FSER2525C7-384-E2N-D2 Rollco AB 1 X-2 Vertical Ball Screw axial FK20 Rollco AB 1 thrust bearing X-3 Vertical Ball Screw radial FF20 Rollco AB 1 bearing X-4 Horizontal Ball Screw FSCR1610C7-290,5-E2N-D2 Rollco AB 1 X-5 Horizontal Ball Screw axial BK12 Rollco AB 1 thrust bearing X-6 Horizontal Ball Screw radial BF12 Rollco AB 1 bearing X-7 Vertical motion guide rails MR7MNSS1V0-250L Rollco AB 4 X-8 Horizontal motion guide MR12MNSS2V0P-450L Rollco AB 2 rails X-9 Bevel gear box MW-088-0001/53-000-1:1-2000-080 Mekanex 1 X-10 Vertical Screw to Bevel WKE/N-19-16H7-18H7 Mekanex 1 Gear Box, axial coupling X-11 Horizontal Screw to Hori- WKE/N-14-10H7-14H7 Mekanex 1 zontal motor, axial coupling

Table 8: Externally manufactured Parts list

All in house products were made from aluminium sheet metal. Wherever possible, all metal cutting has been done using a waterjet metal cutting setup. The parts have been numbered on the drawings. The description of each part corresponding to its part number can be found in table 9.

85 Part number Part description Quantity 1 Main base plate 1 2 Support plate with limit switches 1 3 Support plate without limit switches 1 4 Horizontal screw bearing support plate 1 5 Horizontal Motor base plate 1 6 Horizontal Motor mount plate 1 7 Horizontal Screw Nut plate 1 8 Horizontal guide rail support plate 1 9 Vertical motion base plate 1 10 Vertical guide beam with limit switches 1 11 Vertical guide beam without limit switches 1 12 Vertical guide beam section 2 2 13 Vertical ball screw bottom bearing support 1 14 Vertical ball screw top bearing support 1 15 Vertical Motor base plate 1 16 Vertical Motor mount plate 1 17 Vertical screw Nut plate 1 18 Saddle support beam section 1 2 19 Saddle support beam section 2 2 20 Saddle base plate 1 21 Vertical Guide Rail carriage mount 1 4 22 Vertical Guide Rail carriage mount 2 4

Table 9: In-house manufactured Parts list

86 Cost This section details the cost of the different mechanical components, as specified below in table 10.

Part Number (Internal) Unit Cost (SEK) Total (SEK)

X-1 2450 2450 X-2 1200 1200 X-3 380 380 X-4 1850 1850 X-5 910 910 X-6 320 320 X-7 725 2900 X-8 1480 2960 X-9 7750 7750 X-10 920 920 X-11 714 714 1-22 4000(app) 4000

Total Cost for Mechanical Hardware: 26354

Table 10: Mechanical hardware cost details

87 C DRIVE SYSTEM ELECTRICAL DRAWING

88 89 D DIVISION OF WORK

This article describes the division of work between the two students responsible for this thesis project, Virinchi Joglekar and Han Yuan.

Virinchi Joglekar was primarily responsible for the mechanical design, parts selection and fabrication. He was also responsible for the movement planning to generate the recreated and randomly varying horse trajectories.

Han Yuan was primarily responsible for the mathematical modelling of the sys- tem as well as controller design. He was also in charge of electronic system design and drive system commissioning..

Actuator selection was carried out jointly by both members of the team, as it was a joint mechanical and electronic design concern.Final system integration and testing were also jointly carried out.

Aside from these primary responsibilities, however, it must be noted that both mem- bers of the team were involved in the entire development process, and all work was carried out in co-ordination.

90 E OPERATING INSTRUCTIONS

This section provides instructions on how to operate the AHGS, using its current setup and configuration. It provides a step-by-step guide on the processes carried out to start and stop the machine, as well as some safety information.

1. Ensure that no rider/load is placed on the AHGS. 2. Turn on the PC. 3. Begin MATLAB/Simulink. 4. Begin dSPACE ControlDesk. 5. Open the Simulink model to be used for the real time application to be run on the AHGS. 6. Ensure that the Matlab root folder is specified as the folder where the vari- able description file (.sdf) for the ControlDesk project is saved, and build the Simulink model for a real time application (Ctrl + B) 7. Turn on the main hardware switch for the Siemens electronic hardware set, wait for the RDY signal to go green on the Control Unit. 8. Flip the first toggle switch (with black connecting wires) 9. Flip the second toggle switch (with black and red connecting wires) 10. Press the start button (marked ‘—’) on the operator control manual. You should now hear the motors powering up and see ‘RUN’ displayed on the operator screen. The vertical motor if not already at the bottom, will slide down. (IMPORTANT: One must not be seated on the AHGS during this procedure) 11. Open the ControlDesk Project which is to be run on the AHGS. 12. Select the option ‘Reload Variable Description’ from the Project menu. 13. Begin online calibration, and measurement through the control desk. 14. It is now safe to load the AHGS with a rider/weights. 15. Push start on the HMI, the AHGS begins its calibration cycle. 16. When the AHGS is at rest, the amplitude of the horizontal and vertical trajec- tories as well as the frequency can be selected through the control desk sliders, as a percentage of their full value. 17. Push ‘Start’ again to begin the trot gait. The speed and the range of movement of the AHGS can be varied during the trot cycle through the control desk, while it is being ridden.

91 18. Push ‘Stop’ to stop the gait and return to rest at the origin position. Please note that the start and stop operations of the trot gait may take several seconds to complete, depending on the speed at which the AHGS is being ridden.

19. At this point, riders may get off the machine, and another rider may mount if needed.

20. Push ‘Start’ again with a new rider.

21. Continue as needed.

22. When use has been finished, push the ‘Em stop’ button to shutdown the motors and apply mechanical brakes.

23. Go offline from the control desk.

24. Shut down the control desk.

25. Flip the toggle switches and the main switch on the electronics in the reverse order of the start up sequence.

26. Shutdown MATLAB/Simulink and the PC.

PLEASE NOTE:

ˆ It is important to ensure that the proper simulink model, MATLAB root path and control desk project are in use, before beginning using the AHGS.

ˆ If at any point during the operation, the machine needs to be stopped immedi- ately, the ‘Em stop’ button can be pressed to bring the AHGS to an immediate halt. This may result in an uncomfortably jarring stop for the rider, and should be used while riding only if necessary.

ˆ If any of the limit switches are crossed during operation, or if the limit switch wiring in disconnected, the emergency stop function will be automatically engaged, bringing the AHGS to a full stop.

92