Motor Drivers Continued…

So in this article I want to finish talking about motor drivers. I want to try to keep this short, so next time I will talk about driver modules you can buy from some of the vendors I have mentioned in previous articles.

Driver Chips

Some of you might be wondering why I am not building my own h-bridge for driving motors. I could build my circuit from transistors or MOSFETs, but I like the ease of use and the extra features that you find with a driver chip. Anyway I started looking at the chips I know about.

I could go with the TC4427A. It is really a MOSFET driver IC, but because I am using small motors I can get away with using this chip. For each motor I will need 2 of these chips to drive it. The TC4427A is only a half bridge chip, and you need a full bridge to control motor direction along with speed. So this solution would need 4 chips and a few resistors – not bad.

How about a Freescale MC33887 or the similar MC33926. These chips have many features including overvoltage and overcurrent protection, fault status output, and chip disable inputs. They sound great with the only issue being they only come in surface mount packages. This is not a problem for me, but for others following along who want to build this same board it could be an issue. Still I like these drivers and might make an adapter board later.

So for the same reason above the ST Microelectronics VNH2SP30 and 3SP30 just don’t factor into the picture. They can handle higher currents than the MC33887, but the surface mount package is even more difficult to deal with. In a later article I will talk about some options you have.

I decided to look at Allegro Micro Systems. They have a few drivers that would work well for the small DC motors I plan to use. Some of their chips I would look at are the A3950, A3959, and the A3968. Again we run into the problem of surface mount technology. The only chip, from my list, that comes in a DIP form is the A3959. It is a good chip with more than enough drive current for small motors. Since the IC is only a single full bridge I would need 2 of them. They come in a DIP 24 pin package, so that would take up a little extra room, but still this looks like a good option.

One of the old standby chips still in use is the L293D and the alternate part SN754410. They provide 2 complete full h-bridges for controlling 2 small DC motors. They cannot handle as much current as the other chips I have mentioned so far. You need to be careful and check your motors data sheet for its maximum stall and continuous current ratings. Verify that the L293D can handle that amount of current. Other than that, you need a hex inverter chip to properly drive the inputs to the L293D. So it is still a 2 chip solution, but they are small chips – 16 pins and 14 pins.

The last driver I am going to talk about is the L298. The L298 is functionally similar to the L293. The main differences are the L298 can handle higher currents, a larger 15 pin Multiwatt package, and you need to add the external diodes. The L293D has the protection diodes built-in. Like the L293D, we need a hex inverter logic chip to drive the inputs. You could forget the logic chip, but then instead of 4 pins you need 6 pins from your micro to control the chip.

Next time

Well this one got away from me. I had planned this to be a short post, but as write these articles I find there is so much information needed to explain what I am talking about. Next time I plan to discuss motor driver modules you can buy, and maybe talk about which way to go – chip or module? Until then check out some of the web sites from here.

New Brain Design

The Idea…

So all of that AVR overview was to get us here, the design of a new robot brain. I compete in Mini Sumo at different robotic competitions. What I like is that it involves mechanical, electrical, and software engineering. The competition is autonomous, so none of this radio control stuff. The robot has to compete on its own. It comes down to whether I made a good design, or do I need to go back to the drawing board (or in this case computer programs).

Mini Sumo robot controller circuit board

This is the first robot controller I designed

So let’s get into the design process. My original brain board used an Atmel ATmega48 microcontroller. The mega48 had more than enough program memory to handle mini sumo. Since I used the DIP (dual inline package) version, I ran out of I/O pins for a couple extra features I wanted. The original plan was to have 4 IR LEDs, on individual I/O pins, and 4 IR detectors. I changed the plan to use 1 output each for 2 LEDs. After a few more changes, I came up with the circuit board you see on the right. The board is blue because I liked the color of the Arduino, so I made mine the same. Though the boards are the same color, I did not design my board to be compatible with the Arduino or its programming tools. This time I think I will make the board compatible with Arduino. Not physically as I need it to fit the size requirements on mini sumo, but in function. I will use a mega328, which the Arduino boot loader can be programmed into the chip. Then the Arduino programming tools can be used.

