Wednesday, January 25, 2012

Three large robots to build and program



Want to gain a good knowledge of robotics, that is to say in electronics, computer and mechanical?
To do this, here is the first in a series of articles in the new category "Robotics", offering three achievements of large programmable robots for entertainment and learning.

Robotics, understood here as machine building "smart" * able to move and perform autonomously a series of operations more or less important, is an activity or hobby (hobby) the most fascinating and instructive that are: to succeed in creating a movement to program a machine "thinking" *, to control a mechanical arm, gives an emotion unique!
Therefore, to achieve such a result, to build and program, even the simplest of robots, it is necessary to have experience in many fields of electronics, mechanics, computer , physics, biology, etc..

Achievements
This made us decide to offer this arti cle dedicated to robotic assembly first ELM is, firstly, the increasing interest you have shown in this area and, secondly, the availability always larger sensors, servos, motors, control plates, systems development programs: in short, everything needed to make this kind of devices is now available. Not to mention the publications of numerous and increasingly within the reach of amateurs.
As for us, we begin by offering to build three different robots, but all using the same circuit board control, of course programmable and programmed in different ways depending on the type of robot.

platinum common control
The circuit of the common platinum (fi gure 5) uses a powerful microcontroller and broad spectrum of use: PIC16F876, well known to our readers, which was implemented in the factory program EF479. Using a PIC from Microchip (as used in this field), allows to use t hundreds of routines and programs ready for the specifications of all types.

Any building or assembling
Much of the material needed for the construction of three robots can be found in retail, but some mechanical specialties will be made from suitably shaped copper plates. Their achievement requires some experience, the right tools and above all patience and time, but rest assured, if you do not have all that, you can still get in the specialized trade of mechanical assemblies ready to assemble (see photos of the fi gure 11). Maybe you'd think that for the first time it is better to settle for such an assembly, but if you are already experienced in this field, well, nothing prevents you from mobilizing scroll saw, lathe, drill press, milling , files, etc..
Anyway, even if you simply assemble, you gain experience which will serve later: in the latter case, simply ra weld parts to assemble with a normal soldering iron and solder if indeed these are a problem (which would surprise us) you can go in and you use two component epoxy adhesive, available in supermarkets or power and crafts. The principles of electronic control, programming and networks used here are much like those used in industrial application professional.
Our three packages, although they may appear to you like games or toys, you will become familiar with key concepts from the world of robots and especially with programs to make "intelligent" * all three of our future friends.
Let us, for fi ne with this preamble, you that these three robots are much larger in size than most of those seen in the catalogs of retailers: the photo of the front page gives you a scale comparison, since one of them, "Spider" shows us his "pack" of 4 standard rechargeable stick.
Now see what look like three robots that you build.

Carbot

 Figure 1: Carbot. For speed, he is unbeatable: it moves rapidly forward and backward, and through its two whiskers (or antennas), it avoids obstacles. It derives its energy from two actuators and the third swivel wheel makes it agile, precise and fast.

Carbot the robot is a three-wheeled vehicle moving with two servos (those used in model airplanes) controlled by a microcontroller. Carbot is the ideal teaching tool for beginning to implement a microcontroller. Indeed, the microcontroller can drive through the right signals sent to its ports, the two actuators and to acquire, always using the ports, the signals received from external sensors, namely micro-switches arranged on his whiskers, or antennas (fi gure 1).
The actuators are available already modifi ed so they can run completely in one way or another, that is to say they are not enslaved by fi xing or by internal mail booster. The peculiarity of the robot Carbot is that the third wheel, the back is pivotally, that is to say capable of turning in all directions: it makes the robot more agile, precise and quick in his movements.
Carbot found in two micro-switches constituting whiskers or antennae, making official what sensors to avoid obstacles. The robot is built in Carbot fi ber glass coated on both sides with a layer of copper do so (such as double-sided PCB): the whole is baked varnish, which effectively protects the surface from scratches. The various pieces were obtained, also using a CNC milling machine, guaranteeing the necessary accuracy. Carbot is built on a base plate to which are added various elements that constitute it. In the body parts are assembled to the movement, two engines and castor wheel. The control board is our common card (fi gure 6b) equipped with a series of components adding namely: two LED (making it official with lights or can be managed by software according to the situation) and a buzzer (a small high- speaker) for emitting a series of sounds. With the control board must also, of course, a series of programs for basic movements. The control board has, as we have said, a PIC16F876 microcontroller at 20 MHz-EF479 already programmed at the factory and with "bootloader" resident, which allows you to load programs directly with a computer, without needing a programmer. In addition to the control board, it can superimpose an additional plate which are mounted components and various accessories, including sensors, miniature video camera, LCD display researcher, photocell and all kinds of others.

