Difference between revisions of "Sandbox/ReverseEngineering"

From EG1004 Lab Manual
Jump to: navigation, search
m (Added old stuff about gear trains.)
m
 
Line 1: Line 1:
== Reverse Engineering ==
= Reverse Engineering =
Reverse engineering software involves reversing a program's machine code to obtain the original source code or determine the file structures the program uses. This is done when source code is lost or is not available. For example, when a project is reactivated after being dormant for years to add new features to a product, the original design documentation may have been lost. Also, when companies are writing a program that must interface with a second company's software, the second company may not have any incentive to cooperate by describing how the data in the files they use are organized, forcing the first company to deduce it on their own. Sometimes, this process is used to improve the performance of a program, to fix a bug, or to find a virus. When the source code is obtained in this way for any of these reasons, it is legal and necessary. Reverse engineering software  to copy it constitutes a copy¬right violation and is illegal.<ref name="two">''What Is ''website. TechTarget Network. Retrieved July 29th, 2003.</ref>
Reverse engineering software involves reversing a program's machine code to obtain the original source code or determine the file structures the program uses. This is done when source code is lost or is not available. For example, when a project is reactivated after being dormant for years to add new features to a product, the original design documentation may have been lost. Also, when companies are writing a program that must interface with a second company's software, the second company may not have any incentive to cooperate by describing how the data in the files they use are organized, forcing the first company to deduce it on their own. Sometimes, this process is used to improve the performance of a program, to fix a bug, or to find a virus. When the source code is obtained in this way for any of these reasons, it is legal and necessary. Reverse engineering software  to copy it constitutes a copy¬right violation and is illegal.<ref name="two">''What Is ''website. TechTarget Network. Retrieved July 29th, 2003.</ref>


Hardware reverse engineering involves taking apart a device to see how it works. If a processor manufacturer wants to see how a competitor's processor works, the company can purchase the processor, disassemble it, and then make a new processor similar to it. In some countries, this process is illegal. Hardware reverse engineering is quite expensive and requires an expert in the field.<ref name="two"></ref>
Hardware reverse engineering involves taking apart a device to see how it works. If a processor manufacturer wants to see how a competitor's processor works, the company can purchase the processor, disassemble it, and then make a new processor similar to it. In some countries, this process is illegal. Hardware reverse engineering is quite expensive and requires an expert in the field.<ref name="two"></ref>


= Design Considerations =
= Gear Trains =
Carefully consider the lab objectives and what needs to be done to achieve them:
* What made or will make the results, inaccurate or imprecise?
* If the robot failed a test, why did it fail?


When beginning the process of reverse engineering the robot, identifying the gear trains and the individual gears used in the original design and in the final design is critical to understanding the robot's operation.
When beginning the process of reverse engineering the robot, identifying the gear trains and the individual gears used in the original design and in the final design is critical to understanding the robot's operation.


There are two types of gear trains: simple (Figure 2) and compound (Figure 3). A simple gear train has its gears arranged in a line (see Figure 1).
There are two types of gear trains: simple and compound. A simple gear train has its gears arranged in a line (see Figure 1).


[[Image:Lab reveng 1.jpg|frame|center|Figure 2: Simple gear train.]]
[[Image:Lab reveng 1.jpg|frame|center|Figure 1: Simple gear train.]]


Compound gear trains use axles to connect the component gears (see Figure 3).
Compound gear trains use axles to connect the component gears (see Figure 2).


[[Image:Lab reveng 2.jpg|frame|center|Figure 3: Compound gear train.]]
[[Image:Lab reveng 2.jpg|frame|center|Figure 2: Compound gear train.]]


Gear trains have measurable characteristics known as gear ratio and velocity ratio. These characteristics are inversely proportional. Gear ratio equals output over input, while velocity ratio equals input over output. If multiple gears are being used, the gear ratio and velocity ratio are the product of these ratios for each individual gear. To determine input and output values, engineers count the number of teeth on each gear or by measuring each gear's radius.
Gear trains have measurable characteristics known as gear ratio and velocity ratio. These characteristics are inversely proportional. Gear ratio equals output over input, while velocity ratio equals input over output. If multiple gears are being used, the gear ratio and velocity ratio are the product of these ratios for each individual gear. To determine input and output values, engineers count the number of teeth on each gear or by measuring each gear's radius.


