Professional Documents
Culture Documents
Semester project
Final report
1
Table of contents
1 Introduction. ............................................................................................................ 5
3 Powertrain. .............................................................................................................. 6
3.1.1 Torque to overcome friction between wheel and the surface .................. 7
9.2.3 Results....................................................................................................... 63
11 3D - Printing. .......................................................................................................... 69
14 Conclusion. ............................................................................................................. 81
15 References. ............................................................................................................ 82
16 Appendix. ............................................................................................................... 83
4
1 Introduction.
Two wheel robot can be compared to inverted pendulum. This is the pendulum that
has its centre of mass above its pivot point. Whereas a normal pendulum is stable when
hanging downwards, an inverted pendulum is inherently unstable, and must be actively
balanced in order to remain upright. This can be done either by applying a torque at the
pivot point, by moving the pivot point horizontally as part of a feedback system etc. The
inverted pendulum is a classic problem in dynamics and control theory and is used as
a benchmark for testing control strategies.
In the first phase, housing's concept and the powertrain were the parts on which
there was the biggest focus. Without deep knowledge about the system, first target weight
was set as 1.5 kg. After concerning about the capability of the robot to balance itself easier
and after gaining more and more knowledge and requirements the target weight for the
5
robot was changed to 0.9 kg. In this case there could be a possibility for the robot to carry
some more weight.
The vertical position of the centre of gravity should be as down as possible, at least it
is supposed to be lower than half of the height of robot for the reason that it can be more
stable when it is going to balance. Another important thing is that the centre of gravity is in
the middle of robot in case of falling down (more possible) to one side which is more heavier
when it is balancing.
To make sure the velocity can gain enough speed to overcome the situation when the
robot is about to fall down, the maximum speed, which was assumed is around
0.25-0.35 m/s. Minimum gear ratio depends on the maximum velocity required, the desired
maximum velocity of the robot wheel is 0.35 m/s. So the minimum gear ratio is supposed to
be 0.96. In consideration of the maximum torque required and the input torque, the
maximum gear ratio is calculated as 1.5. To satisfy the protection to the whole robot while
dropping from 20cm, the deflection should be at least 15mm.
After internet research concerning websites with wanted parts, the cost of some
components that are about to be used, aimed in approximately 150-190 Euros.
Besides the requirements above which must be followed, additionally some more
requirements are considered to be reached:
1. Ability to have loads of varying weight and size placed on the top platform.
2. Capability of handling disturbances including bumps from humans or running
into stationary objects.
3. High manoeuvrability and ability to travel at a moderate speed.
3 Powertrain.
The power train of two wheel robot consists of belt-drives on each wheel powered by
a Maxon DC motor (134324). Power train calculations were made based on the initial design
of robot and by assuming some unknown values. The primary objective of the power train
6
calculation was to derive adequate gear ratio of the drive system and to select proper
pulleys and belt.
Coefficient of friction between Robot wheel (rubber) and ground surface (concrete)
= μW
= μW *(M/2)* g*RW
�W = 0.8*0.9*9.8*0.03/2 = 0.106 Nm
7
�B = m*g*l*sinθ
�B = 0.85*9.8*.07*sin10° = 0.1014 Nm
Since we have one motor on each wheel, the maximum torque required,
�2 = 0.157/0.8 = 0.196 Nm
Outer diameter = 16 mm
Nominal Voltage = 9 V
3.3 Gear
Output diameter = 16 mm
Input Torque: �1 = Nominal torque of the motor * Gear ratio of the reduction gear
* Efficiency of the reduction gear
�1 = 0.00211*84*0.8 = 0.142 Nm
8
= 8970/84 = 106.8 rpm
We used timing belt and pulleys for our belt drive since it allows accurate control of
movement by avoiding the chances of slip.
Select D1 and D2 based on Gear ratio. Now we need to select corresponding belt for
the pulleys.
9
Imagine that both pulley wheels are completely free to turn and that the belt is
initially tensioned by stretching the centre distance between the wheels. The tension in the
belt will be the same along its whole length and equal to F. When transmitting power, the
driven wheel will be reluctant to turn and the driving wheel has to pull it and exert a torque
on it. Consequently the tension in the side pulling will increase to F 1 but the tension in the
other side will decrease to F2. The increase in tension on the tight side of the belt is equal to
the decrease in tension on the slack side so that the sum of the tensions remains constant.
Mechanical power is the product of force and velocity. So P = Fv (Watts). In this case
we have one force pulling in opposition to the other so the net power transmitted is
P = v(F1– F2)
�1 = R1 * (F1 – F2)
Now consider the case of a rope wrapped around a post so that it takes the strain out
of the rope. It will be shown that the formula relating the large force being held (F 1) to the
small force being exerted (F2) is given by
F1/ F2 = eμθ
This formula is also important for the ropes passing around drums and pulleys and
governs the power that can be transmitted by a pulley drive before the belt slips.
To select belt width we need to know the maximum tensile force (F1) on the belt. This
value should be less than the allowable maximum value of tensile force of the belt.
10
We know the value of �1 and R1. Find the value of coefficient of friction between belt
a d pulley fro a ufa turer s data.
Calculation of C:
C = A+√(A2-B)
A = (L/4) - (π*(D1+D2)/8)
B = (D2-D1)2/8
Choose available belt length, L for the corresponding values of D1 and D2.
By solving the following equations find maximum tension on the belt, F1:
�1 = R1 * (F1 – F2)
F1/ F2 = eμθ
11
Select belt based on the above value of F1 (keep in mind to consider the factor of
safety).
Following are the technical details of the belt and pulleys used:
3.5.1 Case 1
Belt width: 6 mm
Maximum allowable tensile force of the belt = width factor*allowable tensile force of
10 mm belt width
= 0.44*120 = 52.8 N
So F1 for the selected belt-pulley system should be less than 52.8/Factor of safety.
C = A+√(A2-B)
C = 41.17 mm
assume μ = 0.3
�1 = R1 * (F1 – F2)
Since the value of F1 is close to allowable tensile force of the belt, it is safer to choose
another belt-pulley system.
13
3.5.2 Case 2
Belt width: 10 mm
Maximum allowable tensile force of the belt = width factor*allowable tensile force of
10mm belt width
= 1.0*120 = 120 N
So F1 for the selected belt-pulley system should be less than 120/Factor of safety
C = A+√(A2-B)
C = 41.17 mm
assume μ = 0.5
�1 = R1 * (F1 – F2)
Since F1 is less than allowable tensile force of the belt, our belt drive design is safe.
4 Suspension system.
The suspension for the robot was required for some specific situations. This
specific situation was given as the requirement for designing the suspension system. The
requirement was to sustain a vertical drop of 20 centimetres. Hence the force and impact
forces due to this drop are the basis of the calculations and design procedure.
Impact Force:
�ℎ
Fim =
�
15
where,
h = Drop height = 20 cm
Fim = 117.72 N
mg = K(lo - xo)
where,
From these specification it was possible to find the stiffness of spring using an excel
sheet to calculate the equations.
16
Figure 10 Calculations for round wire helical springs.
KT = K1 + K2
17
KT = 3300 N/m
After getting the spring stiffness it was possible to go back to the equilibrium
equation to find out the initial length at equilibrium:
mg = K(lo - xo)
after substituting,
xo= 0.0988 m
Another constant that should have been calculated for the spring is the Damping
Coefficient C:
wn = √
�
wn = natural frequency
wn = 14.97 Hz
Ccr = 2√�. �
ζ = damping ratio
so that,
C = 14 N.s/m
�� + � � + � � = C + Fim
where,
19
4.1 Simulink Simulation
After reaching this point, the theoretical part was finished and Simulink simulation
was started. It was done to get more accurate values. The following system was built:
Tool boxes:
1- Transitional spring : inside this toolbox it is possible to specify the stiffness of the
spring (3300 N/m)
4- Mechanical reference: it's a frame ,connected from both ends of the spring.
5- Motion Sensor: To sense the deflection and the velocity of the spring.
6- Force: in this case it's an impact force, which is only a hit for less than one second.
The graph below shows the impact force.
20
Figure 15 Impact force.
Results:
We needed to check and be sure from our results that or spring will not reach the
locking conditions. The maximum deflection of our shock absorber is 30 mm.
As we see in the graph below the x-axis is the time and the y-axis is the spring
deflection which didn't reach the locking length (30 mm) .
This results gave confidence that calculated and chosen spring will function properly.
Despite that it was also confirmed in balancing simulation performed in MotionView. That is
much more accurate way to check the system and this part is discussed in chapter 9.2.
21
Suspension system results
Impact force: 117 N
Stiffness of the two springs: 3300 N/m
Damping coefficient: 14 N.s/m
Maximum deflection of springs: 20mm
5 Electronic components.
The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM
Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It
has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog
inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2
DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button
and an erase button. The board contains everything needed to support the microcontroller;
simply connect it to a computer with a micro-USB cable or power it with a AC-to-DC adapter
or battery to get started. The Due is compatible with all Arduino shields that work at 3.3V
and are compliant with the 1.0 Arduino pinout. Unlike most Arduino boards, the Arduino
Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V.
Applying voltages higher than 3.3V to any I/O pin could damage the board.
22
The IMU we use in this system is MPU 6050.IMU sensors usually consists of two or
more parts. Listing them by priority, they are : accelerometer, gyroscope, magnetometer
and altimeter. The MPU 6050 is a 6 DOF (Degrees of Freedom) or a six axis IMU sensor,
which means that it gives six values as output. Three values from the accelerometer and
three from the gyroscope. The MPU 6050 is a sensor based on MEMS (Micro Electro
Mechanical Systems) technology. Both the accelerometer and the gyroscope is embedded
inside a single chip. This chip uses I2C (Inter Integrated Circuit) protocol for communication.
Gyroscopes work on the principle of Coriolis acceleration. Imagine that there is a fork
like structure, that is in constant back and forth motion. It is held in place using piezoelectric
crystals. Whenever, you try to tilt this arrangement, the crystals experience a force in the
direction of inclination. This is caused as a result of the inertia of the moving fork. The
crystals thus produce a current in consensus with the piezoelectric effect, and this current is
amplified. The values are then refined by the host micro-controller.
23
Figure 19 Piezoelectric Gyroscope.
DRV8833 dual motor driver can deliver 1.2 A per channel continuously (2 A peak) to a
pair of DC motors. With an operating voltage range from 2.7 V to 10.8 V and built-in
protection against reverse-voltage, under-voltage, over-current, and over-temperature, this
driver is a great solution for powering small, low-voltage motors.
The sensor encoder which is connected directly to the motor is used to get the
relative position signal suitable for positioning tasks. For further processing in the controller,
the encoders deliver square-wave signals whose pulses can be counted for exact positioning
24
or speed measurement. Channels A and B pick up phase shifted signals, which are compared
with one another to determine the rotation direction. All maxon positioning systems
evaluate the rising and falling signal edges. With regard to encoder number of pulses, this
results in a four times higher positioning precision. This is what is referred to as quad-counts.
The level shifter features four bi-directional channels, allowing for safe and easy
communication between devices operating at different logic levels. It can convert signals as
low as 1.5 V to as high as 18 V and vice versa, and its four channels are enough to support
most common bidirectional and unidirectional digital interfaces, including I²C, SPI, and
asynchronous TTL serial.
As digital devices get smaller and faster, once ubiquitous 5 V logic has given way to
ever lower-voltage standards like 3.3 V, 2.5 V, and even 1.8 V, leading to an ecosystem of
components that need a little help talking to each other. For example, a 5 V part might fail to
read a 3.3 V signal as high, and a 3.3 V part might be damaged by a 5 V signal. This level
shifter solves these problems by offering bidirectional voltage translation of up to four
independent signals, converting between logic levels as low as 1.5 V on the lower-voltage
side and as high as 18 V on the higher-voltage side, and its compact size and breadboard-
compatible pin spacing make it easy to integrate into projects.
25
5.2 Place of Electronic Components
As we can see from the picture below which shows the connection between each
components.
The Arduino Due is the control unit of the whole electronic circuit, it connects to the
level shifters directly, MPU6050 and motor driver carrier. So it should be put on the first
board which is the easiest place for connecting other electronic components and has the
biggest space for cables.
For the place to mount the IMU (MPU 6050). Because of its specialty that it is used to
control the balance of the robot, it must be somewhere horizontal to the vertical supporting
poles. But to have the best result, the most appropriate position for it is the middle of the
robot. So we decided to put it on the middle of the second (middle) board.
For other electronic components, to ensure that the centre of gravity is in the middle
line of the robot. They should be mounted on the middle position or in the symmetrical
place to balance its weight. The picture below shows the position where the electronic
components are installed.
26
In the first phase, we didn t know that the level shifters are connected directly on the
Arduino. So the place where they are supposed to be was set on another board. Also
because of the spring dampers going through the second board, the space for motor driver
carrier is not enough while the IMU has to be at the middle of the board. The level shifter
finally mounted on the reverse side of the first board. The Figure 25 shows the first version
of the position of all the electronic components. The Figure 26 follows showing the final
layout for all the electronic components.
Arduino
Motor Driver
Carrier
MPU6050
Level
Shifter
27
Level Shifter
Arduino
Motor Driver
Carrier
MPU6050
For better organization of project files, special folders were created and used for
storing the whole work of the team. Main folders were dedicated to divide work for each
phase. They consists of other folders, which stores all tasks separately. It helped to keep
order in files and favor the work on project.
28
6.2 CAD Design.
Working with Catia V soft are as started fro esta lishi g file s a e syste , so
that every part could be easily found by searching particular name using following notation:
VPD_xxx_3DPart_TEMPLATE_xx_A1A, where singular sectors were filled by author of the
part:
One of possibilities to manage team work was to use collaboration tools. In Catia V6
it was realized by Enovia - common team folder, where all the CAD parts and assemblies
were saved. In HyperWorks there is option to use collaboration tools as well. Using Personal
Repository and created Libraries, collaboration tools were examined, but later on were not
implemented to team work. Due to some errors with Checking-out option, it was decided to
cooperate by using folders mentioned in 6.1 chapter, dropbox and what-up application. It
resulted in fast and good work without risk of over saving files.
7 CAD Design.
Soon after establishing concept of power train system, the geometry creation of the
robot was started. The first step of creating geometry of the robot was to find as many as
good ideas as possible. For that brain storming, gallery method and internet research were
used. The main aim was to create simple and practical, but elegant design. That means
exoteric parts were supposed to be used and shape was about to be determined by smooth,
non-sharp curves and patches. Big benefit was given by 3D printing, so that the shape of
designed components could be adjusted in desired manner.
29
7.1.1 Implementation of skeleton geometry.
The next step was to create master file, which would be the source of the most
important references to all the parts. Among them elements like: main axis system, axis of
the wheels and motors, position of mounting elements etc. could have been found.
Moreover master file played the role of main skeleton in assembly. That prevented from
mistakes and errors like clash, improper dimensions and incorrect positions in cooperating
parts etc. It also prevented from problems and unnecessary work with updating many parts
after only one small modification. Furthermore all of the parts were built based on template
file, so that all of them had the same working principle and followed the same scheme.
Concept of the vehicle body consisted of three boards: one base board, one middle
and one upper board. Main task of base board was to accommodate power train system and
battery. It had to be strong enough to take shock and stresses, so its thickness was two times
bigger than the thickness of two other boards. Middle and upper boards are responsible to
carry electronic components. Springs were placed between base and middle board (see
Figure 28).
Easy and fast assembling and disassembling were also important factors taken into
consideration while constructing the robot. It led to development of the concept of special
mounting mechanism (see Figure 30). It consisted of tube, pin and spring. Both, tube and pin
were able to be printed on 3D printer and spring could be easily found in any mechanical
shop. The main working principle of this mechanism is to press the pin inside the tube, so
that spring would be compressed, then turn the pin and lock it in specially shaped tube. To
disassemble these two parts, follow the above described process in other direction (turn ->
spring decompress -> take the pin out of tube).
31
Figure 30 Mounting mechanism - concept.
Main advantage of this mechanism is that it provides fast and friendly method for the
user to assemble and disassemble the housing without the use of any tool. On the other
hand, in later stages of detailed design, it turned out to be impossible to realize this
mechanism as it had many limitations. Main disadvantage was the big size determined by
possibility of catching the pin with two fingers without the risk of slipping and its weight.
All the other parts, except the motors, were supposed to be mounted by M3 screws
for which tight connection was applied. Electronic components were placed with the idea of
obtaining the best location of centre of gravity. This was the main reason for achieving as
symmetrical robot construction as possible. The only asymmetrical part was the base board
with power train system, which was caused by the use of belt drive. It had to be mounted
horizontally. Vertical mounting would not give enough stability and would additionally
increase the overall height of the robot. The scheme of the powertrain system mounted on
base board is shown below (bottom view).
32
Conceptual design gave good result with respect to the location of centre of gravity.
Unfortunately the mass was much higher than assumed and desired, which was the biggest
challenge and caused major changes in detailed design.
Main modifications
Concept design Problems Detailed design Improvement
33
Housing sides as
need of strong housing connection between boards gained stability,
joining element for
- too big weight realized by rods weight decreased
boards
Vehicle body too big weight, housing reduced to single
covered entirely by inhibited access to cover with minimal weight decreased
housing components thickness
Tab. 2 Main modifications in design.
The need of reaching the maximum weight of 0.9 kg had effect also on calculation of
suspension and powertrain system. For the new requirements, calculations were made
again, which allowed major changes in both systems. This time to get minimum deflection
of 15mm, two spring dampers with specific spring stiffness and damping coefficient were
enough. Then the idea of connecting spring dampers to upper board was realized, which not
only reduced the weight and overall height of the robot, but also made the housing smaller
through the addition of extra holes in middle board (see Figure 33).
At the same time housing was rigidly rebuilt with special connecting shape for easy
and accurate mounting. Because it did not play the role of joining element any more, which
required strong - thick construction, it became thinner and lost its weight. Additional beam
34
holes (see Figure 34) allowed the air to go through what prevented electrical components
from getting hot. For the sake of 3D printing, housing cap was divided into two parts and
extra ribs were added (to make the housing stiff enough).
Figure 34 Housing.
36
All the modifications and optimization (see chapter 8) significantly affected the
weight of the robot. From mass of 1.993kg through 1.132kg after applying all new ideas, up
to 0.807kg after optimization. Automatically calculated characteristics in Catia V6 software
can be seen on figure below.
37
The need of making the base board and the mounting for springs strong, contributed
to adding extra ribs. Their location and use will be explained in next chapters. Ready CAD
model of the two wheel robot can be seen on the figure below.
Bill of material
Component Material Note
Shafts Steel -
Tab. 3 Bill of material.
38
CAD Design results
Mass 0.807 kg
Centre of Gravity Gx = -0.005 mm, Gy = 0.143 mm, Gz = 64.241 mm
(Note: axis: x - width, y - length, z - height)
Inertia around wheel axis 0.008 kg*m^2
8 Optimization of design.
The preliminary CAD design of the two wheel robot was heavy (close to 2Kg)
corresponding to its motor-drive capability. So it was necessary to optimize the design
through Deformation analysis and Topology optimization. CAD model in CATIA V6 has been
updated based on the results of deformation analysis and topology optimization.
Deformation analysis and topology optimization of the two wheel robot was done
using the software called SolidThinkingInspire. The following steps were followed in the
deformation analysis and topology optimization process:
In our two wheel robot design, the most crucial part, which is going to take impact
load, is the base board. All other parts will be getting less impact while drop test, since those
are secured by the spring damper suspension system. So the optimization process was
carried out only on the base board. The initial part was 8mm thick. The main objective of the
39
analysis was to optimize the thickness and to remove the material from unnecessary areas of
the base board.
The STEP file of the base board part has been exported from CATIA V6 and it has
been imported to SolidThinking Inspire.
iii. Defeaturing.
A good quality mesh of the CAD model is very important to get fast and accurate
results in SolidThinking Inspire. A good quality mesh can be achieved by simplification of CAD
model by eliminating small curved surfaces and small holes.
In SolidThinking Inspire we have the option to identify different features like fillets,
holes etc. and to delete them if not required. Filtering of the features based on the size of
the features is also possible.
40
Figure 42 Identification of features.
Since there is some complex surfaces in our base board model, it was necessary to
delete the unwanted faces by selecting one by one.
The spring damper should deform at least 15mm during the drop test. So according
to the principle of conservation of Energy,
I pa t for e o ea h heel = . / = . N≈ N
where m is the mass of the robot(= 1Kg), g is acceleration due to gravity(= 9.8m/s),
h is drop height(= 0.2m) and v is the free fall velocity at the time of impact.
Half the impact force value is applied on each wheel shaft of the two wheel robot.
Additionally, the effect of gravity is also considered.
41
The base board is supported at the spring damper fixing screws for the deformation
analysis.
The faces of the Shaft and the corresponding holes on the base plate were defined as
o ta ti g surfa es.
The next step was meshing. The mesh size used is 0.00162m.
In the solution phase, the base board model was analysed by the solver of the
software based on the load conditions given in pre-processing phase.
The results from the initial analysis were analysed in this phase. The initial model
used was so strong. Then we used topology optimization to identify the areas of base board,
from where material can be removed.
The main thickness of the base board was defined as the design space for the
topology optimization.
Mass reduction was the main objective of topology optimization. Since the plastic
parts are made using 3D printing process, we kept little higher factor of safety (= 3) and
minimum thickness (= 6mm). Load case for the topology optimization was similar to the
deformation analysis.
43
Figure 46 Optimization run details.
44
Results of topology optimization.
The maximum value of deformation of the base board obtained from the analysis is
0.34mm.
45
The maximum stress on the part under the given loading conditions is 9.72MPa.
The critical area obtained is at the centre of the part between the spring-damper
connection and shaft mounting.
46
Through topology optimization, the mass of the baseboard wasreduced by 58 grams
(Mass reduced from 202g to 144g).
The results of the deformation analysis on the final design was analysed to check the
deformation and stress on it.
The maximum value of deformation of the base board obtained from the analysis is
0.28mm. From this value, it is clear that the horizontal stiffness of the base board is very
high.
47
The stress plot is as follows:
The maximum stress on the part under the given loading conditions is 28.7MPa.
In addition, the factor of safety plot was also checked to ensure the design is safe:
48
8.2 Geometry Optimization.
49
Figure 56 Optimization of base board - ribs.
Additionally material was removed from the middle board, upper board and housing
by reducing the thickness and introducing holes.
50
Figure 58 Optimization of middle board.
51
Results of Optimization
Topology Optimization
Deformation Analysis
One of the main requirement of the two wheel robot is to sustain the impact of
dropping from a height of 20cm. Suspension system consists of a spring damper is the key
part to fulfil this requirement. The spring damper should deflect at least 15mm to absorb the
dropping impact.
To simulate the behaviour of two wheel robot suspension system, we have used
Multibody simulation in Motion view – Motion solve of Altair HyperWorks software package.
52
The plan of action was to start from a model with primitive graphics in motion view
and then replace it with actual imported CAD geometry for drop test.
Following are the main components of two wheel robot model for drop test:
53
i. Bodies
The bodies used for drop test are ground body, two wheels, part of robot below
spring damper (Bottom) and part of robot above spring damper (Top).
ii. Points
Required points were defined to position the bodies and to define other features like
spring damper, joints etc.
iii. Graphics
Step file from CATIA V6 was imported to Motion view to get better understanding of
the behaviour of two wheel robot in drop test.
iv. Joints
Translational joints were assigned between top to bottom parts and between bottom
part to ground body to make sure the vertical alignment of the robot.
v. Contacts
Rigid to rigid body contacts were defined between the two wheels and the ground
body. Following are the properties of contact used:
In the actual model, there are two spring dampers. So for the drop test in Motion
view-Motion solve, we have used two spring dampers to represent them in software
54
environment. Following are the values of spring constant, K (N/mm) and damping
coefficient, C (Ns/mm) used for the drop test:
vii. Outputs
Maximum deflection of spring dampers obtained from the drop test is 17.5mm.
The contact force between wheels and the ground body is 2443N.
We tried drop test with scripted simulation also. In scripted simulation, we simulated
the action of holding the robot on housing and then dropping it to the ground body. A fixed
joint constraint between housing and ground body was used to simulate this.
56
Figure 68 Scripted simulation properties.
--------------------------------------------------------------------------------------------------------
<Simulate
analysis_type = "Static"
/>
<Deactivate
element_type = "JOINT"
element_id = "{j_HoldingJoint.idstring}"
/>
<Simulate
analysis_type = "Transient"
end_time = "2."
print_interval = "0.001"
/>
--------------------------------------------------------------------------------------------------------
The results obtained from the sequential simulation were quite similar to the
simulation carried out without script.
57
Maximum deflection: 17.5mm
58
9.2 Balancing simulation.
One of the tasks which robot is supposed to perform is to balance with the velocity
equal or close to zero. Main factors which have the crucial influence on the quality of
balancing task are torque, speed, weight and location of center of gravity. All of them have
an impact on each other, so it was very important to take care of all of them simultaneously.
Speed and torque are directly related to motor characterization and the gear ratio is the
factor which let control both of them. At the same time, location of center of gravity
determines behavior of robot, which would need more power if there is offset between
center of gravity and wheels' axis offset between center of gravity and wheels' axis.
At first it was done with simplified model, using 'step by step' method, where all the
model became more and more advanced after accomplishing every step. Besides data
parameters, bodies, graphic, systems and all other objects the most important features
were:
59
Figure 73 Contact properties.
Finished model with all the objects can be seen on figures below.
60
Figure 75 Balancing simulation tree.
Before running the simulation, Matla s ript as used to get gai alues for ro ot s
controller. To achieve proper values, all parameters had to be set carefully and precisely,
which can be seen on below.
61
The results were put in another Data Set called Control_parameters.
Balancing simulation was run with prepared script, where both, static and dynamic
simulation could be performed. That was important to prevent robot from bounding which
was caused by definition of contact. In this case extra join was added, activated while
running static simulation and deactivated during transient simulation. Applied force - torque
was defined opposite way, so that it does not affect static simulation. The code can be seen
below.
<Deactivate
element_type = "jprim"
element_id = "{sys_Vehicle_body.j_Paraller_axis.idstring}"
/>
<Deactivate
element_type = "force"
element_id = "{sys_Powertrain_wheels.frc_moment_left.idstring}"
/>
<Deactivate
element_type = "force"
element_id = "{sys_Powertrain_wheels.frc_moment_right.idstring}"
/>
<Simulate
analysis_type = "Static"
/>
<Activate
element_type = "jprim"
element_id = "{sys_Vehicle_body.j_Paraller_axis.idstring}"
/>
62
<Activate
element_type = "force"
element_id = "{sys_Powertrain_wheels.frc_moment_right.idstring}"
/>
<Activate
element_type = "force"
element_id = "{sys_Powertrain_wheels.frc_moment_left.idstring}"
/>
<Deactivate
element_type = "joint"
element_id = "{sys_Vehicle_body.j_Static_joint.idstring}"
/>
<Simulate
analysis_type = "Transient"
end_time = "3."
print_interval = "0.01"
/>
9.2.3 Results.
To achieve more real conditions, initial angle of robot was applied. To control
position of points and orientation of coordinates systems mathematic functions were
introduced. As an example IMU marker (describing IMU position and orientation in robot)
was defined by point and axis system, which coordinates were dependent upon sinus and
cosinus functions (see figure below).
63
Vehicle was supposed to come to vertical position and balance. In this case maximum
reached angle was 13.96°. Obtained torque and model with initial angle is shown on figure
below.
64
The maximum torque required to balance the robot with initial angle of 13.96° is
0.18Nm. This results were obtained for previously made calculations, were gear ratio was
equal to 1.5. To find the maximum and minimum required gear ratio, more runs were
implemented. Output plots made it clear which range of gear ratio was applicable.
Examination of maximum gear ratio (green – gear ratio equal to 1.9, blue – ratio
equal to 2.0):
Examination of minimum gear ratio (red – gear ratio equal to 1.0, blue – ratio 1.2):
65
The results show that even without gear robot would be able to balance.
Controller gains calculated by using Matlab script were applied to motion view.
Together with other references like markers or gear ratio, they were given as input to
python script to calculate the torque. To obtain the smooth plot, changes in penalty value
were made. Figures below show the effect of the penalty value on the torque (initial angle is
equal 10°).
66
Figure 82 Torque - penalty value: 5*e04.
Results achieved for gear ratio 1.5 were very close to manually made calculations.
This allowed to proceed with next step of projects which was to order all necessary parts and
assemble the robot.
Unfortunately in real life application, gains from simulation could not be used. Robot
was too slow, tended to fall and shake. It required detailed examination of Simulink
program, many attempts and experiments, where observation and understanding of robot's
behaviour were the main factors which decided about chosen values of gains.
67
Balancing simulation
Maximum initial angle: 13.96°
Maximum torque (for max. initial angle): 0.18 Nm
Required gear ratio: 1.5
Minimum and maximum gear ratio (for initial angle equal to 10°): 1.0 - 1.9
10 Purchasing list.
Purchasing List
Company for
Components Quantity Size Cost
purchasing
Screw 16 M3
Screw 4 M4
Screw 8 M1.5
Workshop Nut 30 M3
Nut 8 M4
Shaft(Wheel) 2
As we can see from the table, the total price of all the components is 176.65 €,
including shipping fee and added-value tax.
11 3D - Printing.
3D Printing gave huge advantage of achieving almost every desired shape in robot's
construction. Unfortunately it has also its limitations. Due to possible problems with
acquiring high precision and short printing time, some parts had to be adapted. The major
modifications could be seen in base board. There, U-Shaped parts had to be printed as
separate parts without holes for bearings and bushings, so that later, they could be done by
milling process with good precision. In this case also the position of ball bearing had to be
changed. For easier mounting and hole making, special geometry was prepared to mark
centre of holes and position of U-Shaped parts (exemplary geometry marked with red circles
on figure below).
69
Figure 83 Geometry prepared for 3D Printing.
After making all necessary changes, stl files were prepared. For that STL Rapid
Prototyping module in Catia V6 was used. To create stl files, tools like Tessellation (with Sag
0.01mm and Step not bigger than 1mm) and STL Export were used.
All the parts were printed in black colour ABS with support material, easy to remove
by melting in liquid. Good enough precision of 3d printing parts led to assemble robot which
is described in following chapter.
12 Assembling robot.
After received all the components from the Maedler, working on the robot assembly
was begun.
When started to assemble the robot, the connection of electronic components was
decided to be done first because of the full schedule in the workshop that our shafts and
some components needed manufacturing was still not available. According to the circuit and
the distance between electronic components in our design, the cables for connection were
made firstly. The cables should be neither too long , nor too short considering the inertia
70
moment and the non-interference to the springs on shock absorbers. Concerning of safety,
the red cables were made as current input and output. There is only one level shifter on our
Arduino, so only one level shifter possible for us to shift all the needed voltage. After
finishing connection, the power supply from computer was used to confirm the rotation of
motors (see Figure 84) was in the right direction with the movement of IMU.
Then the right place for screw holes to mount the electronic components were
measured, and the holes were made on the boards. The electronic components were fixed
on the set position with screws and nuts and the circuit was rechecked later on (see Figure
85). There is no space designed for switch, so the switch was put to an easy control position
outside of the housing on the opposite side of the second board and exact holes were made
for mounting it.
While waiting for the parts from workshop, the 3D parts were assembled at the
same time with electronic components. Because of the limited capacity of the 3D printing,
the air flowing holes on the housing parts should be made manually ourselves. Firstly the
continuous holes were drilled with the drill machine at the border of the holes. Then the
useless material was cut with knife (see figure below).
To light weight the robot more, some unnecessary material was removed from the
baseboard in the ribs (see Figure 87). After mounting all the possible parts, a problem was
found that the guiding poles from the baseboard to the second board were not matching
perfectly. The holes for the pipes are 3mm, but the pipes available for us to get are 2,7mm.
So the holes were enlarged to 4mm and pipes for another size we got as a backup for 4mm
were used. Although they added a little weight, but they fully solved the problem and made
the connection stronger.
Finally shafts and the manufactured parts done from the workshop hopefully, the
powertrain was assembled at last. To make sure the holes for mounting motors won t hurt
the surface of motors and fix the motors tight enough meanwhile, the holes were polished
ourselves little by little to check the condition of mounting the motor. Then couplings were
used to connect the shafts with the output of motors. The belt was too tight and the friction
between shafts and bushes were non-ignorable at the beginning that the motor runs slower
as expected. Thanks to the adjustable couplings, after readjusting the couplings, the
powertrain works properly afterwards.
The last part was to mount the shock absorber and finish the assembly of the
whole robot with housing. But the stiffness of the shock absorbers is too high. The way to
reduce the stiffness are described in detail as follows.
First problem faced was that the housing was not fixed, stabilized, it had a small
movement that had a high negative effect on the IMU reading. It was solved by
elongating the guiding rods till upper board. The figure below shows the guiding rod after
it was elongated. Now the guidance between the shock absorber and the housing is
smooth and efficient, also the noise on the IMU readings disappeared.
Third problem was the damping ratio. By using the 400 oil the damping was too high
and there was no smooth movement. The 100 viscosity (index number) oil was examined,
but still the damping was a bit too high. Finally the 50 oil solved the problem and best
smooth damping was reached.
74
13 Functional testing - Simulink.
After assembling the robot, it was the time to start the control part to balance the
robot. Simulink is the software used for control. The software communicates between the
Arduino and IMU, also between the Arduino and Motor.
The IMU reads the angle and the rate of change of the angle and then it sends
readings to the Arduino using I2C protocol. The second step is filtering the noise on the IMU
outputs. In this case complementary filter is used to eliminate the noise of the signal.
The speed of the DC motor is controlled using Duty cycle (PWM), where each motor
is connected to a PWM channel on the Arduino.
The state chart is responsible for the scheduling of the tasks when the software runs.
The inverted pendulum or 2 wheel robot is an unstable system, where the poles of
the system are in the unstable region (right hand side). If the poles are in the left hand side
of the graph below, the system is stable.
Particular project - two wheel robot with unique construction, mass and position of
centre of gravity requires its own prepared software. That is the reason why some of the
values and functions were modified in Simulink code. Main changes in the software were
connected with gain values, which were adjusted experimentally.
Unfortunately at the beginning the DC motors were not powerful enough to balance
the robot. In this case the best performance that DC motors could achieve, was
recommended. One of the factors that influences the performance of the motor is the
triggering frequency (PWM frequency). This Frequency can vary between 20 Hz to 20 KHz .
For these DC motors the range was between 500 Hz to 1 KHz. Within this range different
frequencies were implemented. Finally the chosen value for the triggering frequency was 1
KHz. At this frequency the motors achieved the highest torque and speed and it also affected
the response of the system. As shown in the figure below, at frequency 500 Hz the noise on
the PWM signal is too high due to losses through the wires and the Arduino efficiency. While
on the other hand at frequency 1 KHz the noise is reduced.
Fortunately the DC motor was supplied with digital encoders, which counts the
revolutions of the motor. The two wheel robot was designed in a way that the wheel and the
motor were not on the same axis. In this case there will always be a speed difference
between the two wheels. This was eliminated by adding a function in the program. This
function calculates the speed and position difference between the two motors according to
the encoder reading. Then this difference is added to the slower motor to eliminate the
rotation of the robot. The position and velocity of each wheel was calculated using the
equations below.
.π.r
Xleft = Encoderleft *
64∗� ������ ∗ �����
.π.r
Xright = Encoderright *
64∗� ������ ∗ �����
∆�� � ∆��� ℎ�
Vleft = , Vright=
∆ ∆
where:
77
Figure 93 Changes implemented in Simulink - velocity estimation.
The state controller gains of the two wheel robot was initially calculated using a
Matlab function. The function takes the geometry and the weight of the robot as an input.
Then it places the inputs in the System matrix A.
78
Mc = 0.529 kg
Mw = 0.273 kg
Jw = 0.0000544 kg/m2
L = 0.093156 m
rw = 0.03 m
�
Md = Mw +
��
0 0 1 0
0 0 0 1
A=
( g / L) * (( Md Mc) / Md ) 0 0 0
g * ( Mc / Md ) 0 0 0
0
0
B=
1 / (L * rw * M d)
- 1 / (rw * M d)
where:
After getting the unstable system matrix A and the input vector B, now the aim is to
replace the unstable poles (Eigen values) of matrix A with the new stable poles.
poles = 14 2i 14 2i 10 2
Finally after checking the response of the robot during balancing , there was a slight
change in the gains.
79
13.5.4 Angle Adjustment Algorithm
As mentioned before in 13.5.1, motor was not powerful enough to balance the robot
without software adjustment. The trails showed that if the angle exceed 15 degrees the
motor was not strong and fast enough to balance the body. So the challenge was to always
keep the angle in the safe range -15 to 15 degrees. This was achieved using an extra PID
controller which adjust the angle according to the actual speed of the robot. A PID controller
continuously calculates an error value as the difference between a desired set point and a
measured process variable. The controller attempts to minimize the error over time by
adjustment of a control variable. Where Kp (=0.6), Ki (=0.5) and Kd (=0.2) all non-negative,
denote the coefficients for the proportional, integral, and derivative terms, respectively
(sometimes denoted P, I, and D). In this case the PID controller takes the robot actual
velocity as input and according to it, the angle of the robot is adjusted. The figure below
shows the Simulink implementation of this algorithm.
80
14 Conclusion.
The whole project consisted of three phases, which contained of many different
tasks. They were solved and challenged step by step. All of them together resulted in
obtaining good and functional design of the robot.
CAD Design was first step to get an idea about the most important features of the
robot. It was developed throughout all the tasks and finally was the base to create the
system in real life.
Optimization together with discussion and team member's ideas gave a huge
progress in gaining required mass. Moreover it assured for the proper geometry to obtain
enough strength.
Multibody simulations gave an idea about robot behaviour while dropping and
balancing.
Assembly of robot showed real life problems, which were difficult to be noticed in
earlier stages, but also taught how to solve it and avoid in future.
Overall it can be said, that the hard work resulted in creating working system which
fulfil all the requirements.
81
15 References.
82
16 Appendix.
83
84
85
86
16.2 Suspension calculations.
87
88
89
90
91
92
93
Drawings made for machining:
94
16.4 Base board drawing - holes.
95
16.5 Battery package drawing.
96
16.6 Shaft drawing.
97
17 List of figures.
Figure 6 Detailed characteristics of profile T 2.5 - length & number of teeth. ............ 12
98
Figure 24 Electronic circuit. .......................................................................................... 26
101
18 List of tables.
102