Filippo

 Figure 2: Filippo. Perhaps the most sympathetic of the three: With the infrared detector, it does not bump his head

Filippo The robot is a bipedal moving media using two similar two-legged (or legs) with their feet (fi gure 2). Filippo is using the booster prior to walk by moving its center of gravity to the right and left within the area bounded by the feet: they will thus raise the soil. The central actuator serves to move the legs back and forth (the feet are parallel to the ground to allow the pantograph legs to run). The legs are connected to the same motor, when an advance, the other retreats: the synchronization of the two actuators can perform the 36 basic movements which, by their composition, are forward, backward or turn on him the same robot. Filippo is also made of fiberglass cladding and copper layers on both sides, the whole stove enamel. In the body elements are assembled to the movements, or both engines. Its construction reflects a series of laws of physics (kinematics), such that the centroid must always have its projection point perpendicular to the ground located within the polygon defined by its two feet in motion (when we walk, we, we do nothing else but think about it and no other program than instinct).
In association with the control board, Filippo uses two transmitting and two receiving LED infrared detectors for obstacle. Among the programs available are also some routines necessary to adjust the servos during the assembly phase: this produces a perfect focus mechanics.

Spider

 Figure 3: Spider. Slow but inexorable, this insect with six legs forward, backward and turns on itself thanks to the three servos which he has. He also is equipped with antennas (or mustache) enabling it to avoid obstacles.

Spider robot evokes a six-legged insect. Although quite left aspect, it is actually not very limited in his movements: he can walk forward, backward and turn on itself. To walk, it initializes its six legs so they are all at the same time on the ground, then it lowers the center tab on the left (which has the effect of raising the other two left feet): no longer relies so only three points (both front and rear right legs and the center tab on the left).
The left leg raised, solicited by the engine, move forward together (because they are connected by the axis that connects them), then the paw is raised and left central fact of this (since they are also interconnected) The center leg falls right: the right legs are worn out and my left leg back, creating forward movement of the "animal". Then the cycle begins again and repeats the infinite nor. As Carbot, two micro-switches are antennas, or whiskers, making official what detectors afi n obstacles to avoid. Spider is built on a base plate to which are added various elements that constitute it: above is the control board and are stowed below their means movements and three engines (fi gure 3). Because the three robots have been described, we can proceed to the description of the plate joint control.

 When you have a garden knows what it means to spend at least one afternoon a week to mow the lawn the sun! This is one of the things we certainly can entrust to specialized robots, commercially available in recent years. Among the best known models you Husqvarna, a Swedish multinational, called Auto Mower and Solar Mower. They cut the grass and an energetic remake - respectively on the 230 V and with the sun - completely automatically, silently and without any exhaust gases. Both have anti-collision sensors bustling near fences, trees, rocks, etc.. And a safety lock. Auto Mower is capable of autonomously mow a meadow to 1500 square feet and can work 24 hours a day. He knows when to recharge its battery and then joined its charging station, recharges itself and begins to mow the grass.
