implementing gyroscopic stabilization1201171/fulltext01.pdf · degree project in mechanical...

78
IN DEGREE PROJECT MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS , STOCKHOLM SWEDEN 2017 Implementing Gyroscopic Stabilization A study on performance and power consumption correlated to flywheel rotational speed SIMON FRÖLANDER ANDRÉ SÄLL KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF INDUSTRIAL ENGINEERING AND MANAGEMENT

Upload: others

Post on 22-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

IN DEGREE PROJECT MECHANICAL ENGINEERING,FIRST CYCLE, 15 CREDITS

, STOCKHOLM SWEDEN 2017

Implementing Gyroscopic StabilizationA study on performance and power consumption correlated to flywheel rotational speed

SIMON FRÖLANDER

ANDRÉ SÄLL

KTH ROYAL INSTITUTE OF TECHNOLOGYSCHOOL OF INDUSTRIAL ENGINEERING AND MANAGEMENT

Page 2: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 3: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Implementing Gyroscopic Stabilization

A study on performance and power consumption correlated to flywheel rotationalspeed

SIMON FROLANDER, ANDRE SALL

Bachelor’s Thesis at ITMSupervisor: Lars SvenssonExaminer: Nihad Subasic

TRITA: MMK 2017:29 MDAB 647

Page 4: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 5: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Abstract

In this study the stability as well as the power consumptionof an implemented gyroscopic stabilizer, when varying therotational speed of the flywheel, was investigated. A fullyfunctional demonstrator was constructed utilizing two DCmotors for driving the flywheel and rotating the gimbal,respectively. To control the stabilization an Arduino Unowith a PID-controller was used, measurements were madewith a second Arduino Uno. Three tests were conducted:no disturbances, a short impulse, and a constant force ap-plied to the demonstrator. The results showed that theperformance in all three tests increased with a higher rota-tional speed of the flywheel, and that the biggest source ofpower consumption was the flywheel DC motor.

Page 6: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

ReferatImplementering av gyroskopisk stabilisering

I den har studien undersoktes stabiliteten saval som ef-fektforbrukningen av en implementerad gyroskopisk stabi-lisator nar svanghjulets rotationshastighet varierades. Enfullt fungerande demonstrator konstruerades vilken anvandesig av tva likstromsmotorer for att driva svanghjulet re-spektive den kardanska upphangningen. For att reglera sta-biliseringen anvandes en Arduino Uno med en PID-regulator,matningar gjordes med en andra Arduino Uno. Tre testergenomfordes: inga storningar, en kort impuls, och en kon-stant kraft applicerad till demonstratorn. Resultaten vi-sade att prestandan i alla tre testerna forbattrades meden hogre rotationshastighet hos svanghjulet, och att denstorsta kallan till effektforbrukning var svanghjulslikstromsmotorn.

Page 7: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Acknowledgements

This project would have been impossible without the help of others. We wouldlike to start by thanking the other project groups which have been working byour sides with their respective projects, contributing with crucial information aswell as company during late working nights. We would also like to thank the everso supporting Arduino community for all the open source material available. Wewould like to thank the assistants who always were there when we needed advice,and especially Marcus and Fredrika. Thank you Staffan for your advice and helpwith the electronics, and thank you Thomas for helping us even after we screwedup your masterfully made parts. Constructing the demonstrator would have beenimpossible without you.

And last but not least, thank you Lars for being such an awesome supervisor. Thisproject would have been entirely different and not in the least as interesting andfun without your guiding hand.

Simon Frolander and Andre SallStockholm, June 2017

Page 8: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Theory 32.1 Gyroscopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Motor dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Equations of motion . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4 PID-controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Demonstrator 93.1 Mechanical design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3 Actuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.3.1 Flywheel DC motor . . . . . . . . . . . . . . . . . . . . . . . 123.3.2 Gimbal DC motor . . . . . . . . . . . . . . . . . . . . . . . . 123.3.3 Motor driver . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.4 Sensors and measurements . . . . . . . . . . . . . . . . . . . . . . . . 133.4.1 Potentiometer . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.4.2 Hall effect sensor . . . . . . . . . . . . . . . . . . . . . . . . . 133.4.3 Current sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 133.4.4 Voltage measurements . . . . . . . . . . . . . . . . . . . . . . 14

3.5 Low pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.6 Control system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.7 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.8 Test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4 Results 174.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.2 Power consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5 Discussion & Conclusions 23

Page 9: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

5.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235.1.1 The results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235.1.2 Challenges and considerations . . . . . . . . . . . . . . . . . . 24

5.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Bibliography 27

Appendices 28

A Arduino Uno schematics 29

B Maxon DC motor 31

C Matlab code 33

D Circuit layout 45

E Arduino code 47

F Test results 53

Page 10: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

List of Figures

2.1 Gyroscope with 3 gimbals, image from [4] . . . . . . . . . . . . . . . . . 32.2 Different types of gyrostabilizers, image from [5] . . . . . . . . . . . . . 42.3 Relation between input-output torque, modeled in Solid Edge ST8 and

rendered in KeyShot 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Motion of the body, drawn in PowerPoint 2016 . . . . . . . . . . . . . . 62.5 PID-control loop, drawn on www.draw.io . . . . . . . . . . . . . . . . . . 7

3.1 The demonstrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 The gyroscope mounted in the demonstrator . . . . . . . . . . . . . . . 103.3 Flywheel, modeled in Solid Edge ST7 . . . . . . . . . . . . . . . . . . . 103.4 The test mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.5 The Arduino Motor Shield, image from [8] . . . . . . . . . . . . . . . . . 123.6 The SparkFun Low Current Sensor Breakout, image from [10] . . . . . . 133.7 A voltage divider, image from [11] . . . . . . . . . . . . . . . . . . . . . 14

4.1 Test with no disturbances applied, plotted in matlab 2016a . . . . . . 174.2 Test with a short impulse disturbance applied, plotted in matlab 2016a 184.3 Test with constant force disturbances applied, plotted in matlab 2016a 194.4 Gimbal motor power for test with no disturbances applied, plotted in

matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.5 Gimbal motor power for test with a short impulse disturbance applied,

plotted in matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . 204.6 Gimbal motor power for test with constant force disturbances applied,

plotted in matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . 21

F.1 Test with no disturbances and short impulses applied, 3300 RPM, plottedin matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

F.2 Test with constant force disturbances applied, 3300 RPM, plotted inmatlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

F.3 Test with no disturbances and short impulses applied, 3900 RPM, plottedin matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

F.4 Test with constant force disturbances applied, 3900 RPM, plotted inmatlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Page 11: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

F.5 Test with no disturbances and short impulses applied, 4500 RPM, plottedin matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

F.6 Test with constant force disturbances applied, 4500 RPM, plotted inmatlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

F.7 Test with no disturbances and short impulses applied, 5100 RPM, plottedin matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

F.8 Test with constant force disturbances applied, 5100 RPM, plotted inmatlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

F.9 Test with no disturbances and short impulses applied, 5700 RPM, plottedin matlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

F.10 Test with constant force disturbances applied, 5700 RPM, plotted inmatlab 2016a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Page 12: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

List of Tables

3.1 PID-controller parameters for different rotational speeds . . . . . . . . . 16

4.1 Average time between constant force being applied and balancing failure 184.2 Flywheel DC motor power . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Page 13: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Acronyms

CMG Control moment gyroscope. 3

EMF Electromotive force. 6

IDE Integrated development environment. 24

PID Proportional–integral–derivative controller. 7

PWM Pulse-width modulation. 12

Page 14: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 15: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Chapter 1

Introduction

1.1 Background

In the development of modern transportation, space and low energy consumptionis key, especially in cramped cities. One possibility to improve both of these as-pects is to construct small, personal two-wheeled vehicles. These would be moreefficient than a conventional four-seated car in both size and power consumption.It is however desirable to make these easier and safer to drive than, for example,normal motorcycles. This could be achieved by using a balancing system utilizinga gyroscope, thus making the vehicle easier to maneuver.

Gyroscopic control is used in the International Space Station, see [1], and com-mercially available for boats as in [2]. Two-wheeled cars such as the C-1 from LitMotors, see [3], has been developed although a commercial breakthrough has yet tobe made.

1.2 Purpose

The purpose of this report is to investigate how the power consumption and stabilityof a balancing system being controlled by a gyro implementation correlate to scalingof the rotational speed of the flywheel, and in extension the angular momentum.The research question that will be investigated is:

How does the stability of the system and power consumption of thedemonstrator correlate to the rotational speed of the flywheel?

1

Page 16: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 1. INTRODUCTION

1.3 ScopeThe only power that was measured was the power fed to the two motors used forrotating the flywheel and turning the gyro to generate torque, respectively. Threecases was studied: no disturbances, short impulse disturbances, and constant forcedisturbances.

1.4 MethodA demonstrator was constructed in a way so that the rotational speed of the fly-wheel could be adjusted and controlled disturbances be applied. Two Arduino Unomicrocontrollers were used, one for controlling the balancing of the demonstrator,and one for gathering test data. To answer the research question of this study threetests were conducted, each of which was run with five different rotational speeds onthe flywheel. In the first test the demonstrator was run without disturbances. In thesecond test the demonstrator was subjected to short impulse disturbances. In thelast test a constant force disturbance was applied to the demonstrator. These testsshowed the performance during ideal circumstances, short and sudden disturbances,and prolonged disturbances until failure, respectively.

2

Page 17: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Chapter 2

Theory

This chapter will provide the reader with the necessary theory to understand thefollowing chapters. Most important is to explain the concept of a gyroscope andhow this can generate a stabilizing torque.

2.1 GyroscopesA gyroscope is a spinning flywheel where the spin axis can be changed since it ismounted in two or three gimbals. Figure 2.1 shows a gyroscope with three gim-bals. A property of a gyroscope is that when tilting or rotating the mounting, theorientation of the spin axis will remain the same due to conservation of angularmomentum.

Figure 2.1: Gyroscope with 3 gimbals, image from [4]

By adding constrains to the construction, either by locking an axis from rotationor by actively control the rotation of one or more axes with a motor, the conceptcan be used as a stabilizer. Figure 2.2 a, c and d shows three possible configura-tions that can be used as a gyrostabilizer, also known as CMG-units. Figure 2.2bdefines a gyroscope just as in Figure 2.1. The gyrostabilizer can be of the types

3

Page 18: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 2. THEORY

single or double gimbal and it can use active or passive actuation. In this work agyrostabilizer with single gimbal and active actuation as in Figure 2.2c will be used,this can generate larger stabilizing torque than double gimbal systems, the torque istransfered through the gimbal structures. In a double gimbal system the stabilizingtorque is transfered through the gimbal motor. This limits the stabilizing torque tothe maximum torque of the motor, as explained in [5].

Figure 2.2: Different types of gyrostabilizers, image from [5]

An illustration shown in Figure 2.3 demonstrates how the gyroscopic effect can beused as a stabilizer. In the figure the flywheel spins around the y-axis with angularvelocity ωspin and the flywheel gimbal can rotate around the z-axis, this motion iscalled precession. According to Newton’s second law the spinning wheel will createan angular momentum H given by

H = Jfωspin, (2.1)

where Jf is the moment of inertia in direction of the spin axis, given by

Jf =∫Qr2dm (2.2)

where Q is the entire mass Q and r is the distance from the point for which themoment of inertia is calculated. Applying a torque τcontrol on the z-axis will rotatethe flywheel around the precession axis with angular velocity ωprec. This rotationwill cause a gyroscopic torque τgyro orthogonal to both the angular momentum of

4

Page 19: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

2.2. MOTOR DYNAMICS

the flywheel and the applied control torque, Figure 2.3 shows the relation betweenthe control τcontrol and the gyroscopic τgyro torque. The gyroscopic torque is givenby the cross product

~τgyro = ~ωprec × ~H. (2.3)

ωprec can be written as d θprec

d t where θprec is the precession angle. Using this togetherwith (2.1) the stabilizing torque in (2.3) can be expressed in the x-direction as

~ex : τgyro = Jfωspind θprecd t

cos θprec. (2.4)

Equation (2.4) shows that when θprec is ±90° the gyro torque with respect to thex-axis is zero. Hence a balancing torque can only be generated when rotating theflywheel within this precession boundaries.

Figure 2.3: Relation between input-output torque, modeled in Solid Edge ST8 andrendered in KeyShot 5

When designing a gyrostabilizer the most important parameters to generate a largerstabilizing torque are:

• Moment of inertia of the flywheel Jf

• Angular velocity of the flywheel ωspin

• Precession rate ωprec

2.2 Motor dynamicsAs described in [6], the characteristics of a DC motor can be modeled by

UA = RAIA + E (2.5)

5

Page 20: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 2. THEORY

where UA,RA and IA is the armature voltage, the resistance in the rotor, and thecurrent flowing through respectively. E is the EMF given by

E = K2Φω (2.6)

where K2Φ is a constant depending on motor characteristics and ω is the angularvelocity of the motor. Combining equation (2.5) and (2.6) the angular velocity ofthe motor can be expressed as

ω = IA −RAIAK2Φ . (2.7)

which will be used to determine the equations of motion.

2.3 Equations of motion

If the construction in Figure 2.3 is seen from the side it can be simplified as inFigure 2.4 and the motion of the body can be described by

H = τtot (2.8)

where H is the total angular momentum of the body and τtot is the sum of thetorque from gravitation and the stabilizing torque given by (2.4). The equation ofmotion is given by

Jbϕ = mgl sinϕ+ Jfωspinθ cos θ. (2.9)

where Jb is the body’s moment of inertia, l is the length from the tilt axis to thebody’s center of mass, m is the mass, g is the gravitational acceleration and ϕ isthe tilt angle.

Figure 2.4: Motion of the body, drawn in PowerPoint 2016

6

Page 21: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

2.4. PID-CONTROLLER

Introducing the motor dynamics θ can be substituted with ω from (2.7) since theangular velocity of the motor must be same as the precession rate. Using this theequation of motion (2.9) can be written as

Jbϕ = mgl sinϕ+ JfωspinUA −RAIA

K2Φ cos θ. (2.10)

2.4 PID-controllerAccording to [7], a PID-controller is a feedback mechanism that gives an controlsignal u(t) based on the error e(t) = r(t) − y(t) between a desired setpoint r(t) andthe real measured value y(t) according to

u(t) = KP e(t) +KI

∫ t

0e(τ) dτ +KD

d

dte(t). (2.11)

The calculated control signal u(t) is the output from the controller, which is usedas input to the system. Output from the system is continuously measured andreturned to the controller, which updates the control signal u(t) too minimize theerror e(t) = r(t) − y(t). This feedback control loop is described in Figure 2.5. ThePID-controller consists of three parts, proportional, integral and derivative whichare represented by the parameters KP , KI and KD respectively. Those parametershas to be tuned to get the desired behavior of the system. The most importanteffects of varying the different parameters are:

• KP-proportional gain: Larger proportional gain gives larger change in out-put for a given error. Operates with a steady-state error and can cause insta-bility if too high.

• KI-integral gain: Eliminates the steady-state error and gives larger outputdepending on both the magnitude of the error and the duration. Can causethe real value y(t) to overshoot the setpoint.

• KD-derivative gain: Gives better stability but increases the impact of mea-surement noise.

Figure 2.5: PID-control loop, drawn on www.draw.io

7

Page 22: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 23: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Chapter 3

Demonstrator

Figure 3.1: The demonstrator

In this chapter the design of the demonstrator will be explained. This will includeelectronics and software. The demonstrator mounted in the test mount is seen inFigure 3.1.

3.1 Mechanical designThe main feature of the demonstrator was the box containing the gyroscope. Thegyroscope was mounted in a position as showed in Figure 3.2 in order to put the leaststress on the axle’s bearings, which were of the groove ball bearing type. A +/-90°rotaion limit was built in order to prevent the wires connected to the gimbal beingtorn off. This does not affect the balancing in a negative way since the effective

9

Page 24: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 3. DEMONSTRATOR

Figure 3.2: The gyroscope mounted in the demonstrator

range is +/-90° anyway, as described in Chapter 2.1. The flywheel was powered bya DC motor which gave it an almost constant speed and power consumption whenfed with constant voltage. The torque was transfered from the motor to the axlewith a V-belt going around two wheels, one on the motor shaft and one on the axle.The ratio between the wheel on the motor and the wheel on the axle was about 1

1.To turn the flywheel another DC-motor was used, which was connected directly onthe gimbal’s axle.

Figure 3.3: Flywheel, modeled in Solid Edge ST7

10

Page 25: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

3.2. ARDUINO UNO

The flywheels were designed to give large moment of inertia relatively to their sizeand weight. The design as showed in Figure 3.3 placed the majority of the weightof the flywheel at the edge, which is preferable according to equation 2.2. Eachflywheel weighed about 150g and were mounted together for a total flywheel weightof 750g.

Figure 3.4: The test mount

In order to test the characteristics of the balancing system the box was placed in atest mount, shown in Figure 3.4. This allowed the tests to be conducted consistentlyas well as avoiding damage to the demonstrator since it could only be turned to alimited angle, thus avoiding unnecessary stress on the construction. The resistanceupon turning the box was very little and assumed to be negligible.

3.2 Arduino UnoTwo Arduino Uno microcontrollers was used for all computations, measurements viasensors and data exports regarding the demonstrator’s control system and powerconsumption. Schematics is available in Appendix A. All code for the ArduinoUno units was written in the Arduino IDE. All Arduino software and hardware isopen source which greatly simplified the developing process, since example scriptswere readily available. The original plan was to use a single Arduino Uno for allprocesses. This proved to be unsuccessful; the time delay caused by printing datato the serial monitor from the Arduino was too large, slowing the program down tothe point of rendering the control system useless. This resulted in the use of twoArduinos, one controlling the balancing of the demonstrator and another for takingmeasurements and printing data to the serial monitor so it could be saved.

3.3 ActuatorsAs previously mentioned two actuators were utilized in the demonstrator. One DCmotor was used to spin the flywheel, and a second DC motor was used to rotate

11

Page 26: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 3. DEMONSTRATOR

the gimbal perpendicular to the flywheel’s spin axis, thereby generating torque asexplained in the Theory chapter.

3.3.1 Flywheel DC motor

The DC motor to drive the flywheel was a Maxon 148877 DC motor. Its nominalvoltage and current was noted as 48 V and 3.17 A, respectively. A datasheet isavailable in Appendix B. The motor was connected directly to a variable voltagesupply. Since the voltage fed to the motor was constant once the flywheel hadbeen fully accelerated, and the only variations to the motor torque was due to thegimbal motor’s corrections, the variations were deemed negligible and the powersupplied to this motor assumed to be constant. This power was thereby measuredby reading the power supply’s voltage and current output and calculating the poweras P = UI.

3.3.2 Gimbal DC motor

This motor had a gearbox connected to it which gave it sufficient torque to turn thegimbal. It was supplied with 12 V with a 1.5A limit to avoid damage. No datasheetwas found for this motor.

3.3.3 Motor driver

Figure 3.5: The Arduino Motor Shield, image from [8]

To control the gimbal DC motor an Arduino Motor Shield, as seen in Figure 3.5, wasused. The Motor Shield is an add on to the Arduino Uno which makes it possibleto control both direction and speed of the motor. The Motor Shield has two PWM-outputs capable of an output of 12V, one of which was used to drive the motor andthe other to measure the voltage fed to the motor. The voltage measurements willbe further described in 3.4.4.

12

Page 27: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

3.4. SENSORS AND MEASUREMENTS

3.4 Sensors and measurementsInformation from sensors are needed to implement the control system as well asmeasuring the power used by the motors. To extract the test data for analysis themeasurement values were printed on the serial monitor. The values could then becopied into an Excel file and from there be imported to matlab. The matlabprogram which was used for creating the data plots in this paper is available inAppendix C.

3.4.1 PotentiometerA potentiometer was chosen to determine the box’s position relatively to a manuallyset setpoint. By turning the potentiometer shaft a variable voltage can be read bythe Arduino Uno. The Arduino IDE command analogRead() converts the analogvoltage read to a number, 0 for 0V read and 1023 for 5V.

The potentiometer shaft was connected to the demonstrator’s turning axle. A set-point used for the control system was found by manually estimating the balancingpoint of the demonstrator, reading the value from analogRead() at that point andsetting that value as the setpoint.

3.4.2 Hall effect sensorTo measure the rotational speed of the flywheel a Hall effect sensor was used. Asexplained in [9], a Hall effect sensor generates a measurable voltage when subjectedto a magnetic field. A small magnet was placed on the flywheel axle so that everyfull rotation of the flywheel was registered as the magnet passed by the Hall effectsensor.

3.4.3 Current sensor

Figure 3.6: The SparkFun Low Current Sensor Breakout, image from [10]

To measure the current fed to the gimbal DC motor the SparkFun Low CurrentSensor Breakout - ACS712, seen in Figure 3.6, was used. It outputs a voltageproportional to the current, and the sensitivity can be adjusted by the built in gainpotentiometer. According to [10] it measures DC and AC currents up to 5A.

13

Page 28: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 3. DEMONSTRATOR

3.4.4 Voltage measurements

Figure 3.7: A voltage divider, image from [11]

To measure the voltage fed to the gimbal DC motor a voltage divider was imple-mented in order to scale down the input voltage to the Arduino analog pin, sincethe range of the voltage sensor in the Arduino is 5V and the maximum voltage fedto the motor was 12 V. The voltage across the R2 resistor in Figure 3.7 can becalculated:

Uinput = (R1 +R2)I (3.1)

Udivided = R2I (3.2)

I = UinputR1 +R2

= UdividedR2

(3.3)

Udivided = R2R1 +R2

Uinput (3.4)

Since the Arduino Uno analog pins can only handle 0-5V, i.e. not negative voltage,the voltage divider could not be put in parallel with the gimbal DC motor, sincethe direction of the current changes during operation. This was solved by using thesecond set of output pins of the Arduino Motor Shield. The second set of outputpins of the Arduino Motor Shield was programmed to output the same magnitudeof voltage as the set used to feed the gimbal motor, but always positive. The voltagedivider was then put in series with that pin set.

The resistors in the implementation was set to R1 = 154kΩ and R2 = 110kΩ,resulting in a reduction of Udivided = 5

12Uinput. The magnitude of resistance waschosen to be large in order to prevent damage to the resistors and Arduino Unofrom large currents.

14

Page 29: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

3.5. LOW PASS FILTER

3.5 Low pass filterSince the analogRead() command gives discrete values, which are updated every it-eration of the program loop, the calculated derivative of the input can obtain valueswhich are unrealistically large. If left unfiltered, this defect of the input signal willrender the D-part of the PID-controller useless. In order to solve this problem, adigital one pole filter was used to filter the input signal from the potentiometer. Asdescribed in [12], a low pass filter is a filter with the purpose of stopping frequencycomponents of a signal above a limit frequency, while letting lower frequency com-ponents of the signal pass. The filter used was from the open source library Filters,available on [13].

