• No results found

VelOn - The detachable bicycle motor

N/A
N/A
Protected

Academic year: 2022

Share "VelOn - The detachable bicycle motor"

Copied!
62
0
0

Loading.... (view fulltext now)

Full text

(1)

IN

DEGREE PROJECT TECHNOLOGY, FIRST CYCLE, 15 CREDITS

STOCKHOLM SWEDEN 2019,

VelOn - The detachable bicycle motor

FILIP ELANDER

CECILIA RÖNNBERG

(2)
(3)

VelOn - The detachable bicycle motor

FILIP ELANDER CECILIA R ¨ ONNBERG

Bachelor’s Thesis at ITM Supervisor: Nihad Subasic

Examiner: Nihad Subasic

TRITA-ITM-EX 2019:27

(4)
(5)

Abstract

Keywords: Mechatronics, Personal transportation, Electri- cal bicycle, Sustainability.

Electric bikes have become a popular means of transporta- tion over the years. This report examined whether or not it is plausible to upgrade old bicycles to electrical bikes, thereby, using the already existing bicycles and avoiding the need of unnecessary manufacturing.

A prototype of the mountable motor was designed and man- ufactured. The device consisted of two units, a mounting unit and a motor unit. A controller was connected to the motor and could be placed on the handlebar. The controller both enabled control and monitoring of the power given to the motor.

The prototype’s durability, potential velocity and control system were tested to answer the research questions and give recommendation to further developments of the project.

No major malfunctions were found in the construction af- ter testing. For a voltage of 12V and a payload of 22kg, the bicycle obtained a top speed about 3m/s. The control system gave a smooth transition between velocities with hardly any noise to the signals.

(6)

Referat

VelOn - Den avtagbara elcykelmotorn

Nyckelord: Mekatronik, Personliga transportmedel, Elcy- kel, H˚allbarhet.

Den elektriska cykeln har under ˚aren blivit ett popul¨art transportmedel. Denna rapport kommer att unders¨oka huruvi- da det ¨ar rimligt att uppgradera traditionella cyklar till el- cyklar. Ist¨allet f¨or att nyproducera elcykelramar kan redan befintliga cyklar anv¨andas.

En prototyp av en monterbar och avtagbar cykelmotor bygg- des. Prototypen bestod av tv˚a enheter, en inf¨astningsenhet och en motorenhet. Motorenheten var kopplad till ett kon- trollsystem som gick att f¨asta p˚a styret. Via kontrollsyste- met kunde man b˚ade kontrollera och ¨overvaka effekten fr˚an motorn.

Prototypens t˚alighet, potentiella hastighet och kontrollsy- stem testades f¨or att besvara forskningsfr˚agorna och l¨agga en grund f¨or vidareutveckling av konceptet.

Det hittades inga allvarliga brister eller skador av konstruk- tionen efter testerna. Vid en motorsp¨anning p˚a 12V och en last p˚a 22kg s˚a n˚addes en maxhastighet p˚a lite ¨over 3m/s.

Kontrollsystemet gav en j¨amn ¨overg˚ang mellan de olika has- tigheterna, utan p˚averkande brus i signalerna.

(7)

Acknowledgements

For starters, we would like to thank the course responsible and examiner, Nihad Subasic, for his inspiring lectures, introducing the subject of mechatronics as well as offering his guidance throughout this period. Secondly, we would like to thank Staffan Qvarnstr¨om and Tomas ¨Ostberg for providing us with the material, knowl- edge and support required to complete this project. Another sign of gratitude goes to Maskineriet at the Royal Institute of Technology for the help with manufacturing mechanical parts. A final gratitude is directed to the talented teachers assistants Sresht Iyer and Seshagopalan Thorapalli Muralidharan for their recommendations and consultations throughout the project.

Filip Elander and Cecilia R¨onnberg

Stockholm, May 2019

(8)

Contents

List of Abbreviations and Acronyms

1 Introduction 1

1.1 Background . . . . 1

1.2 Purpose . . . . 2

1.3 Scope . . . . 2

1.4 Method . . . . 3

2 Theory 5

2.1 Environmental Analysis of Electrical Bicycle . . . . 5

2.1.1 Production Process . . . . 5

2.1.2 User Phase . . . . 7

2.1.3 Disposal Process . . . . 7

2.2 Mechanical and Component Analysis . . . . 8

2.2.1 Mechanics of a Bicycle . . . . 8

2.2.2 Schematic Overview . . . 10

2.2.3 Arduino . . . 11

2.2.4 Brushed DC-motor . . . 11

2.2.5 Transistor . . . 13

2.2.6 PWM - Pulse With Modulation . . . 14

2.3 Construction and Motor Analysis . . . 15

2.3.1 Construction . . . 15

2.4 Unknown motor . . . 15

2.4.1 Transmission . . . 16

3 Demonstrator 19

3.1 Concept design . . . 19

3.2 Electronics . . . 19

3.3 Hardware . . . 21

3.4 Software . . . 21

4 Testing 23

4.1 Prototype . . . 23

4.2 Control system . . . 23

(9)

4.3 Power supply . . . 24

5 Results 25

5.1 Construction . . . 25

5.2 Environmental Analysis of Electrical Bicycle . . . 27

5.3 Testing results . . . 28

5.3.1 Prototype . . . 28

5.3.2 Control system . . . 28

5.3.3 Power supply . . . 28

6 Discussion and conclusion 31

6.1 Discussion . . . 31

6.1.1 Environmental analysis of electrical bicycle . . . 31

6.1.2 Construction . . . 32

6.1.3 Testing . . . 32

6.2 Conclusion . . . 32

7 Possible improvements 33

7.1 Construction design . . . 33

7.2 Material . . . 33

7.3 Concept . . . 34

Bibliography 35

Appendices 36

A Arduino code for programming of motor 37

B Code in Matlab for interpolating and plotting how the velocity

changes with the voltage 43

C Code for calculating the acting forces 45

(10)

List of Figures

2.1 Flowchart of the production process of a vehicle made in draw.io. . . . . 5 2.2 Material inventory, emissions and energy use of electrical bicycle and

regular bicycle compiled in Microsoft Excel. . . . 6 2.3 Illustration of acting forces, made in Microsoft Power Point version 16.24. 8 2.4 The graph shows how the sum of all acting forces increases with the

velocity, graph made in Matlab. . . 10 2.5 The graph shows how the power needed for acceleration increases with

the velocity, graph made in Matlab. . . 10 2.6 The picture illustrates a schematic overview of the in-going components,

made in Microsoft Power Point version 16.24. . . 11 2.7 The picture illustrates how the rotor will rotate to align the opposite

poles [7]. . . 12 2.8 Illustration of DC motor and its basic components [8]. . . 13 2.9 An electric schematic of the MOSFET transistor [12] . . . 14 2.10 The picture illustrates how a pulse from controller results in a equal

pulse of current to the motor, made in Microsoft Power Point version 16.24. . . 14 2.11 A photo of the first prototype . . . 15 2.12 An electric schematic of the DC-motor [10]. . . 16 2.13 Transmission schematics made in Microsoft Power Point version 16.24. . 17 3.1 The mounting unit and mobile motor, made in Solid Edge ST9 and

rendered in KeyShot 6 64. . . 19 3.2 An illustration of the electrical circuit constructed in Fritzing. . . 20 3.3 The hardware components assembled together created in Solid Edge ST9