Solar Mower gets its own energy with solar cells and on sunny days he worked almost without pause. He can mow a meadow to 1200 square feet and, thanks to its built-in battery, it works even during cloudy days.
The work area of the mower is defined by an electrified perimeter and buried along the edges of the meadow. The cut is continuous and the grass is mowed fairly finely to fall on the ground that it fertilizes. The mower has no bag or recycling bin of grass cuttings: thanks to this machine is 100% autonomous. As for the movements, they are risky, but if you want to work day and night so that no grass grows too, statistically the machine passes over all areas of the meadow. From a technical standpoint, the Auto Mower uses two DC motors powered by a pack of NiMH batteries of 4.4 Ah and a power consumption of about 8 kWh / month. The Base Station, to which the machine runs automatically when the battery level is too low, can operate to 230 Vac or 115 Vac (you can take it mow your Texas ranch!). Solar Mower also uses two DC motors, it can be recharged through the area but normally it uses its solar panels forming the top of the shroud and its backup battery NiMH 1.2 Ah. Its operating principle is identical to that of the Auto Mower: The mower has a cut a few mm and it moves randomly within the designated area. This allows a constant grass height. For more information, see our commentary site in chronic Husqvarna "On the Internet" at the end of this issue.


Figure 4: The robot gardener

platinum common control
The wiring diagram

 Figure 5: Diagram of the plate joint control.

The wiring diagram is given in fi gure 5. This deck joint control has been developed specifically for use with our three robots, which does not e that it can not be used also as a platinum design and development of applications in which it is implement the Risc PIC16F876, quite the contrary!
As the wiring diagram shows, the microcontroller (IC1) is the heart of the installation: it has 8 KB of program memory (in words of 14 bits), 386 bytes of data memory, 256 bytes of EEPROM data memory, 13 interrupts, 22-pin I / O divided into 3 ports (Ports A, B, C), 3 "timers", 2 modules Capture / Compare / PWM, 5 input channels Analog / Digital 10-bit hardware USART and able to operate with a clock frequency of 20 MHz.
For programming, we will see in future articles we will use the "Bootloader" resident: it allows (via the RS232 port on the controller board) to insert the programs directly through the serial inter face the computer (it is not necessary to have a programmer).
But let us look more closely at the wiring diagram of the fi gure 5: the clock circuit (pins 9 and 10) is controlled by a quartz of 20 MHz and the switch S1 acts as a reset. This reset can also be controlled by the serial line through pin 4 of the RS232 line (there enough t the jumper JP10 is closed on pin 12 of IC2 to IC1 and 1 connected). This trick can easily and automatically load new programs.
Programming is therefore through the serial port of the computer. Afi nd'adapter levels of this line (+ or -12 V) to those of PIC (0 / 5 V), we used a standard MAX232 (IC2) interposed between the DB9 and lines RC6/RC7 of IC1.
To produce the 12 V positive and negative for the system, the integrated circuit implements a circuit internal capacitive charge pump using the external electrolytic capacitors C5-C8: This process produces low currents, but more than enough for health our design. The integrated circuit does not require any external components and is powered with 5 V available to the regulator output IC3 (L4805). The same voltage also powers the PIC.
At the port RA1 is the circuit of IC1 pager comprising the transistor T1 and the buzzer SP1. The three outputs for use ser vo lines RB0, RB1 and RB2 corresponding connectors JP3, JP2 and JP1. Each connector has three pins as it is necessary to provide servo control also the supply voltage of 5 V. RC0 lines (connector JP6) and RC1 (JP7 connector) are used for infrared transmitters that are part of the recognition system of barriers. The corresponding receptors using lines RC2 and RC5 (respectively connectors JP5 and JP4). The control board still has two rows (RC3, RC4 and connector JP8, JP9 connector) to connect two LEDs to simulate eyes or report a change of state or anomalies.
Two other pairs of contacts with resistor pull-ups (which are inserted the micro-switches to simulate the whiskers or antennae) are the connectors JP11 and JP12: these entries coincide with the lines RA4 and RA5. The circuit provides two more expansion slots: one (SV1) 20-pin brings out the 19 ports of the microcontroller (the other 3 out of 22 are related to the beeper and micro-switches) and the mass .
The other (JP13, JP14, JP15) provides 8-pin (3 GND 3 +5 V and 2 power direct from battery). These two connectors are positioned so that one can superimpose the plate controls an additional card on which to add additional components or accessories: for example, other sensors or detectors, miniature video camera, LCD display researcher , photoresistor, etc..
The feed section provides 5 V stabilized from the input voltage of 6 V. All the robots are in fact supplied with 4 AA batteries or rechargeable type stick (4 x 1.5 V) to provide power to the servos and control circuit. The voltage drop is limited between the input and output, use a regulator with low voltage "drop out" (waste) or the L4805. The ignition of LD1 indicates that the circuit is powered. As it is located downstream of the regulator, the LED also indicates the proper functioning of the integrated circuit. Two high capacity electrolytic capacitors compensating current peaks actuators complement the power.

 Figure 6a: Schematic implementation of the components of the deck joint control.

 Figure 6b: Photograph of a prototype of the plate joint control.

 Figure 6c-1: Drawing to scale 1, double-sided PCB with plated through holes of the plate joint control, component side.

 Figure 6c-2: Drawing to scale 1, double-sided PCB with plated through holes of the plate joint control side seams.