3.6 Control systemThe control algorithm used for the demonstrator was a PID-controller. The inputsignal for this controller was the potentiometer value and the control signal con-trolled the voltage fed to the gimbal DC motor. The parameters were set manuallyby the following method:

1. Set KP to the highest possible value without the system becoming unstable.

2. Set KI to the highest possible value without the system becoming unstable.

3. Set KD to the highest possible value without the system becoming unstable.

4. If necessary, decrease one parameter while increasing another to slightly changethe characteristics of the control system, e.g. decreasing KI while increasingKD to get stronger damping.

Steps one to three were often enough to get satisfactory results.

3.7 Power suppliesTo power the two DC motors one EX354RT Triple Power Supply was used. Thetwo Arduino Uno microcontrollers was supplied power via the PC’s USB ports.

3.8 Test setupTo answer the research question of this project three tests was developed, each ofwhich was run with the flywheel having different rotational speeds.

• In the first test the demonstrator was run without disturbances.

• In the second test the demonstrator was subjected to short impulse distur-bances. A bottle was filled with water giving it the weight of 300g and hung

15

Page 30: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 3. DEMONSTRATOR

up in a string like a pendulum. The demonstrator was placed right next to thebottle and the bottle was lifted to 90° and then released, causing it to swinginto the demonstrator’s side, making contact for an instance. The bottle wascaught during the rebound to prevent a longer disturbance.

• During the third test the bottle was placed on top of the demonstrator besidethe center of gravity to induce a constant force disturbance.

The highest rotational speed tested was set to the highest speed obtainable by thedemonstrator and the lowest rotational speed was set to the lowest speed for whichthe demonstrator could function. Table 3.1 shows the PID-parameters used for eachrotational speed. The circuit layout and the Arduino code used during the testingis showed in Appendix D and E, respectively.

Table 3.1: PID-controller parameters for different rotational speedsSpeed [RPM] KP KI KD

3300 7.0 3.0 0.03900 12.0 3.0 0.04500 17.0 3.0 0.15100 19.0 3.0 0.55700 21.0 5.0 1.0

16

Page 31: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Chapter 4

Results

This chapter contains the results of the tests described in the previous chapter.First with regard to performance and thereafter with regard to energy consumption.All the graphs shown in this chapter are parts of the full data samples shown inAppendix F and were created using the matlab program in Appendix C.

4.1 Performance

5 6 7 8 9 10 11 12

Time [s]

535

540

545

550

555

560

Pote

ntiom

ete

r valu

e

No disturbances

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.1: Test with no disturbances applied, plotted in matlab 2016a

Figure 4.1 show a snippet of time where the demonstrator balances without being

17

Page 32: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 4. RESULTS

subjected to disturbances. The steady state error and stability improvements ofincreasing rotational speed are apparent.

0.5 1 1.5 2 2.5 3

Time [s]

480

500

520

540

560

580

Pote

ntiom

ete

r valu

e

Impulse

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.2: Test with a short impulse disturbance applied, plotted in matlab 2016a

Figure 4.2 and 4.3 show the demonstrators response of being subjected to a shortimpulse and a constant force disturbance, respectively. The improvements of sta-bility as well as time before failure are apparent. Table 4.1 shows the averagetime between constant force being applied and balancing failure for each rotationalspeed. The average times were calculated from the plots in Appendix F. In Table4.1 balancing failure is defined as the time when the potentiometer value falls below490.

Table 4.1: Average time between constant force being applied and balancing failure

Speed [RPM] Average time [s]3300 0.993900 2.024500 2.745100 3.005700 3.54

18

Page 33: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

4.2. POWER CONSUMPTION

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Time [s]

420

440

460

480

500

520

540

560P

ote

ntiom

ete

r valu

eConstant force

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.3: Test with constant force disturbances applied, plotted in matlab 2016a

4.2 Power consumptionThe power consumption for the whole system consists of two parts, power to thegimbal motor and the motor that drives the flywheel. Power from the gimbal motorare shown in Figure 4.4, 4.5 and 4.6 respectively. Power consumption from theflywheel motor are treated as constant as explained in Chapter 3.3.1. Power usedby the flywheel motor for each test can be seen in Table 4.2.

Table 4.2: Flywheel DC motor power

Speed [RPM] Voltage [V] Current [A] Power [W]3300 20.4 0.45 9,183900 23.6 0.60 14.164500 27.4 0.70 19.185100 31.1 0.85 26.445700 35.2 1.00 35.2

19

Page 34: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 4. RESULTS

5 6 7 8 9 10 11 12

Time [s]

0

0.5

1

1.5

2

2.5

3

3.5P

ow

er

[W]

Power - No disturbances

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.4: Gimbal motor power for test with no disturbances applied, plotted inmatlab 2016a

0.5 1 1.5 2 2.5 3

Time [s]

0

2

4

6

8

10

12

Pow

er

[W]

Power - Impulse

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.5: Gimbal motor power for test with a short impulse disturbance applied,plotted in matlab 2016a

20

Page 35: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

4.2. POWER CONSUMPTION

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Time [s]

0

2

4

6

8

10

12

14

16

18

Pow

er

[W]

Power - Constant force

3300 RPM

3900 RPM

4500 RPM

5100 RPM

5700 RPM

Figure 4.6: Gimbal motor power for test with constant force disturbances applied,plotted in matlab 2016a

21

Page 36: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 37: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Chapter 5

Discussion & Conclusions

5.1 Discussion

5.1.1 The results

The results show that increasing the rotational speed, as could be expected,improves performance. This holds true for all three tests conducted. For thetest where no disturbances were applied the improvements are most dramatic forthe first increase in rotational speed, while increasing to 5700rpm from 5100 rpmonly marginally decreases the balancing error. This could be explained by theproportional part of the PID-controller and the gimbal DC motor being unable toturn the gimbal for voltages below a certain value due to friction. A higher KP

value translates to a stronger reaction to offset from the setpoint, i.e. a highervoltage output to the gimbal DC motor in this case, and since a higher valuefor KP could be achieved without the system becoming unstable with higherrotational speeds, the voltage output rose above the friction threshold much fasterin those cases than the lower rotational speed cases, leading to a faster response.A different control system which takes the friction into consideration might be ableto reduce the differences in performance during these tests. Another explanationmight be the fact that as the angular momentum of the flywheel increases withhigher rotational speeds, the inherent tendency to keep the current position, asfound in gyroscopes even without control systems, increase.

When it comes to the test where a short impulse disturbance was applied the biggestdifference is also seen between the 3300rpm and 3900rpm cases. Considering thebig offset errors even without disturbances in the 3300rpm case this is unsurprising.In the higher rotational speed cases the performance improvements regarding risetime, overshoot and settling time could be said to be roughly proportional to theincreased rotational speed. There is however quite a performance jump between5100rpm and 5700rpm where the settling time improves a lot.

23

Page 38: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

CHAPTER 5. DISCUSSION & CONCLUSIONS

One of the biggest reasons why a higher rotational speed, which is synonymousto a increased angular momentum of the flywheel, is desirable when implementinggyro stabilization is the performance increase with regard to longer disturbances inthe same direction. This performance increase is highly noticeable when looking atthe results from the test with a constant force disturbance.

Considering the differences between power consumption for the different rotationalspeeds the results implies that the power consumption contribution from thegimbal DC motor is relatively small compared to the contribution from the flywheelmotor in all cases. This power consumption difference between the two motorsincreases with the rotational speed. The gimbal DC motor power consumptionwas however not negligible; even at 5700rpm it made up for about 20% of thetotal power consumption in the worst case for the short impulse disturbance tests.It is although worth noting that depending on the application for a gyro basedbalancing system the power consumption by the actuator controlling the gimbalmight never rise to such large numbers, and even if that is the case the powerspikes might not last very long. Thus the power consumption contribution fromthe flywheel motor should be the most important aspect when optimizing powerconsumption in an application.

5.1.2 Challenges and considerations

In this study some challenges had to be overcome when implementing the gyrostabilization which might be worth noting for future similar projects. Regardingimplementing the control system the most important aspect was filtering the inputsignal before sending to the controller. In this case this was needed due to thediscrete outputs from the potentiometer, but projects utilizing a different kindof sensor will probably need to use some kind of signal processing as well. Agood example would be if an inertial measuring unit (IMU) was used instead ofa potentiometer; an IMU was originally tested in place of the potentiometer forthis study, but discarded in favor of the potentiometer which function is simpler.In that case the small irregularities and asymmetries in the flywheel and flywheelaxle caused vibrations during functioning which the IMU detected and added agreat amount of noise to the signal. A low pass filter similar to the one used in thisproject should be able to solve that problem.

Another challenge arose when the code for measurements was to be implemented.Printing data to the serial monitor is really slow in the Arduino software, and alsowhen saving to a SD card or similar due to the same command being used in bothcases. This lead to the usage of two Arduino Uno units, since the measurementscript slowed down the control system code to such a degree that it was rendereduseless. This problem is somewhat specific to the Arduino IDE, and the problemwas mentioned in Chapter A, but the importance of having this in mind when

24

Page 39: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

5.2. CONCLUSIONS

working with the Arduino IDE and the common usage of Arduino microcontrollersmakes this worth noting again.

A property of the demonstrator worth noting is that when the gimbal DC motor isnot in active use, the gimbal can rotate freely within the built in +/- 90° limitation.An upside of this design derived aspect is that some of the inherent properties ofa gyroscope is preserved, which might make the demonstrator slightly less suscep-tible to disturbances. This property might however also affect the control systemimplementation in a negative way if one would want to optimize the control system,since complete control of the gimbal movement is not achieved.

5.2 ConclusionsA higher rotational speed on the flywheel was proven to increase performance in allthree tests that were conducted. The performance came however with the cost ofhigher power consumed by the flywheel DC motor, which in all cases were the biggestsource of power consumption. Thus the most important aspects, while developing agyro based stabilization or balancing implementation where low power consumptionand high performance is of importance, is maximizing the flywheel power trainefficiency and the flywheel’s rotational speed. Depending on application there mightalso be a possibility that settling for less than the highest attainable rotational speedgives sufficient performance while also decreasing power consumption.

25

Page 40: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 41: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Bibliography

[1] NASA. “NASA - International Space Station Zero-Propellant Maneuver(ZPM) Demonstration”. In: (2016). url: https://www.nasa.gov/mission_pages/station/research/experiments/274.html (visited on 06/11/2017).

[2] Seakeeper. “Eliminate boat roll”. In: (). url: https://www.seakeeper.com/(visited on 06/11/2017).

[3] Lit Motors. “C-1 - Lit Motors”. In: (2013). url: http://litmotors.com/c1/(visited on 06/11/2017).

[4] Maritime Park Association. “Principles of Guided Missiles and NuclearWeapons”. In: (2013). url: https://maritime.org/doc/missile/part1.htm (visited on 06/11/2017).

[5] Nicholas C. Townsend et al. “Gyrostabilizer Vehicular Technology”. In:Applied Mechanics Reviews 64.1 (2011), p. 010801. issn: 0003-6900. doi:10 . 1115 / 1 . 4004837. url: http : / / appliedmechanicsreviews .asmedigitalcollection.asme.org.focus.lib.kth.se/data/journals/amread/25940/010801_1.pdf (visited on 06/11/2017).

[6] Hans Johansson. Elektroteknik. 2013th ed. Stockholm: KTH, Institutionen forMaskinkonstruktion, Mekatronik, 2006.