For example, to compute the gear ratio of the gear trains in Figures 2 and 3, these formulas (Figure 4) are used, where the values are the radii of the gears in the gear train:
For example, to compute the gear ratio of the gear trains in Figures 1 and 2, these formulas are used, where the values are the radii of the gears in the gear train:


{| class="wikitable" style="text-align: center; margin: 0px auto;"
{| class="wikitable" style="text-align: center; margin: 0px auto;"
|+ style="caption-side: bottom;" | Figure 4: Gear ratio.
|<math>Gear Ratio = \frac{2}{1} \times \frac{4}{2} = 4\,</math><br />Simple gear train
|<math>Gear Ratio = \frac{2}{1} \times \frac{4}{2} = 4\,</math><br />Simple gear train
|<math>Gear Ratio = \frac{N_2}{N_1} \times \frac{N_4}{N_3} \times \frac{N_6}{N_5} \times \frac{N_8}{N_7}\,</math><br />Compound gear train
|<math>Gear Ratio = \frac{N_2}{N_1} \times \frac{N_4}{N_3} \times \frac{N_6}{N_5} \times \frac{N_8}{N_7}\,</math><br />Compound gear train
|}
|}


For example, to compute the velocity ratio of the gear trains above, these formulas (Figure 5) are used:
 
For example, to compute the velocity ratio of the gear trains above, these formulas are used:


{| class="wikitable" style="text-align: center; margin: 0px auto;"
{| class="wikitable" style="text-align: center; margin: 0px auto;"
|+ style="caption-side: bottom;" | Figure 5: Velocity ratio.
|<math>Velocity Ratio = \frac{1}{2} \times \frac{2}{4} = \frac{1}{4}\,</math><br />Simple gear train
|<math>Velocity Ratio = \frac{1}{2} \times \frac{2}{4} = \frac{1}{4}\,</math><br />Simple gear train
|<math>Velocity Ratio = \frac{N_1}{N_2} \times \frac{N_3}{N_4} \times \frac{N_5}{N_6} \times \frac{N_7}{N_8}\,</math><br />Compound gear train
|<math>Velocity Ratio = \frac{N_1}{N_2} \times \frac{N_3}{N_4} \times \frac{N_5}{N_6} \times \frac{N_7}{N_8}\,</math><br />Compound gear train
|}
|}


It is important to note that the input is the source of rotation in a system, like a motor, and the output is the final gear of rotation in a system, like a wheel.
It is important to note that the input is the source of rotation in a system, like a motor, and the output is the final gear of rotation in a system, like a wheel.
Below are images and descriptions of the types of gears that can be implemented in your robot's gear train design.


{| class="wikitable" style="text-align: center; margin: 0px auto;"
{| class="wikitable" style="text-align: center; margin: 0px auto;"
|+ style="caption-side: bottom;" | Figure 6: Types of Gears<br />Figures 6a-d courtesy of http://www.howthingswork.com<br />Figure 6f courtesy of Honda Motor Company, Inc.
 
|[[Image:Lab reveng 7.jpg|frame|center|'''Figure 6a: Rack gear.''' Its purpose is to change rotation into linear motion.]]
|[[Image:Lab reveng 7.jpg|frame|center|'''Figure 3a: Rack gear.''' Its purpose is to change rotation into linear motion.]]
|[[Image:Lab reveng 8.jpg|frame|center|'''Figure 6b: Crown gear.''' Its purpose is to change the direction of rotation perpendicularly.]]
|[[Image:Lab reveng 8.jpg|frame|center|'''Figure 3b: Crown gear.''' Its purpose is to change the direction of rotation perpendicularly.]]
|-
|-
|[[Image:Lab reveng 9.jpg|frame|center|'''Figure 6c: Spur gear.''' Its purpose is to transmit torque through the gear train.]]
|[[Image:Lab reveng 9.jpg|frame|center|'''Figure 3c: Spur gear.''' Its purpose is to transmit torque through the gear train.]]
|[[Image:Lab reveng 10.jpg|frame|center|'''Figure 6d: Worm gear.''' Its purpose is to change the direction of rotation perpendicularly.]]
|[[Image:Lab reveng 10.jpg|frame|center|'''Figure 3d: Worm gear.''' Its purpose is to change the direction of rotation perpendicularly.]]
|-
|-
|[[Image:Lab reveng 11.jpg|frame|center|'''Figure 6e: Idler gear.''' Its purpose is to transfer force while not affecting the gear or velocity ratios.]]
|[[Image:Lab reveng 11.jpg|frame|center|'''Figure 3e: Idler gear.''' Its purpose is to transfer force while not affecting the gear or velocity ratios.]]
|[[Image:Lab reveng 12.jpg|frame|center|'''Figure 6f: Pulley gear.''' Its purpose is to transmit rotation from one point to one or more other points.]]
|[[Image:Lab reveng 12.jpg|frame|center|'''Figure 3f: Pulley gear.''' Its purpose is to transmit rotation from one point to one or more other points.]]
|}
|}


The objective of reverse engineering the robot is to understand how it works and to calculate the gear and velocity ratios for its drive train (remember the wheels are part of the drive train). Remember that engineers reverse engineer products to reproduce or improve them. As the robot is disassembled, improvements to the robot's design should be considered.
= Center of Gravity =
 
'''Note''': Using gear and velocity ratios have proven to be extremely helpful when building robots for your EG1003 Semester-Long Design Project.
 
== Center of Gravity ==
'''Center of Gravity''' is the place in a system or body (such as a robot) where the weight is evenly distributed and all sides are in balance. An example of the center of gravity is the middle of a seesaw when it is balanced.
'''Center of Gravity''' is the place in a system or body (such as a robot) where the weight is evenly distributed and all sides are in balance. An example of the center of gravity is the middle of a seesaw when it is balanced.


You can think of a robot’s center of gravity as the “center position” of all the weight on the robot. Because the Center of Gravity uses both weight and position, heavier objects have a greater effect than lighter ones in determining where the center of gravity is. For example, if your robot can collect, hold, and/or manipulate objects, those objects change the center of gravity as they are being manipulated because they add weight.
You can think of a robot’s center of gravity as the “center position” of all the weight on the robot. Because the Center of Gravity uses both weight and position, heavier objects have a greater effect than lighter ones in determining where the center of gravity is. For example, if your robot can collect, hold, and/or manipulate objects, those objects change the center of gravity as they are being manipulated because they add weight.


[[Image:CofG.PNG|frame|center|Figure 2: Change of Center of Gravity because of change of weight of the robot.]]
[[Image:CofG.PNG|frame|center|Figure 4: Change of Center of Gravity because of change of weight of the robot.]]


Likewise, pieces that are farther out have a greater effect than pieces that are near the middle of the robot. So, if your robot has an arm that lifts and/or reaches, it's center of gravity changes with that movement.
Likewise, pieces that are farther out have a greater effect than pieces that are near the middle of the robot. So, if your robot has an arm that lifts and/or reaches, it's center of gravity changes with that movement.


[[Image:DynamicCG.PNG|frame|center|Figure 3: Change of Center of Gravity because of dynamic parts.]]
[[Image:DynamicCG.PNG|frame|center|Figure 5: Change of Center of Gravity because of dynamic parts.]]


== Drivetrain Design ==
= Drivetrain Design =
The most basic, multi-functional competition robot '''Drivetrain''' design consists of:
The most basic, multi-functional competition robot '''Drivetrain''' design consists of:


Line 80: Line 75:
1. Make sure that the '''Wheelbase''' (distance between '''Drivetrain''' wheels) is wider (side-to-side) than it is long (front-to-back):
1. Make sure that the '''Wheelbase''' (distance between '''Drivetrain''' wheels) is wider (side-to-side) than it is long (front-to-back):


[[Image:Wheelbase.PNG|frame|center|Figure 4: Wheelbase Example.]]
[[Image:Wheelbase.PNG|frame|center|Figure 6: Wheelbase Example.]]
 
 


2. Use different wheel and/or tire types to reduce the friction of '''Turning Scrub''':
2. Use different wheel and/or tire types to reduce the friction of '''Turning Scrub''':


[[Image:Wheels.PNG|frame|center|Figure 5: Different Wheels Example.]]
[[Image:Wheels.PNG|frame|center|Figure 7: Different Wheels Example.]]
 
== Part 1: Reverse Engineering ==
Upon receiving the pre-built robot, selected by the TA, analyze the design and performance of the robot by both physical inspection and basic testing (i.e. '''run the robot at least once to see how it works'''). Run the robot once on the ramp and once on the flat surface in Section 1. There are 5 basic problems in the pre-built robots. The problems are listed below:
 
# The '''Center of Gravity''' of the robot is too high. This will be observed when the robot is tested over the ramp. The high center of gravity does not allow the robot to traverse the hill.
# The incorrect '''Drivetrain''' is installed. The lack of tires on the rear wheels of the robot cause it to slip when it tries to turn.
# The '''Light Sensor''' is positioned incorrectly. The Light sensor is more than 2 cm above the ground.
# The '''Gyro Sensor''' is installed in the incorrect orientation. It has been installed vertically which hinders its functioning.
# The '''Ultrasonic Sensor''' is also oriented incorrectly. The Ultrasonic sensor is installed in the z-axis orientation whereas the robot will need the sensor to record data in the x-axis.
 
The fixes for these problems are listed below:
 
# The Connectors connecting the EV3 Brick and the chassis can be shortened to lower the robot.
## Disconnect the Gyro Sensor
## Remove the angled connectors marked in the picture below [[Image:Angled_supports.png|thumb|center|400px|Figure 13: Robot before modifications.]]
## Remove the right-angled connectors shown in the picture below [[Image:Right_angled_motor_connectors.png|thumb|center|400px|Figure 14: Robot before modifications.]]
## Connect a 7-hole connector to the square frame as labeled in the picture below using the blue arrow: [[Image:7_hole_connectors.png|thumb|center|400px|Figure 15: Robot before modifications.]]
## Connect the right-angled lego pieces as marked in the picture above using red arrows.
# The '''Tires''' can be attached to the rear wheels which will provide enough traction for a proper turn.
# The '''Light Sensor''' can be moved to a different mounting position to make it closer to the ground.
# The '''Gyro Sensor''' can be flipped to make it horizontal.
## Connect it as shown in the picture below [[Image:Before_2018.PNG|thumb|center|400px|Figure 16: Robot after modifications.]]
# The '''Ultrasonic Sensor''' can be oriented so that it’s horizontal instead of diagonal. This will be achieved when the Center of Gravity is brought down.

Latest revision as of 18:18, 24 August 2019

Reverse Engineering

Reverse engineering software involves reversing a program's machine code to obtain the original source code or determine the file structures the program uses. This is done when source code is lost or is not available. For example, when a project is reactivated after being dormant for years to add new features to a product, the original design documentation may have been lost. Also, when companies are writing a program that must interface with a second company's software, the second company may not have any incentive to cooperate by describing how the data in the files they use are organized, forcing the first company to deduce it on their own. Sometimes, this process is used to improve the performance of a program, to fix a bug, or to find a virus. When the source code is obtained in this way for any of these reasons, it is legal and necessary. Reverse engineering software to copy it constitutes a copy¬right violation and is illegal.[1]

Hardware reverse engineering involves taking apart a device to see how it works. If a processor manufacturer wants to see how a competitor's processor works, the company can purchase the processor, disassemble it, and then make a new processor similar to it. In some countries, this process is illegal. Hardware reverse engineering is quite expensive and requires an expert in the field.[1]

Gear Trains

When beginning the process of reverse engineering the robot, identifying the gear trains and the individual gears used in the original design and in the final design is critical to understanding the robot's operation.

There are two types of gear trains: simple and compound. A simple gear train has its gears arranged in a line (see Figure 1).

Figure 1: Simple gear train.

Compound gear trains use axles to connect the component gears (see Figure 2).

Figure 2: Compound gear train.

Gear trains have measurable characteristics known as gear ratio and velocity ratio. These characteristics are inversely proportional. Gear ratio equals output over input, while velocity ratio equals input over output. If multiple gears are being used, the gear ratio and velocity ratio are the product of these ratios for each individual gear. To determine input and output values, engineers count the number of teeth on each gear or by measuring each gear's radius.

For example, to compute the gear ratio of the gear trains in Figures 1 and 2, these formulas are used, where the values are the radii of the gears in the gear train:


Simple gear train

Compound gear train


For example, to compute the velocity ratio of the gear trains above, these formulas are used:


Simple gear train

Compound gear train


It is important to note that the input is the source of rotation in a system, like a motor, and the output is the final gear of rotation in a system, like a wheel.

Below are images and descriptions of the types of gears that can be implemented in your robot's gear train design.

Figure 3a: Rack gear. Its purpose is to change rotation into linear motion.
Figure 3b: Crown gear. Its purpose is to change the direction of rotation perpendicularly.
Figure 3c: Spur gear. Its purpose is to transmit torque through the gear train.
Figure 3d: Worm gear. Its purpose is to change the direction of rotation perpendicularly.
Figure 3e: Idler gear. Its purpose is to transfer force while not affecting the gear or velocity ratios.
Figure 3f: Pulley gear. Its purpose is to transmit rotation from one point to one or more other points.

Center of Gravity

Center of Gravity is the place in a system or body (such as a robot) where the weight is evenly distributed and all sides are in balance. An example of the center of gravity is the middle of a seesaw when it is balanced.

You can think of a robot’s center of gravity as the “center position” of all the weight on the robot. Because the Center of Gravity uses both weight and position, heavier objects have a greater effect than lighter ones in determining where the center of gravity is. For example, if your robot can collect, hold, and/or manipulate objects, those objects change the center of gravity as they are being manipulated because they add weight.

Figure 4: Change of Center of Gravity because of change of weight of the robot.

Likewise, pieces that are farther out have a greater effect than pieces that are near the middle of the robot. So, if your robot has an arm that lifts and/or reaches, it's center of gravity changes with that movement.

Figure 5: Change of Center of Gravity because of dynamic parts.

Drivetrain Design

The most basic, multi-functional competition robot Drivetrain design consists of:

  • A rectangular Chassis (the structure of a mobile robot that holds wheels, motors, and/or any other hardware used to make up a Drivetrain)
  • Two Motors
  • Four Wheels
  • Gears transmitting Power from the Motors to all Wheels

Drivetrains can come in all shapes and sizes - some don’t provide power to all wheels, use different types of wheels, or are not even a rectangular shape! Whatever the details of your Drivetrain, you should always be aware of a property known as Turning Scrub.

Turning Scrub is the friction that resists turning. This friction is created from the wheels dragging sideways on the ground as a robot (or another mobile vehicle) turns. The greater the Turning Scrub in a Drivetrain, the harder it is for a robot to turn. Turning Scrub in a basic Drivetrain can be easily managed and minimized in two ways:

1. Make sure that the Wheelbase (distance between Drivetrain wheels) is wider (side-to-side) than it is long (front-to-back):

Figure 6: Wheelbase Example.

2. Use different wheel and/or tire types to reduce the friction of Turning Scrub:

Figure 7: Different Wheels Example.
  1. ^ a b What Is website. TechTarget Network. Retrieved July 29th, 2003.