Robot. C Description. Line Following. Robot. C Include File. If you are using Robot. C, the following Include file is referenced by the Robot. C examples below. The file should be placed in the Robot. C Includes folder. Please also note that the example programs in Robot. C shown below make reference to Light. Portion and Light. Percent which are both functions found in the include file (shown below). This line follower uses PID feedback to control the same line follower we used in our NXT-G line follower video. Compare 26 seconds with RobotC PID versus 42 seconds, and much jerkier motion of the NXT-G program. Lego MINDSTORMS NXT Basic Line Follow Step By Step Directions. A lower motor speed will allow the robot to track a 'more curvy' line. This program will track the Right Hand side of the line. For our line follower P controller the input range is. We now have the pseudo code for our complete PID controller for a line following. It would be interesting to have the NXT-G program write data to a file while the. NXT-G v1.1 PID Blocks for Line Followers. This page contains screen shots and links for a simple P-Controller line follower and a more complex PID-Controller. The values in the program are for a light sensor about 1/4. These functions calculate the percent (or portion) of light compared to a range of light values. This range of light values is stored in a data file called . Whether the line is straight, curved, or a combination of both, the robot will use a simple formula to determine its position in relation to the line and how it should move in order to stay on the line. There are dozens (probably hundreds) of different programs that can be written to help the robot follow a line. Several of the various programs are discussed and illustrated below. Line Follower Programming Guide (ROBOTC. To start, open the program from Line Follower Extension Part 2. A comment is not part of the code that the NXT brick will execute. The easy way of learning how to built your own Line follower Robot using a PID Controller without any of the mathematical. HOWTO create a Line Following Robot using Mindstorms. Trackback 0 Comment 0 « 1. 219 220 221 222 223 224 225 226 227. Values less than 0 will steer the robot in one direction. Values greater than 0 will steer the robot in the other direction. If the value is equal to 0 then the robot will drive straight. The basic idea in using this block for line following is that you want to get the robot to steer in one direction if the light sensor sees the black line and to steer in the other direction if the light sensor sees the white surface background. The other part of the formula you need to determine is the value for the constant (k). In general, the value of the constant (k) should be set to the midpoint of the light range. For example, if the value of the light sensor on the white background is 5. The duration of the Motor block should be sent to infinity. And the combination of light sensor, Subtraction with k, and Motor block should be placed within an infinite loop. The power level for the Motor block should be set to a low value at first and then gradually increase this to see how well the robot is able to follow the line. Tip: Which formula you decide to use will depend on whether you want the robot to follow the left side or the right side of the line. Pseudocode for the smallest form of this program using Un- Calibrated light sensors. Minus Light Value equals Steering. Formula: k - value = Steering. Light Value minus k equals Steering. Formula: value - k = Steering. Programs for Un- Calibrated Light Sensors. Tip: The smallest form of this program works best if using Un- Calibrated light sensors. Method 2: Steering in the Move block Adjusted by a Factor. Problem: There is a potential problem if you use the above programs with a robot that has calibrated light sensors. The Midpoint of the light range for a calibrated light sensor has the value of 5. If the values returned by the light sensor range from 0 to 1. Midpoint is 5. 0. The problem is that: Any values of Steering greater than 4. This has the undesireable effect of making the robot possibly move backwards. Our goal is to get the robot to move forward as it follows the line. Try It: Run the two programs in the previous section using Calibrated light sensors. This would make the Midpoint of the light range equal to 5. This larger form of the program is for use with Calibrated light sensors which have a midpoint of 5. This amount of turning may be too great for the robot to remain on the line. If the robot is on a line with curves or if the robot frequently loses the line, then you need to use a factor which is smaller. If you are using Calibrated light sensors, then the Midpoint would be set to 5. Then add the Constant power. The controller attempts to minimize the error through the use of a formula. NXT- G allows you to specify whether the direction of the motor is forward or backward. Force the robot to turn. Value = turn. . Using this difference in the relative positioning of the Blue and Green LED allows the robot to detect if the sensor is too far to the left or right of the line. If the sensor is directly over the line, the sensor will see black.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |