picAxe 14m Motor Driver Board: Make Your Own ... 9076 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 |
Do It Yourself Parts Used To Create This Project.
Top Ten Most Viewed Projects: Build the L298 H-Bridge Motor Control Views: 9287 picAxe 14m Motor Driver Board: Make Your Own Views: 9077 Build Your Own Track Drive Robot Views: 6957 CwhatIcanDo Website Views: 6707 BEAM BOT: HexBug Exposed! Views: 6404 Converting a Flashlight to LED Views: 6328 Build a Robot In 5 Minutes Views: 6131 Building an RFL Inspired Upright Robot Base Views: 5334 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! |
©Copyright 2008 - , cwhatidid.com, all rights reserved.