and rendered in KeyShot 6 64. . . 21 3.4 Flowchart of the motors main logic. Made with draw.io. . . 22 5.1 The electric bicycle motor mounted on a bicycle. . . 25 5.2 The mounting of the motor frame. Made in Solid Edge ST9 and rendered

in KeyShot 6 64. . . 26 5.3 The different steps to attach the motor to the mounting unit. Made in

Solid Edge ST9 and rendered in KeyShot 6 64. . . 26

(11)

5.4 A simplified life cycle process for the regular bicycle with electric motor.

Made in Microsoft Power Point version 16.25. . . 27 5.5 A plot and linear interpolation of the velocities received from different

voltages. Made in Matlab. . . 29

(12)

List of Tables

5.1 The resulted velocities from the testing of different voltages and their

average. . . 28

(13)

List of Abbreviations and Acronyms

DC - Direct Current EMF - Electromotive Force

ICSP - In Circuit Serial Programming IDE - Integrated Development Environment ITM - Industrial Technology and Management KTH - Royal Institute of Technology

LED - Light-Emitting Diode

MOSFET - Metal Oxide Semiconductor Field Effect Transistor PLA - Polyactic Acid Plastic

PWM - Pulse Width Modulation

(14)
(15)

Chapter 1

Introduction

The electrical bike has come to be a popular means of transportation all around the world. The majority of them are constructed with an integrated electrical motor.

By separating the bicycle’s construction from the motors, their life cycles will also become separated. This enables the opportunity to easily replace broken motors on fully functioning bikes as well as upgrading an existing bicycle to an electrical vehicle. Another positive effect is allowing electrical motors to be shared within groups.

The purpose of this project is to understand how it could be possible to create a user-friendly motor attachment, that is easy to mount and dismount. The report will also investigate the environmental impact of separating the motors and bicycles life cycles.

1.1 Background

Cities are experiencing a growing demand for electric vehicles. Due to strict emis- sion policies many of our older ways of commuting are being redesigned.

One of our oldest means of transportation, the bike, has recently received an up- grade. Today, the market offers a variation of electrical bikes. The construction and functioning varies but most of them are newly produced bicycles with a built in electric motor integrated in the construction of the bicycle.

The strive for a more environmentally friendly future motivated research on how it could be possible to create a motor-system that easily could be applied on old bicycles to achieve the benefits of a newly produced electrical bike.

Mountable motors designed for ordinary bicycles does already exist, however, most

of them are not (to us) user friendly since they require a complicated assembly.

(16)

CHAPTER 1. INTRODUCTION

The idea is that it should be easy to attach an electric motor on an already ex- isting bike and also be able to quickly remove it when not needed. This type of design enables the motor to be shared amongst a larger group of users and have less of an impact on the environment.

1.2 Purpose

The purpose of the project is to create a user friendly product that upgrades an already existing bicycle to an electric vehicle rather tan producing an entirely new electric bike. The solution focuses on a environmentally friendly motor-system being attachable and detachable. The thesis will also consist of researching the following questions:

1. How can a mountable electric motor be constructed?

2. In what way could the separation of the motor-system in electrical bikes effect the environment, considering manufacturing, usage and disposal?

3. What are the advantages and disadvantages of a non-integrated motor?

1.3 Scope

This study of bachelor is executed at the Royal Institute of Technology (KTH) in Stockholm at the school of Industrial Technology and Management (ITM) with spe- cialization in mechatronics. It spans over one semester and consists of producing a final prototype, report and a video presentation of the investigated area (15 credits).

Due to the time frame and limited resources some limitations have been formu- lated

• The prototype will focus on managing the payload of the bikes and motors own weight.

• The implementation of required motor effect and battery characteristics will be reduced due to resources.

• No large scale user-research will be executed due to to time limitation.

• All electrical components will be bought and used with little to no modifica- tion.

• The thesis will not focus on vehicle dynamics or wind resistance since it is not meant to be an high-performing vehicle.

2

(17)

1.4. METHOD

• The control-system will only focus on managing the velocity.

• Materials able to handle long time usage and high performance will not be used.

1.4 Method

To answer the questions in the thesis, the project was divided into three blocks.

Firstly, scientific reports were studied in order to gain theoretical knowledge in the fields of electrical bikes and its manufacturing. Reports were found by searching through recommended databases to ensure reliable sources.

Secondly, a first prototype was produced. Software were developed and faults with the main mechanics were detected and before manufacturing a final prototype.

Lastly, the final prototype was designed. This was made primarily in the mod-

eling program Solid Edge ST9. The prototype lab at KTH was used to produce

some of the components. Tests were conducted and evaluated to answer the ques-

tions in the thesis.

(18)
(19)

Chapter 2

Theory

This chapter contains the theory needed to answer the formulated thesis questions.

2.1 Environmental Analysis of Electrical Bicycle

The environmental impact of a transportation vehicle can be divided into three dif- ferent categories. Production, user phase and disposal. A brief review of the stages and their environmental impacts are presented below.

2.1.1 Production Process

The production phase contains different stages of finalizing a model. These are presented in Figure 2.1 and are both compatible to the production of the electric bicycle and the regular bicycle [1].

Figure 2.1. Flowchart of the production process of a vehicle made in draw.io.

To evaluate the environmental impact of just manufacturing the electrical motor

and not the bicycle, compared to manufacture them both, the difference in material

used were analyzed. The difference in weight of an electrical and normal bicycle

(20)

CHAPTER 2. THEORY

made out of the same frame gave the weight of the electrical parts. This gave a maximum limit of weight when designing the detachable motor. Staying under this limit would ensure that the combined weight of the mountable motor and bicycle would not surpass the weight of an average electrical bicycle. With the weight of the mountable motor, the excess material of manufacturing the electrical bike could be simplified to the difference in their weights.

From the weight of the electrical parts in an electrical bike, it is possible to an- alyze the energy used and emissions from all of the production stages. From that, it is possible to estimate both the frame and electrical part’s contribution to the sum of used energy and the potential emissions from the manufacturing of an electrical bike.

In a study made by Cherry, Weinert and Xinmiao from 2009, an assessment of the environmental impact of electrical bicycle’s together with other vehicles was compiled. It is noticeable that several assumptions and omissions were made while constructing it. The values should as well be considered lower bound due to the omitting of several components in the life cycle [1]. This can be found in Figure 2.2, where the material inventory, emissions and energy use of the production of both electrical bicycles and regular bicycles is presented and compared.

Figure 2.2. Material inventory, emissions and energy use of electrical bicycle and regular bicycle compiled in Microsoft Excel.

6

(21)

2.1. ENVIRONMENTAL ANALYSIS OF ELECTRICAL BICYCLE

The selection of battery also has a big impact when estimating the environmen- tal impact from the production. From a study published in 2013, 95% of the electric bicycles in China used lead-acid batteries [3]. Other possible choices of battery are Lithium Ion (Li-ion) and Nickel Metal Hydride (NiMH) [1]. Lithium Ion batteries are considered the most environmentally friendly option [3].

2.1.2 User Phase

During the user phase, the biggest difference between the electric bicycle and the regular bicycle is the mountable motors simplification to choose origin of the op- erating energy by enabling the user to detach the motor and bring it to desired power outlet. The electric power can be extracted from a standard electrical wall outlet [1]. No exact figures on how it effects the environment were found since it differs depending on where the electricity originates. According to Li, Qian and Su, an electrical bicycle that consumes 1935 kWh has a total energy consumption, in usage, of 32,044,050 kilo Joule [4].

Another positive aspect is that the electrical bicycle, as a vehicle, has the capa- bility to be charged during the night where the request for energy is at its lowest.

