• Aucun résultat trouvé

Software replaces hardware Software replaces hardware Software replaces hardware

Often it is possible to use simpler or fewer sensors if we compensate by more elaborate programming and more complex behaviour. Take as an example, the line following behaviour of the Quester, which relies on having two sensors.

It would save space, input channels, and cost to have only one sensor. With one light sensor, program the robot to keep the sensor directly above the track. If the sensor detects that the robot has deviated from the track, it starts to waggle from side to side, trying to find the track again and stay on it. Program the robot so that it remembers which waggle direction successfully brings it back on track. Then, when the robot next deviates from the track it tries the successful direction first. If it is still on the same curved part of the track, which is likely, this behaviour will help it get back on the track more quickly.

This is just one example of the interdependence of the mechanical, electronic, and programming aspects of robotics. Although they are described in separate Parts of the book, effective design depends on all three, considered together.

Projects

That was the cookbook — now for some menus ...

Part 6 takes the mechanical, electronic and programming ideas of Parts 3 to 5 and puts them together to make robots. If the individual ideas are the recipes for the courses, the robots are the tasty meals. Part 6 shows five ways of combining some of the ideas, but these are not the only ways of putting them together. For instance, take the infrared sensors of the Quester and put them on the Android. Then add the maze-solving routines of the Gantry. That done, the Android will be able to run a maze and learn to solve it. This is just one way of recombining the ideas — there are dozens more.

6.1 The Scooter 6.1 The Scooter 6.1 The Scooter

6.1 The Scooter 166 166 166 166

An easily built but surprisingly versatile mobile robot.

An easily built but surprisingly versatile mobile robot.An easily built but surprisingly versatile mobile robot.

An easily built but surprisingly versatile mobile robot.

6.2 Not another android!

6.2 Not another android!

6.2 Not another android!

6.2 Not another android! 209 209 209 209

For those who like a robot to look like a robot.

For those who like a robot to look like a robot.For those who like a robot to look like a robot.

For those who like a robot to look like a robot.

6.3 6.3 6.3

6.3 A robotic toy A robotic toy A robotic toy A robotic toy 246 246 246 246

Turn an existing toy into a robot.

Turn an existing toy into a robot.Turn an existing toy into a robot.

Turn an existing toy into a robot.

6.4 The Quester 6.4 The Quester 6.4 The Quester

6.4 The Quester 258 258 258 258

A mobile robot with a wide range of features A mobile robot with a wide range of featuresA mobile robot with a wide range of features A mobile robot with a wide range of features

6.3 The Gantry 6.3 The Gantry 6.3 The Gantry

6.3 The Gantry 297 297 297 297

A gantry robot that plays board games, paints A gantry robot that plays board games, paintsA gantry robot that plays board games, paints A gantry robot that plays board games, paints pictures, and solves mazes.

pictures, and solves mazes.pictures, and solves mazes.

pictures, and solves mazes.

Specification

Chassis based on ready-made plastic box.

Runs on 4.5 V or 4.8 V battery.

Three wheels: 2 rear drive wheels, 1 biased castor at front for simple steering.

PIC 16F690A.

This robot is to have low-cost construction and its electronics circuits are to be as simple as possible.

Its modular electronic design makes it a low-cost project in another way.

You can change the sensors and re-program the PIC, so that you can in effect build several different scooters for little more than the cost of one.

The panel on the right lists the Scooter’s main features, but you can add other features at any time after you have built the essential

structures.

Building the robot in a ready-made box gets it up and running that much sooner. It is also a plus feature for those who are not too expert at — or not too interested by — building things. The prototype was assembled in a plastic food storage box with snap-on lid, bought at the local supermarket. The box is about 120 mm square and 50 mm deep. It is made of green transparent plastic and the lid is orange, so it has a striking appearance as it dashes erratically about the room, flashing its LEDs.

Hobby electronics stores are another source of plastic boxes of various shapes and sizes.

Choose a squarish one, possibly slightly bigger than the one we used.

Slightly more expensive, but suitable for drilling and cutting are the Jiffy boxes or other ABS plastic enclosures sold by electronics hobby shops. Most are black plastic but it is possible to get them in other colours, including transparent ones for people who like to see the works. Choose one which has a squarish shape — many are too long and narrow to be suitable.

Some have grids marked on the lid, which are helpful when cutting holes. They often have slots for mounting circuit boards, and may have a built-in battery compartment.