|
No plan survives contact with reality. Initial testing of the Ria chassis looked promising, so I wrote an additional piece of nqc software which would make it stop at "stations" along its six foot track. I was quite proud of the software, using just the light sensor and one motor. But, there were repeated problems with the chassis wobbling and binding, which made the "station" software unreliable. Here's what Ria looked like after the modifications:
Ria about to stop before hitting the bookshelves. Here's the software. Note that this is all you need for controlling a basic monorail.
/* the driver software for proof of concept for Ria, my beamrider.
At this stage, all it does is move backwards and forwards while
I get the bugs out of the chassis and try to reduce the parts count... */
#define DRIVE OUT_C
/* Ria has a drive motor on the "rear" wheel, now geared at six to one
with an idler gear... */
#define STOP_L SENSOR_1
/* again retained from QuAD, although my game plan was to use this for
marking the station positions. Time will tell... */
#define BLUE 45
/* value of a strip of blue tape on the track, as opposed to pine...
...since the sensor is up close and personal, as in line following,
this is easier to measure */
task main()
{
SetSensor (STOP_L , SENSOR_LIGHT);
SetPower (DRIVE , 1);
Fwd (DRIVE);
while (true)
// this is just a test: turn it off when we finish...
{
move ();
}
}
sub move()
{
On (DRIVE);
// move so that we're clear of any tape marks...
Wait (200);
while (true)
{
if (STOP_L < BLUE) break;
}
// we've hit a tape mark
Wait (20);
Off (DRIVE);
// move on a little bit...
Wait (300);
// stop at the "station"...
// ...are we still on a blue tape?
if (STOP_L < BLUE)
{
// if so, end of the line so turn round... otherwise just move on...
Toggle (DRIVE);
}
Wait (30);
}
This software could be the basis for all kinds of tricks using tape to control the thing, right up to a basic Turing machine. But it relies on fairly accurate positioning, so the wobble and the pinching caused reliability problems. I took the chassis apart and rebuilt it using pegs to hold it together rather than the plate. I turned the wheels round so that the track was wider, to cut down on the wobbling and substituted little rollers for the solid bar as guides. These are just the same as Fell used on the Aldershot railway. For completeness, I built the gearbox into the side of the chassis, rather than using a through axle. This will leave space for the grab mechanism on the other side. Besides, it looks neater, and in engineering, if it looks and feels right, it most probably is right. The wheels are now spread as far as they can be, covering the bushes which hold them away from the chassis bars. The engine raft over the top of the gearbox is now two 8x2s, meaning that the motors will both fit properly when I mount the second one. The 8x2s also hold the chassis sides together... ...until the RCX is clipped on as before. The light sensor fits underneath the chassis. I'll need the light sensor to do ball sorting so I'll substitute a touch sensor when I figure out how I want the markers to be made. For now, though, one motor and one sensor gets the whole thing trundling backwards and forwards to its heart's content. text copyright© Andy Anderson, 1999-2001 LEGO and LEGO MINDSTORMS are trademarks of The LEGO Company, which does not endorse or support this independently produced page. [home] [pockets] [mindstorms] [tour] |