This implies that the electric bike has the ability to use that energy during the day, which otherwise would not have been utilized [1]. Other vehicles, that for instance operates on fuel, do not have the same benefit, as the energy they use have to be extracted while the vehicle is being used.

The traditional bike’s energy consumption comes from the rider’s calorie intake.

This is something that is hard to measure since the origin and its environmental impact often is unknown [1].

During the user phase repairing and service are included. According to an on- line survey presented by MacArthur, Dill and Person, 49% of the electric bicycle owners indicated that their bike had to be serviced as frequently as a standard bike while 27% felt they had to repair it more frequently [5].

2.1.3 Disposal Process

The disposal phase for bicycles was hard to evaluate due to lack of information on the used methods [1]. Although, some valuable information of the stage was found.

The recycling of an electrical bicycle is divided into two stages, the recycling of

the bicycle body and the recycling of the attached battery. The body is processed

in the same way as for ordinary waste and can thereby be considered to be recycled

in the same way as a regular bicycle would [4].

(22)

CHAPTER 2. THEORY

In the disposal phase, one major environmental difference between the electrical bicycle and regular bicycle is the demolition or recycling of the lead batteries where it occurs on the electrical one and not the other [4].

2.2 Mechanical and Component Analysis

2.2.1 Mechanics of a Bicycle

A mechanical analysis of the acting forces was constructed to gain a better under- standing of how to design an effective motor-system for a bicycle.

The forces acting on the bicycle were approximated to; wind resistance, gravity and the rolling resistance. A graphical overview of how the forces are applied to the bicycle can be seen in Figure 2.3. The motor has to overcome the sum of these forces to accelerate the bike. Wind resistance varies with the physical shape of the bicyclist, but here the shape was simplified and standardized for easier calculation.

The influence of gravity was simplified to be the force of the bicyclist weight plus the weight of the bike pulling the bicycle backwards in an inclination, thus, a maximum weight of the rider was set to simplify the calculations. Rolling resistance would be the dragging force of friction between the bikes tires and the ground. To make the calculations easier it was set to an average value of friction between rubber and concrete.

Figure 2.3. Illustration of acting forces, made in Microsoft Power Point version 16.24.

The modulation of the problem was approximated with

F

tot

= (F

roll

+ F

wind

+ F

slope

)n (2.1)

8

(23)

2.2. MECHANICAL AND COMPONENT ANALYSIS

where n is for what efficiency the power from the motor will be transmitted to the driving force, F

roll

is the rolling force caused by friction. F

wind

is air resistance and F

slope

is the force caused by gravity when riding in an inclination. All these factors together will be the force the motor has to overcome F

tot

to make the bicycle accelerate.

The mechanical model was simplified to the level that it would be easy to cal- culate but still valid enough to use. The motor efficiency n was set to 1, thus discarding the motor losses. The slope was set to zero degrees, hence F

slope

equal to zero, making the model only suited for flat surface calculations. This gave the final model:

F

tot

= F

roll

+ F

wind

(2.2)

The total rolling forces for both tiers were approximated with the formula

F

roll

= µmg (2.3)

where µ was the estimated friction coefficient between concrete and rubber, m was the total mass of the bicyclist plus bike and g was the gravitational acceleration.

Meanwhile, the wind resistance was a bit more complicated to calculate, and a few more simplifications had to be made. The calculation did not take the natu- rally occurring wind into account, since neglecting of the natural breeze would make the wind velocity equal to the velocity of the bike. The shape and size of the rider was also approximated to an average value. With these simplifications made, the wind resistance could be calculated using the formula

F

wind

= ρµ

w

2wind

(2.4)

where ρ was the air density, µ

w

A was the shapes drag coefficient and its area, υ

wind

was the wind velocity.

The maximum payload was set to 100 kilograms (bicycle included). Using the max-

imum load, the total force F

tot

was calculated for an accelerating velocity. When

the needed force was calculated, the power for different velocities could be plotted

and can be seen in Figure 2.4 and Figure 2.5. The data and the graphs were later to

be used as support when designing motor and battery effect for the electric bike. As

seen, the needed force and power would increase exponentially with a rising velocity.

(24)

CHAPTER 2. THEORY

Figure 2.4. The graph shows how the sum of all acting forces increases with the velocity, graph made in Matlab.

Figure 2.5. The graph shows how the power needed for acceleration increases with the velocity, graph made in Matlab.

2.2.2 Schematic Overview

The construction of the project started with a schematic of the electrical compo- nents. Since the aim only was to create a conceptually working, lightweight and portable prototype, the simplest driving solution was desired. A brushed Direct Current (DC) motor was chosen. Since it was only intended for the bicycle to go in one direction, there was no need for electrical currents in two directions, which enabled the motor to be controlled with only a transistor.

10

(25)

2.2. MECHANICAL AND COMPONENT ANALYSIS

Batteries were the natural choice of power since they are portable, relatively light in weight and emits a direct current. The transistor was controlled with an Arduino microcontroller, and a potentiometer was placed on the handle of the bicycle, al- lowing the rider control the power to the motor. An illustration of the schematic is found in Figure 2.6.

Figure 2.6. The picture illustrates a schematic overview of the in-going components, made in Microsoft Power Point version 16.24.

2.2.3 Arduino

For this project the Arduino Uno was chosen as the controller. Arduino Uno is a board base that uses the microcontroller ATmega328P. The board has a USB connection to upload code and/or power the Arduino. The Arduino is powered by connecting it to a computer through USB or a AC-to-DC adapter. It will also work by connecting it to batteries. The board holds 14 digital pins that can be set to input or output. Six of these pins are capable of delivering Pulse Width Modulation (PWM) as an output and six pins are able to read analog inputs. There are different ways of programming the Arduino. One can either use its own software Integrated Development Environment (IDE) which is easily downloaded from their web page or the In Circuit Serial Programming (ICSP) [6].

2.2.4 Brushed DC-motor

The Brushed DC motor is one of simplest and most user friendly motors [7]. From

now on the brushed DC motor will be referred to as ”the motor”.

(26)

CHAPTER 2. THEORY

The motor contains two elements, a magnetic field and a conductor carrying cur- rent [7]. By simplification of the motor, the construction could be explained as two parts. The embracing case called the ”Stator” provides a constant magnetic field, and inside this case there is a rotating body called the ”Rotor”, which basically is a simple coil conducting a current. The rotating Rotor is arranged so that it will act like an electrical magnet when connected to a power source. When electricity is flowing through the Rotor (the coil) it will naturally pull its southern magnetic pole towards the Stators northern magnetic pole simultaneously as it will push its northern magnetic pole away from the Stators northern magnetic pole. This will make the rotor rotate towards the position where the southern and northern poles are aligned [7]. This is shown in Figure 2.7.

Figure 2.7. The picture illustrates how the rotor will rotate to align the opposite poles [7].

In the last sequence the wiring in the Armature is vertically aligned with the poles, and the magnetic force drops to zero while the rotations stops. To prevent this from occurring, metal contacts are connected to the armature that will reverse the current every half revolution. This is a mechanical solution to make sure that the forces rotating the armature never drops to zero [7]. Since the torque action would drop when the coil is nearly perpendicular to the magnetic flux, the resulting rota- tion would be irregular. To overcome this, extra coils with a separate commutator is added which will activate when other coils are near alignment. The more coils the smoother revolution. An illustration of the DC motor and its basic components is presented in Figure 2.8.

12

(27)

