GET LOGGED IN

 

 

 

 

HOME
ABOUT • HELP

 



picAxe 8 bit Motor Controller: Look Inside      ...     106 Views
Author's name: WeRbots       Author's ratings = 0

The low-cost picAxe Motor Controller allows you to build a universal motor control for Robots.

Just mount the IR detector right on the board. Then you can mount the whole thing on an R/C car or junker robot and wham! You are in business!


You need an 8m picAxe chip in the controller. Most are advertised with an 8m chip, although I have found them with only a picAxe 8 pin chip. There is no interrupt in the 8 pin chip, so you will need the 8m to make this design work.

Why do this? You can have a controller that you can move around. It is cheap and easy to create the universal board by mounting the IR detector directly on the PC board.


Give some examples of alternatives - Like using the TA8080.

Get Software...
Author's Assigned Keywords:    Robot Motor Control    Robots


Why Pay the Money?     
Why not buy your own programmer and a pic Chip directly? Its gonna cost ya. Commercial units cost a bundle, the c-compiler alone is a couple hundred.

Why does an 85 cent chip cost almost 4 bucks? Because you are paying for two things, a profit (means they buy wholesale volumes and mark it up to retail). Plus, theres a lot of R and D money (true), but eventually theyll get cheaper.

Its like buying an old 555 timer. They cost pennies now, but cost a lot more before everyone started building one. We are in a limited demand field (Robotics) so it will take a while for the volume to build up like microprocessors used in common computers.

I use one of these in sort of a pre-built unit with an IR detector strapped on, this way I can add it to any old RC chassis.

This is perfect for "benders", people (like me) who scrounge semi operational bots and RC toys.

It they have a battery controlling motors, I grab them.

Then I simply connect the motors to this combo motor drive and IR, and voila! Instant robot, or r/c vehicle autonomy...
The extras on the board     
These extras make the board easier to use universally. They are the switch I soldered to a 3 pin connector so you can switch between programming and operation. Really handy when you have to tweak the program to accomodate some new wild chassis you find.
Schematic Diagram     
The PC Board uses an L293 H-Bridge attached to four io pins on the picAxe 8 or 8m chips. Mine came with a picAxe 8, I prefer to use the 8m because I use the interrupt to get the driver to react in some way to an interrupt source. The source, Sharp GP2D12 IR Object detector.

I could use bump switches then the interrupt routine could check whether the IR detector, or a "feeler" switch (right or left) was bumped.

But this particular board makes it handy when Im "bending" another r/c model, or just about any other semi-experimental application.
Software     
This is all pretty simple, just pounding pins to drive the bot forward. Then you adjust according to behavior. The rumble bot, when I first fired it up, moved with pretty small steps. So I tweaked the delay times in the software, basically changing the length of time the motors stay on relative to the types of motors in the rumble bot.

When the rumble bot was tamed, I moved the whole assembly over to the Tumbler robot, but things got crazy. So again, I tweaked the delay times and made them a lot shorter. I like the way tumbler bot scoots around objects, so Ill probably mount a controller, probably using a picAxe m14 and start with the same basic program in this listing.

=========================================================================
`-------------------------------------------------------
`
` picAxe Motor Control
` Created by: Jim Huffman
` Rev 0.1 October 18, 2007
` Rev 0.2 October 20, 2007 JH
` Rev 0.3 look around functions begun Oct22, 2007
` Rev 0.4 Changed Motor Drive approach Nov 04, 2007
`
`-------------------------------------------------------
`
` Initialize System Wide Values
`
` Directives
` Select and initialize chipset
#picaxe 08m
`
` System resources
symbol fwdM1 = 0 `(pin 7)(Careful, Used in Programming)
symbol revM1 = 1 `(pin 6)
symbol revM2 = 2 `(pin 5)
symbol IRsense = 3 `(pin 4)(input only on 8 pin)
symbol fwdM2 = 4 `(pin 3)
` (pin 1 Vdd, pin 8 = Vss, pin 2 = Serial In)
`
` Motor Control constants
` assumptions:
` open means no output
` trying not to use external chips, only 3904s (4 outs)
` using a single sensor with dual IR emitters
` motors are M1 and M2 (cheapies from Avoider Robot)
` powered by 3x 1.2v liIon (use button batteries?)
`
` vars
symbol storResult = w2 ` place to put ADC10 results
symbol storResShrt= b4 ` place to put adc results
`
`
`--------------------------------------------------------
` Code Blocks:
`
let dirs = %00010111
` short wait before main routine begins
setint %00001000, %00001000
`
` main demo routine

`It goes like this
` gosub (fwd,rev,leftspin,rightspin)
` pause - long as you want it to do the appropriate subroutine
` gosub stopAll - You have to stop it from driving, don`t forget this
` That`s how you make the world go round
`
init: `gosub fwd `basically, you make it go, then you pause for running time
`obviously, an interrupt loop makes it quit driving anytime
gosub stopAll `don`t forget to stop the action you put in motion
pause 3000 `think and abandon all hope loop

main: gosub fwd
pause 30
goto main


interrupt:
`if pin3=1 then interrupt
gosub stopAll
pause 50 `think a second little machine :-)
gosub iSpy
setint %00001000, %00001000
return


` Look to see if a spot is clear, then head in that direction
iSpy:
gosub rev
pause 150
gosub stopAll
gosub leftSpin
pause 80
gosub stopAll
if pin3 = 1 then `still in trouble that way
gosub leftSpin ` call yourself until you`re out of trouble
pause 70
gosub stopAll
pause 150
if pin3 = 1 then `still in trouble that way
gosub rev
pause 100
gosub stopAll
gosub leftSpin ` call yourself until you`re out of trouble
pause 100
gosub stopAll
pause 100
return
endif
endif