[7] Torkel Glad and Lennart Ljung. Reglerteknik - Grundlaggande teori. 4:13.Lund: Studentlitteratur AB, 2006.

[8] Arduino. “Arduino Motor Shield”. In: (). url: https://www.arduino.cc/en/Main/ArduinoMotorShieldR3 (visited on 06/11/2017).

[9] Edward Ramsden. Hall-Effect Sensors: Theory and Application. 2006.[10] SparkFun. “ACS712 Low Current Sensor Hookup Guide -

learn.sparkfun.com”. In: (). url: https : / / learn . sparkfun . com /tutorials / acs712 - low - current - sensor - hookup - guide ? _ga = 2 .195027053.1560214655.1495362211-1647181921.1495362211#hardware-overview (visited on 06/11/2017).

[11] Tony R. Kuphaldt. “Lessons In Electric Circuits – Volume I (DC) - Chapter6”. In: (). url: http://www.ibiblio.org/kuphaldt/electricCircuits/DC/DC_6.html (visited on 06/11/2017).

27

Page 42: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

BIBLIOGRAPHY

[12] Hans Boden, Kjell Ahlin, and Ulf Carlsson. Applied Signal Analysis. Stock-holm: KTH Aeronautical and Vehicle Engineering, 2014.

[13] Arduino. “A realtime digital signal processing (DSP) library for Arduino.”In: (). url: https://playground.arduino.cc/Code/Filters (visited on06/11/2017).

28

Page 43: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix A

Arduino Uno schematics

29

Page 44: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

(ADC5)PC

528

(ADC4)PC

427

(ADC3)PC

326

(ADC2)PC

225

(ADC1)PC

124

(ADC0)PC

0)23

(SCK)PB5

19

(MISO

)PB418

(MOSI)PB3

17

(SS)PB216

(OC1)PB1

15

(ICP)PB0

14

(AIN1)PD

713

(AIN0)PD

612

(T1)PD5

11

(T0)PD4

6

(INT1)PD

35

(INT0)PD

24

(TXD)PD

13

(RXD

)PD0

2

GND

8VC

C7

AVCC

20AR

EF21

XTAL19

XTAL210

RESET

1

AGND

22

12

34

56

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 101 2 3 4 5 6

11

22

33

1234

P$1P$1 P$2P$2

1

IN3

OUT

42

(AIN0/IN

T1)PD1

7

(AIN2/PC

INT11)PC

25

(CTS/H

WB/AIN

6/TO/IN

T7)PD7

13

(INT4/IC

P1/CLK0)PC

722

(INT5/AIN

3)PD4

10

(OC0B/IN

T0)PD0

6

(OC1A/PC

INT8)PC

623

(PCINT5)PB5

19(PC

INT6)PB6

20(PC

INT7/O

C0A/O

C1C

)PB721

(PCINT9/O

C1B)PC

525

(PCINT10)PC

426

(PD0/M

ISO/PC

INT3)PB3

17

(PDI/M

OSI/PC

INT2)PB2

16

(RTS/AIN

5/INT6)PD

612

(RXD

1/AIN1/IN

T2)PD2

8

(SCLK/PC

INT1)PB1

15

(SS/PCINT0)PB0

14

(T1/PCINT4)PB4

18

(TXD1/IN

T3)PD3

9

(XCK/AIN

4/PCINT12)PD

511

AVCC

32

D+

29D-

30

GND

3

PAD33

RESET(PC

1/DW)

24

UCAP

27

UGND

28

UVC

C31

VCC

4

XTAL11

XTAL2(PC0)

2

12

34

56

21

21

1 8

27

36

45

1 827

36

4 5

18

27

36

45

18

27

36

45

1 23 4

2 31

6 57

84

12

34

5

IN1

ON/OFF

3

NC/FB

4

OUT

5

GND

212345678

2 1

Page 45: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix B

Maxon DC motor

31

Page 46: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

186

max

on

DC

mo

tor

M 1:2

148866 148867 148877 218008 218009 218010 218011 218012 218013 218014

4.7 K/W 1.9 K/W 41.5 s 809 s -30…+100°C +155°C

0.05 - 0.15 mm 0.025 mm 5.6 N 110 N

1200 N 28 N

1 13 480 g

ESCON Mod. 50/5 417ESCON 50/5 418ESCON 70/10 418EPOS2 24/5 425EPOS2 50/5 425EPOS2 70/10 425EPOS2 P 24/5 428EPOS4 Module 50/8 431EPOS4 Comp. 50/8 CAN 431MAXPOS 50/5 435

12 24 48 48 48 48 48 48 48 486920 7580 7590 6420 5560 3330 2690 2130 1720 1420241 137 68.6 53.7 43.7 21.9 16.6 12.5 9.66 7.76

6380 6940 7000 5810 4930 2710 2060 1510 1080 78194.9 177 187 186 180 189 190 192 192 190

6 6 3.17 2.66 2.23 1.4 1.13 0.909 0.73 0.61720 2420 2560 2040 1620 1020 814 655 523 424105 80.2 42.4 28.6 19.7 7.43 4.79 3.06 1.97 1.3288 91 92 91 91 89 89 88 86 85

0.115 0.299 1.13 1.68 2.44 6.46 10 15.7 24.4 36.30.024 0.082 0.33 0.46 0.613 1.7 2.62 4.14 6.41 9.3216.4 30.2 60.3 71.3 82.2 137 170 214 266 321581 317 158 134 116 69.7 56.2 44.7 35.9 29.84.05 3.14 2.97 3.16 3.45 3.29 3.31 3.27 3.29 3.375.89 4.67 4.28 4.2 4.19 4.16 4.15 4.15 4.15 4.16139 142 137 127 116 121 120 121 120 118

Stock programStandard programSpecial program (on request)

Specifications Operating Range Comments

n [rpm] Continuous operationIn observation of above listed thermal resistance (lines 17 and 18) the maximum permissible winding temperature will be reached during continuous op-eration at 25°C ambient.= Thermal limit.

Short term operationThe motor may be briefly overloaded (recurring).

Assigned power rating

maxon Modular System Overview on page 20–27

Part Numbers

maxon DC motor April 2016 edition / subject to change

RE 40 ∅40 mm, Graphite Brushes, 150 Watt

Values at nominal voltage1 Nominal voltage V2 No load speed rpm3 No load current mA4 Nominal speed rpm5 Nominal torque (max. continuous torque) mNm6 Nominal current (max. continuous current) A7 Stall torque mNm8 Stall current A9 Max. efficiency %

Characteristics10 Terminal resistance W11 Terminal inductance mH12 Torque constant mNm/A13 Speed constant rpm/V14 Speed / torque gradient rpm/mNm15 Mechanical time constant ms16 Rotor inertia gcm2

Motor Data

Thermal data17 Thermal resistance housing-ambient 18 Thermal resistance winding-housing 19 Thermal time constant winding 20 Thermal time constant motor 21 Ambient temperature 22 Max. winding temperature

Mechanical data (ball bearings)23 Max. speed 12 000 rpm24 Axial play 25 Radial play 26 Max. axial load (dynamic) 27 Max. force for press fits (static)

(static, shaft supported) 28 Max. radial load, 5 mm from flange

Other specifications29 Number of pole pairs 30 Number of commutator segments 31 Weight of motor

Values listed in the table are nominal. Explanation of the figures on page 151.

Option Preloaded ball bearings

* Industrial version with radial shaft seal ring (resulting in increased no load current).

IP54 protection only if mounted on brush side, in compliance with maxon modular system.

Planetary Gearhead∅42 mm3 - 15 NmPage 349

Recommended Electronics:Notes Page 24

Planetary Gearhead∅52 mm4 - 30 NmPage 354

Brake AB 2824 VDC0.4 NmPage 446

Encoder MR256 - 1024 CPT, 3 channelsPage 393Encoder HED_ 5540500 CPT, 3 channelsPage 399/402

Industrial Version IP54*Encoder HEDL 9140Page 405Brake AB 28Page 447End capPage 451

1606_DC_motor.indd 186 14.04.16 13:07

Page 47: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix C

Matlab code

1 %Implementing gyro s cop i c s t a b i l i z a t i o n

3 Bachelor ’ s t h e s i s in mechatronics at KTH − ITMSimon Fro l ander & Andr e Sa l l

5 TRITA: MMK 2017:29 MDAB 647

7 Matlab code f o r data p r o c e s s i n gReads experiment data from e x c e l s h e e t s and gene ra t e s graphs showing

9 potent iometer va lue and power .Written in Matlab 2016a

11 %

13 %% Read data from Excel s h e e t sc l e a r a l l ; c l o s e a l l ; c l c

15Test 3300 1 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’ 3300−1 ’ ) ;

17 Test 3300 2 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’Ny−3300−2 ’ ) ;

19 Test 3900 1 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’ 3900−1 ’ ) ;Test 3900 2 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’Ny−3900−2 ’ ) ;

21Test 4500 1 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’ 4500−1 ’ ) ;

23 Test 4500 2 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’Ny−4500−2 ’ ) ;

25 Test 5100 1 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’ 5100−1 ’ ) ;Test 5100 2 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’Ny−5100−2 ’ ) ;

27Test 5700 1 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’ 5700−1 ’ ) ;

29 Test 5700 2 = x l s r ea d ( ’ Teste rTi l lMat lab ’ , ’Ny−5700−2 ’ ) ;

31 %% S p l i t matr i ce s i n to v e c t o r s

33 % 3300 RPM ImpulsCurrent 3300 1 = Test 3300 1 ( : , 1 ) ;

35 RPM 3300 1 = Test 3300 1 ( : , 2 ) ;Pot 3300 1 = Test 3300 1 ( : , 3 ) ;

37 Voltage 3300 1 = Test 3300 1 ( : , 4 ) ;

33

Page 48: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX C. MATLAB CODE

Time 3300 1= Test 3300 1 ( : , 5 ) ;39

% 3300 RPM Constant41 Current 3300 2 = Test 3300 2 ( : , 1 ) ;

RPM 3300 2 = Test 3300 2 ( : , 2 ) ;43 Pot 3300 2 = Test 3300 2 ( : , 3 ) ;

Vo l tage 3300 2 = Test 3300 2 ( : , 4 ) ;45 Time 3300 2= Test 3300 2 ( : , 5 ) ;

47 % 3900 RPM ImpulsCurrent 3900 1 = Test 3900 1 ( : , 1 ) ;

49 RPM 3900 1 = Test 3900 1 ( : , 2 ) ;Pot 3900 1 = Test 3900 1 ( : , 3 ) ;

51 Voltage 3900 1 = Test 3900 1 ( : , 4 ) ;Time 3900 1= Test 3900 1 ( : , 5 ) ;

53% 3900 RPM Constant

55 Current 3900 2 = Test 3900 2 ( : , 1 ) ;RPM 3900 2 = Test 3900 2 ( : , 2 ) ;

57 Pot 3900 2 = Test 3900 2 ( : , 3 ) ;Vo l tage 3900 2 = Test 3900 2 ( : , 4 ) ;

59 Time 3900 2= Test 3900 2 ( : , 5 ) ;

61 % 4500 RPM ImpulsCurrent 4500 1 = Test 4500 1 ( : , 1 ) ;

63 RPM 4500 1 = Test 4500 1 ( : , 2 ) ;Pot 4500 1 = Test 4500 1 ( : , 3 ) ;

65 Voltage 4500 1 = Test 4500 1 ( : , 4 ) ;Time 4500 1= Test 4500 1 ( : , 5 ) ;

67% 4500 RPM Constant

69 Current 4500 2 = Test 4500 2 ( : , 1 ) ;RPM 4500 2 = Test 4500 2 ( : , 2 ) ;