2.2. MECHANICAL AND COMPONENT ANALYSIS

Figure 2.8. Illustration of DC motor and its basic components [8].

2.2.5 Transistor

Since the brushed DC motor does not have an embedded control system, a power regulator was needed. One solution was to regulate the battery power given to the motor. This, however, is a complex and complicated construction. The easiest way of controlling a brushed DC motor is simply by giving full battery power but for shorter periods of time. A transistor can be described as an ideal electrical power shift that will switch the circuits on and off for different time periods. Even though there is no such thing as ideal switches, the transistor is often regarded as one [7].

A transistor contains three different terminals, the gate, the Drain and the source

[7]. In Figure 2.9, an illustration of the transistor is shown. In this case, the gate

will receive a low voltage from the Arduino. When gate source voltage from the

controller is reached the resistance in the transistor will be close to zero, letting

a current flow through the transistor between the Drain and source. When the

voltage from the controller to the gate is lower than the gate source a resistance

will occur in the transistor and when the gate voltage is close to zero the resistance

will be infinite [8]. In this way the transistor is enabling a low voltage controller to

regulate a high voltage current without letting the high voltage pass through the

controller.

(28)

CHAPTER 2. THEORY

Figure 2.9. An electric schematic of the MOSFET transistor [12] .

2.2.6 PWM - Pulse With Modulation

The motor is governed by sending various pulses t the transistor which opens and closes the gate. This way of delivering pulses is referred to as Pulse Width Mod- ulation or PWM. By sending pulses opening and closing the transistors’ gate, the transistor will then bypass the same pulses of battery power to the motor. Wide pulses will give more current to the motor and shorter pulses will give less current.

The square pulses are sent from the controller in different periods denoted T. A period is the time between the starting points of two pulses which is determined by the frequency. The pulse width is the time that the pulse is high, pulse width is denoted t. The wider the pulse width the more power it is given each period.

There is no exact science behind determining the frequency but there are some rule of thumb. Often the frequency is a result of trial and error [7]. In Figure 2.10, an illustration of how a pulse from controller affects the pulse of current to the motor is shown.

Figure 2.10. The picture illustrates how a pulse from controller results in a equal pulse of current to the motor, made in Microsoft Power Point version 16.24.

14

(29)

2.3. CONSTRUCTION AND MOTOR ANALYSIS

2.3 Construction and Motor Analysis

2.3.1 Construction

A first model of the concept was built out of wood and temporary electrical cir- cuits, see Figure 2.11. The weaknesses and strengths of the model was analyzed and problems that was hard to see digitally was found. The physical model was critical for designing the final construction and optimizing the concept.

Figure 2.11. A photo of the first prototype

2.4 Unknown motor

The data sheet for the available motor was missing. Therefore the unknown motor constant K and inner resistance R

A

were obtained by experiment. For DC-motors, the torque constant K

E

and the voltage constant K

V

is considered the same constant K when using SI units [10].

K = U

A

0

(2.5)

U

A

is the supplied voltage and ω

0

is the no-load speed [10]. The inner resistance was calculated by holding the motor’s axis fixed and measuring the Voltage U

stall

and current I

stall

. Using Ohm’s law the resistance R was calculated [11].

R = U

stall

/I

stall

(2.6)

The motor constant K and the inner resistance R are often used together with

EMK E, motor current I

A

, torque τ, motor voltage U

A

and motor speed ω in three

common equations for different motor calculations [10], see Figure 2.12.

(30)

CHAPTER 2. THEORY

U

A

= RI

A

+ E (2.7)

E = Kω (2.8)

τ = KI

A

(2.9)

Figure 2.12. An electric schematic of the DC-motor [10].

2.4.1 Transmission

For velocities over 6m/s, the required torque estimated in Figure 2.4, was about 47 times larger (depending on the wheel radius) than the motor’s nominal torque.

This required a gear reduction of 47:1.

By combining the equations (2.7), (2.8) and (2.9), the theoretical motor speed before gear reduction was approximated.

ω = U

A

/K − Rτ /K

2

(2.10)

The gear reduction would lead to approximately half of the desired velocity if not to exceed the motor’s nominal power. The fact that the acting forces would have dropped with the velocity was known but not taken into account.

A conceptual gear was developed to analyze how a non-integrated motor transmis- sion could be designed. To enable a portable motor, the transmission was divided into an inner and an outer step. For the inner transmission, a system of pulleys and driving belt was chosen. For the outer transmission, from the motor to the bicycle’s tire, a frictional system was selected.

The inner gear reduction could be calculated with the pulleys’ teeth numbers Z

m

and Z

d

, the outer gear reduction could be calculated with the driving wheel’s and tier’s diameter d

d

and D

w

. The total gear reduction i

tot

would be the product of the two [9].

i

tot

= i

inner

i

outer

= (Z

d

/Z

m

)(D

w

/d

d

) (2.11)

16

(31)

2.4. UNKNOWN MOTOR

For the frictional transmission to work efficiently and not slip, the frictional torque between the driving wheel and the bicycle’s wheel had to be greater than the driving torque.

M

d

< M

f ric

⇒ M

d

< (d

d

/ 2)Nµ

s

(2.12) The frictional torque could be calculated with the radius d

d

/ 2 from the driving wheel, normal force between the wheels N and the static friction coefficient µ

s

be- tween the driving wheel and the tire. Rearranging the equation 2.12, the minimum force N

min

between the driving wheel and tire could be calculated.

N

min

> 2M

d

/ (d

d

µ

s

) (2.13)

Figure 2.13. Transmission schematics made in Microsoft Power Point version 16.24.

(32)
(33)

Chapter 3

Demonstrator

3.1 Concept design

To meet the desire of an user-friendly and flexible device, the construction was divided into two units. One unit is fixated on the bicycle, managing the universal size settings for a specific bike. That unit has the possibility to be attached and detached in a few simple steps. Having a separate unit controlling the size settings enables the motor to be universal in a sense that it could be mounted to a range of different bicycle frames. The other unit is the assembled motor, containing all the technology and mechanics. This enables, for example, an easier dismounting of the motor unit for charging. Both of them are presented in Figure 3.1 below.

Figure 3.1. The mounting unit and mobile motor, made in Solid Edge ST9 and rendered in KeyShot 6 64.

3.2 Electronics

The circuit was divided into two parts, one for the user interaction and one for the

motor/power management. The user interaction contained the soldered board for

the Light-Emitting Diode-display (LED) and the potentiometer. The potentiome-

ter enables the user to give an input power signal. A LD-425 SYGWA/S530-E2 -

(34)

CHAPTER 3. DEMONSTRATOR

7-segments LED-display was used together with a 470 kOhm carbon potentiome- ter. This board was placed in a module on the handle of the bike and connected to the Arduino through wires. The seven segments in the LED was individually connected to one of the digital ports in the Arduino that gave a current to light up the segment when needed. The two different chatodes of the display was also individually connected to a resistance and a digital port in the Arduino that could control which segment to be activated. What segments that would be activated was determined from the signal of the potentiometer. The display showed low, neutral or high, depending on how much power was given to the motor. The potentiometer was connected to a analog port, 5 volt and ground. This setup gave the Arduino the different references.

The motors power management was soldered on a board and mounted on the frame- work of the motor unit. This board had a n-channel BUZ 342 MOSFET transistor connected through the drain and source to the negative poles of the motor and power supply. A connection from the gate to the Arduinos digital pin delivered a PWM. Three 5W 39V 500nA Surmetic 4 Semiconductor Zener diodes were soldered parallel to the motor, creating a passage for the throwback current. The power was supplied by two 6V, 4Ah batteries, model NP4-6 Valve Regulated Lead Acid from YUASA. The batteries were connected in series giving an total voltage of 12 Volts.

