Wednesday, March 2, 2011

How To Build A Simple Robot

This is the first of a multi-part series on how to build a simple robot. I will not be covering a lot of theory but instead will cover the nuts and bolts of building a robot. In this first instalment I will cover some of the different options in building this robot.

Platform:
You have several options for the base material.
  1. Wood Depending on the size of your robot plywood may be a good choice it is inexpensive or free and easy to work with simple tools. You can get 1/4″ and 3/8″ plywood at Hardware, Home Improvement, Craft, or Hobby stores. A good place to look for free material is at a Cabinet shop they have lots of scrap too small for their use but perfect for a small robot.
  2. Aluminium Light weight and moderately easy to work can also be found at Hardware, Home Improvement, Craft, or Hobby stores. You should always be very cautious when working with aluminum as edges can be very sharp and should be sanded or filed to round the edges.
  3. Plastics Acrylic or Plexiglas are both easy to work and can also be found at Hardware, Home Improvement, Craft, or Hobby stores. High-speed tools should not be used, as they will melt the plastic. When cutting or drilling use low speeds.
  4. Old CD’s These can be easy to find most people get them in the mail from AOL or Earthlink instead of throwing them away you can use them to make a robot. They can be a little on the brittle side so go easy when you do any cutting or drilling. I will be using Plexiglas from my local home center but you can use whatever material you want.

Motors:

  1. Servos You can use servos for easy to get gear motors. Hobby shops will usually carry several sizes and brands. You will need to modify them for use there are many sites on the net with different methods; the one I like is detailed at the PARTS website. Servos already have all of the control circuitry built in and are easy to control they have 3 wires signal, +, and ground by pulsing the signal line you can go forward, stop, or backward. Servos are probably the easiest and cheapest way to go but may not be the best for you.
  2. Gear motors These are available from surplus stores or hobby shops some people modify servos and remove the electronics to use them as gear motors. Gear motors will require control circuitry normally an H-bridge to allow forward and reverse motion and in some cases braking. Gear motors can give the greatest flexibility but at a higher cost compared to servos. Another source for gear motors is the toy section of your locale department store. What you want are the radio control toys that have differential steering, meaning they have a separate motor for each side. To turn left they go forward on the right motor and turn off the left motor and do the opposite to turn right. The really good cars will turn right by going backward on the right motor and forward on the left this will allow a vehicle to almost turn on a dime. If you use gear motors you will need to devise a method to mount the wheels I will be using a toy for my example.

Wheels:
You can use wheels from toys or you can buy wheels from a hobby shop they have pneumatic or foam wheels for model aircraft that are very easy to use.


Power System:

Batteries You will need to decide what type of batteries to use. It can quickly become very expensive replacing batteries. Rechargeable batteries are best; there are a number of different types to choose from. Electronic supply stores or Hobby shops are good places to look, you will need batteries and a charger to charge them with.
Power supply We will need a voltage regulator to drop the voltage from the battery to the 5 volts needed by the Microcontroller and other parts of the Brain for the robot.
I will cover using two different voltage regulators both are available FREE from National Semiconductor as samples. Each part has its good and bad points:
LM2825 Integrated Power Supply 1A DC-DC Converter is a complete switching power supply on a 24 pin DIP although a little large it requires no other components and has an efficiency of 80%. It does require at least 7 volts on the input but your batteries will last much longer than with a linear regulator.
LM2940 1A Low Dropout Regulator is a linear regulator in a TO 220 package it requires a couple of filter capacitors it is not as efficient as the LM2825 the big up point is it only requires 5.5 volts input to give a regulated 5 volts out.
For the brain, lets have a look at three different microcontroller’s. I will admit I am bias when it comes to Basic Micro products as I have been using them for quit a while now and have always been very happy with the products and the support.



Atom from Basic Micro is mostly compatible with the Basic Stamp but is much better, just to name a few of the things that set it above the Basic Stamp:
  • 8k of program space
  • IDE for programming
  • ICD for in circuit debugging lets you watch your program run
  • Floating point 32×32 bit math allows you to do real math. In case you don’t now it 5/2=2 to a Basic stamp but to the Atom 5/2=2.5
  • Interrupts (Up to 14 Sources) allow the Atom to stop where it is in a program and jump to another part of a program and when finished go back where it came from based on an event either internal or external.
  • Analogue to Digital Converter 4 10 bit analog to digital converters.
You can also buy the Atom28 28 Pin Interpreter Chip and build it up on a solderless bread board.
Basic Stamp from Parrallax the old workhorse of the list has a well-established base of users and resources. Their educational resources are outstanding and nothing else really compares they have texts on Robotics, Earth Measurements, Industrial Control, and more.
PIC16F876 Programmed with Mbasic compiler also from Basic Micro version 5.0 is basically syntax compatible with the Atom most of the differences being pin designations with Mbasic you can use any one of a number of PIC Micros. I will provide a hex file of the program so that those who don’t want to buy a compiler at this time can still build the robot. I will have PIC16F876 chips programmed with a boot loader available to those who don’t have the ability to program pic’s you can download the ISP-PRO Programmer software Ver 4.0.4.1 from Basic Micro to program the chips using the boot loader. If you purchase an ISP-PRO you can make all the boot loader chips you want for free.
Any of the micro controllers above are a good choice so which should you choose? I personally like the Atom it is superior to the Basic Stamp. Below are the prices for both the module and the development kit with module for each. Though you don’t have to buy the development kit it will make the project much simpler and really is money well spent.

Cost:

Basic Micro
Atom Module $59.95
Atom Combo $129.95
Parallax
BASIC Stamp 2 Module $49.00
BS2 Starter Kit with Board of Education $159.00
You could also just buy the module and a solderless breadboard or piece of perf board to build on instead of a development board and save a little money.



A third choice is to buy a Basic compiler; I will be using Basic Micro’s 2840 Combo w/ Pro Compiler. This development board lets you use either 28 or 40 pin PIC’s. I will be using the 5.0 beta Version of the Mbasic compiler which is still in beta the current version is 4.0.3 but the 5.0 should be available by the time we start the programming and updates are free.
Below are some things that make the Atom or Mbasic compiler far superior to the Basic stamp they are speed, Basic interrupts, and hardware pulse width modulation.
The first speed is obvious; you can’t have too much speed. The second Basic interrupts we will use by connecting whiskers so they generate an interrupt if something is bumped and the program will jump to a subroutine that will determine the correct course of action and after it completes that returning to continue the program from where it was when the interrupt was generated.
The third hardware pulse width modulation will really shine if you use gear motors instead of servos. With the Basic Stamp we will just be able to turn the motors on at one speed because we have other things to do. We will not be able to do variable speed but the Atom or a PIC16F876 both have 2 hardware pulse width modulation channels which means we can set the pulse width and it continues until we change or stop it which will give us variable speed.
For gear motors we can use the same HPWM command on the Atom to get a variable speed. The Basic stamp has a PWM command but it is done with software and the Stamp cannot do anything else so it is not really usable for variable motor speed because we will not get smooth movement so all we can do is turn the motor on full speed
Sensors:
We will use infrared obstacle avoidance and bump sensors we will use the PNA4612M it is easy to use and inexpensive you could substitute the infrared detection module from Radio Shack. So what will you need to complete a robot as described in this series of articles? Material for a base a piece of material 8″ x 8″ will be more than enough.
Motors:
You will need 2 motors either servo’s modified for continuous rotation or gear motors. You could also hack a toy that has the motors and the wheels or even legs.




A toy called a Battle Scarab is a good candidate for hacking.
In short, you will need:
  • 2 Wheels
  • Batteries and a holder if needed you will need between 6 and 12 volts depending on what motors and regulator you use. Servos will run fine on 6 volts.
  • A voltage regulator LM2825 or a LM2940
  • A microcontroller ATOM, Basic Stamp or PIC16F876
  • Infrared detection module you will need 1 or more we will go more into these later.
  • You will need a development board a solderless breadboard or perfboard to build on.
  • If you are using gear motors, you will also need a motor controller either a L293DNE Dual H Bridge with diodes or two 3952 Full-Bridge PWM Motor Drivers available from Alegro as ree samples.