return ` found a hole - start driving again


`-----------------------------------
` Drive Routines
`
fwd:
high fwdM1, fwdM2
pause 5
return

rev:
high revM1, revM2
pause 5
return

stopAll:
low fwdM1, fwdM2, revM1, revM2
pause 20
return

leftSpin:
high fwdM1
high revM2
pause 5
return

rightSpin:
high revM1
high fwdM2
pause 5
return

picAxe Development URLs     
Cheap, quick picAxe (US) supplier:
<a href="http://www.phanderson.com/picaxe/">PH Anderson</a>

The Original picAxe chip was created and developed here:
<a href="http://www.rev-ed.co.uk/picaxe/>Rev-Ed</a>

Object Detection using 38 kHz Pulsed Infrared - PICAXE-18X:
<a href="http://www.phanderson.com/picaxe/ir_1.html">picAxe and IR Tricks</a>

General picAxe apps:
<a href="">PH Anderson again!</a>

Use of a PICAXE-08M as an Accessory to a Basic Stamp, PICAXE-18 or Similar:
<a href="http://www.phanderson.com/picaxe/pwm_stamp.html">picAxe apps</a>

PICAXE Infra-Red Interfacing:
<a href="http://www.hippy.freeserve.co.uk/picaxeir.htm">Hippy - great source picAxe trips and learning</a>
Insert Your Comments
Subject:
Message:


ADD COMMENT | CLOSE COMMENT
close window

It's Easy To Show Your Skills:

C - What - I - Did

• Sign up - Get ID and Password

• Plan and Create a Project That Someone Might Enjoy and May Even Want to Build

• Link to your creation on your favorite social networking site or blog.

• Become famous! Because your projects get a lot of Hits!

 

Do It Yourself Parts Used To Create This Project.

- PARTS LIST -

PICAXE 8 Pin Motor Driver Board
Mfr: SparkFun
Price $15.95
PN-SKU: DEV-08317
Vendor: SparkFun




Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Mfr: Sharp
Price $13.95
PN-SKU: SEN-08959
Vendor: SparkFun



 

Junk Box Reviewer

Itching To Start Building A DIY Do It Yourself Project? Got Some Parts of Your Own in your JunkBox? Find projects by Surfing' the Parts List!
TA8080K
Toshiba
$2.00
  
Web Frame Work
ExtJS
$0.00
  
Robo Quad
Wowee
$70
  
picAxe 08m
MicroChip
$3
  
Twin Motor Gearbox
Tamiya
$10.95
  
RFL Upright Robot
Active-Innovations
$119.95
  
Andrei And Jim
Web Developers
$.02
  
Scribbler Robot
Parallax
$79.95
  
L 298 Compact Motor Driver Kit
Solarbotics
$18.95
  
Account On CwhatIcanDo
CwhatIcanDo.com
$0.00
  
Tribot
Wowee
$79.00
  
Microrobot Avoider Jr
Microrobot
$75??
  
picAxe 14m
MicroChip
$4.00
  
Wall Hugging Mouse
Tamiya
$20
  
Brilliant Blue/Green LED
Surplus
$1.00 (4)
  
PICAXE 8 Pin Motor Driver Board
SparkFun
$15.95
  
Tracked Vehicle Chassis Kit
Tamiya
$17.50
  
Twin Motor Gearbox
Tamiya
$10.95
  
PICAXE 8 Pin Motor Driver Board
SparkFun
$15.95
  
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
$13.95
  
PICAXE 8 Pin Motor Driver Board
SparkFun
$15.95
  
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
$13.95
  
Gear Motor 2 - 224:1 Offset Shaft
SolarBotics
$5.75
  
4 X AA Cell battery holder plus on/off switch
Powerize
$1.59
  
PICAXE 8 Pin Motor Driver Board
SparkFun
$15.95
  
Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F
Sharp
$13.95
  
4 Section In-Ground Batting Net
battingnets.com
$750.00
  
DROID
Motorola
$600.00
  
battery
NEC/Tokin
$1.95
  
IR LED
Any TV remote compatible
$0.25
  
Butterfly Lite
Gadget Factory
$99.99
  
picAxe 08m
MicroChip
$3
  
picAxe 08m
picAxe
$2.95
  
PICAXE 8 Pin Motor Driver Board
SparkFun
$15.95
  
hexbug
bandai
$$10
  
Rumble Bot
USED
$4-30
  
Morphibian Land Shark
Kid Galaxy
$~30
  
SCC2433-B solar cell
Solarbotics
$6.50
  
3 VDC Motor
Hankscraft
$
  
bamboo or dowels
$
  
Mylar Film W hologram
garden centers
$10.00
  
©Copyright 2008 - , cwhatidid.com, all rights reserved.