The motor available for the project was an Exmek electric brushless DC motor with nominal voltage 24V , torque 0.29Nm and angular velocity 3000 rpm. The diagram of the components is presented in Figure 3.2.

Figure 3.2. An illustration of the electrical circuit constructed in Fritzing.

20

(35)

3.3. HARDWARE

3.3 Hardware

The mechanics of the motor consisted of an XL 3/8” 381mm driving belt, two 3D printed pulleys in Polylactic Acid plastic (PLA), a 3D printed driving wheel in PolyFlex plastic, an aluminum axis and two stainless steel deep groove ball bearings from Svenska Kullagerfabriken (SKF). The driving belt and the ball bearings were purchased whilst the other parts were constructed at KTH.

The power from the motor was transferred to the pulley riding the motor axis that through the driving belt could drive the pulley mounted on the driving axis.

The driving wheel would transfer the drive through friction to the front wheel of the bicycle. The driving axis was riding on two ball bearings mounted in the framework.

The different connections between these components are illustrated in Figure 3.3

Figure 3.3. The hardware components assembled together created in Solid Edge ST9 and rendered in KeyShot 6 64.

3.4 Software

The program written was responsible for controlling in-going power reference from the potentiometer, controlling the 7-segment display and monitoring the outgoing power from the batteries to the motor.

The code creates an endless loop that started by asking for the power-reference.

The potentiometer would give a reference value between 0 and 1023 depending on

the angle of the potentiometer. Since the outgoing PWM-pin from the Arduino only

could give values between 0 and 255, the value from the potentiometer was divided

(36)

CHAPTER 3. DEMONSTRATOR

by four to be converted to fit the outgoing value-span and sent as an outgoing signal to the transistor. The function controlling the LED-display had two inner functions and six different cases depending what digit and which segments that needed to be displayed. The program read and lit the two digits separate and held them lit for 5 milliseconds each before restarting the loop. The human eye is to slow to recognize 5 milliseconds difference so it gave the illusion of them both being lit at the same time.

A flowchart was created for the main program in the loop to illustrate the pro- cess of the program. This can be seen in Figure 3.4

Figure 3.4. Flowchart of the motors main logic. Made with draw.io.

22

(37)

Chapter 4

Testing

Tests were made to answer the questions in the thesis on how a mountable mo- tor could be constructed and to evaluate the advantages and disadvantages of the concept.

4.1 Prototype

The mass of the motor and the total payload of the motor plus bicycle was mea- sured directly on a conventional household scale. The total payload was measured by holding the bike standing on a scale and later subtracting the weight of the person holding the bicycle.

The durability and strength of the construction were tested by simulating how a usage of the motor might work. The mounting part was attached to a bicycle, in this case a mini-bicycle. Using the joints on the mounting-unit, all the necessary settings were made before attaching the motor. The batteries had been charged separately from the mounting gear, simulating real usage. The motor was given a payload of 108kg, its own weight included. The motor was supporting the rider pedaling at an average of 3m/s for 5 minutes. The overall experience of the ride was then evaluated and the construction was checked for malfunctions.

4.2 Control system

The bicycle was mounted on a rig, elevating the front tire a few centimeters above

the ground. The velocity was increased to maximum speed and then decreased until

the tire came to a stand. The signals from the controller was logged for five different

periods by a computer, connected to the Arduino. The logged values was plotted

in Matlab to analyze how smoothly they were changing.

(38)

CHAPTER 4. TESTING

4.3 Power supply

The corollary of the power supply and speed were tested by measuring how the ve- locity varied with different voltages supplied by the batteries. The motor was feed with four different voltages between zero and twelve Volt. The different voltages were set by the potentiometer and measured with a multimeter, reading the voltage over the motor. Support wheels were placed on the rear wheel while steering the front wheel straight manually. For the different voltages, the bicycle was accelerated up to its max velocity and timed by hand driving ten meters. The total weight of the payload was 22kg including the motor.

The tests were carried out outside on a parking lot to enable the necessary dis- tance for the bike to accelerate. This minimizes the error of not reaching top speed and also allowing a greater distance to be timed.

24

(39)

Chapter 5

Results

The received results from the theory and testing are presented below. Gathered and compiled to answer the problem formulations in the thesis.

5.1 Construction

The final construction resulted in a prototype mounted on a bicycle seen in Figure 5.1.

Figure 5.1. The electric bicycle motor mounted on a bicycle.

(40)

CHAPTER 5. RESULTS

The joints placed furthest out on the mounting-arms fixates the mounting unit to the frame of the bicycle. This, by sliding two locking blocks on each fork of the front wheel and securing them. The joints connecting the mounting-arms to the cradle is loosened and tightened to give the desired angle for the motor. The mounting is described in Figure 5.2. Step 1 implies the sliding of the locking blocks and step 2, the securing of them.

Figure 5.2. The mounting of the motor frame. Made in Solid Edge ST9 and rendered in KeyShot 6 64.

To describe the mounting process of the motor unit, a simple instruction is pre- sented in Figure 5.3. Step 1 indicates that one should lower the module in the slots over the axis of the structure to later in step 2, push into place in a forward motion.

In step 3, the motor is lowered towards the frame until the drive wheel and the bicycle wheel are pressed against each other so that in step 4, the motor unit can be locked.

Figure 5.3. The different steps to attach the motor to the mounting unit. Made in Solid Edge ST9 and rendered in KeyShot 6 64.

26

(41)

5.2. ENVIRONMENTAL ANALYSIS OF ELECTRICAL BICYCLE

The final weight of the motor unit resulted in roughly 4 kilograms and the obtained volume is approximated to 21 cubic centimeters.

5.2 Environmental Analysis of Electrical Bicycle

To receive a more simplified picture of how the environmental impacts compare to each other a simple life cycle illustration was created based on the theory gathered, see Figure 5.4.

Figure 5.4. A simplified life cycle process for the regular bicycle with electric motor.

Made in Microsoft Power Point version 16.25.

From Figure 2.2, the environmental and material costs of the productions are re-

ceived. The profit of producing a bike instead of an electrical bicycle differs from

14 to 26 percent. The result is that you could earn up to 86 percent of this if you

buy an engine that can be applied to an already produced bike. This, assuming

it cost as much to produce the electric part in the electric bicycle as the separate

electric-bike engine.

(42)

CHAPTER 5. RESULTS

5.3 Testing results

5.3.1 Prototype

The durability and strength test showed that the prototype was able to deliver help to the paddling rider. The ride was smooth and gave notable aid to the rider. If the driver stopped paddling the driving belt would start to slip in its pulleys and the motor would stop providing help to the rider. Small malfunctions were found after the ride. Some nuts had started to loosen up due to vibrations, however not enough to detach the motor from its place in the cradle.

5.3.2 Control system

The signals from the control-system to the Arduino were mostly continuously with almost no noise or and fluctuating values at all. The smoothness of the tires ac- celeration was a seemingly correlated with the continuity of the values from the potentiometer.

5.3.3 Power supply

The table 5.1 shows the final results of the different measurements received from the testing of the bike’s velocity at different voltages.

A linear interpolation provided the best result when fitting the curve to the values,

Voltage

Try 1 [m/s] Try 2 [m/s] Try 3 [m/s]