71 Pot 4500 2 = Test 4500 2 ( : , 3 ) ;Vo l tage 4500 2 = Test 4500 2 ( : , 4 ) ;

73 Time 4500 2= Test 4500 2 ( : , 5 ) ;

75 % 5100 RPM ImpulsCurrent 5100 1 = Test 5100 1 ( : , 1 ) ;

77 RPM 5100 1 = Test 5100 1 ( : , 2 ) ;Pot 5100 1 = Test 5100 1 ( : , 3 ) ;

79 Voltage 5100 1 = Test 5100 1 ( : , 4 ) ;Time 5100 1= Test 5100 1 ( : , 5 ) ;

81% 5100 RPM Constant

83 Current 5100 2 = Test 5100 2 ( : , 1 ) ;RPM 5100 2 = Test 5100 2 ( : , 2 ) ;

85 Pot 5100 2 = Test 5100 2 ( : , 3 ) ;Vo l tage 5100 2 = Test 5100 2 ( : , 4 ) ;

87 Time 5100 2= Test 5100 2 ( : , 5 ) ;

89 % 5700 RPM ImpulsCurrent 5700 1 = Test 5700 1 ( : , 1 ) ;

91 RPM 5700 1 = Test 5700 1 ( : , 2 ) ;

34

Page 49: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Pot 5700 1 = Test 5700 1 ( : , 3 ) ;93 Voltage 5700 1 = Test 5700 1 ( : , 4 ) ;

Time 5700 1= Test 5700 1 ( : , 5 ) ;95

% 5700 RPM Constant97 Current 5700 2 = Test 5700 2 ( : , 1 ) ;

RPM 5700 2 = Test 5700 2 ( : , 2 ) ;99 Pot 5700 2 = Test 5700 2 ( : , 3 ) ;

Vo l tage 5700 2 = Test 5700 2 ( : , 4 ) ;101 Time 5700 2= Test 5700 2 ( : , 5 ) ;

103%% Plot t e s t , 3300 RPM

105 % −−−−−−−−−−Impuls −−−−−−−−−−−−−−−−% Moving mean o f cur rent and vo l tage

107 Current 3300 1 mean = movmean( Current 3300 1 , 100) ;Voltage 3300 1 mean = movmean( Voltage 3300 1 , 100) ;

109f i g u r e (1 )

111 yyax i s l e f tp l o t ( Time 3300 1 ( 2 00 : end−1) /1000 , Pot 3300 1 ( 20 0 : end−1) )

113 hold onp lo t ( Time 3300 1 ( 2 00 : end−1) /1000 , 543∗ ones ( numel ( Time 3300 1 ( 2 00 : end

−1) ) ,1 ) ) % Setpo int115 p lo t ( Time 3300 1 ( 2 00 : end−1) /1000 , 380∗ ones ( numel ( Time 3300 1 ( 2 00 : end

−1) ) ,1 ) ) % Limitsp l o t ( Time 3300 1 ( 2 00 : end−1) /1000 , 706∗ ones ( numel ( Time 3300 1 ( 2 00 : end

−1) ) ,1 ) )117 t i t l e ( ’No d i s tu rbance s & Impulse , 3300RPM K p=7, K I=3, K D=0 ’ )

x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )119 hold on

yyax i s r i g h t121 p lo t ( Time 3300 1 ( 2 00 : end−1) /1000 , Current 3300 1 mean ( 2 0 0 : end−1) . ∗

Voltage 3300 1 mean (2 0 0 : end−1) )y l a b e l ( ’ Power [W] ’ )

123 l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

125% −−−−−−−−−−−−−−−− Constant f o r c e −−−−−−−−−−−−−−−−−−

127 % Moving mean o f cur rent and vo l tageCurrent 3300 2 mean = movmean( Current 3300 2 , 100) ;

129 Voltage 3300 2 mean = movmean( Voltage 3300 2 , 100) ;

131 f i g u r e (2 )% −−−−−−−−−−−−−Potent iometer va lue −−−−−−−−−−−−−−−−−−−−−−

133 yyax i s l e f tp l o t ( Time 3300 2 ( 2 00 : end−1) /1000 , Pot 3300 2 ( 20 0 : end−1) )

135 hold onp lo t ( Time 3300 2 ( 2 00 : end−1) /1000 , 546∗ ones ( numel ( Time 3300 2 ( 2 00 : end

−1) ) ,1 ) ) % Setpo int137 p lo t ( Time 3300 2 ( 2 00 : end−1) /1000 , 431∗ ones ( numel ( Time 3300 2 ( 2 00 : end

−1) ) ,1 ) ) % Limits

35

Page 50: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX C. MATLAB CODE

p lo t ( Time 3300 2 ( 2 00 : end−1) /1000 , 661∗ ones ( numel ( Time 3300 2 ( 2 00 : end−1) ) ,1 ) )

139 t i t l e ( ’ Constant fo r c e , 3300RPM K p=7, K I=3, K D=0 ’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

141 hold on% −−−−−−−−−−−−−− Power −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

143 yyax i s r i g h tp l o t ( Time 3300 2 ( 2 00 : end−1) /1000 , Current 3300 2 mean ( 2 0 0 : end−1) . ∗

Voltage 3300 2 mean (2 0 0 : end−1) )145 y l a b e l ( ’ Power [W] ’ )

l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

147%% Plot t e s t , 3900 RPM

149% −−−−−−−−−−Impuls −−−−−−−−−−−−−−−−

151 % Moving mean o f cur rent and vo l tageCurrent 3900 1 mean = movmean( Current 3900 1 , 100) ;

153 Voltage 3900 1 mean = movmean( Voltage 3900 1 , 100) ;

155 f i g u r e (3 )yyax i s l e f t

157 p lo t ( Time 3900 1 ( 2 00 : end−1) /1000 , Pot 3900 1 ( 20 0 : end−1) )hold on

159 p lo t ( Time 3900 1 ( 2 00 : end−1) /1000 , 543∗ ones ( numel ( Time 3900 1 ( 2 00 : end−1) ) ,1 ) ) % Setpo int

p l o t ( Time 3900 1 ( 2 00 : end−1) /1000 , 380∗ ones ( numel ( Time 3900 1 ( 2 00 : end−1) ) ,1 ) ) % l i m i t s

161 p lo t ( Time 3900 1 ( 2 00 : end−1) /1000 , 706∗ ones ( numel ( Time 3900 1 ( 2 00 : end−1) ) ,1 ) )

t i t l e ( ’No d i s tu rbance s & Impulse , 3900RPM K p=12, K I=3, K D=0 ’ )163 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

hold on165 yyax i s r i g h t

p l o t ( Time 3900 1 ( 2 00 : end−1) /1000 , Current 3900 1 mean ( 2 0 0 : end−1) . ∗Voltage 3900 1 mean (2 0 0 : end−1) )

167 y l a b e l ( ’ Power [W] ’ )l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l t

l im i t , l e f t ’ , ’ Power [W] ’ )169

% −−−−−−−−−−−−−−−− Constant f o r c e −−−−−−−−−−−−−−−−−−171 % Moving mean o f cur rent and vo l tage

Current 3900 2 mean = movmean( Current 3900 2 , 100) ;173 Voltage 3900 2 mean = movmean( Voltage 3900 2 , 100) ;

175 f i g u r e (4 )% −−−−−−−−−−−−−Potent iometer va lue −−−−−−−−−−−−−−−−−−−−−−

177 yyax i s l e f tp l o t ( Time 3900 2 ( 2 00 : end−1) /1000 , Pot 3900 2 ( 20 0 : end−1) )

179 hold onp lo t ( Time 3900 2 ( 2 00 : end−1) /1000 , 546∗ ones ( numel ( Time 3900 2 ( 2 00 : end

−1) ) ,1 ) ) % Setpo int181 p lo t ( Time 3900 2 ( 2 00 : end−1) /1000 , 431∗ ones ( numel ( Time 3900 2 ( 2 00 : end

−1) ) ,1 ) ) % Limits

36

Page 51: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

p lo t ( Time 3900 2 ( 2 00 : end−1) /1000 , 661∗ ones ( numel ( Time 3900 2 ( 2 00 : end−1) ) ,1 ) )

183 t i t l e ( ’ Constant fo r c e , 3900RPM K p=12, K I=3, K D=0 ’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

185 hold on% −−−−−−−−−−−−−− Power −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

187 yyax i s r i g h tp l o t ( Time 3900 2 ( 2 00 : end−1) /1000 , Current 3900 2 mean ( 2 0 0 : end−1) . ∗

Voltage 3900 2 mean (2 0 0 : end−1) )189 y l a b e l ( ’ Power [W] ’ )

l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

191%% Plot t e s t , 4500 RPM

193% −−−−−−−−−−Impuls −−−−−−−−−−−−−−−−

195 % Moving mean o f cur rent and vo l tageCurrent 4500 1 mean = movmean( Current 4500 1 , 100) ;

197 Voltage 4500 1 mean = movmean( Voltage 4500 1 , 100) ;

199 f i g u r e (5 )yyax i s l e f t

201 p lo t ( Time 4500 1 ( 2 00 : end−1) /1000 , Pot 4500 1 ( 20 0 : end−1) )hold on

203 p lo t ( Time 4500 1 ( 2 00 : end−1) /1000 , 543∗ ones ( numel ( Time 4500 1 ( 2 00 : end−1) ) ,1 ) ) % Setpo int

p l o t ( Time 4500 1 ( 2 00 : end−1) /1000 , 380∗ ones ( numel ( Time 4500 1 ( 2 00 : end−1) ) ,1 ) ) % Limits

205 p lo t ( Time 4500 1 ( 2 00 : end−1) /1000 , 706∗ ones ( numel ( Time 4500 1 ( 2 00 : end−1) ) ,1 ) )

t i t l e ( ’No d i s tu rbance s & Impulse , 4500RPM K p=17, K I=3, K D=0.1 ’ )207 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

hold on209 yyax i s r i g h t

p l o t ( Time 4500 1 ( 2 00 : end−1) /1000 , Current 4500 1 mean ( 2 0 0 : end−1) . ∗Voltage 4500 1 mean (2 0 0 : end−1) )

211 y l a b e l ( ’ Power [W] ’ )l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l t

l im i t , l e f t ’ , ’ Power [W] ’ )213

215 % −−−−−−−−−−−−−−−− Constant f o r c e −−−−−−−−−−−−−−−−−−% Moving mean o f cur rent and vo l tage

217 Current 4500 2 mean = movmean( Current 4500 2 , 100) ;Voltage 4500 2 mean = movmean( Voltage 4500 2 , 100) ;

219f i g u r e (6 )

221 % −−−−−−−−−−−−−Potent iometer value−−−−−−−−−−−−−−−−−−−−−−yyax i s l e f t

223 p lo t ( Time 4500 2 ( 2 00 : end−1) /1000 , Pot 4500 2 ( 20 0 : end−1) )hold on

225 p lo t ( Time 4500 2 ( 2 00 : end−1) /1000 , 546∗ ones ( numel ( Time 4500 2 ( 2 00 : end−1) ) ,1 ) ) % Setpo int

37

Page 52: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX C. MATLAB CODE

p lo t ( Time 4500 2 ( 2 00 : end−1) /1000 , 431∗ ones ( numel ( Time 4500 2 ( 2 00 : end−1) ) ,1 ) ) % Limits

227 p lo t ( Time 4500 2 ( 2 00 : end−1) /1000 , 661∗ ones ( numel ( Time 4500 2 ( 2 00 : end−1) ) ,1 ) )

