Motors, more motors and a couple more motors

For a while I have been considering different motors and to use with the modular robot, the various drive options avalible include; servo motors, geared motors or ungeared motors. While wheels include; small wheels, tracks, or bare motor shafts (possibly with a small amount of heatshrink for traction).

The very first Edgebot I built using spare parts and about 20 minutes, more importantly however, is that I used geared servo motors and small Lego wheels connected using a large amount of hot glue (I really don't refrain from using hot-glue :D) Although the end result had a reasonable amount of torque, it was quite slow and the amount of work that was required to both 360 degree hack and DC (rather than PWM) hack the servo did not make it a fast and easy process. Also, even the cheapest servos are relatively expensive.



You can see the servo motors at the back, along with the crudely attached wheels.
It is not my circuit design; the original circuit design can be found here

Where servos are slow and high in torque, ungeared motors are very fast (7000rpm) with hardly an torque (the stall torque of most small, ungeared motors is about 15 grams) Therefore making them handle wheels poorly, as they simply stall and drain the batteries quicker. However, people often attach heatshrink to the motor shafts and use them on lighter robots which require high speed movements.

The final type of motors are the geared motors, which are similar to servo motors, but typically have a lower gear ratio so that they travel faster. Unlike servo motors, geared motors do not require any hacking to make them function as robot wheels. Geared motors are the same price as, or slightly more expensive than, servo motors, but as they require no work for them to function correctly, it would typically be worth it.

For the modular robot chassis, I am going to try some of each to see how well they work (or don't). For the servos, I am going to use standard, lightweight servos from Hobbyking. The Solarbotics' motors are often suggested for use in robots, so I'll test them also. While for the geared motors I am going to try some standard geared motors as well as a pair of offset shaft motors, which should work with these tyres, these are again, from Hobbyking. The reason I am using Hobbyking is that I frequently place orders with them for RC supplies and the like. 

I shall post results once I received and tested all the motors.

Shield template

As previously mentioned, I have used a shield template as a starter board for both the Photovore and motor controller, this ensures that all the board headers line up and connect correctly. I generated the template from the Edgebot board.

The shields are composed of two six pin headers, one with 3 power connections; battery voltage (Typically between 5.6v and 6.4v), a ground connection - this connects to all required grounds on all levels, and a regulated 3.3v output, which is provided by the motor controller main module and can deliver up to 800ma. All other the header pins, nine in total, are used for signal transfers between boards, such as the upper left pins being used for logic interfacing with the Edgebot from the Photovore.


The headers are standard, 6-pin Arduino stackable headers therefore they are breadboard friendly with pin spacing of 0.1". Likewise, I have positioned the headers to be exactly 0.9" apart, thus meaning that you can plug the boards into a breadboard if you desired.



The template schematic connections

The bare template PCB

The latest shield template (v0.1 - works with all current shields) can be downloaded from Dropbox.

Motor controller

The layout for the motor controller PCB was, again, fairly straightforward as there was already had a board layout ready, also the board composes of little more than a single H-Bridge, a voltage regulator and some side connectors. On the other hand, finding components which worked together was a little more challenging.

Ever since starting to designing the modular robots, I was constantly thinking of shield boards that could be developed to allow for more complex behaviour and an Arduino/Atmel shield seemed to be an obvious option for a programmable control structure. The main Atmel chips are typically powered off 3.3v or 5v power supplies, also, 5v is a standard supply voltage for logic chips. However, no battery supplies 5v, therefore a voltage regulator would have to be used, the most common 5v voltage regulator appeared to be the LM7805, but it requires a minimum input voltage of 7.5v to function properly and my intended battery array is not that high (I was thinking of using AA batteries, as they are widely available, cheap, and have a large capacity. So 3 or 4 in series would be good; 4.5v/6v respectively) This lead me to consider a 3.3v voltage regulator such as the LM1117, I had a look and found it requires a minimum input voltage of 4.5v, which is perfect.


Another component which required some research was the H-bridge, I originally intended to use the SN754410 which is sold by Sparkfun (or more accurately, resold by Hobbytronics) so it could be sourced easily. Unfortunately, the SN754410 requires a regulated logic supple voltage of 5v, which, as was just mentioned, I am unable to provide with the current battery amount. I then found a few more H-bridges, but they all provided me with the same problem, I finally stumbled upon the L293D, which operates down to 4.5v also. A common issue with motor controllers of all types that they can become hot when operating, but I found a few suitable DIP heatsinks on UK Farnell, such as this and this. The maximum current output of the L293D is 600ma with a 1.2A peak, both of which are way above the current use of the motor/s I have been looking at, more on that at a later date though.


Although there are two revisions of the board, the only difference between the two is the presence of mounting holes in the second, the width and height between the centre of the holes is 1400 and 1500 mils respectively, the mils measurement is a standard PCB measurement, but almost useless anywhere else, so those dimensions in metric are (annoyingly) 35.56mm and 38.1mm and the diameter of the holes is 3mm.


The schematic, you can see that it is basically two circuits; the H-bridge and the voltage regulator

The PCB


The top side of the PCB as seen in the OSH Park preview/checker

The latest motor controller PCB design files (v0.2) can be downloaded from Dropbox.

Photovore

As I have stated previously, the Photovore circuit is simple in comparision to the Edgebot, therefore it has less components and required no work to make all the parts fit onto the board. Also, I could simply copy the board template over from the Edgebot files, thus causing the two boards to be identical shapes, the same header positioning and ensuring that the two boards would slot together and carry out the modular features, this also provided a starter board to use for future modules.

As you could see from the Photovore circuit in a previous post, it uses a single comparator and a inverter, however, inverters typically come in 14 pin DIP packages as the chips contain six inverters, plus power connections. Therefore I used a dual comparator and used the spare comparator as a signal inverter, thus reducing the parts to a single 8 pin DIP package.


The second revision had a simple layout change and I swapped the LDRs around, as I realised that I (for some reason) had used the principle that the higher the light intensity, the higher the resistance of the LDR, this is, however, false. So by simply swapping the LDRs around it now drives away from the darker LDR and 'into the light'.



The schematic

The PCB

The latest Photovore design files (v0.2) can be downloaded from Dropbox.

Edgebot

I have now finalised the design for the Edgebot schematic and Eagle PCB board, I went through a total of 5 revisions of the board, changing multiple things each time; board size, components, component layout, routing, all to reduce costs of fabrication and increase the ease of building and using the board.

 The main problem that I encountered with the development of the PCB was being able to allow for another board to slot on top, while retaining the current functionality and adding more with the extra board. My first design incorporated a set of headers for the transfer of signals and to stabilise the upper board and a single, two pin male header for power transfer. From my second design onwards I proposed to use a pair of 6 pin Arduino stackable headers, this meant that I could plug multiple boards directly on top of each other (e.g. Photovore, Edgebot, H-bridge) As only 4 pins are used for the Photovore-Edgebot signals (Excluding the two/three power pins) It leaves 5 pins for other signal transfers of future boards.


Another dilemma I faced was how to keep the feature of modularity when it came to inputs/outputs, the first through to fourth designs used screw terminals to connect the external switch input pins and the motor outputs. However, this meant that you could have to use a screwdriver every time you added or took off a board, which would both time consuming and tiresome, especially if you do not have a fine screwdriver to hand. Screw terminals  are relatively large, therefore taking up unnecessary space on the PCB and thus increasing the cost. So I replaced them with right angle headers so that you can simply slot the sensors in and out, if you wanted a more permanent solution, you could also solder the sensor directly into the header PCB holes.


The latest version of the board also uses a trim-pot so that you can change the reverse time delay of one of the motors, the capacitor values were changed accordingly.


The schematic

The PCB

The latest Edgebot design files (v0.5) can be downloaded from Dropbox.

Circuit simulation

The inputs of both the Photovore and Edgebot are manipulated multiple times by logic gates for the robot to go forward/reverse at the right times and I was unable to quickly and easily figure out a logic gate system that responded correctly. I Google searched for a (free) circuit simulation software and soon found a Java circuit simulation applet which seemed to be easy to learn and use. You can see/use/download the Java applet here.

Although the circuit simulator is relatively basic, I was easily able to redesign my logic array multiple times to get the desired responses, both when the Photovore circuit is 'plugged in', not 'plugged in' and working standalone.


The following image show the simulation with both boards, the red tracks is that of the Edgebot, while the green is the Photovore, when the two circuits are joined, the white switches flip and the Edgebot uses the Photovore's direction. Note that RC component values have been changed for the simulation, as it cannot simulate a circuit in real-time.



The schematic

You can download the simulation file from dropbox.

A little background infomation

Over the last few months, I have been developing a series of simple modular electronics kits, with the aim that they could be assembled and then they could simply plug together to form different responses to sensory inputs.

The first two modules that I am creating are originated from BEAM type circuits and they include an Edgebot, a simple robot which reverses and turns when it touches an object, and a Photovore (Literally means “Light-eater”) like logic system, which drives in the direction of the brightest light source.


The Edgebot circuit comprises of a single touch sensor, two RC timers and a small amount of logic. The touch sensor is to be mounted at the front of the robot with an extended arm, the RC circuits are time delays for how long the motors reverse for (One reverses longer than the other in order to turn) and the logic is to process the RC circuits for forward/reverse motions and to allow for the logic expansion brought by the Photovore board.


The Photovore circuit is simple in comparison; it uses a comparator to compare the signals of two LDRs and the output dictates whether or not the right motor should go forward in order to face the more light (The signal for the left motor is inverted)


The final board that is to be designed will a motor controller that is a simple H-Bridge that allows for basic forward/reverse movement of two motors. It is likely that it will also contain a 3.3v voltage regulator to accommodate future expansion boards. (An AVR processor would seem to be a likely candidate)


I hope to send the boards to OSH Park to be fabricated and then (hopefully) have some working prototypes. I will publish images as they become available as well as the all the Eagle schematics, PCB designs and circuit simulation files as the boards become finalised.