Average [m/s]

5

1,28 1,49 1,26

1,34

7

1,82 1,79 1,78

1,80

9

2,43 2,15 2,37

2,31

12

2,94 3,02 2,70

2,88

Table 5.1. The resulted velocities from the testing of different voltages and their average.

showing a indication that the received velocity seems to have a linear correlation with the given voltage from the power supply. See Figure 5.5.

28

(43)

5.3. TESTING RESULTS

Figure 5.5. A plot and linear interpolation of the velocities received from different voltages. Made in Matlab.

(44)
(45)

Chapter 6

Discussion and conclusion

This chapter is dedicated to conclude and discuss the collected information and received data.

6.1 Discussion

6.1.1 Environmental analysis of electrical bicycle

From the received information gathered in section 2.1, one can examine the outcome of the concept and how it compares to the electrical bike.

The extraction and processing are arguably the most contaminating steps in the production chain. If the need to produce a new frame for the electrical bicycle is reduced, less materials are extracted in the process. Thereby, some energy and emissions can be strangled.

Depending on whether the components are, for example, locally produced or if they are produced in a far away country with long transport distance, the environ- mental impact will differ as well. One can thereby argue that it would be more environmentally friendly with the electric motor when it weighs less and occupies a smaller volume than an electric bicycle. This would reduce the emissions that occur during transport of the appliances.

It might also be easier to service the motor alone instead of an entire bicycle. So

if the motor stops working, they will not loose the entire vehicle but will only be

without the motor for as long as it need repairing. This enables the user to continue

bicycling during this period.

(46)

CHAPTER 6. DISCUSSION AND CONCLUSION

6.1.2 Construction

This construction is one of many possible compositions and is by no mean the only plausible. The advantage of the design is that by separating the mountable unit and the motor unit, the motor unit will be easier to carry to the charging station.

The risk of the motor being stolen while not supervised is reduced if the motor easily could stored away after the ride. The disadvantages is that it makes it a little less user-friendly to have more than one unit, it also makes it more vulnerable for damages and malfunctions when there are more parts.

Since the motor was able to give aid to the rider even if the power supply was undersized considering the payload, it could be plausible that an adequate power supply would be able to give enough drive to carry a driver even when not paddling.

The fact that the driving wheel did not slip on any of the tests shows great promise for the concept. The reason why the slip occurred between the driving belt and the pulleys could be explained by the choice of using PLA plastic, making them the weakest link in the power supply chain.

Slip and damages between the tire and driving wheel is one if the biggest dis- advantages of the concept. Mounting the motor on the wheel was found to be the simplest solution of external drive but another solution could be by applying drive to the bikes gear on the rear tire or directly to the paddles. This would probably be harder to solve while still keeping the motor removable and user-friendly. A problem with mounting a motor to the front tire is the mobility of the bike. During the tests, it showed that the bike was harder to control with the weight on top of the front tire. For this concept to become reality, the weight of the motor should be decreased.

6.1.3 Testing

All the measurements made for calculating the maximum velocity were made by hand and have therefore a large margin of error. The tests were also carried out in an uncontrolled environment. This enabled wind and slight slopes to interfere with the results. The linearity between applied voltage and motor speed can also be seen in equation (2.10), for a constant torque. The linearity in the testing shows that the wind resistance did not have that big of an effect on the riderless bike.

6.2 Conclusion

Creating a user-friendly and mountable electrical motor for bicycles that also could have the chance to be environmentally beneficial is to us plausible. This solution is by no mean the only possible or perhaps the best, but works as a conceptual solution. This thesis could hopefully be an inspiration for further investigation.

32

(47)

Chapter 7

Possible improvements

The primary goal of this project was to prove that the concept is applicable in real life. Therefore, possible improvements can be applied to further perfect the concept as a whole. Since this project only was a prof of concept there are a lot of improvements to be made, most noticeable in construction design, material and concept.

7.1 Construction design

The main attachment for the motor-unit is functioning but heavily restricted by the size of the motor and batteries. With a greater budget it would be possible to get an equivalent or stronger motor in a smaller size. To minimize the size and weight of the motor-unit, smaller and lighter batteries could be chosen. It could also be possible to attach the driving wheel directly on the motor axis instead of using a driving belt and pulleys. This would also reduce the loss of efficiency created in the driving belt system.

The design of the mounting devices proves the point of the thesis but could be much more user-friendly with better manufacturing alternatives. In the prototype, all the adjustable joints consists of nuts and bolts which could be exchanged for more user friendly buckles, tightened by hand instead of using tools.

7.2 Material

The construction was created by primarily combining PLA-prints and parts in

Acrylic. These materials are only suited for making a prototype and should be

replaced by materials capable of restraining larger forces and strain. The driving

belt and pulleys, were especially exposed and should be made in some kind of metal

with higher tolerances. The materials of the motor chassis, attachment and mount-

ing device should also be replaced for a stronger and sturdier material.

(48)

CHAPTER 7. POSSIBLE IMPROVEMENTS

7.3 Concept

To further optimize the electric motor-unit, a Hall sensor could be incorporated to measure the motor’s revolutions per minute to calculate the correct velocities at different loads. A pedaling sensor could be integrated to properly classify the vehicle to follow current traffic classifications.

Other reasonable improvements are to enable charging to the batteries from pad- dling. Also a speed regulator could be implemented, letting the rider control the speed instead of power.

34

(49)

Bibliography

[1] Cherry, C.R, Weinert, J.X, Xinmiao, Y, Comparative environmental impacts of electric bikes in China [Online: 2019-02-12].

DOI: https://doi.org/10.1016/j.trd.2008.11.003

[2] Cherry, C, Weinert, J, Ma, C, The Environmental Impacts of E-bikes in Chinese Cities [Online: 2019-02-12].

Available: https://ideas.repec.org/p/cdl/itsrrp/qt4zg3b4d6.html

[3] Fishman, E, Cherry, C, E-bikes in the Mainstream: Reviewing a Decade of Research [Online: 2019-02-12].

DOI: https://doi.org/10.1080/01441647.2015.1069907

[4] Li, T, Qian, F, Su, Chen, Energy consumption and emission of pollutants from electric bicycles [Online: 2019-02-12].

DOI: https://doi.org/10.4028/www.scientific.net/AMM.505-506.327

[5] MacArthur, J, Dill, J, Person, M , Electric bikes in North America [Online:

2019-02-12].

DOI: https://doi.org/10.3141/2468-14

[6] Unknown, Arduino Uno [Online: 2019-02-12].

Available: https://store.arduino.cc/arduino-uno-rev3

[7] Scarpino, M, MOTORS for MAKERS A guide to steppers, servos and other Electrical Machines [2016].

Available: http://index-of.es/Varios-2/Motors%20for%20Makers%20A%

20Guide%20to%20Steppers,%20Servos%20and%20Other%20Electrical%

20Machines.pdf

[8] Johansson, H, Elektronik [2013 Institutionen f¨or Maskinkonstruktion Meka- tronik].

[9] Institutionen f¨or maskinkonstruktion, Makinelement Handbok [1 printing 2008 edition].

[10] Sandqvist, W, DC-motor.

Available: https://www.kth.se/social/files/5773817cf2765405bd5ed9b3/

Le_DCmotor_en.pdf

(50)

BIBLIOGRAPHY

[11] MIT, Measurement of Brushed DC Electric Motor Constants.

Available: https://web.mit.edu/drela/Public/web/qprop/motor_measure.

pdf

[12] Texas Instruments, Datasheetdiagram.