15 comments:

  1. Hey There. I found your blog the usage of msn.
    This is a really well written article. I�ll
    make sure to bookmark it and come back to learn extra of your useful info.
    Thank you for the post. I�ll certainly comeback.

    Stop by my page; date sites that are free

    ReplyDelete
  2. I realized more interesting things on this fat loss issue.
    One particular issue is that good nutrition is highly vital while dieting.
    A huge reduction in fast foods, sugary foodstuff,
    fried foods, sweet foods, red meat, and white-colored flour products
    can be necessary. Retaining wastes unwanted organisms, and toxic compounds may prev

    Also visit my page :: cultoftheturtle.com

    ReplyDelete
  3. Heya i�m for the first time here. I came across this board and I find It really useful & it helped me out much.

    I hope to give something back and aid others like you helped me.


    Feel free to surf to my weblog; internet dating is

    ReplyDelete
  4. Thanks for your exciting article. One other problem is that mesothelioma is generally brought
    on by the inhalation of dust from mesothelioma, which is a dangerous material.
    Its commonly found among staff in the construction industry who may have long experience of asbestos.
    It is also caused by moving into asbestos covered buildings for long periods of time, Your age plays a huge role, and some
    consumers are more vulnerable on the risk than others.



    Also visit my website; sex facebook

    ReplyDelete
  5. I have figured out some new elements from your web-site about pc's. Another thing I have always thought is that laptop computers have become an item that each home must have for many people reasons. They provide convenient ways in which to organize the home, pay bills, shop, study, tune in to music and in some cases watch shows. An innovative s complete these tasks is with a notebook. These personal computers are mobile, small, strong and mobile.

    Look at my homepage :: www.ultimaonline-wiki.de

    ReplyDelete
  6. Oh my goodness! an incredible article dude.
    Thank you Nonetheless I am experiencing concern with ur rss .
    Don�t know why Unable to subscribe to it. Is there anyone getting identical rss
    downside? Anyone who is aware of kindly respond.
    Thnkx

    Review my blog ... dating online dating dating

    ReplyDelete
  7. Howdy just wanted to give you a quick heads up. The
    words in your content seem to be running off the screen in Opera.
    I'm not sure if this is a formatting issue or something to do with web browser compatibility but I thought I'd post to let you know.
    The design look great though! Hope you get the
    problem solved soon. Cheers

    Also visit my website; seaporttattoos.com

    ReplyDelete
  8. I must express some thanks to you for rescuing me from this
    particular setting. Because of scouting throughout the the net and coming across views which were not
    pleasant, I thought my life was well over.
    Living minus the solutions to the issues you have sorted out through
    your entire report is a critical case, and ones which might have
    negatively damaged my career if I had not encountered your site.

    r good training and kindness in handling almost everything was useful.
    I'm not sure what I would have done if I had not encountered such a subject like this. It's possible to now
    relish my future. Thanks for your time so much for the high quality and sensible
    help. I will not hesitate to suggest the blog to anyone who requires direction about this problem.


    My blog post; adult finder

    ReplyDelete
  9. Thanks on your marvelous posting! I seriously enjoyed reading it, you
    might be a great author.I will always bookmark your blog and definitely will come back down the road.
    I want to encourage you to ultimately continue your great writing,
    have a nice day!

    Stop by my web-site - facebook sex

    ReplyDelete
  10. Useful info. Lucky me I found your website unintentionally, and I am stunned why this accident did not came about earlier!
    I bookmarked it.

    Also visit my web blog - hornymatches

    ReplyDelete
  11. I am constantly browsing online for ideas that can assist
    me. Thanks!

    Also visit my web-site ... facebook of sex

    ReplyDelete
  12. Partіcularly popular durіng the 1950s and 1960s ωeгe costume parties or themed cосκtaіl partieѕ.

    One of the must-have mornіng dгess shaρes that a wоman wіth most figures can don is the Gгeсіan coνer dress.
    Inѕtead of а trаdіtionаl
    veil, conѕіdег a
    bеаԁed headpіесе and wear your haіr in an upԁo baseԁ
    aгound finger wаves.

    Fеel freе to surf to my webрage; egov-conference.org

    ReplyDelete
  13. Special dry cleaning caгe cοulԁ run you at
    least $20. Thе rеаl glow аnԁ effect of a fаcial сomes after
    3-4 dауѕ. Alsο , plan to shοp in the off-season for best ѕеlection.


    Feel free tο surf to my blog: Cheap Dresses

    ReplyDelete
  14. Very enеrgetic post, I loved that a lot. Will theгe be a part 2?



    my page: ѕellіng olԁ cars fοr сash ()

    ReplyDelete