Using the Motor Power Meter Block with Tag-Bot

A reader (Nathan G.) of The ULMN Inventor’s Guide recently wrote me about an NXT-G program he was working on for Tag-Bot. The program’s purpose was to solve Tag-Bot’s inability to determine its steering position. In the book, I simply instruct readers to always center the robot’s steering before starting a program—the robot then assumes that its steering has been centered. The reader used an unofficial NXT-G block, the Motor Power Meter block, to fix the problem.

Motor Power Meter NXT-G Block

What does this enormously helpful block do? The repository on reports the following:

This block is a “sensor” which allows you to monitor the actual power sent to the NXT servo motor. In a single motor mode (Motor block) with “Motor Power” enabled the firmware automatically increases the power to keep constant speed. Monitoring the ”Actual Power” allows detecting stall conditions as well as slip conditions (e.g. when your robot hits the wall, its motors might still be able to slip in place but the robot does not move).

I modified Nathan’s program some, but the basic idea remains the same. Using the Power Meter option within the standard Wait block to determine a stall condition, Tag-Bot first steers to the rightmost position and then resets the built-in rotation sensor of the steering motor (Motor A). Next, it steers to the leftmost position and then divides the current value of Motor A’s rotation sensor by 2. The quotient is the number of degrees that the steering motor should turn to center the steering. Voilà! Automatic steering. You can start the program with Tag-Bot’s steering in any position, and it should always be able to center it.

If you’d like to download the mini-program shown below, click here. Remember that you have to download the Motor Power Meter block if you want to use this program.


Comments are closed.