Component List
R1 = 470 Ω
R2 = 220 Ω
R3 = 220 Ω
R4 = 470 Ω
R5 = 470 Ω
R6 = 100 Ω
R7 = 10 kW
R8 = 22 kW
R9 = 22 kW
R10 = 4.7 kΩ
R11 = 47 kilohm
C1 = 220 uF 35 V electrolytic
C2 = 1000 uF 16 V electrolytic
C3 = 100 nF multilayer
C4 = 100 nF multilayer
C5 = 1 uF 100 V electrolytic
C6 = 1 uF 100 V electrolytic
C7 = 1 uF 100 V electrolytic
C8 = 1 uF 100 V electrolytic
C9 = 22 pF ceramic
C10 = 22 pF ceramic
C11 = 100 nF multilayer
C12 = 1 uF 100 V electrolytic
LD1 = LED 5 mm red
D2 = 8.2 V Zener
D3 = 1N4148
IC1 = PIC16F876-EF479 already programmed in the factory
IC2 MAX232 =
IC3 = L4805
Q1 = 20 MHz Quartz
T1 = BC547
SP1 = 5 V without electronic buzzer
S1 = Micro switch
SW1 = Inverter PCB

Miscellaneous:
1 Support 2 x 8-pin
1 Support 2 x 14-pin
1 Terminal 2 poles
1 DB9 female connector
1 20-pin female connector
1 8-pin female connectors
2 8-pin female connectors protected
5 3-pin male connector
2 2-pole male connector


The practical

 Figure 7: The deck joint control.

A beautiful photo of our "motherboard" ready to be installed on one of three robots in the foreground the DB9 connector to transfer programs from the computer to the microcontroller constituting the core of the plate.


