GET LOGGED IN

 

 

 

 

HOME
ABOUT • HELP

 



picAxe 14m Motor Driver Board: Make Your Own      ...     9078 Views
Author's name: WeRbots       Author's ratings = 0

Both motor speed and direction are easily controlled using the picAxe 14m. The speed and direction motor drives most small DC electric motors up to 1A stall current. It uses the Toshiba TA 8080K to drive the motor. This is a chance to exercise the capabilities of the 8080. Yes, the 8080 which gives some of us flashbacks to the early microprocessor days!

Steering is controlled by using a servo. In the buggy bot, this servo turns steerable front wheels. While you can also use the servo to steer the drive wheels as in the tricycle robot base project.

What is a picAxe?

A picAxe is a pic microcontroller (In this case a PIC16F684.) with a built-in BASIC Language Interpreter. Yes, it eats up a bit of memory and can do only a limited number of things. But you cannot beat a pixAxe for experimenting and playing around. If you use them correctly, they can serve well. But you may need to dedicate the chip. For example, dogBot used a picAxe 14m just like this project. It could drive Servos, OR Drive Electronic Motor Controllers. Trying to get it to do both is pushing the capabilities.

When you need to use more of the chips capabilities, you get a bigger chip, or you program the PIC16F684 in a compiled language instead of as a picAxe.

picAxe 8m`s are other examples, while the chip itself can decode IR signals, the limitations on number of pins restrict it from many applications. An m8 can control a motor, but little else. The 14m in this project uses all the available outputs and could still use more. Achieve complexity by using more than one chip. (Or go straight to assembly language or C compiler which gives you much more memory, but makes programming difficult.)

Author's Assigned Keywords:    Robot Motor Control    Robots    picAxe    picAxe 14m    robotics


Schematic of Buggy Controller     
Here is the simple schematic for the electronic control part of the Buggy Bot. Notice no inputs hooked up at all. You can store and execute driving patterns.

Ultimately, you will want to hook up the interrupts, add ADC (to keep track of operating voltage, read CDS cells, etc). There are no inputs hooked up what so ever.

Note C1, this, according to the spec sheet, should be mounted as close as possible to the IC...

Software Listing     
The figure shows the wiring for the communications with your pc for the picAxe chip.

Below: The program listing.

`-----------------------------------------------------------------------------
`------------------------------------------------------------------------------
`
` ------------------------------------
` picAxe Servo Steer Electronic Motor Drive
` ------------------------------------
`
` Figure Eight Pattern
`
` Created by: Jim Huffman
` Notes: GP2Y0A02YK range finder capability
` Rev 00 03/01/08
` Rev 01 03/02/08
` Rev 02 03/02/08 Drive a figure 8 then long pause
`
` -------------------------
` Initialize System Wide Values
` -------------------------
`
` Directives
` Select and initialize chipset
#picaxe 14m
' #terminal 4800

` System resources
symbol RtLED = 0 `(pin 13) o0, serialOut
symbol LtLED = 1 `(pin 12) o1
symbol Spkr = 2 `(pin 11) o2
symbol Steer = 3 `(pin 10) o3 servo Horizontal
symbol MTRa = 4 `(pin 9) o4
symbol MTRb = 5 `(pin 8) o5
symbol ADCin0 = 0 '(pin 7) i0 also interrupt
symbol PB1 = 1 `(pin 6) i1 interruptable push button
symbol i2 = 2 `(pin 5) i2
symbol i3 = 3 `(pin 4) i3
symbol ADCin4 = 4 `(pin 3) i4 volts
symbol srlIn = 2 `(pin 2) i5
` (pin 1 Vdd, pin 14 = Vss)

`
` Delay to slow down servo motion (40ms default)
symbol servo_delay = 200

` select for your servo setup normally 0.5 to 2.3 ms
symbol minSteer = 75 `rightest
symbol ctrSteer = 130 `center Side to Side
symbol maxSteer = 225 `leftist

` register allocations
symbol side2sideCnt = b0 `= w0
symbol speed = b1 `= (w0)
symbol xCount = b2 `= w1
symbol lrRangeRight = w2
symbol lrRangeLeft = w3
symbol IRstor = w4 ` used hereafter in the IR reading stuff
symbol maxStor = b10 `= w5
symbol xStor = b11 ` (w5)
symbol yStor = b12 `= w6
symbol alrmCnt = b13 `=(w6)

` motor drive truth table:
` H H Brake
` L L Open
` H L fwd
` L H rev
`
`--------------------------------------------------------------
` -------------------------
` Actual Code starts Here
` -------------------------
`---------------------------------------------------------------
`
`
init:
pause 200
` center the servo head
servo Steer, ctrSteer
pause servo_delay
high Steer

` horn honk
alrmCnt = 3
gosub evasion
pause 200
alrmCnt = 1
gosub evasion

` The all important "Bail Out" pause - gives you time to clear hardware memory
pause 2000

` Select the width of the looking around of the head
lrRangeRight = ctrSteer + 25 `82 `setup for width of view
lrRangeLeft = ctrSteer - 25 `

` define the places where this baby needs to be on alert
symbol ledgeEdge = 40 ` if the number gets smaller, yall are fallin'
symbol touchMeNot = 70 ` I see things from this point on...
symbol backUp = 90 ` react to the thing - backup

` setint %00000001,%00000001 ' note on 14m, only 0,1,2 used, 3 and 4 ignored in setint operation
` --------------------------------------------------------
` Look Around for open spot to go to...
` 2 Degrees of freedom = up/down right/left


` sertxd("The value of IRstor is ",#IRstor,13,10)
pause 100

snoop:
` Turn Right
gosub rtBlinker
servo Steer,lrRangeRight ` move servo to one end
pause servo_delay
high Steer
` fwd
gosub goFwd
pause 2000 `for awhile

` Turn Right
gosub rtBlinker
servo Steer,lrRangeRight ` move servo to one end
pause servo_delay
high Steer
` fwd
gosub goFwd
pause 2000 `for awhile



` Turn Left
gosub ltBlinker
servo Steer,lrRangeLeft ` move servo to one end
pause servo_delay
high Steer

` left
gosub goFwd
pause 2500

` Turn Left
gosub ltBlinker
servo Steer,lrRangeLeft ` move servo to one end
pause servo_delay
high Steer

` left
gosub goFwd
pause 2500

` stop with brake
high MTRb,MTRa

goto snoop

evasion:
` Ray Gun sound
for xCount = 1 to 200
pulsout Spkr, xCount
next xCount
`pause 10
dec alrmCnt
if alrmCnt < 1 then
return
else goto evasion
endif
low Spkr
return

interrupt:

for side2sideCnt=1 to 10
pulsout RtLED, 600
pause 50
next side2sideCnt
pause 3
setint %00000001,%00000001
return


rtBlinker:
for xCount = 0 to 4
high RtLED
pause 250
low RtLED
pause 250
next xCount
return

ltBlinker:
for xCount = 0 to 4
high LtLED
pause 250
low LtLED
pause 250
next xCount
return

goFwd:
` fwd
high MTRa
low MTRb
return

goRev:
` rev
low MTRa
high MTRb
return



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 -

TA8080K
Mfr: Toshiba
Price $2.00
PN-SKU: TA8080K
Vendor: Surplus Gizmos.com




picAxe 14m
Mfr: MicroChip
Price $4.00
PN-SKU: COM-08351
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.