Top Banner
NXT-G Programming *Note: this presentation contains animations and is best viewed by pressing F5 or the button *
11

NXT-G Line Follower Presentation

Mar 30, 2016

Download

Documents

Austin Lucas

A presentation with some interesting animations
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NXT-G Line Follower Presentation

NXT-G Programming*Note: this presentation contains animations and is best viewed by pressing F5 or the button *

Page 2: NXT-G Line Follower Presentation

Mission: Rapid Blood Screening The purpose of this

mission is to hit the lever on the right hand side of the dispenser, knocking down the syringe it holds.

Completing this mission is worth 25 Points in the 2010-11 FLL Competition

Page 3: NXT-G Line Follower Presentation

Mission Map: Overview Completion of this

mission will require the robot to follow a line in it’s approach and have a manipulator designed to hit down that lever. Sta

rt

Knock

Down

Page 4: NXT-G Line Follower Presentation

Theoretical Robot Design Motor A is attached

to an arm-like device that is capable of swinging back and forth

Motor B is connected to the left wheel

Motor C is connected to the right wheel

CB

L.S.A

Page 5: NXT-G Line Follower Presentation

Psuedocode: articulating what should happen Move motors B and C forward

for 2 full rotations (gets robot out of base)

Follow line for 1400 degrees of motor B Places robot in front of the

syringe Move motor A 180 degrees

Hits the syringe Turn motor B 2 full rotations

Turns robot back around towards the base

Turn motors B & C unlimitedly until button on NXT device is pressed Puts robot back in the base

Line Follower

Knock DownReturn

Page 6: NXT-G Line Follower Presentation

NXT-G: The Actual CodeMove forward to get out of the baseUse (loop) the line follower with the condition of the rotations of encoder B being less than 1400 degrees.

Page 7: NXT-G Line Follower Presentation

NXT-G: The Actual CodeStop All MotorsMove Motor A Forward to Knock Down the Syringe

Turn Around

Return to base

Page 8: NXT-G Line Follower Presentation

Line Follower Segment IF the light sensor detects

a light surface Stop the right motor (C) move the left one (B) for

an unlimited period of time

This causes the robot to swing left

IF the light sensor detects a dark surface (the line) Stop the left motor (B) Move the right motor (C)

for an unlimited period of time

This causes the robot to swing right

Packaged as a reusable function

block

Page 9: NXT-G Line Follower Presentation

Line Follower: Line Responses

If the light sensor picks up a dark surface: The C motor stops

moving to prevent the sensor from going over the line.

The B motor begins to move It will be stopped once

the light sensor no longer detects the line

The result of one motor moving and the other staying constant is an arc motion.

CB

L.S.

Page 10: NXT-G Line Follower Presentation

Line Follower: Table Responses

If the light sensor picks up a light surface (not a line): The B motor stops

moving to stop the robot from moving away from the line

The C motor begins to move It will be stopped

once the light sensor detects the line

CB

L.S.

Page 11: NXT-G Line Follower Presentation

Printing Values to the Screen Takes the numeric

value of the angle motor B has moved over the course of the program

Converts that angle to text

Displays the text This is useful when

measuring the distance a robot traveled over a segment of the code.