Wednesday, April 20, 2011

Variable resistor box


Point to point wiring - yummy


While playing around with a current microcontroller project I found myself constantly swapping around the same resistor for a few different valued resistors. This led me down the path of wishing I had something to plug into a circuit that could change the resistor value easily.

I had seen resistor wheels before but they usually only had a limited range and were at the standard set resistor values. In essence a multipole switch. I wanted variable resistors. I had seen a project that had five variable resistors linked in series (not sure where I saw this, lost in the internet haze). The resistor values started at 1K and jumped up in value (10K, 50K, 100K, etc). That was closer to what I wanted. But I knew that variable resistors all have a tolerance range so it would be better to bypass the variable resistors I didn't want to use. It also meant I could set one variable resistor to a value, switch it out, set another and toggle between the two. Great for 555 timer circuits for example.

So I wanted half a dozen or so variable resistors in series with switches attached so I could bypass any variable resistor as desired. For values I chose 1K, 1K, 10K, 50K, 50K, 1M. The first 1K was a 25 turn precision type. The rest were the single turn type. Originally I was going to use a 100K resistor as the fifth resistor in series but the store was sold out so I went for another 50K resistor. I used SPDT switch to bypass the resistors. Finally I used a 2 pin molex connector to attach my test leads to. I would make up a few test leads with different ends (IC hook testing connectors, alligator clips, breadboard wire plugs).

To house everything I used a black UB5 jiffy box. It was the smallest box that could fit all components on the lid with a reasonable spacing. All wiring was simple point to point. I had been waiting for a good project to try out my new soldering iron station too.

After a quick mud map sketch I created a proper schematic with TinyCAD. Five minutes later I'm all done. There is nothing hard with this circuit but I'm finding as I tend to only get short amounts of time to spend on projects spread across a long period of elapsed time so documentation is a must.

Since I would be cutting out 11 holes and 2 squareish slots from the UB5 box lid I created a drill template using CadStd. A lot of mucking around was involved as I remember how to use CadStd and finally I had a nice template. As I planned to use my milling machine to actually make the holes the template was more to make sure my measurements were right and provide some sanity while making cuts.

When I came to drill out the holes (both the variable resistor and switches have round shafts) I used a 3-12mm step drill. The light plastic of the UB5 box lid can't really handle having an 8mm drill (needed for the variable resistors) go through it in one hit. Plus the plastic was only a few mil thick so the step drill went through it very easily. The mill made making a straight line of holes dead easy. The quality difference over my $100 drill press in terms of chuck wobble and control makes me think my drill press is going to get pretty dusty. For the 25 turn resistor I drilled two small holes and then filed out the remainder to get a rectangular slot. If I had been really keen I could (should) have used the slot cutter. For the 2 pin molex connector I used a dremel to cut out some material so the header sat recessed slightly so the pins were accessible from the other side of the lid. Finally I used an off cut of prototype board to glue (with 2 part epoxy) under the 25 turn variable resistor and 2 pin header to provide some more support. I didn't want the 25 turn resistor to be pushed through the lid and I didn't think a bit of hot glue would hold it well enough.

When the glue was dry and after cleaning up the holes I mounted all the variable resistors and switches. Ah, straight lines of components. It really does make a difference. Next was an orgy of wiring stripping, tinning and point to point wiring. Lots of double checking for shorts along the way. Then the lid was screwed onto the UB5 box. This was when I found the only bit of this project that failed. The self tapping screws that came with the box were rubbish. The head of one stripped and another started to go. Cheap soft metal were used in the screws. Not happy Jan. Finally I make up some tester cables and printed out some labels.

The majority of the parts for this project came from Jaycar. No reason other than Jaycar is my closest store. The IC testing hooks and alligator clips came from http://www.dealextreme.com/.

Parts List

Jaycar parts


  • SPDT switches (ST0300)

  • Variable resistors (RP8510, RP8516, RP8524, RP8504, RT4644)

  • Dials (HK7734)

  • UB5 jiffy box (HB6013)

  • 2 pin molex header (HM3402, HM3412)
Dealextreme parts


  • Electrical Wire Testing Hooks (10-Pack)

  • Multimeter Testing Clamps (10-Pack Small)

Tuesday, February 22, 2011

Pennybot

Pennybot is my attempt at a second mini sumobot. A sumobot with brains (or at least a microcontroller), IR sensors to detect opponents and possibly other sensors (a front touch sensor looks like a good idea). Again I will be constructing the chassis mainly from scratch. For motors I had two GM2 motors from Solarbotics. I really liked the offset design of the motors and skinny wheels available. Getting Nudgebot to fit in 10x10cm box was quite a challenge with the standard Tamiya gearbox and wheels. The GM2 motors will make life much easier.

