close

Enter

Log in using OpenID

Department of Mechanical & Industrial Engineering

embedDownload
Department of Mechanical & Industrial Engineering
MEC830 Mechatronics System Design
Final Report – Team Legotron
Program: Mechanical Engineering
Due Date: April 8, 2008
Prepared for:
Prof. F. Sharifi
Names
Student ID
Hector Cueva
XXX108012
Jugal Parikh
XXX993745
Kerry Thakurdin
XXX734013
Samir Jariwala
XXX391741
ACKNOWLEDGEMENTS
The design team, Team Legotron, would like to acknowledge and extend their gratitude to the
following persons who have made the completion of this project possible:
Our professor, Professor Farrokh Sharifi, for his commitment to our class and our project
through the teaching of core concepts, providing the required resources, and his continued
guidance and support.
Mr. Devin Ostrom, Technical Officer, for his continued efforts to teach and guide our class
throughout our project.
Without his efforts to constantly provide technical assistance,
supervision and technical guidance, this project could not have been completed.
Mr. Senthilnathan Panchatsaram, for his guidance and supervision during the labs, and his
selfless act to provide us with additional time to ensure that the all the design teams had
sufficient time in the lab to complete the project.
Lastly, Legotron acknowledge and thank to the entire Mechanical Engineering Department at
Ryerson University for their continued support of our class, the Mechatronics stream and the
entire Engineering student body.
EXECUTIVE SUMMARY
The continued developments in robotics have an astounding potential to change and improve our
quality of life.
Robots are heavily used in the industrial and medical industries, and are
stemming into several new areas. The advantage of using multiple robots to perform a given
task is the intended emphasis of the project presented to the Legotron design team.
The
proposed project involves designing, building and programming a Lego robot to function in
unison with the Mecbot to complete an outlined course.
The proposed course poses many challenges; as a result, several design parameters for the design
of the robot were continuously developed. Several prototypes of the robot were built; each
successive prototype was built to rectify any problems encountered by the preceding model.
The simulation of the mechanical system is obtained by using SimMechanics which allows the
designer to manipulate design parameters and their effects on the overall assembly. Conceptual
design of the robot is further understood through the functional requirements which are derived
from the design matrices and design parameters.
The build, design and programming of the Lego robot were successful. The robot performed as
required, successfully traveling through the course.
Challenges were encountered such as
electrical complications (light sensors) and mechanical challenges, in particular when turning.
The mechanical challenges caused the robot to slightly deviate from the desired path and
increase the time required when turning due to the excessive amount of friction form the
equipped wheels.
Reinforcing the rear axis to avoid any deformation of the wheel axis could minimize the turning
radius and in return, reduce the time required to complete the turns. More successful and
consistent turning may also be achieved by using the tracks as the primary turning mechanism;
this would reduce the amount of deformation on the axis and substantially limit the friction
encountered between the wheels and the travelling surface; resulting once again in the reduction
of the turning radius and turning time.
TABLE OF CONTENTS
1
INTRODUCTION .................................................................................................................. 5
2
THEORETICAL BACKGROUND ........................................................................................ 7
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
3
Input Ports ....................................................................................................................... 7
Output Ports .................................................................................................................... 7
Buttons ............................................................................................................................ 7
IR Tower ......................................................................................................................... 9
Motor............................................................................................................................... 9
Sensors .......................................................................................................................... 12
Gears Ratio.................................................................................................................... 13
Torque ........................................................................................................................... 13
Speed ............................................................................................................................. 14
Force ............................................................................................................................. 14
PWM and Motor Speed ................................................................................................ 15
MODELING ......................................................................................................................... 16
3.1
Product Architecture Schematic (PAS) ........................................................................ 16
3.2
Conceptual .................................................................................................................... 17
3.3
Mechanical .................................................................................................................... 21
3.3.1
Dynamic Analysis ................................................................................................. 21
3.3.2
Stall Torque of the Two DC Motors ..................................................................... 22
3.4
Control .......................................................................................................................... 23
3.5
Sensory.......................................................................................................................... 24
4
DESIGN AND OPTIMIZATION......................................................................................... 25
4.1
Conceptual .................................................................................................................... 25
4.1.1
Requirement Phase................................................................................................ 25
4.2
Specification Phase ....................................................................................................... 26
4.2.1
Power System........................................................................................................ 26
4.2.2
Design ................................................................................................................... 26
4.2.3
Design of Mechanism: .......................................................................................... 27
4.3
Integration ..................................................................................................................... 27
4.3.1
Virtual Prototyping: .............................................................................................. 27
4.3.2
Physical Realization: ............................................................................................. 27
4.3.3
Operation............................................................................................................... 28
4.4
Mechanical .................................................................................................................... 28
4.4.1
Mechanical System ............................................................................................... 28
4.4.2
Relation of Power System to Mechanical System ................................................ 28
4.5
Control .......................................................................................................................... 28
4.5.1
Control System...................................................................................................... 28
4.5.2
Relation of Power System to Control System....................................................... 29
4.6
Sensory.......................................................................................................................... 29
4.6.1
Sensor System ....................................................................................................... 29
i
4.6.2
4.6.3
4.6.4
5
Relation of Power System to Sensor System ........................................................ 29
Relation of Mechanical System to Sensor System ............................................... 30
Relation of Control System to Sensor System ...................................................... 30
IMPLEMENTATION ISSUES AND EXPERIMENTAL RESULTS VERSUS
SIMULATION RESULTS ........................................................................................................... 31
6
DISCUSSION AND CONCLUSION .................................................................................. 33
7
REFERENCES ..................................................................................................................... 34
APPENDIX A - ANALYSIS OF STALL TORQUE ............................................................... A - 1
APPENDIX B – PART LOAD COUNTER, VELOCITY SENSOR & WEIGHT SENSOR . A - 1
APPENDIX C – C Programming ............................................................................................. A - 1
ii
LIST OF FIGURES
Figure 1: Representation of the Course ......................................................................................... 5
Figure 2: RCX Brick with Inputs and Outputs[1]........................................................................... 8
Figure 3: IR Tower[2] ..................................................................................................................... 9
Figure 4: 9 V RCX Motor[2] .......................................................................................................... 9
Figure 5: Circuit Model of DC Motor[7] ...................................................................................... 10
Figure 6: Block Diagram of DC motor[8] .................................................................................... 10
Figure 7: 3:1 Gear Ratio .............................................................................................................. 13
Figure 8: Ratio of Torque is Equal to the Ratio of the Radii ....................................................... 14
Figure 9: Ratio of Rotation Speed is Equal to Inverse of Radii ................................................... 14
Figure 10: Force, Torque and Radius Relationship for a Wheel ................................................. 15
Figure 11: PWM Duty Cycle ....................................................................................................... 15
Figure 12: Product Architecture Schematic (PAS) ....................................................................... 16
Figure 13: Space Rover Vehicle Design[3] .................................................................................. 17
Figure 14: Concept Link Design ................................................................................................... 18
Figure 15: Lego Link Design Model ............................................................................................ 19
Figure 16: RoboWorks Model of Link Design ............................................................................. 19
Figure 17: SimMechanics Block Diagram of Link Design .......................................................... 20
Figure 18: FBD of Stair Case and Front Wheel ............................................................................ 21
Figure 19: Bang-bang Algorithm Flowchart................................................................................. 23
Figure 20: Light Sensor Calibration ............................................................................................. 24
Figure 21: Lego Robot and Mecbot Hierarchy Diagram .............................................................. 25
Figure 22: Implementation of Improved Design Parameters ........................................................ 31
Figure A 1:
Figure A 2:
Figure A 3:
Figure A 4:
Torque vs Speed for Motor 1................................................................................ A - 2
Torque vs Speed for Motor 2................................................................................ A - 2
Max Power Motor 1.............................................................................................. A - 3
Max Power Motor 2.............................................................................................. A - 3
Figure B 1: Load Sensor Mechanism....................................................................................... B - 3
iii
LIST OF TABLES
Table 1: Simulink DC Motor Model ............................................................................................. 11
Table 2: DC Motor Steady State Speed Response ........................................................................ 11
Table 3: RCX Sensors[2] .............................................................................................................. 12
Table 4: VR Model of Link Design Frame by Frame .................................................................. 21
Table 5: Stall Torque Experimental Observations ....................................................................... 22
Table 6: Power Observation for Stall Torque .............................................................................. 23
Table B 1: Experimental Observations .................................................................................... B - 3
Table B 2: Linear Relationship between IR Reading and Load .............................................. B - 4
iv
1
INTRODUCTION
Team Legotron was asked to produce a prototype Lego mobile robot, using the Lego Mindstorm
kit that will perform in unison with the Mecbot, to complete the proposed course. The course is
intended to emphasize the advantages of using multiple robots to perform a given a task.
To understand the performance and the design parameters required of the Lego mobile robot, the
first step was to understand the challenges the course presented. The Lego robot must first climb
up and over a set of stairs. Using only sensors to navigate the robot, it must travel along the
encountered wall. The Ryerson mobile robot (Mecbot) is then waiting behind the wall for the
Lego robot to come into contact with its bumper switches to initiate its travel. The Mecbot then
travels along a strip of tape, using only the edge detector, until the course is completed.
Figure 1: Representation of the Course
The greatest initial challenge is the climbing and descending of the stairs. For this to occur, a
high amount of torque is required in relation to the size and mechanics of the robot’s design. By
analyzing the stall torques prior to building of the robot, an estimation of the motor’s
performance limitations could be derived. In addition, the performance of the team’s initial
5
design was analyzed in SimMechanics to further identify how the prototype was performing and
what design parameter needed to be altered to enhance the current level of performance.
To navigate around the wall, the Lego robot had to be mounted with light sensors. The sensors
were programmed, in interactive C, to help control the navigation of the robot, with reference to
the wall. How the robot would turn, when it would turn, and the various required speeds were
developed through the software and the necessary mechanical modifications were applied as
required.
The Mecbot was programmed, also in interactive C, to follow the tape using the edge detectors.
The initiation of the Mecbot was a significant challenge. To initiate the Mecbot the Lego robot
had to successfully travel around the wall, without a significant amount of deviation in order to
be in line with the bumper switch, which when contacted, initiates the travel of the Mecbot.
6
2
THEORETICAL BACKGROUND
At first glance, the Lego Mindstorm kit may appear as nothing more than a toy, but for
engineering students, inventors, and industries, it is a practical learning tool for prototyping
devices. At the core of the RCX brick is a Hitachi H8 microcontroller with 32K of external
RAM. RCX Lego Mindstorm model includes a programmable microcontroller-based brick that
can simultaneously controls three motors, three sensors, and an infrared serial communication
port.
2.1 Input Ports
The RCX brick contains three input ports that can accept a variety of Lego Sensors such as touch
sensors, light sensors, and encoders. For the ease of connection, the connecting wire has both
ends integrated with mountable Lego pieces, with metallic connections to the underside,
providing easily mounting onto brick input ports. Also of significance, is that it is designed in
such a way that the orientation of the connected Lego piece does not matter.
2.2 Output Ports
There are also three output ports that controls actuators, but mainly used for motors in this
project. Unlike input ports, output ports behave differently for different orientation in which the
motor is connected. When the wire is connected at the 6 o’clock or 9 o’clock orientation, the
motor will turn clockwise conversely when the wire is connected at the 12 o’clock or 3 o’clock
the motor will turn counter clockwise. However, this is only true when the motor end of the wire
is connected such that it passes through the grove on motor. This encourages building model in
symmetric pattern so that wheels rotation of a car are in same direction.
2.3 Buttons
There are four buttons on the RCX brick: On-Off, Run, View, and Pram. These allow the user to
interact with the microcontroller, mostly to execute the downloaded program and built in
firmware programs.
7
On-Off: The main function of this button is to turn the power on or off. Notice that turning off
the power does not erase the saved program.
Run: This button starts executing the desired program. It also interrupts the program if pressed
while the program is running.
View: As a default the view button is programmed in firmware to show the value of the input
and output ports.
Pram: RCX is capable of storing five different programs. The Pram button is used to switch
between programs and then executed using Run button.
Figure 2: RCX Brick with Inputs and Outputs[1]
8
2.4 IR Tower
The Lego Mindstorm kit comes with an infrared transmitting tower. It allows the user to transfer
the C program, developed on a PC, wirelessly to the brick. The IR signal transfer between IR
tower and brick behaves much like a television remote control. The IR tower is connected to a
PC via a serial port.
Figure 3: IR Tower[2]
2.5 Motor
The Lego Mindstorm kit comes with a 9-volt DC motor which runs on RCX AA battery pack or
an AC adapter connected to the brick. Unfortunately, theses motors only have one rate of
rotation. The speed of rotation can be decreased by supplying less voltage using firmware code,
but there will be no change in the output torque. The only way to manipulate speed and torque is
to use gears on output shafts.
Figure 4: 9 V RCX Motor[2]
9
Figure 5 is a circuit model of the field control DC motor.
Figure 5: Circuit Model of DC Motor[7]
Using the electrical and mechanical system boundary analysis, the transfer function for the DC
motor can easily be obtained. This transfer function is shown in Figure 6.
Figure 6: Block Diagram of DC motor[8]
Using the transfer function and the Simulink, the motors performances were observed. Table 1
shows the block diagam in Simulink, and motor parameters used.
10
Table 1: Simulink DC Motor Model
DC Motor Block Diagram
DC motor Parameters
Finally, the motor speed output was obtained and displayed in Table 2. From the results it was
evident that motor1 had higher speed than motor2. Hence, it was important to componset this
difference in our programming.
Table 2: DC Motor Steady State Speed Response
DC Motor1 Steady State Speed Response  = 32.5
DC Motor2 Steady State Speed Response  = 33.2
11
2.6 Sensors
Sensors are very important components of any robot, because they convey the information of the
external surroundings. This information is then used to make a decision on what the next move
should be. The Lego Mindstorm kit comes with different types of sensors, which include: touch
sensors, light sensors and encoders.
Table 3: RCX Sensors[2]
Touch Sensor
Light Sensor
Encoder
Touch Sensors: It is the most basic and the easiest to program sensor in the RCX. It is
typically used in conjunction with a bumper to detect the contact. It has only two states: on
and off. Both on and off states are associated with Boolean logic true and false (i.e. 1 or 0).
Light Sensors: The light sensors works on the light intensity. These sensors are mainly used
to measure the distance between the object and the robot. Utilizing a C program, these sensors
can detect the continuous wall and direct the robot to follow the wall without collision.
Encoders: Encoders are used to measure how far a rotating axle has turned. It has a free
spinning bushing which fits on a shaft and rotates as the shaft rotates. As the bushing turns, a
counter in the RCX is incremented or decremented. Using the proper gear ratio and the radius
of the wheels, the linear distance can be measured.
12
2.7 Gears Ratio
Gear ratio is how much the output shaft turns for a given rotation of the input shaft. In Figure 7:
3:1 Gear Ratio, we have an 8t gear pinion and a 24t output gear. If the 8t gear rotates one full
revolution then eight of its teeth would pass through the starting line and 24t gear’s teeth also
pass the starting line. If teeth are properly meshed and evenly distributed around the
circumference of the gears, 24t gear turns 8/24 or 1/3 of a revolution. Hence, the gear ratio is
given by the inverse of the ratio of the number of gear teeth, resulting in the following gear ratio:
Gear Ratio = 1:1/3 = 3:1.
Figure 7: 3:1 Gear Ratio
2.8 Torque
Torque is the measure of a force's tendency to produce torsion and rotation about an axis. A
typical example of a torque application is the required force to the turn the handle of a wrench.
Gears operate by transmitting force at the teeth of the gear. In Figure 8: Ratio of Torque is
Equal to the Ratio of the Radii, the torque transmission between two gears is displayed. Note
that force experience by both gears is same. It also shows the relationship between the torques
and the radii of the gears (number of teeth can also be used instead of radius).
13
Figure 8: Ratio of Torque is Equal to the Ratio of the Radii
2.9 Speed
Gears are used to increase the output torque, but the speed is sacrificed in doing so. In essence,
the output shaft turns stronger which allows it to increase load capacity of the machine but the
shaft turns at a much slower rate. Figure 9: Ratio of Rotation Speed is Equal to Inverse of Radii,
indicates the speed transfer between two gears. Note that this time linear velocity (tangential
speed) of both gears is the same. This time the larger gear turns slower than the smaller.
Figure 9: Ratio of Rotation Speed is Equal to Inverse of Radii
2.10 Force
As established above, the relationship between force, torque and radius also holds true for a
wheel. As shown in Figure 10: Force, Torque and Radius Relationship for a Wheel, large
wheels have a bigger radius (lever length) and will generate less force for a given torque than
small wheels would. Less force means less acceleration. The car will go faster, but it will take
longer to reach that speed.
14
Wheel Torque = Motor Torque x Gear ratio
Force = Wheel Torque / Radius
Torque
R
Force
Figure 10: Force, Torque and Radius Relationship for a Wheel
2.11 PWM and Motor Speed
Pulse Width Modulation (PWM) provides a variable voltage supply to the motor by changing
high and low at a fixed frequency. In Figure 11: PWM Duty Cycle, duty cycle is the percentage
of high period t versus total period T.
DC = (t/T) x 100 %, where T fixed, and t varying.
t
T
Figure 11: PWM Duty Cycle
The RXC quickly switches the power on and off. Different power levels are achieved by varying
the percentage of time that the power is on (this is called the duty cycle).
15
3
MODELING
Modeling and simulation is a very important aspect of Mechatronics engineering. It allows
engineers/designers to evaluate the entire system without physically building and implementing
the design. More importantly, it allows to change and manipulate the design variables and to
examine the effects on the resulting outputs. Modeling Mechatronics design problems include
conceptual, mechanical, control and sensory design.
3.1 Product Architecture Schematic (PAS)
MCU
COMPUTER
GEARS
MOTORS
POWER
STAIRS CLIMBING
& ACTUATING
ROBOT
FRAME
BATTERIES
BODY (LEGO
PIECES, WHEELS,
ETC.)
SENSORS
BODY (LEGO
PIECES, WHEELS,
ETC.)
Figure 12: Product Architecture Schematic (PAS)
The Computer acts as the brain of both robots since it is used to program them. The computer
provides both robots with instructions for the course and hence there is only information transfer
16
between MCU and the Computer. The MCU passes the instructions to the motors, which in turn
pass them onto the gears. Any sort of movement from the gears is directly translated into
movement by the robot and hence the gears are one of the outputs of the system. Therefore the
transfer / interaction between MCU and the motor, and the motor and gears are informational.
Electrical components such as MCU, computer, and the sensors, need power to operate. The
power supplied by electrical outlets and batteries and any kind of interaction between these
components is energy transfer.
For the Lego pieces used in the robot, there is a mass transfer through the body of the Lego
Robot (or the frame). There is no change in what is being transferred, i.e. the robot at the
beginning is same as the robot at the end. The robot moves from one end to another.
3.2 Conceptual
The concept of our initial design chassis originated from the space rover vehicle design shown in
Figure 13: Space Rover Vehicle Design.
Figure 13: Space Rover Vehicle Design[3]
Once the idea was generated concept sketch was developed as shown in Figure 14. Note that the
center wheel is connected to the back frame and the front frame is free to rotate about the axis of
17
the link joint. It shows the robot in motion (to the left) climbing the stairs. As the front wheels
come in contact with the vertical wall of the first step, the front link rotates upward as long as the
center wheel does not touch the step. At this particular instant, front wheel catches the edge of
the first step and the friction generates enough torque to pull center wheel over the first step.
During all this time the back wheels are continuously pushing the whole car to move forward.
This entire process continues until top of the stair. Coming down the floor is not a problem as
gravity, in addition to the torque generated from motors, helps to drive the car down.
Figure 14: Concept Link Design
The main difference between the space rover design and our design is that our chassis had five
wheels instead of six as shown in Figure 15: Lego Link Design Model. We eliminated one
wheel from the center so that we can reduce the amount of space occupied by the extra wheel. In
addition, due to the limitation of the numbers of motors available, and the high level of torque
required, we were unable to utilize a steering based turning system. To tackle this issue, the back
wheels were driven independently. As a result, to turn right, the left wheel was programmed to
18
go forward while right wheel was programmed to go backward. Similarly, to turn left, the right
wheel was programmed to go forward and left wheel was programmed to go backward.
Figure 15: Lego Link Design Model
Once the concept is developed and agreed upon, the next step is to model the concept using
interactive modeling software such as RoboWorks and SimMechanics.
RoboWorks is an easy to use software tool for 3D modeling, simulation and animation of any
physical system. Figure 16: RoboWorks Model of Link Design, shows a working model of the
concept. It can be animated so that viewer can see the actual rotation of the links and wheel as it
climbs the stairs.
Figure 16: RoboWorks Model of Link Design
19
SimMechanics is an extension to Simulink which helps modeling and simulating mechanical
system with the construction of block diagrams. It allows designers to manipulate with design
parameters and view their effects on the overall design. One of the major advantages of using
SimMechanics over Simulink is that it does not require any transfer function. User can directly
insert the mechanism in the form of blocks diagrams such as rigid body, joints, actuators, and
sensors. Furthermore, it can also generate a 3D model and simulate with the Virtual Reality
function.
Figure 17: SimMechanics Block Diagram of Link Design
As mentioned above, the build in Virtual Reality function was used to create the 3D model, and
the simulation was created which is shown in Table 4.
The SimMechanics model was created to simulate the motion at the instance where the robot
begins to climb the stairs. The model was created in Solidworks and then imported into
MATLAB. The force and velocity of the robot were analyzed. The simulation did not produce
the desired results, which in this case is the robot climbing and descending the stairs. The
simulation only involved the motion of front wheels moving up and down; the back wheels had
no motion.
20
Table 4: VR Model of Link Design Frame by Frame
Simulation Frame 2
Simulation Frame 1
Simulation Frame 3
3.3 Mechanical
Mechanical design is an essential part of Mechatronics system design. For the project, the
analysis of speed, torque, friction, and inertia are all part of the mechanical design.
3.3.1 Dynamic Analysis
The most critical and challenging part of this project was to climb a stair case with the step
height (55.0mm) is greater than the radius (40.8mm) of the biggest wheel from RCX
MINDSTORMS kit. Hence, in-depth dynamic analysis had to be conducted to understand and
improvise the design. Figure 18 is the FBD of the stair case and front wheel of the robot.
Figure 18: FBD of Stair Case and Front Wheel
21
y0 f
A
 fB  0