t i t l e ( ’ Constant fo r c e , 4500RPM K p=17, K I=3, K D=0.1 ’ )229 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

hold on231 % −−−−−−−−−−−−−− Power −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

yyax i s r i g h t233 p lo t ( Time 4500 2 ( 2 00 : end−1) /1000 , Current 4500 2 mean ( 2 0 0 : end−1) . ∗

Voltage 4500 2 mean (2 0 0 : end−1) )y l a b e l ( ’ Power [W] ’ )

235 l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

237 %% Plot t e s t , 5100 RPM

239 % −−−−−−−−−−Impuls −−−−−−−−−−−−−−−−% Moving mean o f cur rent and vo l tage

241 Current 5100 1 mean = movmean( Current 5100 1 , 100) ;Voltage 5100 1 mean = movmean( Voltage 5100 1 , 100) ;

243f i g u r e (7 )

245 yyax i s l e f tp l o t ( Time 5100 1 ( 2 00 : end−1) /1000 , Pot 5100 1 ( 20 0 : end−1) )

247 hold onp lo t ( Time 5100 1 ( 2 00 : end−1) /1000 , 543∗ ones ( numel ( Time 5100 1 ( 2 00 : end

−1) ) ,1 ) ) % Setpo int249 p lo t ( Time 5100 1 ( 2 00 : end−1) /1000 , 380∗ ones ( numel ( Time 5100 1 ( 2 00 : end

−1) ) ,1 ) )p l o t ( Time 5100 1 ( 2 00 : end−1) /1000 , 706∗ ones ( numel ( Time 5100 1 ( 2 00 : end

−1) ) ,1 ) )251 t i t l e ( ’No d i s tu rbance s & Impulse , 5100RPM K p=19, K I=3, K D=0.5 ’ )

x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )253 hold on

yyax i s r i g h t255 p lo t ( Time 5100 1 ( 2 00 : end−1) /1000 , Current 5100 1 mean ( 2 0 0 : end−1) . ∗

Voltage 5100 1 mean (2 0 0 : end−1) )y l a b e l ( ’ Power [W] ’ )

257 l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

259% −−−−−−−−−−−−−−−− Constant f o r c e −−−−−−−−−−−−−−−−−−

261 % Moving mean o f cur rent and vo l tageCurrent 5100 2 mean = movmean( Current 5100 2 , 100) ;

263 Voltage 5100 2 mean = movmean( Voltage 5100 2 , 100) ;

265 f i g u r e (8 )% −−−−−−−−−−−−−Potent iometer va lue −−−−−−−−−−−−−−−−−−−−−−

267 yyax i s l e f tp l o t ( Time 5100 2 ( 2 00 : end−1) /1000 , Pot 5100 2 ( 20 0 : end−1) )

269 hold on

38

Page 53: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

p lo t ( Time 5100 2 ( 2 00 : end−1) /1000 , 546∗ ones ( numel ( Time 5100 2 ( 2 00 : end−1) ) ,1 ) ) % Setpo int

271 p lo t ( Time 5100 2 ( 2 00 : end−1) /1000 , 431∗ ones ( numel ( Time 5100 2 ( 2 00 : end−1) ) ,1 ) ) % Limits

p l o t ( Time 5100 2 ( 2 00 : end−1) /1000 , 661∗ ones ( numel ( Time 5100 2 ( 2 00 : end−1) ) ,1 ) )

273 t i t l e ( ’ Constant fo r c e , 5100RPM K p=19, K I=3, K D=0.5 ’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

275 hold on% −−−−−−−−−−−−−− Power −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

277 yyax i s r i g h tp l o t ( Time 5100 2 ( 2 00 : end−1) /1000 , Current 5100 2 mean ( 2 0 0 : end−1) . ∗

Voltage 5100 2 mean (2 0 0 : end−1) )279 y l a b e l ( ’ Power [W] ’ )

l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l tl im i t , l e f t ’ , ’ Power [W] ’ )

281%% Plot t e s t , 5700 RPM

283% −−−−−−−−−−Impuls −−−−−−−−−−−−−−−−

285 % Moving mean o f cur rent and vo l tageCurrent 5700 1 mean = movmean( Current 5700 1 , 100) ;

287 Voltage 5700 1 mean = movmean( Voltage 5700 1 , 100) ;

289 f i g u r e (9 )yyax i s l e f t

291 p lo t ( Time 5700 1 ( 2 00 : end−1) /1000 , Pot 5700 1 ( 20 0 : end−1) )hold on

293 p lo t ( Time 5700 1 ( 2 00 : end−1) /1000 , 543∗ ones ( numel ( Time 5700 1 ( 2 00 : end−1) ) ,1 ) ) % Setpo int

p l o t ( Time 5700 1 ( 2 00 : end−1) /1000 , 380∗ ones ( numel ( Time 5700 1 ( 2 00 : end−1) ) ,1 ) ) % Limits

295 p lo t ( Time 5700 1 ( 2 00 : end−1) /1000 , 706∗ ones ( numel ( Time 5700 1 ( 2 00 : end−1) ) ,1 ) )

t i t l e ( ’No d i s tu rbance s & Impulse , 5700RPM K p=21, K I=5, K D=1 ’ )297 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

hold on299 yyax i s r i g h t

p l o t ( Time 5700 1 ( 2 00 : end−1) /1000 , Current 5700 1 mean ( 2 0 0 : end−1) . ∗Voltage 5700 1 mean (2 0 0 : end−1) )

301 y l a b e l ( ’ Power [W] ’ )l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l t

l im i t , l e f t ’ , ’ Power [W] ’ )303

305 % −−−−−−−−−−−−−−−− Constant f o r c e −−−−−−−−−−−−−−−−−−% Moving mean o f cur rent and vo l tage

307 Current 5700 2 mean = movmean( Current 5700 2 , 100) ;Voltage 5700 2 mean = movmean( Voltage 5700 2 , 100) ;

309f i g u r e (10)

311 % −−−−−−−−−−−−−Potent iometer va lue −−−−−−−−−−−−−−−−−−−−−−yyax i s l e f t

313 p lo t ( Time 5700 2 ( 2 00 : end−1) /1000 , Pot 5700 2 ( 20 0 : end−1) )

39

Page 54: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX C. MATLAB CODE

hold on315 p lo t ( Time 5700 2 ( 2 00 : end−1) /1000 , 546∗ ones ( numel ( Time 5700 2 ( 2 00 : end

−1) ) ,1 ) ) % Setpo intp l o t ( Time 5700 2 ( 2 00 : end−1) /1000 , 431∗ ones ( numel ( Time 5700 2 ( 2 00 : end

−1) ) ,1 ) )317 p lo t ( Time 5700 2 ( 2 00 : end−1) /1000 , 661∗ ones ( numel ( Time 5700 2 ( 2 00 : end

−1) ) ,1 ) )t i t l e ( ’ Constant fo r c e , 5700RPM K p=21, K I=5, K D=1 ’ )

319 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )hold on

321 % −−−−−−−−−−−−−− Power −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−yyax i s r i g h t

323 p lo t ( Time 5700 2 ( 2 00 : end−1) /1000 , Current 5700 2 mean ( 2 0 0 : end−1) . ∗Voltage 5700 2 mean (2 0 0 : end−1) )

y l a b e l ( ’ Power [W] ’ )325 l egend ( ’ Potent iometer va lue ’ , ’ Se tpo int ’ , ’ T i l t l im i t , r i g h t ’ , ’ T i l t

l im i t , l e f t ’ , ’ Power [W] ’ )

327%% Prestanda

329 %% No d i s tu rbance s% f i g u r e (11) shows potent iometer value , f i g u r e (12) shows power f o r the

same331 % sampling time

333 f i g u r e (11)t3300 = f i n d ( Time 3300 1 < 30000) ;

335 p lo t ( Time 3300 1 ( t3300 ( 2 00 : end−1) ) /1000 , Pot 3300 1 ( t3300 ( 20 0 : end−1) ) )hold on

337 f i g u r e (12) % Ef f ek tPower 3300 1 = Current 3300 1 mean . ∗ Voltage 3300 1 mean ;

339 p lo t ( Time 3300 1 ( t3300 ( 2 00 : end−1) ) /1000 , Power 3300 1 ( t3300 ( 20 0 : end−1) ) )hold on

341t3900 = f i n d ( Time 3900 1 < 30000) ;

343 f i g u r e (11)p l o t ( Time 3900 1 ( t3900 ( 2 00 : end−1) ) /1000 , Pot 3900 1 ( t3900 ( 20 0 : end−1) ) )

345 f i g u r e (12) % Ef f ek tPower 3900 1 = Current 3900 1 mean . ∗ Voltage 3900 1 mean ;

347 p lo t ( Time 3900 1 ( t3900 ( 2 00 : end−1) ) /1000 , Power 3900 1 ( t3900 ( 20 0 : end−1) ) )

349 t4500 = f i n d ( Time 4500 1 < 30000) ;f i g u r e (11)

351 p lo t ( Time 4500 1 ( t4500 ( 2 00 : end−1) ) /1000 , Pot 4500 1 ( t4500 ( 20 0 : end−1) ) )f i g u r e (12) % Ef f ek t

353 Power 4500 1 = Current 4500 1 mean . ∗ Voltage 4500 1 mean ;p l o t ( Time 4500 1 ( t4500 ( 2 00 : end−1) ) /1000 , Power 4500 1 ( t4500 ( 20 0 : end−1) ) )

355t5100 = f i n d ( Time 5100 1 < 30000) ;

357 f i g u r e (11)p l o t ( Time 5100 1 ( t5100 ( 2 00 : end−1) ) /1000 , Pot 5100 1 ( t5100 ( 20 0 : end−1) ) )

359 f i g u r e (12) % Ef f ek tPower 5100 1 = Current 5100 1 mean . ∗ Voltage 5100 1 mean ;

361 p lo t ( Time 5100 1 ( t5100 ( 2 00 : end−1) ) /1000 , Power 5100 1 ( t5100 ( 20 0 : end−1) ) )

40

Page 55: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

363 t5700 = f i n d ( Time 5700 1 < 30000) ;f i g u r e (11) % Potent iometer

365 p lo t ( Time 5700 1 ( t5700 ( 2 00 : end−1) ) /1000 , Pot 5700 1 ( t5700 ( 20 0 : end−1) ) )f i g u r e (12) % Ef f ek t

367 Power 5700 1 = Current 5700 1 mean . ∗ Voltage 5700 1 mean ;p l o t ( Time 5700 1 ( t5700 ( 2 00 : end−1) ) /1000 , Power 5700 1 ( t5700 ( 20 0 : end−1) ) )

369f i g u r e (11)

371 t i t l e ( ’No d i s tu rbance s ’ )l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )

373 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

375 f i g u r e (12)t i t l e ( ’ Power − No d i s tu rbance s ’ )

377 l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Power [W] ’ )

379%% Impuls

381 % f i g u r e (13) shows potent iometer value , f i g u r e (14) shows power f o r thesame

% sampling time383

f i g u r e (13)385 t3300 = f i n d ( Time 3300 1 > 127126 & Time 3300 1 < 132000) ;

p l o t ( Time 3300 1 ( t3300 ) /1000 − Time 3300 1 ( t3300 (1 ) ) /1000 , Pot 3300 1 (t3300 ) )

387 hold onf i g u r e (14)

389 p lo t ( Time 3300 1 ( t3300 ) /1000 − Time 3300 1 ( t3300 (1 ) ) /1000 , Power 3300 1( t3300 ) )

hold on391

