Upload
dhruvesh-patel
View
220
Download
0
Embed Size (px)
Citation preview
8/12/2019 Report self-balancing skate
1/17
ED 3110 : Product Design Lab. 2
I-Glide: Self-balancing Personal Transporter
Rohan Chavan - ED11B010Piyush Jadav - ED11B018
Dhruvesh Patel - ED11B026Shambhuraj Sawant - ED11B034
May 11, 2014
Abstract
1
8/12/2019 Report self-balancing skate
2/17
Contents
1 Problem Statement 3
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Market . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Existing products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Our Ideation 4
2.1 What is it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Technical feasibility 5
4 Manufacturing 7
4.1 layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74.2 Design Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74.3 Initial assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5 Electronics 9
5.1 Code and Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105.2 Problems faced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6 Appendix 14
7 References 17
2
8/12/2019 Report self-balancing skate
3/17
1 Problem Statement
To develop a product that addresses the short distance transportation (2-7 km) issues of peopleacross age groups while keeping the product compact, portable and safe.
1.1 Motivation
Around 85% of students in institute either took public transport or cycled to reach their desireddestination. But this model had its deficit. Students complained about parking issues and bikegetting stolen or damaged.
When we interacted with the older age group they complained about safety and parking is-sues issues and an absence of transport option that could directly reach their doorstep. Otherissues also included significant waiting times and overcrowding in public transportation systems.
We wanted a solution that could address all of these issues. This required the final productto be portable, compact and easy to use on daily basis.
1.2 Market
The next step was to study the market that could be targeted. There is a lot of scope for aproduct like this, if tweaked as per the needs as the range would further widened
1. Students and middle-aged group: Our primary target, here the product could elimi-nate issues mentioned above.
2. Mall, airport and hotel staff: The product could be modified to provide safe, stabletransport with an option to carry luggage.
3. Movement of operators in multi-bay plants: This would reduce waiting times andincrease plant efficiency.
1.3 Existing products
Products in the market targetting these problems include Scarpar, Segway and Electric skate-boards among others. But every option here had their disadvantages such as expensive, heavy,availability etc
3
8/12/2019 Report self-balancing skate
4/17
2 Our Ideation
Figure 1: Initial layout
2.1 What is it? A self balancing 2 wheeled transporter
Focusing on basic control algorithm for safe propulsion
Compactness and portability to some extent.
Provided with straps to carry around.
Design can be extended further to include variants of the same to meet different marketneeds and safety requirements.
4
8/12/2019 Report self-balancing skate
5/17
3 Technical feasibility
The existing literature ofmobile inverted pendulumwas studied thoroughly ([1],[2]). It was con-cluded from this study that though the dynamics of the system is nonlinear, linear approximationworks very well in a sufficiently large range.
The dynamics of the system was modelled using Newtons laws and linearised to arrive atthe following state space model.
States:
x=
y(t)y(t)(t)(t)
Dynamics matrix:
A=
0 1 0 0
0 2KeKm(MbL2+MbRwLJb)
R(2Mb( JwRw2
+Mw)L2+Jb( 2JwRw2
+Mb+2Mw))Rw2gL2Mb
2Mb( JwRw2
+Mw)L2+Jb( 2JwRw2
+Mb+2Mw) 0
0 0 0 1
0 2KeKm((2Jw
Rw2+Mb+2Mw)Rw
LMb)R(2Mb( Jw
Rw2+Mw)L2+Jb( 2Jw
Rw2+Mb+2Mw))Rw2
gLMb(2Jw
Rw2+Mb+2Mw)2Mb( Jw
Rw2+Mw)L2+Jb( 2Jw
Rw2+Mb+2Mw) 0
Input coupling matrix:
B=
02Km(MbL2MbRwL+Jb)
R(2Mb( JwRw2
+Mw)L2+Jb( 2JwRw2
+Mb+2Mw))Rw0
2Km(LMb( 2JwRw2
+Mb+2Mw)Rw)R(2Mb( Jw
Rw2+Mw)L2+Jb( 2Jw
Rw2+Mb+2Mw))Rw
Input:
u= V(t)
State space equation:x(t) = Ax(t) + Bu(t)
Here,
g Acceleration due to gravityJb Moment of inertia of the person about their center of mass
Jw Moment of inertia of wheels
Ke,Km Motor constants
L Height of the pendulum (person)
Mb Mass of the pendulum
Mw Mass of the wheels
5
8/12/2019 Report self-balancing skate
6/17
R Motor armature resistance
Rw Radius of wheels
V(t) Control voltage
6
8/12/2019 Report self-balancing skate
7/17
4 Manufacturing
4.1 layout
Figure 2: layout of components on the board
4.2 Design Parameters
To maintain a low centre of gravity all the components were placed on the bottom
Components should not hit ground as than balancing and therefore controlling would bedifficult plus damages to product
The centre of gravity could not lowered to an extent that there would be difficulties placingthe components below.
Figure 3: Our final CAD model
7
8/12/2019 Report self-balancing skate
8/17
4.3 Initial assembly
The assembly consisted of three major parts - Motor and wheel, axle and platform. The idea wasto check for part availability in the market and than start with actual manufacturing.
1. Wheels used here (fig. 4 ) are electric scooter wheels
2. A safety factor of 1.75 was considered while designing the axles
3. We faced a lot of issues with these mounts and hence we changed them with bushes
Figure 4: Wheel assembly with sprockets
Figure 5: Axle CAD model
Also it was seen that, the weight distribution is uniform
8
8/12/2019 Report self-balancing skate
9/17
Figure 6: Wheel-sprocket mounts
Table 1: Dimensions of components
Parts Symbol Dimensions WeightWheels D 25cm 2 kg
Deck L x W x H 80cm x 35cm x 2cm 2.25 kgMotors d1 10cm 4 kgBattery L1XW1 15cm X 6cm 2.2 kg
sprocket diameter D2 12.5cmpitch of the chain p 8mm 0.7 kg
chain length (30)p 24cm NAdistance between tires a 40cm 4.7 kg (axle+sprocket+wheel)
5 Electronics
Electronics part of I-glide consists of basic modules:
1. Sensing module: It consists of following parts: Razor IMU (SEN-10736 RoHS), FTDI BasicBreakout 3.3V (DEV-09873 RoHS)
2. Actuator module: It consists of following parts: 2X 2500 RPM motor, 2X 12V Lead-acidbatteries, 2X DC motor drivers
3. Processing module: It consists of following parts: Arduino UNO.
4. Electrical assembly: It consists of general electrical components like 10, 15, 20A fuse, 10Vand 24V switches, LEDs, Prototype board.
Circuit Schematic:
9
8/12/2019 Report self-balancing skate
10/17
Figure 7: Circuit
5.1 Code and Algorithm
For the first implementation PID controller for pitch angle was used. The code is as follows:
# i n c l u d e / To s u pp o rt s e r i a l c om mu ni ca tio n w it h2 d e v i c e s s i mu l t an e o u sl y /
S o f t w a r e S e r i a l m y Se r ia l ( 1 2 , 1 1 ) ;/ RX, TX Se t th e s o f t S e r i a l p or t /
/wor kin g v a r i a b l e s o f t he p id /unsigned long l astTi me=0;double I n p u t =0 , O ut pu t=0 , S e t p o i n t = 0;double ITerm =0 , l a s t I n p u t = 0;double kp , ki , kd ,KP=0.0 05 ,KI=0,KD=0;i nt pwm=0;const double s l o p e = 1 0 . 6 2 5 ; / t o s c a l e t he Output
i n V o l ta g e t o a p p r o p r i a t e PWM s i g n a l/c on st i n t DirPin=4;c on st i n t M1pwmPin=3,M2pwmPin=9;i nt SampleTime=250; // . 2 50 s e c
void S e t T u n i n g s ( double Kp, double Ki , double Kd)// F unc tio n t o f i n d g a in s f o r t he d i s c r e t e syst em{
10
8/12/2019 Report self-balancing skate
11/17
double SampleTimeInSec = (( double )SampleTime)/1000;kp = Kp;k i = K iSampleTimeInSec ;kd = Kd/SampleTimeInSec ;
}
/ / Fu nc ti on t o r e ad t h e p i t c h a n g l e v a l ue fr om IMUdouble ReadPitch ( )
{my Seri al . pri n t (#f ) ;while ( m y S e r i a l . a v a i l a b l e ( )
8/12/2019 Report self-balancing skate
12/17
}
void l oop () / / Main l o o p{
double e r r o r ;Input= ReadPi tch ( ) ;e r r o r = S e t p o i n t Input ;
while ( e r r o r=10) // Loop f o r s o f t s t a r t{ Input= ReadPi tch ( ) ;e r r o r = S e t p o i n t Input ;}
SetTunings(KP,KI,KD);l astTi me=0;pwm=0;
while ( 1 ) / /Main c o n t r o l l o op{Input= ReadPi tch ( ) ;e r r o r = S e t p o i n t Input ;
unsigned long now = m i l l i s ( ) ; / / p r e s e n t t im es ta mpdouble t i meChange = ( double )(now l a s t T i m e ) ; / / t i m ec h a n ge
i f( timeChange>=SampleTime){
/Compute a l l t he w or ki ng e r r o r v a r i a b l e s/
/do o nl y f o r p it ch /ITerm += ( k i e r r o r ) ;double d I n p u t = ( I n p u t l a s t I n p u t ) ;
/Compute PID Output/Output = kp e r r o r + I T e r m kd dInput ;
/Remember s ome v a r i a b l e s f o r n e xt t i me/l a s t I n p u t = I np ut ;l a s t T i m e = n o w ;
}
/ Co nv er t t h e Output i n t o a s i g n a l wh ic hc an b e g i v e n t o pwm /
i f( Output>=0){
pwm= i nt ( s l o p e ( Output ) ) ;an al og Wr it e (M1pwmPin, pwm) ;an al og Wr it e (M2pwmPin, pwm) ;di gi ta l W ri te (D i rPi n , HIGH ) ;
12
8/12/2019 Report self-balancing skate
13/17
}e l s e
{pwm= i nt ( s l o p e (Output ) ) ;an al og Wr it e (M1pwmPin, pwm) ;an al og Wr it e (M2pwmPin, pwm) ;di g it al Wr it e ( DirPin ,LOW) ;
}
i f(pwm>100) // s a fe t y c u t o f f {
break ;}
}}
The filter and communication code on the controller on the IMU is quite complicated and hencegiven in Appendix-1 for the sake of completeness.
5.2 Problems faced
1. Serial communication problem: Razor IMU firmware was designed to give continuousstreaming output, while arduino couldnt handle this continuous stream. For this purpose,we needed to change the firmware a bit and write a separate module for communication.Finally everything synced together!
2. Connectors: This is the usual problem of any circuit, connection breaking in between orloose connection. To solve this, we used sealing gun.
3. Motor Driver: This problem was caused because of high initial current requirement of dcmotor. Even after putting fuse, we lost 4 of our working motor drivers. We couldnt fixthis problem. For this purpose, total of 4 types of drivers were tried, but none of themworked successfully. The best way to overcome this problem would be to build our ownmotor driver based on H-bridge circuit.
13
8/12/2019 Report self-balancing skate
14/17
6 Appendix
(A) Mathematica code to obtain closed loop system
In[1]:= subs 2 Mw 2 Jw Rw^2 Mb;
subs Jb 2 Mb L^ 2 Mw Jw Rw^2;
In[3]:= A 0, 1, 0, 0, 0, 2 Km KeMb L Rw Jb Mb L^ 2 R Rw^2,
Mb g L^ 2 , 0, 0, 0, 0, 1,
0, 2 Km KeRw Mb L R Rw^2, Mb g L , 0 . subs.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:= minModel SystemsModelDeletemodel, None, None, 1 . Data
Out[8]=
Voltage
vel 0.11275 0.308242 0 0.271686
angle 0 0 1 0
ang_vel 0.0527333 22.5188 0 0.127068
vel 1 0 0 0angle 0 1 0 0
ang_vel 0 0 1 0
In[9]:=
gains StateFeedbackGainsminModel, 10, 5, 1.5
Out[9]=12.7528, 747.778, 156.231
In[10]:=
rlen L
Figure 8: Code to obtain closed loop system
14
8/12/2019 Report self-balancing skate
15/17
Code added for simulation and visualization
In[11]:= animation initial state response
Manipulate
gains StateFeedbackGainsminModel, p1r, p2r, p3r;
fullstateFB SystemsModelStateFeedbackConnectminModel, gains;
soln StateResponsefullstateFB, 0, start, 0, 0, t;
solvt_ soln1;
solt_ soln2;
soldott_ soln3;
solxt_ xt . DSolvex't solvt, x 0 0, x t, t 1;
Voltaget_ gains.solvt, solt, soldott;
Withloc solxrun, run solrun,
topx rlen Sinrun;
topz rlen Cosrun;base Graphics3D
Yellow, Polygon
10, 0.2, 0.2, 10, 10, 0.2, 10, 10, 0.2, 10, .2, 0.2;
rod Graphics3DBlue, Cylinderloc, 0, 0, loc topx, 0, topz, .1;
ball Graphics3DRed, Sphereloc topx, 0, topz, .1;
wheel Graphics3DBlack,
Cylinderloc, .2, 0, loc, .2, 0, .3;
board Graphics3D
Green, Polygonloc 1 Cosrun, .4, Sinrun,
loc 1 Cosrun, .4, Sinrun, loc 1 Cosrun, .4, Sinrun,
loc 1 Cosrun, .4, Sinrun;
Grid
Showbase, rod, ball, board, wheel, PlotRange 8, 8 , 0.5, 2, 1, 2 ,
ImageSize 800, 400, Axes True,
Plotsolxt, t, 0, 10, PlotRange All, PlotLabel "Displacement",
AxesLabel "times", "disp.m", ImageSize 200, 150,
Plotsolvt, t, 0, 10, PlotRange All, PlotLabel "velocity",
AxesLabel "times", "velocity.ms", ImageSize 200, 150,
SpanFromAbove,
Plotsolt, t, 0, 10, PlotRange All, PlotLabel "pitch angle",
AxesLabel "times", "rad", ImageSize 200, 150,
Plotsoldott, t, 0, 10, PlotRange All, PlotLabel "pitch rate",
AxesLabel "times", "'rads", ImageSize 200, 150,
SpanFromAbove,
Plotrlen soldott ^2 9.8,
t, 0, 10, PlotRange All, PlotLabel "Centrpetal acc. ",
AxesLabel "times", "acentg", ImageSize 200, 150,
PlotVoltaget, t, 0, 10, PlotRange All, PlotLabel "sup. Voltage",
AxesLabel "times", "Voltage V", ImageSize 200, 150
,
Alignment Top
,
var name,initial val,"label",
min,max,increment size,Appearance"Labeled",
start, 0.1, "angle ", 8, 8, Appearance "Labeled",
p1r, 3.2, "pole1 real part ", 10, 0, .2, Appearance "Labeled",
p1c,.02,"pole1 complex part",1,0,.02,Appearance"Labeled",
p2r, 2, "pole2 real part", 10, 0, .5, Appearance "Labeled",
p2c,2,"pole2 complex part",10,0,.5,Appearance"Labeled",
p3r, 3, "pole3 real", 10, 0, .2, Appearance "Labeled",
run, 0, "release system", 0,
10, .1, ControlType Trigger, AnimationRate 1,
SynchronousUpdating True, SaveDefinitions True,
AutorunSequencing 1, 3, 5, TrackedSymbols True
Figure 9: Code added for simulation and visualization
15
8/12/2019 Report self-balancing skate
16/17
angle q 0.1
pole1 real part -3.2
pole2 real part -2
pole3 real -3
release system
-5
0
50
1
2-1
0
1
2
2 4 6 8 10timeHsL
-2.0
-1.5
-1.0
-0.5
disp.HmL
Displacemen
2 4 6 8 10 timeHsL
-1.5
-1.0
-0.5
elocity.HmsL
velocity
2 4 6 8 10timeHsL
-0.02
0.02
0.04
0.06
0.08
0.10
qHradL
pitch angle
2 4 6 8 10timeHsL
-0.20
-0.15
-0.10
-0.05
q'HradsL
pitch rate
2 4 6 8 10timeHsL
0.002
0.004
0.006
0.008
acentHgL
Centrpetalacc.
2 4 6 8 10timeHsL
10
20
30
VoltageHVL
sup. Voltage
Figure 10: Dynamic simulation
Physical parameters of the system
Mw Mass of the wheels 4Mb Mass of the pendulum 120Ke Motor constant 0.083Km Motor constant 0.069R Motor armature resistance 1Rw Radius of wheels 0.2L Height of the pendulum (person) 1.8Jb Moment of inertia of the person about their center of mass 60
Jw Moment of inertia of wheels 0.07g Acceleration due to gravity 9.8
16
8/12/2019 Report self-balancing skate
17/17
7 References
1. Grasser, Felix, et al. JOE: a mobile, inverted pendulum. Industrial Electronics, IEEETransactions on 49.1 (2002): 107-114.
2. Thao, Nguyen Gia Minh, Duong Hoai Nghia, and Nguyen Huu Phuc. A PID backstep-ping controller for two-wheeled self-balancing robot. Strategic Technology (IFOST), 2010International Forum on. IEEE, 2010.
3. https://www.sparkfun.com/products/10736
4. https://www.sparkfun.com/products/9873
5. http://arduino.cc/en/Main/ArduinoBoardUno
17