pasterpocket.blogg.se

Robotc command list
Robotc command list












  1. #ROBOTC COMMAND LIST HOW TO#
  2. #ROBOTC COMMAND LIST CODE#

Program: linefollowdistance.c YouTube: 41Ĥ2 Find The Ball Stand Spin 90 Degrees Let s have the robot spin 90 degrees CCW Starting Position Final Position Robot Robot (East) 42Ĥ3 Find The Ball Stand Spin 90 Degrees We will use the spin feature to turn the robot When the robot spins, the wheel path is a circle centered between the wheels The diameter is the track width of the robot Robot 43Ĥ4 To spin the robot 90 deg Find The Ball Stand Spin 90 Degrees Robot track width = 16.2 cm The circumference of the robot s circular path C = PI * D = 3.14 x 16.2 cm = cm The circumference of the robot s wheel C = PI * D = 3.14 x 5.5 cm = cm 90 degrees is ¼ of the circle. Loop until the desired distance is traveled. YouTube: 38ģ9 Find The Ball Stand Proposed method: Compute the distance to travel along the edge of the playing field (H/2 or W/2) Compute the number of rotations required to travel that distance Follow the edge of the playing field Stop the robot when the desired number of rotations is reached Spin 90 degrees Travel to the bottle 39Ĥ0 Example Find The Ball Stand Compute Distance To Travel Assume H = 80 cm H/2 = 40 cm Number of rotations Distance = (Wheel Diameter) x (PI) x (# Rotations) Solve for (# Rotations) (# Rotations) = Distance (Wheel Diameter) x (PI) 40 cm (# Rotations) = (5.5 cm) x (PI) = 2.32 rotations 40Ĥ1 Find The Ball Stand Line Follow The Proper Distance Here we define some variables.

#ROBOTC COMMAND LIST CODE#

Program: measuredistance.c Code added to wait until the touch sensor is pressed to keep the information visible on the robot screen. The encoder outputs the rotation of the motor in degrees so we convert the output to rotations. YouTube: 32ģ4 Find The Ball Stand General idea Now that we can travel from one base to another, we can align our robot with the ball stand by traveling half way to a base The rules specify that the bottle will be located in the middle of the playing field The dimensions of the playing field are L and W The distance traveled should be H/2 or W/2 Once the appropriate distance is traveled, turn 90 degrees and travel towards the ball stand 34ģ5 Find The Ball Stand Approach Modify LineFollowZZStop.ev3 to stop at the location of the ball stand Spin 90 degrees Travel to the ball stand Tools needed Line following Measure distance traveled Precise turning 35ģ6 Measure Distances Determine how far the robot travels moving forward for 2 seconds Compute distance traveled by measuring the number of rotations of the wheel Distance 36ģ7 Measure Distances Use the wheel geometry PI = 3.14 Radius How can use this information? 37ģ8 Measure Distances Here we reset the a motor encoder.

robotc command list robotc command list

Program: linefollowzzstop.c Once edge is reached, we exit while loop and stop the robot. 31ģ2 Run The Bases Here we modify the while loop conditional statement to use the second color sensor to detect when the edge of the field is reached. Let s change the outer loop to stop when the green is reached.

#ROBOTC COMMAND LIST HOW TO#

Program: LineFollowZZ.c YouTube: 26Ģ7 How to improve our line following algorithm Zig-zag method can cause a bumpy response To improve the response, you can use a 3-level line follower (concept shown below) Off Table On Table Off Table On Table 27Ģ9 Run The Bases One method to move from one base to another is the use two color sensors Sensor 1 used to follow the edge of the playing field Sensor 2 used to locate the end of the playing field Color sensor 2 Color sensor 1 29ģ0 Run The Bases Couple comments regarding moving around the field It is possible to achieve this using only one color sensor, but it more difficult and potentially less reliable Remember that only two of the bases have foil tape, please keep this under consideration When your robot finds the foil tape, which base are you at Need to count bases without a foil tape indicator 30ģ1 Run The Bases Let s modify the program to stop when the robot reaches the end of the base line Currently the program will line follow until we stop the robot. Based on color senor reading, determine which direction to travel to line follow.

robotc command list

25Ģ6 Simple Line Following Algorithm Set the threshold value. Color Sensor 1 Color Sensor 2 On field = (70) On field = (70) Off field = (10) Off field = (10) Color Sensor Readings 24Ģ5 Follow The Edge Of The Field or Mat Light sensor settings example Off field = 10 On field = 70 Median threshold = (10+70)/2 = 40 Two cases Light sensor reading > 40. We will use the color sensor in Reflective Light Intensity mode. 24 Follow The Edge Of The Field or Mat Get color sensor values to determine when the robot is on or off the playing field.














Robotc command list