| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Activity 11

Page history last edited by PBworks 16 years, 4 months ago

Closed loop control -- line stopper

 

jon: again, I think this sheet makes good sense just replacing program with MSRS version.

 

The extension (not on the TXR sheet, but think we usually do it) is 'stay-inside' program, which links to 'explore' which is a standard example and quite a good achievement point.

 

Explore also works well with NXT sonar (and presumably the simulated laser range finder robots) and can be more sophisticated (eg arc away from distant objects, spin in front of close ones). So possibilities of extension activities.

 

 

Light Sensor

The light sensor measures the amount of ambient light or light reflected from a surface as a percentage value relative to some automatically calibrated scale. The higher the percentage reading, the brighter the light.

 

 

Write a program to configure the robot with a single light sensor. Ensure the light sensor is facing down on your robot.

 

Exercise

How might you write a program to move your robot forwards over a light coloured floor until it reaches a black line, at which point it must stop? Discuss amongst your group what you think the program should do, and how it might do it. Walk through or talk through your approach to see if it works in principle, before going on to the next part.

 

 

Exercise (Requires Record Sheet)

 

 

 

Why is the threshold set as it is?

 

 

To calibrate your program so that it operates correctly on the real robot, use the View button (RCX) to measure the reflected light level when the light sensor is over the white surface and the black check line.

 

Select a threshold value somewhere between these two readings - this value will be used by the control program to decide whether the robot can see either black or white. Put this value into your control program and download it to the real robot. Record the value on your Record Sheet.

 

 

Run the program - does the robot stop when the light sensor crosses over the black line?

 

 

Now calibrate your program so that the robot can distinguish between seeing a table top and looking over the edge of the table. How confident are you that your robot will stop when it looks over the edge of table? Try it...

 

 

If you have time, try to modify your program so that the robot pauses for 1 second when it reaches the black line, before continuing straight ahead for 2 or 3 seconds or so. What changes did you make to your program?

!

Sonar/Ultrasound Sensor

 

In the previous exercise, you used a downward facing light detector to detect a black line and stop on it or to identify when the light sensor was looking down over the edge of a table.

 

In a separate activity, a touch sensor is used to detect a collision, such as bumping into a wall.

 

The ultrasound sensor can be used to detect an obstacle at a distance.

 

Using essentially the same control program as the line stopper or collision detector, see if you can modify your program so that it can detect an obtacle 5cm or so in front of it using the ultrasound sensor.

 

Back to Home or on to Activity 12

Comments (0)

You don't have permission to comment on this page.