0   A ma   B mg
a
B
g
A
0 .3
(9.81)
0 .4
a  7.35m / s 2
a
From the static equilibrium in y direction, it is clear that if the acceleration of the carth is more
than 7.35 m/s2. Note that the coefficients of friction are estimate values.
A
  A ma

 A   A m a
fA 
 (4.08  10 3 )(0.4)(0.4)(7.35)
 A  0.047 N  m
Finally, the torque required is calculated to be 0.047 N.m, which is substantially more than Tmax
in Table 5. Hence, the gear ratio had to be utilized to provide sufficient torque in order to go
over stair case.
3.3.2 Stall Torque of the Two DC Motors
The stall torque of the two DC motors is an essential analysis to understand the torque
capabilities of the motors. This design parameter was analyzed by constructing a small structure
that is capable of withstanding a significant amount of weight. The DC motors are mounted onto
this structure, and the known mass is applied to the attached armature. By measuring the
distance of the armature and recording the masses to achieve the stop torque for both motors, the
stall torque can be derived.
Table 5: Stall Torque Experimental Observations
ωn
Motor 1
Motor 2
ωn/2
(rad/s)
(rad/s)
32.5
rad/s
33.2
rad/s
16.25
rad/s
16.6
rad/s
Load (g)
0.225
kg
0.250
kg
Kt
(Nm/A)
0.277
9.00 V
0.271
9.00 V
22
U (V)
Ts
(Nm)
0.044
Nm
0.049
Nm
Tmax
(Nm)
0.022
Nm
0.0245
Nm
R
(Ω)
56.7 Ω
49.8 Ω
Table 6: Power Observation for Stall Torque
Motor 1
Motor 2
Pmax
Pmax
Mechanical
Electrical
0.358 W
0.407 W
0.90 W
0.90 W
*Refer to Appendix A for experimental parameters and sample calculations
3.4 Control
Many control methods such as bang-bang control, proportional control, proportional derivative
control and proportion integral derivative control can be applied to this project.
Most
importantly, when the robot requires to turn and to follow the wall, the control is necessary to
ensure that the robot follows the required path with minimum error. The simplest of all, bangbang control was used in this project. It adjusts the control only by two limits, min and max. It
follows a simple algorithm, as shown in Figure 19; if the measurement is less than set point go to
max else go to min. The set point, max and min are user defined.
Figure 19: Bang-bang Algorithm Flowchart
23
3.5 Sensory
The touch sensor is a digital sensor with two states: 0 and 1. When sensor is pressed (actuated),
the returned value is 1 and when it is released (not actuated) the returned value is 0.
The light sensor used for this project is an analog sensor. Hence, the value measured by sensors
is in analog and had to be converted into digital form. Also, the calibration is needed to establish
a relationship between ADC reading and measurement value. The calibration plot for both light
sensors is shown in Figure 20. According to the values, both sensors behave linearly with a
range of one to six inches. Measurement for less than one inch returns as 727 and 764 counts for
sensor 1 and sensor 2 respectively. Similarly, measurement more than six inches returns as 821
and 869 counts for sensor 1 and sensor 2 respectively.
Light Sensor Calibration
1000
y = 18.2x + 765.13
Light Sensors Value
900
800
y = 17.943x + 723.53
700
600
500
400
300
200
100
0
0
1
2
3
4
5
6
7
Distance (in)
Light Sens 1
Light Sens 2
Linear (Light Sens 1)
Linear (Light Sens 2)
Figure 20: Light Sensor Calibration
*Refer to Appendix B for description of part load counter, velocity sensor and weight
sensor
24
4
DESIGN AND OPTIMIZATION
4.1 Conceptual
Requirement
Phase
Conceptual
Design
Specification
Phase
Design
Phase
Detail
(Embodiment)
Design
Implement
Integration
Integration
 Trial/Error
 Simulation
Operation
Figure 21: Lego Robot and Mecbot Hierarchy Diagram
4.1.1 Requirement Phase
1. The Ryerson mobile robot (Mecbot) is waiting behind the wall with bumper switches.
2. The Lego robot starts to move; climbs up and down stairs.
3. It will follow the wall using sensors.
4. Lego robot will push the bumper switch of Ryerson mobile robot (Mecbot).
25
5. The Ryerson mobile robot will start move forward (using sensors) following the black strip
on the floor.
4.2 Specification Phase
The specification phase shows matrices with functions required (FR) and the design parameters
(DP) available for those functions. The design matrix (DM) is obtained by checking which
parameters are required for a particular function. A best design would have only one parameter
per function, and hence a diagonal DM. A design with all diagonal DM’s would be most efficient
system. Multiplying DM with DP gives all the parameters required for a particular FR
4.2.1 Power System
FR
Power on board - MCU (Lego)
DM
DP
1 0 0 0 Batteries / AC / DC
Power on board - MCU (Mecbot) 1 0 0 0 DC Motors

Actuate (Lego)
1 1 1 0 Touch Sensor
Actuate (Mecbot)
1 1 0 1 Bumper Switch
4.2.2 Design
4.2.2.1 Mechanism
Wheels, track system, gears and frame to move (forward / backward, turn and climb up / down).
4.2.2.2 Power
Batteries and adapter to operate sensors, controllers, and actuators.
4.2.2.3 Control
Touch sensor, light sensor, and time based controls to send commands to MCU.
4.2.2.4 Sensors
Touch sensor to start, light sensor to position at a distance from the wall and to position turning,
and time-based sensors to position turning.
26
4.2.3 Design of Mechanism:
1.
Design the frame robust such that it is able to withstand and absorb the force exerted by the
stairs when in contact.
2.
Design the frame with evenly distributed weight which prevents the robot from tipping
while climbing the stairs.
3.
Design the frame such that gears and other accessories are high enough to clear the steps
while climbing and do not cause any interference.
4.
Design the gear system such that it has enough torque to lift the robot over the steps.
4.2.3.1 Design of Power:
1. Choose the batteries and adapter with enough power to drive the car and is according to class
requirement.
4.2.3.2 Design of Control:
1. Choose sensors and program the car such that the design requires minimum number of
sensors and provides maximum functions.
4.2.3.3 Deigns of Sensors:
1.
Choose touch sensor.
2.
Choose light / infrared sensor.
4.3 Integration
4.3.1 Virtual Prototyping:

Create a model for selected components.

Design a simulation program to simulate performance.

Compare results to specification and apply modifications if necessary.
4.3.2 Physical Realization:

Acquire components and apply physical realization.
27

Test the system.

Compare results to FRs and specifications and apply modifications if necessary.
4.3.3 Operation

Test the system for N-cycles.

Test the system for robustness.

Compare results to specifications and apply modifications if necessary.
4.4 Mechanical
4.4.1 Mechanical System
FR
Forward / Backward (Lego)
DM
DP
1 0 0 1 0 1 0 Wheels (Lego)
Forward / Backward (Mecbot)
Turn Left / Right (Lego)
0 1 0 0 1 0 1 Wheels (Mecbot)
1 0 0 1 0 1 0 Track System (Lego)
Turn Left / Right (Mecbot)
Climb Up / Down Stairs
 0 1 0 0 1 0 1 Gears (Lego)
1 0 1 1 0 1 0 Gears (Mecbot)
Stop (Lego)
1 0 1 1 0 1 0 Frame (Lego)
Actuate Mecbot
1 0 0 1 0 1 0 Frame (Mecbot)
4.4.2 Relation of Power System to Mechanical System
FR
Wheels (Lego)
Wheels (Mecbot)
Track System (Lego)
Gears (Lego)
Gears (Mecbot)
Frame (Lego)
Frame (Mecbot)
DM
0010
DP
0010
Power On-board - MCU (Lego)
0010
Power On-board - MCU (Mecbot)
 0000
Actuate (Lego)
0000
Actuate (Mecbot)
0000
0000
4.5 Control
4.5.1 Control System
28
FR
Control Motor (Lego)
DM
DP
1 0 0 0 0 0 Digital Output (Lego)
Control Motor (Mecbot)
0 1 0 0 0 0 Digital Output (Mecbot)
Interface Digital (Lego)

Interface Digital (Mecbot)
0 0 1 0 0 0 ADC (Lego)
0 0 0 1 0 0 ADC (Mecbot)
Interface Analog (Lego)
0 0 0 0 1 0 Digital Input (Lego)
Interface Analog (Mecbot)
0 0 0 0 0 1 Digital Input (Mecbot)
4.5.2 Relation of Power System to Control System
FR
Control Motor (Lego)
DM
0010
Control Motor (Mecbot)
0 0 0 1 Power On-board - MCU (Lego)
Interface Digital (Lego)
Interface Digital (Mecbot)

DP
1 0 0 0 Power On-board - MCU (Mecbot)
0 1 0 0 Actuate (Lego)
Interface Analog (Lego)
1 0 0 0 Actuate (Mecbot)
Interface Analog (Mecbot)
0100
4.6 Sensory
4.6.1 Sensor System
FR
Sense Contact (Lego)
DM
100000
DP
Sense Contact (Mecbot)
0 1 0 0 0 0 Touch Sensor (Lego)
Sense Wall (Lego)
0 0 1 0 0 0 Bumper Switch (Mecbot)
Sense Black Strip (Mecbot) 0 0 0 1 0 0 Light/Infrared Sensor (Lego)

Measure Distance (Lego)
0 0 1 0 1 0 Optical Edge Detector (Mecbot)
Measure Distance (Mecbot)
Measure Rotation (Lego)
0 0 0 1 0 1 Time (Lego)
0 0 1 0 1 0 Time (Mecbot)
Measure Rotation (Mecbot)
000101
4.6.2 Relation of Power System to Sensor System
FR
DM
29
DP
Sense Contact (Lego)
Sense Contact (Mecbot)
1000
0100
Sense Wall (Lego)
1 0 0 0 Power On-board - MCU (Lego)
Sense Black Strip (Mecbot) 0 1 0 0 Power On-board - MCU (Mecbot)

Measure Distance (Lego)
1 0 0 0 Actuate (Lego)
Measure Distance (Mecbot)
Measure Rotation (Lego)
0 1 0 0 Actuate (Mecbot)
1000
Measure Rotation (Mecbot)
0100
4.6.3 Relation of Mechanical System to Sensor System
FR
DM
Wheels (Lego)
10101010
Wheels (Mecbot)
01010101
DP
Contact Sensor (Lego)
Contact Sensor (Mecbot)
Wall Sensor (Lego)
Track System (Lego) 1 0 1 0 1 0 0 0
Black Strip Sensor (Mecbot)
Gears (Lego)
 00000000
Distance Sensor (Lego)
Gears (Mecbot)
00000000
Distance Sensor (Mecbot)
Frame (Lego)
10101010
Rotation Sensor (Lego)
Frame (Mecbot)
01010101
Rotation Sensor (Mecbot)
4.6.4 Relation of Control System to Sensor System
FR
DM
DP
Contact Sensor (Lego)
Control Motor (Lego)
0 0 0 0 0 0 0 0 Contact Sensor (Mecbot)
Control Motor (Mecbot)
0 0 0 0 0 0 0 0 Wall Sensor (Lego)
Interface Digital (Lego)
1 0 0 0 1 0 1 0 Black Strip Sensor (Mecbot)

Interface Digital (Mecbot) 0 1 0 0 0 1 0 1 Distance Sensor (Lego)
Interface Analog (Lego)
Interface Analog (Mecbot)
0 0 1 0 0 0 0 0 Distance Sensor (Mecbot)
0 0 0 1 0 0 0 0 Rotation Sensor (Lego)
Rotation Sensor (Mecbot)
30
5
IMPLEMENTATION ISSUES AND EXPERIMENTAL RESULTS
VERSUS SIMULATION RESULTS
From the simulation (SimMechanics model) of the initial design, it appeared that the front part of
the robot would climb the stairs but no conclusion could be drawn for the back portion of the
design. Hence the simulation was inconclusive and an actual model was built to further examine
the robot. The robot (built from initial design) did not climb the stairs and from the analysis of its
run, the following problems were encountered: (1) not enough friction, (2) not enough torque, (3)
stair edge clearance, and (4) center of gravity. The front wheels got up the first step but due to
the lack of friction, it kept slipping at the second step. The amount of torque on both the front
and back wheels was not sufficient. In particular, the back end of the robot needed a substantial
increase in torque. Although the front end successfully elevated, the back end did not have
enough power to move the robot forward, past the first step and onward. The chassis had motors
and other pieces were mounted close to the stair height. This also prevented the robot from
climbing up the stairs due the impedance of parts due to the design. Finally, the center of gravity
was located closer to the back end; as a result, at times the robot would topple backwards after
climbing the first step due to the imbalance of the weight distribution.
Two Wheels
Track with Belt V-Frame High Gear
ratio
Figure 22: Implementation of Improved Design Parameters
31
Based on the complications of our original design, the design team decided to pursue a new
design that would rectify the problems encountered. The process followed for the new design is
detailed in section 4. In order to overcome the problems encountered in the initial design, extra
wheels were added at the front to increase friction, design was changed to increase torque by
changing our gear train in both front and rear drive, V-frame was introduced to avoid
interference with the stairs, and weight was distributed more evenly throughout the robot to
prevent it from tipping (refer to
Figure 22)
32
6 DISCUSSION AND CONCLUSION
The most important part of the course was the stair climb and our robot climbed the stairs
consistently without a hitch. It also followed the wall consistently at the end of the stairs. The
Mecbot followed the black strip every time once actuated as well. The only drawback in the
design was the final left turn, which wasn’t perfect and often missed the bumper switch on the
Mecbot.
There are no perfect designs and all designs need improvements. In this design, there are several
things that could be changed to make the design more efficient. Firstly, the turning took long
time compare to travel time and also some of the wheels were dragging. If the robot was all
wheel drive with one motor controlling right wheels and another motor controlling left wheels;
the turning could have been more efficient as all wheels would be in motion resulting in less
drifting. Secondly, the robot fairly long and this required wide turns and also turning took longer.
If the robot were more compact, turning would be more accurate, faster, and would also
eliminate wide turns.
A technical problems encountered during the project were inconsistency in sensor reading. The
reading varied every time under same environmental conditions (i.e. lights off). The reason for
being the sensor was too old and was wearing down.
Overall the project was a success as all assigned tasks were completed. There was a lot learned
from this project and it helped enhance our technological knowledge and further develop our
problem solving skills. In future projects in industry, we would definitely apply the skills
acquired in this course. We understand that a thorough design analysis and simulation prior to
building a model or prototype is vital in a project as it saves time and money.
33
7
REFERENCES
[1] Brear, David, comp. "Lego Dacta Robotics and Helpful Web Sites." 5 Mar. 2008
<members.shaw.ca/dbrear/legowebsites.html>.
[2] "Lego Mindstorm & Technic (Spare Parts and Accessories)." 2 Mar. 2008
<http://www.active-robots.com/products/lego/legospares.shtml>.
[3] "Track 2 Remote Operation Challenges." BotBrain Educational Robots. 22 Mar. 2008
<http://botbrain.com/camp2Remote.html>.
[4] Necsulescu, Dan. Mechatronics. New Jersey: Prentice Hall, 2002.
[5] Bagnall, Brian. Lego Mindstorms Programming. New Jersey: Prentice Hall, 2002.
[6] Hystad, Dean. Building Lego Robots for First Lego League. Minnesota First Lego League.
Innovations in Science and Technology Education, 2002. 03 Mar. 2008
<www.hightechkids.org>.
[7] Sharifi, Farrokh Janabi, “MEC 830 Mechatronics Design”, Ryerson University, 2008, 06 April.
2008 <www.ryerson.ca/~fsharifi/Courses/MEC830>
34
APPENDIX A - ANALYSIS OF STALL TORQUE
Theoretical Calculations
Stall Load
Motor1: 230 g
Motor2: 240 g
Armature Radius: 20 mm
Sample Calculation
--Calculating Kt
ωn = u/Kt
Kt=9/32.5=0.277 Nm/A
--Calculating Ts (stall torque)
Ts = (Stall Mass)(Acceleration due to Gravity)(Armature Radius)
Ts =(0.225kg)(9.81m/s2)(0.020m)=0.044 Nm
--Calculating R
Ts = uKt/R
R = uKt/ Ts
R = (9V)(0.277Nm/A)/(0.044Nm)=56.7 Ω
--Calculating Max Power
Mechanical Power:
Tmax=0.5 Ts = 0.022
Pmax = ωnTs/4=(32.5rad/s)(0.044Nm)/4=0.358 W
Electrical Power
P=ui=(9V)(0.1A)=0.90 W
A-1
Torque Vs. Speed
0.045
0.04
Torque (Nm)
0.035
0.03
0.025
0.02
0.015
0.01
0.005
0
0
5
10
15
20
25
30
35
Speed (rad/s)
Figure A 1: Torque vs Speed for Motor 1
Torque Vs. Speed
0.06
Torque (Nm)
0.05
0.04
0.03
0.02
0.01
0
0
5
10
15
20
Speed (rad/s)
Figure A 2: Torque vs Speed for Motor 2
A-2
25
30
35
Max Power Motor 1
1
0.9
0.8
Power (W)
0.7
0.6
0.5
Mechanical
0.4
Electrical
0.3
0.2
0.1
0
0
5
10
15
20
25
30
35
Speed (rad/s)
Figure A 3: Max Power Motor 1
Max Power Motor 2
1
0.9
0.8
Power (W)
0.7
0.6
0.5
Mechanical
0.4
Electrical
0.3
0.2
0.1
0
0
5
10
15
20
25
Speed (rad/s)
Figure A 4: Max Power Motor 2
A-3
30
35
Practical Calculations
A-4
From the experiment it is clear that stall torque for both motor 1 and 2 are 0.03946 Nm and
0.03889 Nm respectively. In comparison to theoretical values, there is now friction involved
with the car and the static load; as a result, the motor has to overcome this additional resistance.
For theoretical calculation, the motor was stationary, and was attached to a pulley system, in this
case, the motor was constructed to be part of the system where it was mounted on the car, and
utilized with gears and wheels. As a result of the motor being mounted with the car, there was
also additional resistance on the motor that it had to overcome from the friction between the
gears. Previously, these additional resistances did not exist, and the existing frictional sources
were small enough to be considered negligible; therefore, the practical stall torques values were
less because it was combined with the additional resistances.
A-5
APPENDIX B – PART LOAD COUNTER, VELOCITY SENSOR & WEIGHT
SENSOR
B.1 Part Load Counter
Design a PART LOAD COUNTER using a touch switch from the Lego Mindstorm kit, write an
IC program for the counter and display the counts on the screen.
int part_no, i, touch;
void main()
{ part_no =0;
while(1)
{
if (touch(1)==1) /*touch sensor attached to channel 1 is hit */
{
sleep(0.50); /* gives time to take back the finger */
part_no = part_no +1; /* accumulates the part # */
}
printf("%d\n", part_no); /* displays the number of parts */
}
}
B.2 Velocity Sensor
long sensor_time[2], Vel, Speed;
int i;
void main()
{ reset_system_time(); //could be alternatively reset by pressing reset switch.
i=0;
while (i < 1)
{ if (irproxright()>110)
{ beep();
sensor_time[i] = mseconds(); //returns the count of system time in msec
printf("%d \n", i);
i++;}}
i=1;
while (i < 2)
{ if (irproxleft()>110)
B-1
{ beep();
sensor_time[i] = mseconds(); //returns the count of system time in msec
i++;}}
Speed = ((4.85/(sensor_time[1]-sensor_time[0]));
printf("%d \n",Speed);
}
/*distance between sensors=4.85inches
trial 1=320 ms
trial 2=324 ms
trial 3=323 ms*/
The lego car goes past the 2 infrared sensors of the MCU robot which would beep when it
detects the lego robot each time and would record the number of the beep, whether it is the first
reading or the second, and then display the speed of the lego robot on its LCD screen.
The distance between the 2 infrared sensors on the MCU robot was known, therefore by dividing
that distance by the time the lego robot takes to travel between the infrared sensors, it is possible
to calculate the speed of the lego robot.
B.3 Weight Sensor
int sensor_reading;
long Weight;
void main()
{
while (1)
{ irproxleft() == sensor_reading;
Weight ==((-1.4887*sensor_reading)+311.14);
printf("Weight is %d\n", Weight);
}
}
The system is designed to attach a few known weights to a string over a pulley and the
other end of the string attached to a sliding face with a rubber band and the other end of the
rubber band fixed. In order for the readings to be “successful” the Lego parts had to be fixed
along with the rubber band so that the length of rubber actually undergoing deformation was
consistent. The infrared sensor also had to be fixed so that our reference point is consistent. By
calibrating the readings from the infrared in relation the applied mass, the weight sensor is
created.
B-2
Figure B 1: Load Sensor Mechanism
Weight (g)
IR reading
90
162
105
158
112
145
120
132
134
121
Table B 1: Experimental Observations
B-3
IR reading Vs Load
IR reading
y = -1.4887x + 311.14
200
180
160
140
120
100
80
60
40
20
0
0
20
40
60
80
100
Load (g)
Table B 2: Linear Relationship between IR Reading and Load
B-4
120
140
APPENDIX C – C Programming
RCX Mindstorms Flowchart
C-1
RCX Mindstorms Program
int i=0;
int j=0;
int k=0;
int Number_turns = 2;
void main ()
{
while(1)
{
while (j<1)
{
forward();
if (touch(1) == 1)
{
right_turn();
i=1;
}
if (i==1 && light(3) > 854)
{
left_turn();
i=2;
forward();
sleep(1.0);
}
if (i==2 && light(3) > 864)
{
left_turn2();
i=3;
}
}
if (i==3 && touch(1)==1)
{
ao();
}
}
}
void forward()
{
fd(1);
fd(2);
fd(3);
}
C-2
void left_turn()
{
while (light(2) > 800)
{
motor(1,48);
motor(3,-80);
motor(2,80);
}
}
void right_turn()
{
while (light(3) > 740)
{
motor(3,100);
motor(2,-100);
motor(1,0);
ao();
}
}
void left_turn2()
{
while (light(2) > 800)
{
motor(1,48);
motor(3,-100);
motor(2,100);
}}
C-3
Mecbot Program
int LEFT_MOTOR = 1, RIGHT_MOTOR = 0, BMP, wall;
int LEFT_EDGE = 50, RIGHT_EDGE = 50;
int speedr, speedl;
persistent int goal;
void main()
{
ao();
while(1)
{
BMP = 0x0f & peek(0x1500);
printf("StartMe -> %b \n", BMP);
if (BMP==0x0e || BMP==0x0d || BMP==0x0b || BMP==0x07 || BMP==0x09)
{
//sleep (1.0);
speedr= 50;
speedl= 50;
while (1)
{
if (edgeright() >=RIGHT_EDGE && edgeleft() >=LEFT_EDGE)
{
forward(speedr, speedl);
printf("Forward %d\n", edgeright());
}
if ((edgeright() <RIGHT_EDGE) && (edgeleft() >= LEFT_EDGE))
{
backward(60,60);
sleep(0.1);
right(50);
printf("Right\n");
}
if ((edgeleft() <LEFT_EDGE) && (edgeright() >= RIGHT_EDGE))
{
backward(60,60);
sleep(0.1);
left(50);
printf("Left\n");
}
if ((edgeleft() <LEFT_EDGE) && (edgeright() < RIGHT_EDGE))
{
backward(60,60);
C-4
sleep(0.3);
left(50);
printf("Left\n");
}
}
ao();
}
}
}
void calibrate()
{
int i=0;
while(i=0)
{
printf("Left button to calibrate left sensor: %d/n", edgeleft());
if (BMP== 0x0e)
{
LEFT_EDGE=edgeleft()+50;
printf("Left button to calibrate right sensor: %d/n", edgeright());
if (BMP== 0x0e)
{
RIGHT_EDGE = edgeright()+50;
i=1;
}
}
}
}
void deg_left(int SPEED, int DEGREE)
{
int BMP, Count, prev, CNT = 165;
ao();
CNT = CNT*DEGREE/90;/* 165 counts = 90o*/
prev= 0x40 & peek(0x1500);
motor(RIGHT_MOTOR,SPEED);
motor(LEFT_MOTOR,0);
while(Count < CNT) {BMP = 0x40 & peek(0x1500);
if(BMP==prev)Count = Count;
else Count = Count + 1;prev= BMP;
}
/*motor(RIGHT_MOTOR,-SPEED);
motor(LEFT_MOTOR,0);
C-5
sleep(0.05);*/
ao();
}
void forward(int speedr, int speedl)
{
motor(RIGHT_MOTOR, speedr);
motor(LEFT_MOTOR, speedl);
}
void backward(int speedr, int speedl)
{
motor(RIGHT_MOTOR, -speedr);
motor(LEFT_MOTOR, -speedl);
}
void right(int speedl)
{
motor(RIGHT_MOTOR, 0);
motor(LEFT_MOTOR, speedl);
sleep(0.2);
}
void left(int speedr)
{
motor(RIGHT_MOTOR, speedr);
motor(LEFT_MOTOR, 0);
sleep (0.2);
}
void stop()
{
ao();
}
C-6
Author
Document
Category
Uncategorized
Views
2
File Size
1 331 KB
Tags
1/--pages
Report inappropriate content