Two Sensors, One Input - LEGO MINDSTORMS Robots Manual

Unofficial guide
Table of Contents

Advertisement

A single touch sensor can be used to detect when the arm is fully raised, either with the gripper open or the gripper closed. Picking up an object is simply a matter of running the motor in the right
direction and waiting for the touch sensor to be pressed. Releasing an object is just as simple.
The "fingers" of the gripper need to pick up objects. Ideally, they should be slightly pliable and tacky rather than smooth. Minerva uses two of the rubber wheels as fingers, which work reasonably
well.
The arm also needs to be strong, as its parts are under a fair amount of stress. You may notice, as you use Minerva, that the pieces of the arm loosen up after time. You could make the arm
stronger, but it would also be bulkier. See Ben Williamson's FetchBot (in the "Online Resources" section) for the original arm design, which is stronger and larger than Minerva's.
Balance
One of the fundamental issues Minerva faces is balance. The grabber arm sticks out in front of Minerva. Without some kind of counterbalance, Minerva falls right on her face. One way to fix this
is to move the drive wheels closer to the front of Minerva. In this case, however, the directional transmission and the grabber arm gearing would not have enough space to coexist. Minerva solves
the problem of balance by mounting the RCX near the back of the robot. The weight of the RCX (the batteries, mostly) more than compensates for the weight of the grabber arm.
Drivetrain
Although the directional transmission is relatively simple, Minerva's drivetrain is a little more complex. When the motor runs one way, the two drive wheels both turn forward. When the motor
runs the other way, the drive wheels turn in opposite directions, causing Minerva to spin in place. Minerva uses a fairly complex system of gears to translate the outputs of the directional
transmission into the correct wheel movements. Only one of the outputs drives a wheel directly.

Two Sensors, One Input

You might think that the RCX's three inputs limit you to designing robots with only three sensors. In this section, I'll describe one way to move beyond the three-input barrier: attaching more than
one sensor to a single input. Minerva, for example, has a touch sensor and a light sensor attached to a single input. If you have ambitious plans (and parts) for expanding Minerva, you've got two
inputs, not just one, with which to play.
There are two common variations on the theme of attaching multiple sensors to one input, both of which are discussed here.
Multiple Touch Sensors
The first and easiest possibility is to attach multiple touch sensors to a single input. With the input configured for a touch sensor, a press on any one of the attached sensors will produce a value of
1 on the input.
This might be useful, for example, in a robot with a "skirt" touch sensor that runs around the entire robot. Different parts of the skirt might trigger different touch sensors. By putting all the skirt
sensors on one input, you could easily detect any collision with the skirt, anywhere around the robot.
The downside, of course, is that you don't know which touch sensor is being pressed. There's a way around this problem, of course, but it involves using a soldering iron. I'll explain how it works
in Chapter 11, Make Your Own Sensors.
Light and Touch
Minerva uses a light sensor and a touch sensor on one input. The input is configured for a light sensor. When the touch sensor is not pressed, it has no effect on the light sensor reading. When the
touch sensor is pressed, the input gives a value of 100; the current value of the light sensor becomes irrelevant.
Usually the light sensor shows values in the range of 30 to 70, roughly speaking; the readings depend on the lighting conditions around the sensor. You'll rarely see a real light sensor reading of
100 unless you point some very bright light directly into the sensor. In general, it's safe to assume that readings of 100 correspond to the touch sensor being pressed.
Minerva's program must account for the two sensors being attached to one input. In particular, the touch sensor must normally be not pressed. In the grab() and release() subroutines, for
example, the grabber arm motor is run forward or in reverse until the touch sensor is triggered. Then the motor must be run the other way briefly so the touch sensor is no longer pressed. This
allows Minerva to observe values from the light sensor.
Page 112
Page 113

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MINDSTORMS Robots and is the answer not in the manual?

Questions and answers

Table of Contents