Available: https://www.ti.com/general/docs/datasheetdiagram.tsp?

genericPartNumber=CSD19536KCS&diagramId=SLPS485B

36

(51)

Appendix A

Arduino code for programming of motor

/∗ P ro je ct name : VeLon

∗ Author : F i l i p Elander & C e c i l i a R n n b e r g

∗ Date : 2019−06 v e r s i o n 1

∗ School : KTH

∗ Course : MF133X

∗ D e s c r i p t i o n : Code f o r c o n t r o l l i n g the detachable

∗ b i c y c l e motorbicycle motor prototype .

∗ Configuration :

∗ MCU: ATmega328P

∗ Frequency : 16 MHz

∗ Board : Arduino uno

// naming the pins to make i t e a s i e r to keep track o f the segment ∗/

// i t r e p r e s e n t on the seven−segment d i s p l a y and port i t c o n t r o l s . i n t mosfetPin = 9 ; // Pin f o r from Arduino to MOSFET

i n t potPin = A3 ; // Analog pin f o r potentiometer

i n t val = 0 ; // v a r i a b e l f o r the ingoing potentiometer value i n t pinA = 1 1; // segment A on Pin 11

i n t pinB = 7 ; // segment B on Pin 7

i n t pinC = 4 ; // segment C on Pin 4

i n t pinD = 2 ; // segment D on Pin 2

i n t pinE = 3 ; // segment E on Pin 3

i n t pinF = 5 ; // segment F on Pin 5

i n t pinG = 6 ; // segment G on Pin 6

i n t common cathod D1 = 1 2; // common cathode

i n t common cathod D2 = 1 3; // common cathode

(52)

APPENDIX A. ARDUINO CODE FOR PROGRAMMING OF MOTOR

/////////////////////////////

// s e t t i n g up the d i f f e r e n t ougoing and input pins f o r the Arduino void setup ( ) {

pinMode ( mosfetPin ,OUTPUT) ; // d e c l a r i n g the Pin as outgoing pinMode ( pinA ,OUTPUT) ; // A

pinMode ( pinB ,OUTPUT) ; // B pinMode ( pinC ,OUTPUT) ; // C pinMode ( pinD ,OUTPUT) ; // D pinMode ( pinE ,OUTPUT) ; // E pinMode ( pinF ,OUTPUT) ; // F pinMode ( pinG ,OUTPUT) ; // G

pinMode ( common cathod D1 ,OUTPUT) ; // common chatod D1 pinMode ( common cathod D2 ,OUTPUT) ; // common chatod D2 // i n i t i a t e communication from Arduino to computer . S e r i a l . begin ( 9 6 0 0 ) ;

}

// the e t e r n a l loop :

// the loop w i l l ask the potentiometer f o r a r e f value , the value are // converted to f i t the PWM value span . When the converted value have // been sent to the outgoing Pin to the MOSFET t r a n s i s t o r the loop // c a l l s f o r the p r i n t function , and p r i n t s LO, ne , HI om on the // LED−display , depending in the value .

void loop ( ) {

// reading values 0 − 1023 val = analogRead ( potPin ) ;

// s c l a i n g to f i t the outgoing 0−255 value to MOSFET val = val / 4;

// value to MOSFET

analogWrite ( mosfetPin , val ) ;

// I f the value are b i g g e r than zero // the p r i n t f u n c t i o n i s c a l l e d .

i f ( val > 0){

i f ( val <= 85){ // low gear

led1 ( 1 1 ) ; // s t a t u s #11 to p r i n t f u n c t i o n f o r the f i r s t d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i se c

led2 ( 1 2 ) ; // s t a t u s #12 to p r i n t f u n c t i o n f o r the second d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i sec

}

38

(53)

e l s e {

i f ( val <= 170 ){ // n e u t r a l gear

led1 ( 2 1 ) ; // s t a t u s #21 to p r i n t f u n c t i o n f o r the f i r s t d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i sec

led2 ( 2 2 ) ; // s t a t u s #22 to p r i n t f u n c t i o n f o r the second d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i sec

}

e l s e { // gear High

led1 ( 3 1 ) ; // s t a t u s #31 to p r i n t f u n c t i o n f o r the f i r s t d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i sec

led2 ( 3 2 ) ; // s t a t u s #32 to p r i n t f u n c t i o n f o r the second d i g i t delay ( 5 ) ; // holding the loop f o r 5 m i l i sec

} } }

// enabling the values to be printed on a plugged in computer S e r i a l . p r i n t ( ” , ” ) ;

S e r i a l . p r i n t ( val ) ; // S e r i a l . p r i n t l n ( val ) ; }

//////////////////////////////////////////////////////////////

// f u n c t i o n to l i g h t up the f i r s t le d segments . // i t c a l l s f o r the f u n c t i o n to p r i n t l e t t e r s . void led1 ( i n t number ){

d i g i t a l W r i t e ( common cathod D1 ,LOW) ; d i g i t a l W r i t e ( common cathod D2 ,HIGH) ; printnumber ( number ) ;

}

// f u n c t i o n to l i g h t up the second le d segments // i t c a l l s f o r the f u n c t i o n to p r i n t l e t t e r s . void led2 ( i n t number ){

d i g i t a l W r i t e ( common cathod D1 ,HIGH) ; d i g i t a l W r i t e ( common cathod D2 ,LOW) ; printnumber ( number ) ;

}

////////////////////////////////////////////////////////////////

// f u n c t i o n to p r i n t the three d i f f e r e n t l e t t e r s to c r e a t e l e t t e r s

//LO, ne , HI . For the three d i s p l a y e d gears . ”LOW” means that the

// segment i s o f f and ”HIGH” means that the segement i s l i t .

(54)

APPENDIX A. ARDUINO CODE FOR PROGRAMMING OF MOTOR

void printnumber ( i n t number ){

// Status # 11

i f ( number == 11){ // L d i g i t a l W r i t e ( pinA , LOW) ; d i g i t a l W r i t e ( pinB , LOW) ; d i g i t a l W r i t e ( pinC , LOW) ; d i g i t a l W r i t e ( pinD , HIGH) ; d i g i t a l W r i t e ( pinE , HIGH) ; d i g i t a l W r i t e ( pinF , HIGH) ; d i g i t a l W r i t e ( pinG , LOW) ; }

// s t a t u s #12

i f ( number == 12){ //O d i g i t a l W r i t e ( pinA , HIGH) ; d i g i t a l W r i t e ( pinB , HIGH) ; d i g i t a l W r i t e ( pinC , HIGH) ; d i g i t a l W r i t e ( pinD , HIGH) ; d i g i t a l W r i t e ( pinE , HIGH) ; d i g i t a l W r i t e ( pinF , HIGH) ; d i g i t a l W r i t e ( pinG , LOW) ; }

// s t a t u s # 21

i f ( number == 21){ //n d i g i t a l W r i t e ( pinA , HIGH) ; d i g i t a l W r i t e ( pinB , HIGH) ; d i g i t a l W r i t e ( pinC , HIGH) ; d i g i t a l W r i t e ( pinD , LOW) ; d i g i t a l W r i t e ( pinE , HIGH) ; d i g i t a l W r i t e ( pinF , HIGH) ; d i g i t a l W r i t e ( pinG , LOW) ; }

// s t a t u s #22

i f ( number == 22){ // e d i g i t a l W r i t e ( pinA , HIGH) ; d i g i t a l W r i t e ( pinB , HIGH) ; d i g i t a l W r i t e ( pinC , LOW) ; d i g i t a l W r i t e ( pinD , HIGH) ; d i g i t a l W r i t e ( pinE , HIGH) ; d i g i t a l W r i t e ( pinF , HIGH) ; d i g i t a l W r i t e ( pinG , HIGH) ; }

// s t a t u s #31

i f ( number == 31){ //H

40

(55)

d i g i t a l W r i t e ( pinA , LOW) ; d i g i t a l W r i t e ( pinB , HIGH) ; d i g i t a l W r i t e ( pinC , HIGH) ; d i g i t a l W r i t e ( pinD , LOW) ; d i g i t a l W r i t e ( pinE , HIGH) ; d i g i t a l W r i t e ( pinF , HIGH) ; d i g i t a l W r i t e ( pinG , HIGH) ; }

// s t a t u s #32

i f ( number == 32){ // I d i g i t a l W r i t e ( pinA , LOW) ; d i g i t a l W r i t e ( pinB , HIGH) ; d i g i t a l W r i t e ( pinC , HIGH) ; d i g i t a l W r i t e ( pinD , LOW) ; d i g i t a l W r i t e ( pinE , LOW) ; d i g i t a l W r i t e ( pinF , LOW) ; d i g i t a l W r i t e ( pinG , LOW) ; }

}

(56)
(57)

Appendix B

Code in Matlab for interpolating and plotting how the velocity changes with the voltage

% P r o j e c t name : VeLon

% Author : F i l i p E l a n d e r & C e c i l i a R n n b e r g

% Date : 2019−06 v e r s i o n 1

% S c h o o l : KTH

% Course : MF133X

% D e s c r i p t i o n : c o d e f o r c a l c u l a t i o n s o f how t h e v e l o c i t y

% c h a n g e w i t h t h e s u p p l i e d v o l t a g e .

c l c

;

c l e a r a l l

;

% S e t t i n g s o f f o r m a t and v a l u e s from t h e t e s t s

format

compact ;

U = [ 0 , 5 , 7 , 9 , 1 2 ] ; % t e s t e d V o l t a g e

v = [ 0 , 1 . 3 3 8 7 , 1 . 7 9 5 3 , 2 . 3 0 9 5 , 3 . 0 3 0 3 ] ; % The r e s u l t s from the t e s t s

% making o f t h e l i n e a r i n t e r p o l a t i o n , u s i n g M a t l a b s own f u n c t i o n constant = l s q c u r v e f i t ( @ l i n f i t , [ 0 ; 0 ] , U, v ) ;

a = constant ( 1 ) ; b = constant ( 2 ) ;

% c r e a t i n g x and y a x i s f o r t h e f i t t e d c u r v e U f i t = 0 : 0 . 1 : 2 4 ;

v f i t = l i n f i t ( constant , U f i t ) ;

(58)

APPENDIX B. CODE IN MATLAB FOR INTERPOLATING AND PLOTTING HOW THE VELOCITY CHANGES WITH THE VOLTAGE

% P l o t t i n g t h e i n t e r p o l a t i o n t o g h e t e r w i t h t h e t e s t r e s u l t s

plot

(U, v , ’ b∗ ’ ) ;

hold

on

t i t l e

( ’ V e l o c i t y due to Voltage ’ , ’ FontSize ’ ,14)

x l a b e l

( ’ Voltage [V] ’ , ’ FontSize ’ ,14)

y l a b e l

( ’ V e l o c i t y [m/ s ] ’ , ’ FontSize ’ ,14)

plot

( Ufit , v f i t , ’ r ’ )

grid

on

44

(59)

Appendix C

Code for calculating the acting forces

% P r o j e c t name : VeLon

% Author : F i l i p E l a n d e r & C e c i l i a R n n b e r g

% Date : 2019−06 v e r s i o n 1

% S c h o o l : KTH

% Course : MF133X

% D e s c r i p t i o n : c o d e f o r c a l c u l a t i o n s o f r e q u i r e d f o r c e

% and power from t h e motor .

c l c

c l e a r a l l

%% F a c t o r s

p = 1 . 2 ; % a i r d e n s i t y [ k g /mˆ 3 ]

m = 2 2 ; % mass [ k g ]

frA = 0 . 3 9 ; % a i r r e s i s t a n c e [mˆ 2 ]

f r g = 0 . 0 0 6 ; % f r i c t i o n c o n s t a n t r u b b e r −c o n c r e t e [ −]

g = 9 . 8 1 ; % g r a v i t a t i o n a l a c c e l e r a t i o n [m/ s ˆ 2 ] r = 0 . 4 5 ; % r a d i u s [m]

%% C a l c u l a t i o n o f how t h e a c t i n g f o r c e s w i l l c h a n g e w i t h v e l o c i t y

% c a l c u l a t i n g t h e a c t i n g f o r c e s f o r v e l o c i t i e s b e t w e e n

% 0 t o 7 m/ s ˆ2 and s a v i n g them i n v e c t o r s .

v elo = zeros ( 7 0 , 1 ) ; % V e c t o r t o s t o r e v e l o c i t i e s f o r c e s = zeros ( 7 0 , 1 ) ; % Vector to s t o r e f o r c e s Watt = zeros ( 7 0 , 1 ) ; % V e c t o r t o s t o r e power

counter = 0 ; % c o u n t e r

f o r

v = 0 . 1 : 0 . 1 : 7 % from 0 . 1 t o 7 m/ s ˆ2

counter = counter +1; % c o u n t e r

(60)

APPENDIX C. CODE FOR CALCULATING THE ACTING FORCES

F tot = p∗ frA ∗( v ˆ2) + (m∗g∗ f r g ) ; % wind + r o l l r e s i s t a n c e

W = F tot ∗ v ; % c a l c u l a t i n g power

velo ( counter , 1 ) = v ; % v e l o c i t i e s f o r c e s ( counter , 1 ) = F tot ; % F o r c e s

Watt( counter , 1 ) = W; % Power

end

% p l o t t i n g v e l o c i t i e s on x−a x i s and t h e sum o f t h e a c t i n g f o r c e s

% on t h e y−a x i s .

f i g u r e

( 1 )

plot

( vel o , f o r c e s )

grid

on

t i t l e

( ’ Total Force ’ , ’ FontSize ’ ,14)

x l a b e l

( ’ V e l o c i t y [m/ s ] ’ , ’ FontSize ’ ,14)

y l a b e l

( ’F [N] ’ , ’ FontSize ’ ,14)

% p l o t t i n g v e l o c i t i e s on x−a x i s and t h e r e q u i r e d power o f

% t h e motor on t h e y−a x i s .

f i g u r e

( 2)

plot

( velo ,Watt)

grid

on

t i t l e

( ’ Power ’ , ’ FontSize ’ ,14)

x l a b e l

( ’ v e l o c i t y [m/ s ] ’ , ’ FontSize ’ ,14)

y l a b e l

( ’ Power [W] ’ , ’ FontSize ’ ,14)

46

References

Related documents

Stöden omfattar statliga lån och kreditgarantier; anstånd med skatter och avgifter; tillfälligt sänkta arbetsgivaravgifter under pandemins första fas; ökat statligt ansvar

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Both Brazil and Sweden have made bilateral cooperation in areas of technology and innovation a top priority. It has been formalized in a series of agreements and made explicit

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

Det har inte varit möjligt att skapa en tydlig överblick över hur FoI-verksamheten på Energimyndigheten bidrar till målet, det vill säga hur målen påverkar resursprioriteringar

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa