The ability to give math terms a real life applications is one of my favorite parts of FLL programming.
Here's how to convert the distance you need to travel into rotations-
Step 1: How to find
circumference: If you know the radius- go to 1
If you know the Diameter- go
to 2.
1 Work space
If you only have the radius : (remember to use metric (cm) when measuring): C-=2 r |
|
C is the circumfernce (and the answer you will find) 2 = you must find the number of Pi times radius or r because r means Half the circle's circumference = 3.14 (an easy trick to remember pi (pronounced {pie} ) The number can be spelled backwords to be read as it's name :) r= radius (the distance from the center to the edge of the circle) |
|
2. Work space
If you know the diameter of your circle: (remember to use metric (cm) when measuring): C= d |
|
C= Circumference (you will find this answer by working the
equation)
d= the distance across the circle through the center = 3.14 (an easy trick to remember pi (pronounced {pie} ) |
|
Tip- the wheel diameter is written on each lego wheel in mm. Convert that to cm (multiple by 10) and you've got your diameter to the hundredth of a point! It's in fine print black on black, so you'll need good light and good eyes to see it, but it's there :) I promise you.
STEP 2- Measure the distance you need to travel in cm- (this equation only works for straight lines right now.)
STEP 3- # of rotations= distance
circumference of the wheel
Tip= Both measurements need to be in the same unit in order to work. You can't divide inches into cm and get the proper number of rotations needed.
You can enter the number of rotation into the "move" block and then convert to degrees by hitting "degrees" after you entered the number from the equation. That way, if you need to add or subtract just a little to the distance you wish to travel, you will have an easier number to shave something off than the larger rotations unit.
Tip= Large wheels have the largest percentage of error when programming moving and turning. Smaller wheel are more precise, but move slower- so everything a trade off.
Calculating turns- two ways
Quick way- Use the "View" (the third button to the right on the first screen of the lego brick) on your brick. Click the "motor degrees", and then choose which motor you wish to view- A,B, or C. You can only view one motor at a time, but if you're using it to measure going straight you can choose your left or right motor to view.
I find this particular option very useful when calculating right turns. Hold one wheel still while carefully and slowly pushing the "turning" wheel forward. The degrees the motor senses will show up on you screen and give you a really good idea of about how many degrees your root will need to move to make your robot turn right. Take three readings and find the average or guess a number in the range you saw the robot measure. Three trys at this often produce three different degrees, so be sure to do it multiple times.
The math way-
Circumference (of the robot*) X angle of turn/360= distance needed to travel
Calculate the circumference of the robot by measuring the distance in between the two wheels (from the center of each wheel). This is the radius of the robot's full circle, so your robot's C=3.14r2 . Take this number and multiple by the degree you wish to turn- 90, 180, etc. 90/360 =1/4 180/360=1/2. \
figure out the turn you wish the
robot to move:
A right turn is 90 degrees, An about
face (getting the robot to turn completely backwards) 180 degrees,
and a ¾ turn is 270 degrees and a complete circle is 360 degrees
So moving our robot a right angle would be like turning it 90 on the circle, or 1/4 of the circle so our equations would be
C (of robot) x 1/4 = distance to be traveled (cm)
Now that we know how far our robot must travel, we can plug back into the equation above- R#=D/C
and get the rotation necessary to turn a right angle.
Cheat
sheet of equations in order
Circumference
|
C=2 r
C=D
|
Distance a
wheel must travel to turn
|
C (of circle
traced) x Turn= D
C x
DegreeTurn/360= D
|
Converting
distance to rotation
(for a
straight line)
|
# of
rotations= D
C
|
(Optional)
Percentage of error
|
(theoretical C measure -
Actual C measure)
Theoretical C
Measure
(t-a/t) X 100=
% of error
|