Project: Motor Driver/Power Regulation Module

Discussion in 'The Completed Projects Collection' started by Barnaby Walters, Apr 16, 2011.

  1. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Hi there everyone,

    This is the first in hopefully a long and progressively more and more interesting series of modular projects.

    Project Outline: Build a small, low power modular robotics platform

    Stage 1 (Complete): Built the base. It's a 15cm diameter circle(ish) of plywood, with gearmotors, held in place with lego, for easy prototyping. Lego geartrain and wheels. Photos coming soon.

    Stage 2 (More recently Complete): The weighty electronics. Namely, DC motor drivers and a 5v power regulation and distribution unit.

    Based on a modified version of the circuit in David Cook's Intermediate Robot Building, this is a 6 MOSFET motor driver, driven by three Maxim 4427s (V. Grateful to Maxim for kindly giving me some free samples). Two of them (and four of the MOSFETS) make up standard common-gate H-Bridges. The other two n-ch MOSFETs lie between the sources of the H-Bridges and gnd, allowing me to brake, coast, fwd and rev two motors using a 6 pin header (Headers kindly supplied free by Molex). Pinout: M1 Fwd, M1 Rev, M1 Enable, M2 Enable, M2 Fwd, M2 Rev.

    The circuit was built in a freeform/dead bug prototyping. The MOSFETS were glued+soldered together, back to back, making the entire thing much easier to assemble. This is the first time I had ever attempted a circuit of this complexity dead bug style, and I was delighted when it worked almost straight off, with few modifications! For a 16 year old who had tried similar things four years ago to no success, it was fantastic. Good soldering practise too — I got to use my new soldering pencil for the first time, as well as experience mixing TH LEDs and SMD resistors.

    Also on this board is a L7805 regulator, with a mixture of TH all. electroltyic caps and SMD tantalum. Nothing special, not even any reverse battery protection. I'm relying on the one-way-insertion KK header to protect my circuits.

    Photos are attached, for anyone who wants to see just how messy my soldering is!

    Next Up: Connecting some brains, in the form of a PIC (haven't decided what type yet), and making the platform move around a bit. After that: Active Reflective IR Obstacle Detection system.

    Thanks for your help, More to come,
    Barnaby
     
    Last edited: May 10, 2011
    RRITESH KAKKAR likes this.
  2. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    Nice work.............
    where is the circuits??
     
  3. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    Mommy look! A dead bug!

    It's been a while since I last saw that board configuration.

    I always like and encourage attempts in the robotics field.
     
  4. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Where are the circuits? Do you mean schematics, or some component somewhere? If schematics, they're on their way. Eventually ;)

    I think it's dying out. It was recommended to me by my grandfather, who has long been a RF engineer. Being mainly a ground plane, dead bug prototyping is quite popular with RF people, I believe!

    Thanks. With luck, this will end up as more than an attempt!

    P.S. I found a suitable shell for this tortiose-like robot — in a chinese supermarket in Liverpool, of all places. I'm currently taking photos of the base and the shell (as well as some of the other hardware I'm using), and will upload them soon.

    Cheers,
    Barnaby
     
  5. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Hi there everyone,

    The robot (now called 'weave' due to the nature of the shell) has progressed! I have made a 555-timer-based 38kHz IR emitter/detector board (2 emitters, 1 detector — explained later). The board had some spare space, so I added three generic NPN transistor switches for general purpose use later on in the project.

    [​IMG]

    This first photo shows Weave with it's shell on. This is a woven wooden bowl found in a Chinese supermarket in Liverpool, of all places. It's surprisingly nice material to deal with (or maybe that's because I'm a musical instrument maker?), and drills/cuts very easily. It is elevated using some rather roughly made spacers — hardwood dowels with embedded bolts and nuts. There are smaller ones that attach the lower storey of circuit boards to the base.

    [​IMG]

    This second photo shows the motor assembly on the bottom of Weave. It is made of Lego technic, and Copal 50:1 (I think) gearmotors. The couplers are permanent, glued on with Araldyte (2 part epoxy). The motors are low power and efficient, and the only noise generating components are the Lego idler gears. I am willing to sacrifice noise for ease of assembly. Talking of ease of assembly, the motors are lodged in with pieces of veneer. Effectively a friction fit, relying on the flat sides of the motors and the rough wooden surface.

    [​IMG]

    This photo shows the IR board — home designed and etched. In the middle, the power header + Supply caps. To the top right, the 555 with adjustable circuitry. Along the bottom: transistor powered IREDs in heat shrink tubing, with brightness pots. In the middle, the 38kHz detector.

    Because this detector ignores any constant frequency, I cannot use them for a logic based robot that has two emitter/detector pairs. So, I am seeing this as a good excuse to build on my PIC programming experience and figure out how to send a set of pulses from one IRED, store the result, then send pulses from the other IRED, and take action.

    The IR board mounted on Weave:

    [​IMG]

    That's as far as I've got. I'm currently designing the board for the brains.

    Thanks,
    Barnaby
     
  6. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    This has come MUCH further that your first post. Well done!

    It makes me wonder, if your profession is wooden instruments maker, how do you know so much about electronics and programming? What have you studied?
     
  7. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Thanks! Musical instrument construction is not yet my profession, it will be this summer when I leave school. I wanted to do GCSE electronics, but my school didn't offer it. Next year I'm off to the Totnes School of Guitar Making.

    Since the age of 10 I've been interested in electronics (and robotics — provides an interesting, physical, visual way to experiment with electronics and programming). Only now 6 years later am I beginning to gain any kind of competency, but I find that after all the years of trying to understand circuits and components, everything's just fitting together now. Always been a Mac geek (posed some problems trying to program PICs, all sorted now), so the programming is interesting, as I can see what's happening a few levels below the GUIs I'm used to!

    Thanks,
    Barnaby
     
  8. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    It's true that the subject of electronics takes years to digest. It's kinda rewarding but in the same time disappointing when you realise how much time you need to study before you get to build your own stuff.
     
  9. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Eventually you'll get both subjects down. They do mix well.
     
  10. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Fortunately I've got a helpful and very knowledgable grandfather (who supplies me with interesting components and ideas) and have built up several sources of reliable information. Interestingly, when I started trying to understand circuits and asm programs, my brain wasn't ready. I came back a few years later, and it all just clicked!

    Electronics and programming, or instrument building? :) I am certainly going to try making my own effects pedals, and amplifiers, as well as instrument circuitry. And, electronics knowledge of filters has helped me to understand how electric guitar circuits work, which will make repair and construction a whole lot more straightforward.

    Just for fun, attached is the schematic for the IR board. Free to anyone who wants to use it, I mainly copied from other people and added my own bits ;)

    Thanks, I'll post progress when it happens. A lot of exams at the moment, so it might be a week or so.
    Barnaby
     
  11. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Very nice work! He even looks good too with his circular cover on.

    Might I suggest that if you "loose mounted" the circular cover so it can move a little bit, then put 4 or 6 microswitches underneath it, then it will act as an excellent bumper detector and tell the bot which direction he bumped into something. :)
     
  12. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Thanks — Your idea is a good one. It would be difficult to implement on this one, and would make the fact that it's designed as a modular prototyping platform a bit more awkward, but I bought two of the circular bowls, and am planning on making a second, more permanent and improved version, which I'll probably have a go at your microswitch idea on. My other ideas for the second one include IR/Ultrasound (+ touch as well now) obstacle sensor redundancy, and an iOS-style capacitive "Slide to Unlock" 'Go' switch that lights up, hidden under the dome — just for a bit of showmanship and finesse ;)

    I'm half way through designing the board with brains on. It's going to have an RJ plug for PIC ICSP (more sturdy, as I'm going to be reprogramming it a lot), and a mini 170 tie point breadboard for experimenting. From my 28 pin PIC, after the motor drivers, IR board in/out and the three transistor drivers, I still have a full 8 bit port (inc. ADC), and a timer input. There should be some interesting things I can do with those…

    Thanks,
    Barnaby
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Sounds very nice!

    If you have not already done so, consider checking out the sharp IR sensors that produce a voltage based on sensor distance;

    [​IMG]

    http://www.pololu.com/catalog/category/79

    They are reasonably immune to room lighting and the colour of the surface being measured.
     
  14. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Ah, the sharp sensors. I have heard of them, and they sound pretty good (they seem to be ubiquitous in hobby robotics!). I didn't use them on this robot as I wanted to spend as little as I could get good results with, and I also wanted to get more experience with discreet circuit design and theory. In future, I'm sure I'll use something like this as my robots progress and gain more sensory 'awareness' of their environments.

    Thanks,
    Barnaby
     
  15. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Hello All,

    Weave has a brain! And, a brain that can be programmed in place, is highly expandable (on-board breadboard and an entire port of ADCs, software comparators and timer inputs to have fun with!) and control the motors.

    The brain is a 28 pin PIC: The PIC16F886. I went for 28 pins as they're a nice size, and offer the kind of expandability I want in a modular project. I was tempted to use a similar PIC18F chip, but I'm more comfortable using the 16F asm at the moment (fewer instructions and features to get my head around) — and, they have built in software/hardware comparators!

    This first photo is a shot of Weave, in his near-'complete' state. Note that there is currently no connection from the brain board to the IR board — it's not even receiving power at the moment.

    [​IMG]

    The second photo just shows the copper on the board. I'm particularly proud of this etch — the largest and most complex I've done so far. Uses a double sided board, but only mounted 3 SMD components on the top. All traces and patterns are hand drawn.

    [​IMG]

    This photo shows Weave with the brain board unattached, and the spare battery shown for clarity. The batteries are 7.4v LiPO clusters I got for a meagre £1 each from eBay — they seem pretty hardy and not at all bad so far, but I've only been using them for two days now. No explosions yet… :|

    [​IMG]

    If anyone's wondering, the circuitry on the breadboard is a simple debounced switch. I didn't include one on the board as it wouldn't always be reachable. Currently the button starts/stops the motors. My first PIC ASM program to use interrupts! Took a while to get my head round it, but now the program runs through a series of motor control statements whilst checking the button for a press every TMR0 timeout. It's not greatly efficient, but I'm still learning.

    So, next up: Connection to IR board and get it avoiding obstacles!

    Although Weave is not a real, sensor-data-interpreting 'robot' yet, I now consider it to be partly finished (It does flash lots of pretty lights, after all ;)). So, what have I learnt from the project so far? Rather a lot, it seems:

    Vastly improved my basic soldering skills.
    Learnt basic board layout skills, as well as gained experience etching, and am half way through testing/prototyping a board etching product I plan to release in the near future.
    Learnt how to prototype in dead bug style.
    How to use MOSFETs and FET drivers — in general, and to control motors.
    Memorised details of basic transistor switches.
    Become more comfortable using calculations such as Ohm's law. Begun to actually apply them to circuits.
    Using PICs! Standard circuits, pull up/down resistors, BORs, interrupts, delays, timer peripherals, developing them using a Mac (A challenge in it's self…)

    And assorted other stuff, like which companies will give me free samples (Thanks, Molex Microchip Intersil Analog Devices Maxim!). So, not bad so far ;)

    Thanks,
    Barnaby
     
  16. lukasoft

    New Member

    May 23, 2011
    9
    1
    I don't mean to go off topic so I'll keep it short. I have a similar area of knowledge, with my parents being an engineer and a musician. I highly recommend this as a first project. Its a guitar preamplifier, and the circuit is very simple, yet really fun to make, and yields very quick, great sounding results. It adds a 'tube' warmth in addition to amplifying, and I just love it. If you have any other ideas as far as making musical effects, make sure to post about it, so people like me can learn and contribute ;).
     
    Barnaby Walters likes this.
  17. Barnaby Walters

    Thread Starter Member

    Mar 2, 2011
    103
    4
    Hi Lukasoft,

    Thanks, that looks like a good thing to start with — nice and simple, also detailed instructions and explanation. I'll give it a go! And I'll certainly post about any other things I make — I'm currently planning a MIDI controlled hybrid Digital/Analogue synth.

    Thanks,
    Barnaby
     
  18. lukasoft

    New Member

    May 23, 2011
    9
    1
    I seem to be unable to find a PM option on this forum. So I apologize again for continuing the off topic discussion.

    Barnaby, these type JFETs are very inconsistently made. However I highly recommend using the J201 JFET (instead of an 'equivalent replacement'), which isn't very easy to find, but is worth it. Make sure to bias the JFET after completion of the circuit or it may actually attenuate the sound instead of amplifying it.
     
  19. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Once you have 10 posts every feature will become available, including PMs.
     
    lukasoft likes this.
Loading...