Which microcontroller?

Hi there,

I'm working on building a small balancing robot and would appreciate some input on which microcontroller and motor controller to choose. First, a few questions:

Does the term "microcontroller" imply just the chip or the entire logic board?

It seems that chips are sold separately from the boards. Why is this? Can different chips be installed on a given board?

Is a "speed controller" the same as a "motor controller"?

Here are my requirements for the microcontroller:

- Chip and board must be less than 2" x 3" x 1/2".

- Must be programmable in something other than assembly.

- Must run fast enough to actually balance my robot (how fast this would be, I am unsure).

- Must be able to accept input from the Rotomotion 2DOF Kit

formatting link
Must be able to interface with a motor controller or provide 1.0A @ 5V of current on its own.

My requirements for a motor controller are similar: something small, something that can do 1.0A @ 5V and something that can do PWM modulation. Motor feedback is not required.

Comments or suggestions in general would be great!

Thank you,

Carson Baker

Reply to
Carson Baker
Loading thread data ...

I'm now using Atmel AVR micros programmed in BASIC using BASCOM AVR. It will suit all your requirements except the 1A @ 5V supply on it's own. I know of no microcontroller that can deliver that much amperage to anything. You are going to want to use an H-bridge motor controller anyway to supply the motor power which will probably be the bulk of it.

I started using Basic Stamps. When the time came to move onto something better, I looked into both PICs and AVRs. The AVR architecture makes more sense to me, the parts seem as cheap as PICs and are more powerful with more options too. Programming them in BASIC is also cheaper, $85 for BASCOM AVR as opposed to $249 for Picbasic Pro. There are also C compilers available. Here are some links with more info on the AVRs. Regards,


formatting link

Reply to

I'd go for Kronos Robotics Dios chip.

formatting link
Hi there,

Reply to

Ouch dude.

I'm all for jumping in over your head, but this might be going a BIT overboard! Self balancing robots are not for the faint of heart, or really for the inexperienced. Build a less complicated robot first, at least, so you know which end of the crystal is which :P

A microcontroller is, essentially, a computer on a chip. The boards are just a convient starting place, or somewhere nice to put the extra components that this mini-computer needs. :)

It's not very difficult to burn out a MCU (I've never done it...but I'm very careful). Static electricity, too much current, or basically any electronic "Whoopsy" will turn it into a pretty useless scrap of ceramic and metal. Some pre-built boards come with chips, some dont, but you can ALWAYS buy extra chips!

Most boards -MAY- be able to host MCU's of the same family, which have the same EXACT pinouts and voltage requirements. I haven't seen any "Universal" boards (except for my breadboard! lol). Don't try to put an ATMEL MCU in a board designed for a PIC MCU! You'll likely burn something out.

A speed controller must control the motor its connected to. :)

Go surface mount!

Eww. Why the hell does everyone think that assembly is some horribly ineffective language? It's not THAT freaking hard! Go with assembly! Unless you want your bot to fall on its face, cause it isn't processing fast enough to realize it's falling over!

If your motors have no torque, no amount of "fast running" will help you.


Uhhh. Technically, you can interface just about anything you'd want to an MCU...this isn't a function of the MCU, but of the person using it...

My suggestion, once again...is that you start with something much less complicated. I think it's pretty clear you don't have much (maybe any?) experience in robotics. Or in microcontrollers. Maybe you've done a bit of programming on a PC, but a PC is not an MCU...They're very different beasts.

Get yourself 2 simple gear motors, a dozen transistors, an MCU (I prefer PIC MCUs, but really it just depends on what you've used first), a crystal or ceramic resonator, and try to build yourself a little robot. Make the frame yourself, and assemble all the components into a working little robotic creature...If you buy a Robot-In-A-Box, you A) Don't learn anything and B) Won't actually be creating anything interesting or original...Just something everyone has seen billions of times before. If you don't want to do any of the work, Solarbotics.com sells small robots that don't require an ounce of work at all.

Every time you create a robot...you put a little bit of your soul into it. It may be ugly (crooked frame, out-of-round wheels, and wires sticking out all over), but damnit...its YOURS, 100%. Cherish that, don't cheapen it!

Reply to
Alex Wisnieski

You don't need a motor controller if you are running without feedback, unless you are going with back EMF feedback. A motor controller implies intelligence, but without feedback of some sort, there is no intelligence.

This being said, an H-bridge will suit your needs, you just need an MCU capable of driving the PWM frequency required by your motors, and the "style" of PWM that your bridge does.

The 1A 5V you specify, is that Bus voltage or motor voltage? You can overdrive a motor for short periods of time, or if you can limit the duty cycle of the PWM. This is dependent to some degree on the motor manufacturers specs. Too high of a voltage will cause terrible things, but running a 5V motor off 7.2V should not be a problem.

My processor of choice is the 'Pod line of devices from NMI.

formatting link
They also make a couple of different H Bridges.

The link you provided does not provide any specific data as to the gyro interface. You should compile that for us, so we can help you out.


Reply to

It implies just the chip. A microcontroller is basically a microprocessor with extra features, such as buffered I/O ports, maybe built-in A/D, PWM, etc.

Reply to
Mark Haase

Both. Technically it is probably just the chip, but I've heard it used for the board also.


Sometimes. An Electronic Speed Controller is a specific device that takes R/C servo pulses and converts them to PWM.

Motor Contoller is a generic term for anything take controls a motor. This may be as simple as a relay to an H-Bridge to a full-fledged controller with ramping and overvoltage protection.

An ESC is one type of motor controller.

There are a couple of choices depending on your budget and preferences.

I like the JStik

formatting link
This is a Java processor.

You can also try a uVM chip (which is a PIC that can be programmed in compiled Java).

formatting link

I think that there are a number of them. I would suggest the one from

formatting link
The microcontroller provides the PWM input. The motor controller provides the power.

-- D. Jay Newman

Reply to
D. Jay Newman

the chip.

most people build their own boards.

can be. neither is really precisely defined.

the micro crunch uses to balance is at ATMEGA32 running at 11 mhz. it polls quadrature decoders at ~8khz and runs the balancing code at 30hz. i program it using avr-gcc, so there's no asm involved. don't listen to the people who say that you have to code in asm for it to be fast; they don't understand compilers. i use another avr for the sonar and a ds80c320 main computer.

be wary of voltage drops, as you could waste a big chunk of your power if you're running motors at 6v.

i highly recommend using a higher battery voltage. i'm using 24 nimh aa's in series. 32v of nimh's really has some punch. i'm using a pair of lmd18200's to drive 12v motors from 32v using ~20 khz pwm; they're pricey but they work way better than the small bjt ones. they need at least 12v though. (they have bootstrap fet drives) the avr does the pwm.

you are going to have a hell of a time balancing without it. encoder data plays a significant role in my balancing system. i'm making do with homemade encoders which are slow enough to poll in software, but it would be easier with real ones because you could run your motor control loop way faster than your balancing loop.

people aren't kidding when they say balancing robots are hard to build. however, they are absolutely worth it. and remember, make your center of mass as high as you can!


Reply to
Edward C. Kern

Hi Ed,

Curious, why make the center of mass as high as you can. This usually goes against the first principles of many machine design. I haven't tried my hand yet at balancing robots but will surely do so in the future. Regards,



Reply to

it does, and i was uncomfortable with it at first as well. the higher center of mass makes it easier to balance because 1. it falls slower and 2. since the wheels are further from the mass, they can apply more torque.


Reply to
Edward C. Kern

It's the old pole-balancing trick. It's actually easier to balance a longer pole in your hand than a short one. It's easy to test with a dowel (preferable absolutely straight). It's easier to balance a 3-foot dowel in the palm of your hand than a 1-foot dowel.

-- Gordon Author: Constructing Robot Bases, Robot Builder's Sourcebook, Robot Builder's Bonanza

Reply to
Gordon McComb

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.