f i g u r e (13)393 t3900 = f i n d ( Time 3900 1 > 107500 & Time 3900 1 < 111000) ;

p l o t ( Time 3900 1 ( t3900 ) /1000 − Time 3900 1 ( t3900 (1 ) ) /1000 , Pot 3900 1 (t3900 ) )

395 f i g u r e (14)p l o t ( Time 3900 1 ( t3900 ) /1000 − Time 3900 1 ( t3900 (1 ) ) /1000 , Power 3900 1

( t3900 ) )397

f i g u r e (13)399 t4500 = f i n d ( Time 4500 1 > 64114 & Time 4500 1 < 67500 ) ;

p l o t ( Time 4500 1 ( t4500 ) /1000 − Time 4500 1 ( t4500 (1 ) ) /1000 , Pot 4500 1 (t4500 ) )

401 f i g u r e (14)p l o t ( Time 4500 1 ( t4500 ) /1000 − Time 4500 1 ( t4500 (1 ) ) /1000 , Power 4500 1

( t4500 ) )403

f i g u r e (13)405 t5100 = f i n d ( Time 5100 1 > 52670 & Time 5100 1 < 56000) ;

p l o t ( Time 5100 1 ( t5100 ) /1000 − Time 5100 1 ( t5100 (1 ) ) /1000 , Pot 5100 1 (t5100 ) )

407 f i g u r e (14)

41

Page 56: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX C. MATLAB CODE

p lo t ( Time 5100 1 ( t5100 ) /1000 − Time 5100 1 ( t5100 (1 ) ) /1000 , Power 5100 1( t5100 ) )

409f i g u r e (13)

411 t5700 = f i n d ( Time 5700 1 > 1 .0508 e+05 & Time 5700 1 < 109000 ) ;p l o t ( Time 5700 1 ( t5700 ) /1000 − Time 5700 1 ( t5700 (1 ) ) /1000 , Pot 5700 1 (

t5700 ) )413 f i g u r e (14)

p l o t ( Time 5700 1 ( t5700 ) /1000 − Time 5700 1 ( t5700 (1 ) ) /1000 , Power 5700 1( t5700 ) )

415

417 f i g u r e (13)t i t l e ( ’ Impulse ’ )

419 l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

421f i g u r e (14)

423 t i t l e ( ’ Power − Impulse ’ )l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )

425 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Power [W] ’ )

427 %% Konstant k r a f t% f i g u r e (15) shows potent iometer value , f i g u r e (16) shows power f o r the

same429 % sampling time

431 f i g u r e (15)t3300 = f i n d ( Time 3300 2 > 28130 & Time 3300 2 < 30500) ;

433 p lo t ( Time 3300 2 ( t3300 ) /1000 − Time 3300 2 ( t3300 (1 ) ) /1000 , Pot 3300 2 (t3300 ) )

hold on435 f i g u r e (16)

Power 3300 2 = Current 3300 2 mean . ∗ Voltage 3300 2 mean ;437 p lo t ( Time 3300 2 ( t3300 ) /1000 − Time 3300 2 ( t3300 (1 ) ) /1000 , Power 3300 2

( t3300 ) )hold on

439f i g u r e (15)

441 t3900 = f i n d ( Time 3900 2 > 35835 & Time 3900 2 < 40000) ;p l o t ( Time 3900 2 ( t3900 ) /1000 − Time 3900 2 ( t3900 (1 ) ) /1000 , Pot 3900 2 (

t3900 ) )443 f i g u r e (16)

Power 3900 2 = Current 3900 2 mean . ∗ Voltage 3900 2 mean ;445 p lo t ( Time 3900 2 ( t3900 ) /1000 − Time 3900 2 ( t3900 (1 ) ) /1000 , Power 3900 2

( t3900 ) )

447 f i g u r e (15)t4500 = f i n d ( Time 4500 2 > 127690 & Time 4500 2 < 132000 ) ;

449 p lo t ( Time 4500 2 ( t4500 ) /1000 − Time 4500 2 ( t4500 (1 ) ) /1000 , Pot 4500 2 (t4500 ) )

f i g u r e (16)451 Power 4500 2 = Current 4500 2 mean . ∗ Voltage 4500 2 mean ;

42

Page 57: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

p lo t ( Time 4500 2 ( t4500 ) /1000 − Time 4500 2 ( t4500 (1 ) ) /1000 , Power 4500 2( t4500 ) )

453f i g u r e (15)

455 t5100 = f i n d ( Time 5100 2 > 176700 & Time 5100 2 < 181000) ;p l o t ( Time 5100 2 ( t5100 ) /1000 − Time 5100 2 ( t5100 (1 ) ) /1000 , Pot 5100 2 (

t5100 ) )457 f i g u r e (16)

Power 5100 2 = Current 5100 2 mean . ∗ Voltage 5100 2 mean ;459 p lo t ( Time 5100 2 ( t5100 ) /1000 − Time 5100 2 ( t5100 (1 ) ) /1000 , Power 5100 2

( t5100 ) )

461 f i g u r e (15)t5700 = f i n d ( Time 5700 2 > 115600 & Time 5700 2 < 120500 ) ;

463 p lo t ( Time 5700 2 ( t5700 ) /1000 − Time 5700 2 ( t5700 (1 ) ) /1000 , Pot 5700 2 (t5700 ) )

f i g u r e (16)465 Power 5700 2 = Current 5700 2 mean . ∗ Voltage 5700 2 mean ;

p l o t ( Time 5700 2 ( t5700 ) /1000 − Time 5700 2 ( t5700 (1 ) ) /1000 , Power 5700 2( t5700 ) )

467

469 f i g u r e (15)t i t l e ( ’ Constant f o r c e ’ )

471 l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Potent iometer va lue ’ )

473f i g u r e (16)

475 t i t l e ( ’ Power − Constant f o r c e ’ )l egend ( ’ 3300 RPM’ , ’ 3900 RPM’ , ’ 4500 RPM’ , ’ 5100 RPM’ , ’ 5700 RPM’ )

477 x l a b e l ( ’Time [ s ] ’ ) , y l a b e l ( ’ Power [W] ’ )

Listing C.1: The code used for data processing which was run in matlab 2016a

43

Page 58: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 59: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix D

Circuit layout

The image of the circuit layout shown on the next page was made in the open sourceFritzing software.

45

Page 60: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Th

e le

ft resisto

r is1

54

kOh

m, th

e righ

t is1

10

kOh

m

Ca

ble

s are

con

ne

cted

to a

12

V p

ow

er su

pp

ly

MO

TO

R S

HIELD

mo

un

ted

on

an

Ard

uin

o U

no

Page 61: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix E

Arduino code

1 /∗Implementing gyro s cop i c s t a b i l i z a t i o n

3 Bachelor ’ s t h e s i s in mechatronics at KTH − ITMSimon Fro l ander & Andr e Sa l l

5 TRITA: MMK 2017:29 MDAB 647

7 Arduino code used f o r measuring .Measures RPM, potent iometer value , cur rent and vo l tage .

9Written in Arduino IDE 1 . 8 . 2

11 ∗/

13 // Volt measure#d e f i n e vo l tP in A5

15 f l o a t voltMotor ;

17 // −−−−−−−−−−−−−−−− Low pass f i l t e r −−−−−−−−−−−−−−−−−−−−−−−−−−−−−// F i l t e r l i b r a r y from :

19 // https : // playground . arduino . cc /Code/ F i l t e r s [ Accessed : 2017−06−11]#inc lude <F i l t e r s . h>

21 f l o a t f i l t e r F r e q u e n c y = 2 . 0 ; // f i l t e r f requency f o r low passFi l te rOnePole l owpas sF i l t e rPot (LOWPASS, f i l t e r F r e q u e n c y ) ; // c r e a t e a

one po le (RC) lowpass f i l t e r23

// −−−−−−−−−−−−−−−Potentiometer−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−25 i n t potPin = 2 ; // s e l e c t the input pin f o r the potent iometer

double Potent iometer va lue = 0 ; // v a r i a b l e to s t o r e the value comingfrom the senso r

27// −−−−−−−−−−−−−−−−−−− Hal l e f f e c t −−−−−−−−−−−−−−−−−−−−

29 v o l a t i l e byte r e v o l u t i o n s ;unsigned i n t rpm ;

31 unsigned long t imeold ;const i n t analogInPin = A0 ;

33// Current s enso r −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

35 // Al l code f o r cur rent s enso r adapted from :

47

Page 62: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX E. ARDUINO CODE

// George Beckste in f o r SparkFun37 // https : // l e a rn . sparkfun . com/ t u t o r i a l s / acs712−low−current−sensor−

hookup−guide [ Accessed : 2017−06−11]i n t sensorValue = 0 ;

39 f l o a t s e n s i t i v i t y = 100 .0 / 1 4 0 . 0 ; // 100mA per 500mV = 0.2f l o a t Vref = 2 5 5 0 . 0 ; // Output vo l tage (mV) with no cur rent

41 // we got 2690mV with 100mA

43 f l o a t vo l tage ;f l o a t cur r ent ;

45// −−−−−−−−−− SET UP −−−−−−−−−−−−−−−−−−−−−−−−−−

47 void setup ( )

49 // i n i t i a l i z e s e r i a l communications at 115200 bps :S e r i a l . begin (115200) ;

51// −−−−−−−−−−−−−− Hal l e f f e c t −−−−−−−−−−−−−−−−−−

53 // Al l code f o r h a l l e f f e c t s enso r i s adapted from :// Arvind Sanjeev

55 // https : // diyhacking . com/ arduino−ha l l−e f f e c t−sensor−t u t o r i a l / [Accessed : 2017−06−11]

a t t a ch In t e r rup t (0 , magnet detect , RISING) ; // I n i t i a l i z e the i n t t e r r u p tpin ( Arduino d i g i t a l pin 2)

57 r e v o l u t i o n s = 0 ;rpm = 0 ;

59 t imeold = 0 ;// −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

61// p r in t t h i s one time to see where the measurements begun and what

the va lue s corresponds to63 S e r i a l . p r i n t ( ” Current ” ) ; S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t ( ”RPM” ) ; S e r i a l . p r i n t ( ”\ t ” ) ;65 S e r i a l . p r i n t ( ”Pot” ) ; S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t ( ” Voltage ” ) ; S e r i a l . p r i n t ( ”\ t ” ) ;67 S e r i a l . p r i n t ( ”Time” ) ; S e r i a l . p r i n t ( ”\n” ) ;

69

71 // −−−−−−−−−−−−−−−−− MAIN LOOP −−−−−−−−−−−−−−−−−−−−−−−void loop ( )

73 // −−−−− Voltage measurment −−−−−−−// 12/1024 = 0.011719

75 voltMotor = 0.011719 ∗ analogRead ( vo l tP in ) ;

77 // −−−−− Potent iometer va lue measurment −−−−−−−Potent iometer va lue = lowpas sF i l t e rPot . input ( analogRead ( potPin ) ) ; //

read the value from the pot79

// −−−−− Current sensor−−−−−−−−−−−−−81 // read the cur rent s enso r analog in value :

sensorValue = analogRead ( analogInPin ) ;83

// The on−board ADC i s 10−b i t s −> 2ˆ10 = 1024 −> 5V / 1024 ˜= 4.88mV

48

Page 63: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

85 // The vo l tage i s in m i l l i v o l t svo l tage = 4.88 ∗ sensorValue ;

87// This w i l l c a l c u l a t e the ac tua l cur rent in Ampere

89 // Using the Vref and s e n s i t i v i t y s e t t i n g s you c o n f i g u r ecur rent = ( vo l tage − Vref ) ∗ s e n s i t i v i t y / 1 0 0 0 . 0 ;