The construction of the deck has no special diffi culty if not the realization of double-sided PCB with plated through holes: if you want to do it yourself (using the fi gure 6c-6c-1 and 2 which shows the drawings of both sides to scale 1), remember to make all connections between the two sides with pieces of 5 mm if the bare copper welded on both sides of the PCB.
Throughout the assembly, have constantly before the fi gures 6a and 6b. Use an iron to failure if not 20 to 30 W of power and retinol of 0.8 mm in diameter of good quality (you do not plumbing!). First, sort all the components by function (R, C, LD, D, IC with and without support, Q, T, SP, S, SW, etc.. In the following list of components) and by values or types.
First insert and solder the two mounting integrated circuits and check them out your welds (or short-circuit between tracks or pads or cold solder joints): you insert integrated circuits at the very fi n.
Then attach all resistance without confusing them. Mount all the capacitors without confusing and not respecting the polarity of electrolytic (the + is the longest leg and the - is written on the side: how to cheat?).
Mount the red LED LD1 respecting its polarity (its longest leg goes +). Mount the two diodes, a zener and a signal, directing them in the right direction cue ring-keyed (fi gure 6a). Mount the regulator IC3 coated metal sole against the printed circuit and so xez it with a bolt 3MA. Quartz mount up and firmly pressed against the PCB. Mount the transistor flat-keyed reference-oriented JP2. Mount the buzzer without reversing its polarity.
Mount the DIP switch S1 to reset the bottom left of SV1. Mount the inverter Miniature PCB. Mount the terminal block 2 poles. Attach the two DB9 connectors (left bottom) and SV1 (bottom right). Attach all connectors to receive the tulips scored many riders.
Check them carefully all your welds: if you want, then insert the two integrated circuits, you can power the circuit in 6 V, inspect to see that the LED lights up and the 5 V is present downstream of the regulator ( with a multimeter). You can then insert the two ICs in their sockets by directing their cue-keyed U in the right direction shown by the fi gure 6a.
The deck is finished, set it aside until the program and use it to control one of three robots (or three): a next article in robotics will teach you how to make and show you Carbot routines ( software) required for the different movements and those used to prepare the signals provided by sensors and detectors. You'll also read how to use the bootloader to load programs directly with the computer, thus avoiding the use of a programmer.
For writing programs, you can use the programming language that is familiar to you, from Assembler to C via Basic. Those that are using it and resort to language compilers or PicBasic PicBasicPro of μEngineering Laboratories, will use the basic listings we've developed with all the initial parameters afi n not to forget to insert the necessary initializations of microcontroller.


On this page we publish the photos of some points detailed construction of the deck joint, and the complete list of all connectors used with their binding.

 The switch to start and the arrival terminal of the supply voltage supplied by a pack of 4 rechargeable batteries type stick (which gives 6 V).

 Three driving the servo connectors and connector protected eight contacts used to supply a possible experimental stage (to be superimposed on the plate main).

 20 pin connector providing outside, besides the mass, the 19 lines of I / O of the microcontroller.

 The buzzer and connectors (from left to right) of the infrared sensor number 1, the infrared transmitter number 1, LED1, LED2 of, the infrared transmitter and receiver number 2 number 2 infrared.

 The table summarizes all the connectors used on the deck common control with information relating to the function and pin configuration. With all this information, it is difficult to reverse the connections (or he's going to take a lot of ill will!): It will make it easy to connect the controller board to all types of experimental plate.

Figure 8: The connectors on the motherboard (controller board).




 Figure 9: Whatever it takes to build three robots that future articles from the robot will learn to climb .

Conclusion
We would fi nally emphasize once again that the three proposed accomplishments of robots are not mere toys and childish games, but mostly they can familiarize themselves with key concepts and knacks of robotics and especially with programs to make "intelligent" * these machines. It definitively challenge a new and certainly more rewarding to learn programming. This series of articles in robotics has obvious pedagogical fi nationality.


*: This is a way of speaking, a metaphor a bit daring. Indeed, intelligence is the fact of living (higher animals and man, of course) and thinking belongs to the man.
In calling it "intelligent" or "thinking", we mean that the computer machine is no longer content to unwind its algorithms, to visit the places she was given, armed with a search criterion, but it can now operate interactively (heuristic) and acquire during its investigations of the criteria it had no beginning (and has developed the so-called AI whose original fantasy remains the famous robot-computer HAL from Stanley Kubrick, 2001 A Space Odyssey). It remains that intelligence is the living power and freedom to deal with new awkwardly true, that for which it has not been programmed and creative thinking is something radically new and not a rearrangement existing elements.

No comments:

Post a Comment

Most visited posts this week