Now that I picked a microcontroller (the mega328), I can work out some other details. Originally I used the 16 bit Timer 1 for creating the 38kHz frequency use for the IR LEDs. This left me with Timer 0 for driving the servos. After looking over the internet for code to drive servos, it became clear that everyone was using Timer 1. Now I had to write my code for driving the servos as I could not use anything from the internet. Where is this leading? Well this time around I will use Timer 1 for the servos. So what about the IR LEDs? Here is where I have a few choices. I could use a 74xx04 logic chip to create an adjustable oscillator centered around 38kHz, a 555 Timer chip – again to create a 38kHz frequency signal, or maybe another microcontroller. I really like the idea of adding another micro. In this case I am looking at using a ATtiny24. It will have enough I/O and timers to deal with IR object detection.

Arduino Uno board

The Arduino Uno

What about USB? The Arduino only has a USB port for downloading the program into the micro. The board has a USB to serial port chip. Do I want to add this to my design? If I don’t, I would need an external USB to serial port converter to download programs using the boot loader. Should I put on a RS-232 transceiver chip (like a MAX3232E) to interface with a standard serial port?

Other Design Decisions

We have been dealing with some of the higher level design decisions. There are many smaller decisions to be made. Should I include a motor driver chip on the board? If so which one? The IR LEDs for the obstacle avoidance detectors need to be shielded from leaking IR light into the sensors. Is heat shrink ok, or should I use the plastic shrouds that Parallax (makers of the Basic Stamp) sells? How about having some prototyping area, or headers for plugging in a daughter board. These are just some of the decisions I have to make. The biggest decision I need to make now is to use surface mount components or go with through hole parts. This really depends on if I want to sell it as a kit. As a kit through hole components work better as more people could build it. If I go surface mount, then it might be left to me to install the parts and sell it as a partially completed product. Or what if I just designed both version, posted all the information here, and let you figure out which one you want to build, if any.

Well, that is all for now. Until next time here are a couple pictures of my Mini Sumo robots.

This is a modified Parallax Sumobot

My very modified Parallax Sumobot

Mini Sumo robot with Tony's brain board on top

My brain board on Parallax Mini Sumo chassis

AVR Overview – Hardware

Hardware

This time I am going to discuss hardware platforms, mainly where you can get them. There are many vendors where you can get board with an AVR micro on it. I am just going to mention a few that I have dealt with before. I am going to move quick, so I hope you can keep up.

Atmel

I am going to start with Atmel. Through Digikey, Atmel sells the AVR Butterfly. The Butterfly has a mega169V micro, a LCD, joystick, and tons of I/O. The board runs about $20 from Digikey. If you read the magazine Nuts & Volts, you might have seen the articles “Smiley’s Workshop”. He uses the Butterfly to teach C programming for the AVR. I recommend you check out the articles.

Pololu

Pololu is another vendor, and a great place to get robotic parts. They carry a line of sensors, motor drivers, motor controllers, and AVR microcontroller boards. Their Orangutan series of boards range from small 24 pin DIP modules to large multi-micro/multi-board designs. So take a look around Pololu’s web site, you won’t be disappointed.

Sparkfun

All I can say about Sparkfun is WOW! They have more electronic offerings than I can mention. They have a long list of AVR development boards along with other microcontrollers. You will just have to check out there site to see everything.

Wright Hobbies

Wright Hobbies is a smaller supplier of electronics. They have 2 different boards for sale. The first is the M32 DevBoard. It uses the mega32 micro. All of the pins are brought out to headers. The second board is the Chibots Controller board. This board was developed by the owner Eddy Wright for Chibots – the Chicago Area Robotics Group. The Chibot Controller carries a mega48 and a motor driver. The board was designed for some of the simpler robotic games held by Chibots. We will hear more about Wright Hobbies in later articles.

Megabitty

The Megabitty is a very small 1″ square microcontroller board with dual 500mA motor drivers. The chip is a mega8, but could be replaced with a mega48/88/168/328 as they all use the same pin out. You will have to check the Megabitty web site to see where to buy the kit.

Arduino/Freeduino

Un Arduino Diecimila

Image via Wikipedia

I decided to lump these together because they are similar boards. In fact there are many copies of the Arduino platform that you could buy, one of them being the Freeduino. First place to look up information on Arduino is the web site. The Arduino is supported by a very large community committed to the platform. Arduino is a board and a programming environment. The resources are too numerous to list here, so I just suggest doing a search in your favorite search engine, for Arduino.

Next Time…

There are many more options out there, but since I plan to build my own. I will leave the rest of the searching up to you. Next time I am going to talk about programmers and debuggers.