91// Reset the s enso r va lue f o r the next read ing

93 sensorValue = 0 ;

95 // −−−−−−−−− Hal l e f f e c t −−−−−−−−−−−−−−−−−−−−−−−−−// c a l c u l a t e s the RPM every 20 r o t a t i o n s

97 i f ( r e v o l u t i o n s >= 20) rpm = 30 ∗ 1000 / ( m i l l i s ( ) − t imeold ) ∗ r e v o l u t i o n s ;

99 rpm = rpm ∗ 2 ;t imeold = m i l l i s ( ) ;

101 r e v o l u t i o n s = 0 ;

103// −−−−−−−−−− S e r i a l monitor −−−−−−−−−−−−−−−−−−−−−−−−−−

105 // p r in t a l l the data to the s e r i a l monitor// s i n c e the re are tabs in between the data i s easy to import to

programs such as Excel107 // by simply copy pas t ing

S e r i a l . p r i n t ( abs ( cur rent ) ) ;109 S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t (rpm , DEC) ;111 S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t ( Potent iometer va lue ) ;113 S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t ( voltMotor ) ;115 S e r i a l . p r i n t ( ”\ t ” ) ;

S e r i a l . p r i n t ( m i l l i s ( ) ) ;117 S e r i a l . p r i n t ( ”\n” ) ;

119// −−−−−−− Hal l e f f e c t −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

121 void magnet detect ( ) // This func t i on i s c a l l e d whenever a magnet/i n t e r r u p t i s detec ted by the arduino

123 r e v o l u t i o n s ++;

Listing E.1: The code for the measurement Arduino Uno

1 /∗Implementing gyro s cop i c s t a b i l i z a t i o n

3 Bachelor ’ s t h e s i s in mechatronics at KTH − ITMSimon Fro l ander & Andr e Sa l l

5 TRITA: MMK 2017:29 MDAB 647

7 Main arduino code used f o r the c o n t r o l system . Takes potent iometerva lue as input and g i v e s

49

Page 64: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX E. ARDUINO CODE

vo l tage to the DC motor as output . Se tpo int f o r the potent iometerva lue has to be s e t manually .

9Written in Arduino IDE 1 . 8 . 2

11 ∗/

13 // Low pass f i l t e r −−−−−−−−−−−−−−−−−−−−−−−−−−−−−// F i l t e r l i b r a r y adapted from :

15 // https : // playground . arduino . cc /Code/ F i l t e r s [ Accessed : 2017−06−11]#inc lude <F i l t e r s . h>

17 f l o a t f i l t e r F r e q u e n c y = 2 . 0 ; // f i l t e r f requency f o r low passFi l te rOnePole l o w p a s s F i l t e r (LOWPASS, f i l t e r F r e q u e n c y ) ; // c r e a t e a one

po le (RC) lowpass f i l t e r19

unsigned long t imer ;21 // Potentiometer−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

i n t potPin = 2 ; // s e l e c t the input pin f o r the potent iometer23 double Potent iometer va lue = 0 ; // v a r i a b l e to s t o r e the value

coming from the senso r

25 // DC−motor −−−−−−−−−−−−−−−−−−−−−−−−−−−−−#d e f i n e PWMOutput 3

27 #d e f i n e D i r e c t i on 12#d e f i n e Brake 9

29// Clone PWM Output f o r measurements

31 #d e f i n e PWMOutputClone 11

33 // PID −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−// Arduino PID Library

35 // by Brett Beauregard// contact : br3ttb@gmail . com

37 // https : // playground . arduino . cc /Code/PIDLibrary [ Accessed : 2017−06−11]#inc lude <PID v1 . h>

39// Def ine Var iab l e s we ’ l l be connect ing to

41 double Setpoint , Input , Output ;double p = 21 .0 , i = 5 . 0 , d = 1 . 0 ; // these PID parameters were used

f o r 5700 RPM43 // f o r the other speeds :

// p = 19 .0 , i = 3 . 0 , d = 0 .545 // p = 17 .0 , i = 3 . 0 , d = 0 .1

// p = 12 .0 , i = 3 . 0 , d = 0 .047 // p = 7 . 0 , i = 3 . 0 , d = 0 .0

49 // Spec i f y the l i n k s and i n i t i a l tuning parametersPID myPID(&Input , &Output , &Setpoint , p , i , d , DIRECT) ;

51// −−−−−−−−−−−−−−−−−−−−−−− SET UP −−−−−−−−−−−−−−−−−−−−−−−−−

53 void setup ( ) S e r i a l . begin (115200) ;

55// PID −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

57 // i n i t i a l i z e the v a r i a b l e s we ’ re l i nked to

50

Page 65: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Input = analogRead ( potPin ) ; // t h i s l i n e i s super f luous , l e f t becausei t was here during t e s t i n g

59 Setpo int = 543 ; // the manually s e t s e t p o i n t

61 // turn the PID onmyPID. SetMode (AUTOMATIC) ;

63 myPID. SetOutputLimits (−255 , 255) ; // max PWM output

65 pinMode (PWMOutput, OUTPUT) ;pinMode (PWMOutputClone , OUTPUT) ; // f o r measuring the vo l tage output

to the motor ( not connected to the motor )67 pinMode ( Direct ion , OUTPUT) ;

69 // void setup ( ) ends here

71// −−−−−−−−−−−−−−−−−−−−−−−−− MAIN LOOP −−−−−−−−−−−−−−−−−−−−−−−

73 void loop ( ) // Use low pass f i l t e r on the potent iometer r ead ings

75 Potent iometer va lue = l o w p a s s F i l t e r . input ( analogRead ( potPin ) ) ; //read the value from the senso r

77 // Motor c o n t r o l −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−Input = Potent iometer va lue ;

79 myPID. Compute ( ) ;

81 // I f Output > 0 , s e t motor d i r e c t i o n LOWi f ( Output > 0 . 0 )

83 d i g i t a l W r i t e ( Di rect ion , LOW) ;

85 // I f Output < 0 , s e t motor d i r e c t i o n HIGHi f ( Output < 0 . 0 )

87 d i g i t a l W r i t e ( Di rect ion , HIGH) ;

89// PWM−s i g n a l sent to motor

91 analogWrite (PWMOutput, abs ( Output ) ) ;// Same PWM−s i g n a l used to measure the vo l tage

93 analogWrite (PWMOutputClone , abs ( Output ) ) ;

95 // void loop ( ) ends here

Listing E.2: The code for the balancing Arduino Uno

51

Page 66: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization
Page 67: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

Appendix F

Test results

The plots in this appendix were created using the matlab program in AppendixC.

53

Page 68: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX F. TEST RESULTS

02

04

06

08

01

00

12

01

40

16

01

80

Tim

e [s

]

35

0

40

0

45

0

50

0

55

0

60

0

65

0

70

0

75

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

No

dis

turb

an

ce

s &

Imp

uls

e, 3

30

0R

PM

Kp=

7, K

I =3

, KD

=0

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.1: Test with no disturbances and short impulses applied, 3300 RPM,plotted in matlab 2016a

54

Page 69: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

05

01

00

15

02

00

25

0

Tim

e [s

]

40

0

45

0

50

0

55

0

60

0

65

0

70

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

Co

ns

tan

t forc

e, 3

30

0R

PM

Kp=

7, K

I =3

, KD

=0

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.2: Test with constant force disturbances applied, 3300 RPM, plotted inmatlab 2016a

55

Page 70: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX F. TEST RESULTS

02

04

06

08

01

00

12

01

40

Tim

e [s

]

35

0

40

0

45

0

50

0

55

0

60

0

65

0

70

0

75

0

Potentiometer value

0 2 4 6 8 10

12

14

Power [W]

No

dis

turb

an

ce

s &

Imp

uls

e, 3

90

0R

PM

Kp=

12

, KI =

3, K

D=

0

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.3: Test with no disturbances and short impulses applied, 3900 RPM,plotted in matlab 2016a

56

Page 71: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

05

01

00

15

02

00

25

0

Tim

e [s

]

40

0

45

0

50

0

55

0

60

0

65

0

70

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

Co

ns

tan

t forc

e, 3

90

0R

PM

Kp=

12

, KI =

3, K

D=

0

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.4: Test with constant force disturbances applied, 3900 RPM, plotted inmatlab 2016a

57

Page 72: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX F. TEST RESULTS

02

04

06

08

01

00

12

0

Tim

e [s

]

35

0

40

0

45

0

50

0

55

0

60

0

65

0

70

0

75

0

Potentiometer value

0 5 10

15

Power [W]

No

dis

turb

an

ce

s &

Imp

uls

e, 4

50

0R

PM

Kp=

17

, KI =

3, K

D=

0.1

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.5: Test with no disturbances and short impulses applied, 4500 RPM,plotted in matlab 2016a

58

Page 73: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

05

01

00

15

02

00

25

03

00

Tim

e [s

]

40

0

45

0

50

0

55

0

60

0

65

0

70

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

Co

ns

tan

t forc

e, 4

50

0R

PM

Kp=

17

, KI =

3, K

D=

0.1

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.6: Test with constant force disturbances applied, 4500 RPM, plotted inmatlab 2016a

59

Page 74: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX F. TEST RESULTS

02

04

06

08

01

00

12

0

Tim

e [s

]

35

0

40

0

45

0

50

0

55

0

60

0

65

0

70

0

75

0

Potentiometer value

0 2 4 6 8 10

12

14

Power [W]

No

dis

turb

an

ce

s &

Imp

uls

e, 5

10

0R

PM

Kp=

19

, KI =

3, K

D=

0.5

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.7: Test with no disturbances and short impulses applied, 5100 RPM,plotted in matlab 2016a

60

Page 75: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

05

01

00

15

02

00

25

03

00

35

0

Tim

e [s

]

40

0

45

0

50

0

55

0

60

0

65

0

70

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

Co

ns

tan

t forc

e, 5

10

0R

PM

Kp=

19

, KI =

3, K

D=

0.5

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.8: Test with constant force disturbances applied, 5100 RPM, plotted inmatlab 2016a

61

Page 76: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

APPENDIX F. TEST RESULTS

02

04

06

08

01

00

12

01

40

16

0

Tim

e [s

]

35

0

40

0

45

0

50

0

55

0

60

0

65

0

70

0

75

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

No

dis

turb

an

ce

s &

Imp

uls

e, 5

70

0R

PM

Kp=

21

, KI =

5, K

D=

1

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.9: Test with no disturbances and short impulses applied, 5700 RPM,plotted in matlab 2016a

62

Page 77: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

05

01

00

15

02

00

25

03

00

Tim

e [s

]

40

0

45

0

50

0

55

0

60

0

65

0

70

0

Potentiometer value

0 2 4 6 8 10

12

14

16

18

Power [W]

Co

ns

tan

t forc

e, 5

70

0R

PM

Kp=

21

, KI =

5, K

D=

1

Po

ten

tiom

ete

r va

lue

Se

tpo

int

Tilt lim

it, righ

t

Tilt lim

it, left

Po

we

r [W]

Figure F.10: Test with constant force disturbances applied, 5700 RPM, plotted inmatlab 2016a

63

Page 78: Implementing Gyroscopic Stabilization1201171/FULLTEXT01.pdf · DEGREE PROJECT IN MECHANICAL ENGINEERING, FIRST CYCLE, 15 CREDITS STOCKHOLM , SWEDEN 2017 Implementing Gyroscopic Stabilization

TRITA MMK 2017:29 MDAB 647

www.kth.se