Wednesday, 21 December 2011

How To Build A Simple Robot For Ur Project


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 thePARTS 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:

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.

No comments:

Post a Comment