For the chassis I tried many ideas before getting it right. All were around the same concept with the motors mounted on pieces of 90 degree aluminium which in turn are connected to a base plate. Just the positioning and battery location kept changing as I kept finding flaws in the designs. Part of this was due to looking at the design over a few months rather than spending a whole day just to work things out.

In the end I mounted both engines on 80mm lengths of 90 degree aluminium angle. Due to the position of the holes in relation to each other I used a paper template rather than dead reckoning to position the holes. The end result was quite a nice job (compared to other jobs I've done).

For the base I used the Tamiya plastic base plate like I had used on Trackbot and Nudgebot. Pre spaced 3mm holes are wonderful.

I mounted the motors on the bottom of the aluminium angle in order to fit the batteries underneath the base plate. This put the batteries at the lowest point and ensured the centre of gravity was as low as possible. To stop the batteries being damaged or accidently falling out I made a cover plate from some thin metel sheet (The EMF covering from inside an old Sun unipack disk enclosure). Instead of bolting the cover plate to the base plate I used a 3mm tap to put a thread in the cover plate. This meant I didn't waste space by needing room for nuts. Another case of "why didn't I always do this". At least that tap and die set purchased was justified.

For batteries I am using 5 x AA batteries. The motors are rated at 6V so I'm still working out if I either over supply the motors, use a diode to drop the voltage or just make a separate 6V tap. I intend to use a LM2940 low voltage regulator to provide a 5V supply off the 7.5V from all the batteries. How this regulator handles the noise from the motors is to be determined.

I did a quick temporary solder to add a power switch and did some push tests with 4 batteries (6V). No issues pushing the necessary weight (500gm). However I am slightly concerned by the amount of wobble in the axle on the motors. Straight line driving is really needed but there was definitely some travel. Hopefully when I screw the wheels to the axles (rather than just push them on) this will tighten up the slop.

Monday, February 21, 2011

CadStd review

Much in a similar vein to using TinyCad to produce semi professional schematics I decided to up the level of my designs with a CAD package. I needed something that was cheap, easy to learn/use and could produce 'true size' paper print outs. The dual end goals were to document my designs but more importantly be able to produce templates for machining (eg drilling templates). Previously I had used graph paper for these tasks.

I had no experience in using CAD packages or technical drawing. So the first step was some research into what a CAD package can do and what to expect out of one. I would recommend anyone looking for a CAD package do this first as some CAD programs are more focused on particular tasks than others (eg 2D vs 3D plans).

After some web research I came across CadStd (www.cadstd.com). The product has two versions, a free unlimited use lite version with some restricted functionality and a licensed pro version with full functionality. The lite version could be all that you need in cases where you are only doing simple plans. After using the lite version to do the tutorials I purchased the Pro version at $37.50 USD. The version I have is 3.7.2. CadStd is a 2D program but it does do isometric projections.

The install was simple with the total install size approx 5mb. There is a tutorial that runs through the basic functionality in a structured lesson format. By the end of the tutorial I was able to construct some simple plans. There is also a user guide. That said you will need to a few hours playing with all the drawing functions just to see how they work. I found some of them odd to begin with (like the three ways to draw an arc) but I suspect that is due to a lack of experience in both CAD and technical drawing. This is definitely a case of the more you do the easier to becomes. CadStd isn't MS Paint with a bit added. It's an engineering tool. You will have to work to use this but that seems to be constant across the CAD field. Feel free to insert "learning curve" in there too.

The litmus test was turning a technical drawing (the Solarbotics GM2 motor plan) into a drilling template. The drawing was detailed but not to scale. After an hour of fiddling I had drilling template ready for use. So success. Did I need the Pro version to do this? No. However I like to support people making tools like this.

I would recommend CadStd to anyone who has limited time to learn new products but is sick of using graph paper to make substandard templates. Be prepared to spend 2-3 hours to learn how to use it and expect to make so odd mistakes along the way. Ctrl-Z is your friend.

Tuesday, February 15, 2011

A(nother) headbot



Another project coming out of "Junkbots, Bugbots & Bots on Wheels" was the construction of a headbot based on the 74AC240 'biocore'. Again I would fully recommend this book for it's interesting projects and "make stuff from junk" ethic. The biocore was constructed according to the instructions in the book. I used 22uF capacitors as suggested.

My first attempt at a base was a failure. I used a small 3-6V DC motor with a pulley attached, which was geared down (via a belt drive) to another pulley that was attached to a larger base plate which had the batteries, biocore, etc. In essence trying to simulate the book example of a cassette deck setup. However the balance was totally off and the motor would simply jam under load (or at best spin and the belt would slip). What I needed was either a cassette deck or a gear head motor. Frustrated I put the biocore and other parts back in the big box of components for another day.

A couple of years pass. Kids arrive. My soldering iron gets rusty.

One day at Dick Smith (when they still sold electronics) I purchased an old and heavily discounted line following robot kit fot $20. The design was poor and complicated but at tht price I wanted the parts. Two gear head motors, a relay, seven IR leds, etc. Bargain. Now I have a gear head motor.
The 74AC240 was purchased from Solarbotics. For the base I used the wheel from the above mentioned robot kit as that was keyed to fit the 4.5V gear head motor. The phototransistors were salvaged from an old balled computer mouse. The base plate is a lid from a vitamin container. While this lid was a great size it wasn't the best choice.

My power source was to be two 1.5 volt AA batteries. For balance I mounted these batteries in two separate battery holders on each side of the motor. I used two part epoxy glue to stick the holders to the lid. However once the glue had dried I found that the glue simply peeled off the lid/base plate. Vitamin lids were obviously made to be highly non stick to stop nasty molds, etc from attaching. So instead of glue I used small (2.5mm) self tapping screws to attach the battery holders to the base plate. The screws came from my collection of salvaged cdrom bits.

The power switch was a small SPDT switch I had which I mounted sideways into the rim of the base plate. Then all that was left was to wire the various components together and put in the biocore. I couldn't decide on a good way to attach the biocore to the base plate so I left is 'hanging' but held in place by the wiring. The wiring was made to be just long enough so there was enough tension to hold the biocore in place. Finally the two eye sensors were attached to the rim of the base plate with U-tack. I didn't want to permanently mount the eyes as I wanted to trial the best setup.

Friday, July 3, 2009

TinyCad review

As my robots have progressed from being other people's designs to my own I decided it was time to start properly documenting the designs. While reverse engineering is always possible having a clear schematic makes referral much easier. Nudgebot was the first project where I considered it complex enough to invest the time in learning how to use a schematic/cad program.

Before I started the search I had a few requirements
  • free if possible. I'm just not doing this enough to justify the cost of software.
  • recent. No 15 year old dos programs running in a dos emulator.
  • ease of use over functionality. I have limited time to learn and use a software package. I don't see my designs ever being that esoteric so a simple program which is easy to use is better than the "greatest software package ever" (tm) which needs a full week course to learn.
  • a CAD program that feeds into a PCB generation program, and the PCB generation program produces industry standard layouts (ie layouts that I can send to a PCB manufacturer).
A quick canvas of the internet showed up plenty of likely candidates. Top of the list was the linux based gEDA package and the windows based TinyCad/Freepcb combo. Both were open source and free. TinyCad/Freepcb where GUI based, gEDA being a mix of CLI and GUI. Given the mixed OS environment I was running in and the fact both TinyCad and Freepcb ran fine under linux via wine I decided to give TinyCad/Freepcb a try.

As TinyCad is designed to a simple program there were no tutorials that I could find. However the in program help was a tutorial by proxy and covered enough to make getting started easy enough. The interface was extreme intuitive (always a mark of a successful interface design) and very clean. Simplicity of design with easy of use. A rare combination in freeware land. A quick summary...

The Pros
  • small install (5mb)
  • very intuitive and easy to use
  • good design checker (to pick up those human errors)
  • ability to generate netlists (in multiple formats include those used by Freepcb), parts lists and export designs as images.
  • very easy to create new components and add them to the component library
  • good support forum
  • runs on linux under wine

Now for the cons...

  • limited default library. A limited library of components (no 555 chip??). That is offset by the ease to make new components (which is going to be mandatory for most people).
  • default library could do with a clean up. Duplicates of some components in the different libraries.
  • resize of components all but broken. You can resize components quite easily. However once that is done they don't (unless you are very lucky) match up to the underlying component grid. This means you will connect components together, save a design, reload it and all those links will exist (ie lines joining components) but won't actually be connecting said components. The design checker will pick these up but the first time it happened it was a case of WTF. The moral here is never resize components. If you want one smaller/larger best to create anew component of the desired size. It's annoying the first time but after you are aware of the problem I don't see it as a major issue.
Summary

A good circuit schematic design tool which met and exceeded all my requirements. After taking half an hour to ready through the help I was making my first circuit without issue. Fell down the resize of components problem but a quick search on the forum resolved that issue. Within a few hours I had not only created a number of new components for the component library but had also completed the circuit design of Nudgebot. The end result was a semi professional looking schematic that I could put up on the web for others to enjoy.

Now to check out Freepcb...

Thursday, February 5, 2009

nudgebot part 5


Nudgebot front and rear

With the circuit complete the only item left to complete was the front shield/scoop. This would both protect the front circuits and sensors and be the scoop to push opponents. With the rest off the robot down I had under 1cm before I hit the 10cm length limit. This meant the scoop would be very steep. The angle end up being approx 80 degrees. So the scoop wouldn't be scooping under over robots but more of a battering shield.

Since I had weight to spare (nudgebot was under 300gm) I went for a heavier metal than what I used for the rear shield. I couldn't go to heavy otherwise I wouldn't be able to work it with the hand tools I have (no sheet metal bender I'm afraid). My standard way of bending sheet metal was to clamp it in a vice and using a small engineers hammer to work it over the bend.

My bottom attachment points were on the front sensor board. The top attachment points were one the front screw holes on the main board. I also wanted the shield to wrap around the front sides and curve over the top of the main board to protect the battery and sensor plugs.

This front sensor board was 7mm above the ground so I curved the bottom of the shield (rather than end in a straight edge) to reduce friction/potential for small bumps to be grabbed. While this seemed to work well I found I kept having scratch marks on the sumo ring. This was because a small part of the bottom of the shield was touching, not the entire bottom of the shield. This resulted in nudgebot bouncing as this one point would catch, scratch and then bounce up and repeat. Much bending and rebending of the bottom attachment points were attempted to fix this. In the end one of them broke off. Sheet metal can only be worked so much. So with only three attachment points the shield was still very rigid. I had learnt from the rear shield that having the metal under a slight amount of tension added a great deal of rigidity. Strangely enough after the bottom attachment point broke off the issue of the scratching from the bottom shield on the sumo ring went away and nudgebot was running with ease across the sumo ring. I cut my losses and stopped fiddling.

All that is left to do is maybe paint the front and rear shields black (to reduce IR detection) and add in some lead weights to get nudgebot up to the 500gm class weight limit.

nudgebot part 4


The brain board

The brain board was connected to the main board by a custom built six pin connector. On the main board I cut up a standard 8 pin DIL socket so I had two 3 pin connectors. These then went next to each other on the main board. The six connectors were power/ground/left sensor/right sensor/right motor/left motor. On the brain board I used an extended 6 pin connector (cut down from a 12 pin connector) that was approx 1.5cm long. This was then soldered into the main board.

Bottom of the brain board

However the first one I used turned out to be too short once the AA batteries were installed (always measure with everything in place!). This caused a problem as when I unsoldered it a number of the copper tracks came off too. Thus the second header was not as securely connected. Over time this weakened quite a bit and in the end I had to reinforce the entire lot with a big glob of epoxy glue to stop it from falling apart. Given the choice again I would just use a standard molex connector or like.

The brain board consisted of the 556 and 393 chips and associated variable resistors/resistors/etc. I used a small board (approx a third the size of the main board) and even that gave me plenty of room. I changed the circuit slightly from the original breadboard design by adding variable resistors to the time circuit in case it needed to make a few adjustments (in case my timings were off on the breadboard). After a few hours of careful soldering I was all done and ready for the first test.


Nudgebot read to go

Things started to look promising. Nudgebot drove well, detected the white line and turned, sometimes. Also there was a humming coming from the relays. Basically the relays were getting stuck (ie latching). The voltage would be at 3.5V approx and the relay wouldn't unlatch. This never happened on the breadboard design. After much trial and failure I did the obvious and used the 555 timer chip from the breadboard instead of the one I purchased for the brain board. Total success. Why were my two 556 timer chips so different? Well the issue was the design. When using a 555 to drive a relay you need a diode in series to prevent latch up. The book I had got the 555 design from specifically mentions it. I had just missed it and the breadboard 556 timer chip obviously handled this better than the other one. So I went with the breadboard 556 timer chip with a todo note for adding in the diodes in series when I get time.

With the bread board done the circuit was finished. Nudgebot worked great. It travelled well, detected the white line without issue, turned, etc. Only quibbles were the values I used for the variable resistors in the timing circuit were too high. At the lowest setting they triggered for approx 1 sec which with the motors resulted in a 100-160 degree turn. Fine but would be nice to have better control. Also as usual the motors performed differently with one motor slightly faster than the other and the turn being impacted by this. Again for a dumbbot this was fine. In fact the uneven turn meant that Nudgebot was unlikely to get stuck in a forward/reverse loop so it was kind of a blessing in disguise.