Motor interface electronics

Killer App: does everything, including cost very little.

OS: Since $500 is your concern, design goal, go Linux, it is free after all. OS is irrevelant, beccause unless you want to write your own dardware drivers, there is too much in between you and the hardware. In this case, OS is irrevelent, since they will all be technically difficult.

Microcontrollers as basis for device: Depends on the device. A vision based robot, absolutely not. Not enough horsepower there. A basis for a motion control system, absolutely. I couls make the same arguement about microcomputers for embedded applications. A place for everything, and everything in its place.

PCI IO card: Well, this is difficult. Do you really want to task your main processor to do a servo loop for several motors at 2 to 4 kHz each? Add to that A/D and PWM, and quadrature feedback, but you still burden your main processor. Now, put a dedicated microcontroller or FPGA on there, and you have a product. Actually several companies do just that. They unburden the host PC so it is not responsable for latency sensitive operations like data gathering and motion control.

Vision, speech recognition etc: Speech recognition and vision require massive amounts of data. navigation not necessarily so. The point I am making is use the proper tool for the job. The thing to remember is that microcontrollers have a lot of functionality. You sited I2C as a potential communications link. I2c emulation is a bummer, I2C on any Philips chip is near trivial. Why not emulate CANbus in software, why not poll the printer pins at 40 mHz and read quadrature directly. An 80 mHz motorola DSP or a 60 mHz ARM can do an awful lot because they have a wide range of register based things like UART, SPI, A/D, timers, etc.

From what you are saying, it sound like you are trying to build a really BIG BASIC Stamp. Yes a BSII is simple to use, every pin is like a swiss knife. The problem is, like a swiss army knife, nearly every tool has a better stronger analog out there. To carry this analogy further, you can only use one swiss army knife at a time.

Do you really want to start running interrups to poll an I2C bus on the printer port for instance?

$500 is an admirable goal, but I think it is difficult to achieve. Look at whitebox robotics. Made in China, PC based, really cool, evolution robotics software, simple, but $1500 is a closer for something like that.

A friend built a PC based bot with vision as its core, he went cheap, and is in it for well near 1K. Problem is, that is a rolling platform and vision. sure it speaks via win 2K's cool features, sure it has voice recognition, but he still had to use a real motor control for decent performance over varied terrain, and he still has to add sensing etc.

I think for $500, you may be able to make a thing that rolls around under PC control, but that is not a robot.


Reply to
Loading thread data ...

there was a motion control system out there that used an FPGA to drive steppers. It ran under DOS, it ran under Windoze 95A. It did this by pretending to be a disk drive... windows 98 killed it.

The real issue here that concerns me, is that there is a level of communication that you speak at, that not everyone can absorb. This is not a fault of your own, on the contrary, you communicated the points here with such clarity, that I have copied this post, so that I may plagarize it wholly or in part in a future column ;^)

It is a simple matter of understanding the fine points, and a matter of real world experience. I think that MLW just needs to run a couple of 2 kHz PID loops using a PS2 mouse under windows, linux, free bsd, or QNX, and see for himself what he is up against. If he succeedes at real motion profiling and real motor control, with enough horse power left for vision, navigation, speech recognition, speech systhesis, etc, then more power to him, we shall learn a lot from him in the process, I am sure.

Reply to

I started with an apprenticeship with TAFE course as an Aircraft Maintenance Engineer Avionics sort of a cross between electrical , instrumernt and radio trades, fitter and technican.

Had to do anything from install new systems sat nav and comms, GPS , entertainment systems , to replacing and refilling oxygen , new fuel quantity sensors and harnesses, reconnecting aircraft engines and generators , ignition systems , uploading new system software, replacing light bulbs.

Worked as an AME for ten years.

Currently doing a Physics and Electrical Engineering degree. With a bit of luck should finally finish the Physics degree this semester then probably another two years to finish the Electrical Eng. Its a six year full time degree, which I'm doing sort of part time.

I like Programming robot controllers by Mike Predko uses pic16f627 but is easily used on other 16f pics and easy to get working on 18f pics.

The other fun thing is helping people fault find and fix faults via a online subject forum.

About half the problems can be related to software problems, things like installing mplab with anti-virus softwware running (has a tendancy to stop the debug arrow from being installed) or xilinx webpack diabling all usb ports.

Or installing software in the wrong order.

Then majority of the rest of the problems are caused by bad soldering,

Best way to learn I reckon , build your own circuits on a bread board, also gives a good feeling when you get something working.

Unlike a premade board , using a breadboard you have to learn a bit more about electronics, things like reading chip pin numbering or how to read resistor values and how transistors work and how to actually connect things together.


Reply to
Alex Gibson

Wouldn't say its all hardware. More of a focus on smaller more easily buildable stuff.

Or doesn't even work (seen more than enough PHD type projects) that should have stayed on the drawing board.

Also know quite a few academics who think that building practically working circuits and building hardware is only for technicans not something that engineers should dirty their hands with.

Want to get a CMU type line following contest going at the uni I'm at (I'm secretary of the Engineering society 700+ members) but hit a brickwall in the mechantronics faculty guys. Still working towards it but going to take a good bit longer.

I agree with you but personally prefer a distributed controller approach. Basically having smart sensors etc so have a micro at the sensor that processes the raw data then sends it to main controller in the format you want.

Doesn't just have to be a micro at the sensor or motor can also stick in analog circuits to smooth out rough edges due to the digital or other problems.

If I had the time, I'd like to have a good look at the psoc from cypress gives you a mixture of programmable analog and digital blocks with a micro in there as well.

Also helps with timing issues and simplifying the main controller. On power use I prefer not working with 240V, to easy to screw up. With small battery stuff it doesn't matter if I'm half asleep or freshly awake, if I screw up the worst that can happen is having to replace a blown chip or similar.

Got all the bits for a larger bot using electric bike / scooter motors and medium gell cells (Oatley electronics) but need the time to get it built.

About another seven weeks until the end of semester and having enough of a struggle with electromagnetics and optics (wave packets and so on). Also doing a High Performance Computing subject parallel programming in fortran 90 / 95 using openmp and mpi.


Reply to
Alex Gibson

You can buy them from quite a few places around but not always that cheaply.

a good resource for where to buy things is oz over clockers

formatting link

wheres the smiley ??

formatting link
scale looks a bit off
formatting link
About 5 hours wrong there. Sydney to Melbourne is a relativly short trip of 45min - 1 hour by plane about 12- 14 hours by car. Sydney to Perth is around 5 hours flight.around a 3- 5 day drive

Dons very good.

No don't buy any Dick Smith pic programmers. Total waste of money.

One of the kits from dontronics for pic programmer and get one with a zif socket.

Or build a cheap avr programmer or if you can afford it an atmel stk500.

formatting link
formatting link
have some cheap pic , avr , 8051 and z8 boards starting from around $35 Australian dollars.


Reply to
Alex Gibson

Thanks - some of the points might be a little subtle if you are not used to the language typically used to talk about this stuff. I appreciate that you appreciated it :-) I guess my main point was that the term "real time" is actually very precise, within the circles that use the term in the way that it is being used here, and to give one example that I think most everyone can relate to - CD burning. "Real time traffic updates" - Puleeeaze.


I agree. I really want to see him do it without any specialized support hardware. PC MOBO only, as he has said! I'm wondering how he's going to generate a 20KHz PWM signal using his general purpose I/O card, continuously, without interruption - not just for short bursts at a time, as required to drive a simple h-bridge. Let alone multiples of those, each at a differing duty cycle. And still be able to do his vision processing, etc, etc. Microcontrollers have built-in hardware to do this - just set up the facility and plug the duty cycle into a register. Set and forget.

Heck - even R/C servos which are the dregs of motion control and if your signal is off by just a few microseconds you get jitter. I just don't see you having this kind of control using a PC parallel port where system response is highly dependent on load.

Oh, nevermind. I just remembered - he's using a DAC to drive some op amps. I'll take a good reliable h-bridge with high current MOSFETs anyday, though. Check this one out:

formatting link
Anyway, these threads remind me of a signature someone is using in another list:

"Good judgment comes from experience, experience comes from bad judgment"

I love that! It's so true. More so for some than others :-)

I seriously hope MLW doesn't give up, though - keep at it. Persistance in this field is key to success! You never know, maybe the end result of all this is that he will design a 40mA Athlon based PC motherboard with all the bells and whistles that we need for our robots that runs on 4 AA's and make a fortune selling it to us for $99.


Reply to
Brian Dean

I think a bare-basics robot using a mini-ITX can be done for under $500, and less if you assume you're going to scrounge. It all depends on the "extras," but here are some prices for readily available parts:

Mini-ITX board (VIA ML5000): $135

12v PS for mini-ITX: $40 12v Motorycycle battery (new, JC Whitney, Pep Boys): $60 230 RPM gear motor (Herbach) $36 (pair) 1/4" setscrew aluminum hubs: $10 (pair) 6-7" diameter wheels, Harbor Freight: $15 (pair) 2 1/4" casters (Home Depot): $7 (pair) 40gig IDE 2.5" hard drive: $70 USB wireless 802.11g adapter: $30 Aluminum/plexi framing (Home Depot): $40 Misc hardware (Home Depot): $20

Total: $463

We're assuming a free OS of some type. I intentionally didn't include some things like a mouse for hacked encoders as you can get those for free out of a dumpster, or for very little at Fry's ($3).

To make it cheaper you'll have to scrounge, and you'll need to in order to have money left over for sensors. You can probably get a used/refurbishbed hard drive at the swap meet for $25, a refurbished motorcycle battery for no more than $35, etc. You can build an IRPD for a couple bucks in parts from Radio Shack. A cheap USB Webcam would be a nice addition. I've seen them, new, at Pomona swap for $20. Not bad quality, either.

It *is* possible to *build* (not buy ready-made) a robot for under $500 using commercially-available parts, but none of this is new or unique. It's what you do with this off-the-shelf stuff that makes it special.

-- Gordon

Reply to
Gordon McComb

Yes. I'm impugning your ability to listen, and benefit from it. To wit:

No, your point wasn't missed, and is repeated again here, so you'll know it was heard. "Less than $500 dollars." Response? There's no challenge in it. It's already passé. Use a modern micro for the motion control, the rest is easy.

Supporting argument::

The "$250 robot anyone can build" is already built, and running. Several copies are now being cloned at universities and within clubs.

It does PID control of two differential motors with profiled control. It does Steering, so it goes in a straight line. It does Odometry, so it knows where it is in a grid. It does drive-to-a-point Navigation, so told to go to a point in a grid it gets there. It does sonar ranging. It does IR ranging. It does obstacle avoidance, so if something is in its way, it goes around it. And it can do more.

The universities are doing remote monitoring via cheap RF serial cables. BeerBot uses the serial to a cheap speech synthesis module, btw. Anyway its an unwise bet against a DSP talking, if it needed to. It can also read CMUcam's at 115,200 in the background. Vision, Navigation, Remote Monitoring, already in practice.

("But wait, there's more!" :)

It can do GPS decoding and drive to a designated GPS point, It can do networking via RS-232, CAN, SPI, and reads I2C from Devantech Compass, and SRF-08 rangers. It has left over A/D's, it has left over PWM, it has left over timers. etc. And what's amazing it does this in a high level language, within a real time OS, is interactive, and has left over processing power.

So actual running hardware is sufficient support to suggestons given.

Robot base with micro? proven reality $250. Remaining $250? Buy a Mini-ITX PC-whatever if you must. Money left over? Go splurge. For everything else, there's MasterCharge.

Reply to
Randy M. Dumse

Yup, just about sums it up.

interrupt driven I2C DAC off the parallel port to an LM12.

I think that this is the time for him to maike a new BIOS, and write an OS in ASM.

Those look like 18201's on that board. Trying to make a toaster ;^)

Try 16 LM12's and you can cook a pork roast.

Reply to

You have motors, but you need motor drivers like h-bridges or similar. I guess relays can work but even those aren't all that cheap. Control would be rather hideous, though.

Also, don't forget his $50 I/O card.


Reply to
Brian Dean

Of course they are small. I generally prefer to use Linux boards for the brain of my robot.

However, because the microprocessor is small, it can handle one task very quickly. For example, the motor driver I'm using uses an AVR microcontroller to handle the PID and so forth. I just sent it serial commands via the RS485 port (or RS232, or I2C, or other means I've forgotten about).

I use others to control one or more sensors.

  • Some* Mini-ITX boards are low power. You can get some with a real Pentium 4 on them.

I have both a VIA M10000 that runs around 25-30 watts, and an iBase 890c with a Pentium M that runs at least 60 watts.

And I *still* use microcontrollers to do the nitty-gritty stuff.

I would love to see you make it. I don't think you can do this without microcontrollers controlling the motors and sensors. And I think that you'll need them.

I would love to see a robot base that has all of the basics:

- motors and their controller - a sensor controller (or more than one) - a common bus to hang this all together

All would be (IMHO) controlled via a serial bus (I like RS485), but USB would also be useful. And most major microcontroller manufacturers are producing controllers with USB.

Gack! Frankly I am very disappointed in the low-level Mini-ITX motherboards. I would prefer a base that allows you to put whatever Linux box you want on it.

For some problems it is a good solution. For others, not so much so.

-- D. Jay Newman

formatting link

Reply to
D. Jay Newman

Out of five computers , only 1 computer here has a ps2 port , only two have serial and parallel ports , three have a serial port and the other two here are usb only with no pci slots.

From pc98 onwards microsoft has stipulated that new pcs should not have parallel ports and more recently no serial ports.

Luckily for us , there are still manufacturers who produce pcs with serial and parallel ports but these are steadily decreasing.

Looks like even the new Via ITX boards are have dropped parallel ports.

Other problem is a lot of the pci parallel port cards are 3.3V not 5V and quite a few are "windows" ports and not full hardware so won't work for all parallel port uses.

usb -> parallel are fine for printers but not much else.

For one of my bots for vision I've used a cmu cam

formatting link
is run by a scenix pic clone, looking at transfering it to use a analog devices blackfin BF-533 EZkit or Blackfin stamp to give it a bit more power. Similar chip to whats in a lot of tablet pcs to off load the handwriting and speech recognition to.

I'm going with a distributed approach as it lets me add features without having to rewire and lets me keep size down. My problem is lack of storage and work space.

A blackfin stamp board(can run uclinux)

formatting link
them from digikey


Reply to
Alex Gibson

H-bridges are among the things you can cobble together for very little, or (as I noted in another thread), get for free from semi companies. Outfits like BG Micro sell PNP and NPN power transistors for like a quarter each, so if you're willing you can put an H-bridge together for a buck or two.

I also did not include a couple of quad decoder chips from US Digital at $3.05 each, which I'd prefer to use rather than the PS2 interface. These would be personal choice items.

Actually I disregarded it! (Mike -- blueeuedpop -- will get the reference ) I prefer a USB adapter ($25) to one of those mythical $5 microcontrollers! Or if the budget would allow, I'd FAR prefer to shave off some bucks by buying refurbished hard drive, battery, etc., and use what's left over for a MAVRIC II, and subprocess with it. No shortage of I/O there. Randy's PlugaPod, at 90 bucks, also would save some headache in interfacing motors and quadrature feedback, among other things. In any case, this type of hardware is up to individual choice, as would be sensors.

-- Gordon

Reply to
Gordon McComb

Not a kosher robot, I take it...

-- Gordon

Reply to
Gordon McComb

I was waiting for someone to do this joke! (I almost did it myself once or twice.)

-- Gordon

Reply to
Gordon McComb

OK, so we agree.

Nonsense. A 20MHZ CPU (8/16 bit) is not faster than a 2GHZ (32/64) bit CPU.

That is cool, I never said microcontrollers do not have a place, but if you don't need one, why have one?


OK, my bad, yes some ITX boards are low power.


Why do you think that? Why does everyone think controling a motor is any more complicated than playing a video or buring a CD? It isn't, it is simple math applied at fairly regular periods to adjust the output power. If I was *really* concerned about "real time," I'd put the routine in an interrupt handler.

Got that built, working on PID software.

The number and type are to be determined.

That's an interesting requirement, what for? Yes, there will be documented ways to handle the I/O but why make up some sort of bus, screw terminals will work. For switches and such, and USB, parallel port, and maybe I2C.

RS485? No thanks.

What are you basing this statement on? I.e. which version of Linux is known not to run on which mini-ITX board. I have had no problems.

I have yet to see a "problem" for which it is the best solution available. If you need something simple and small, SQLite is better and smaller, if you need a "real" SQL database, PostgreSQL.

Reply to

You are the one who makes the ad-hominem attacks.

I'm not talking about a simple line walker or remote control scooter. I'm talking about a fully programable robot with a complete tool set that anyone can build.

Yes, I've seen the "beer bot."


OK, the design criteria has a few things that may not have been obvious:

"Total cost" is $500, that is OS, hardware, development system, interfacing, charger, everything. "Everything."

The development model is not micro-controllers simply because I want to keep one tool chain. I want people to be able to develop software on their PC and run it on the robot. When you have a micro-controller, you almost always need two, one on which to test, and one to run, unless you only use the one, but that sucks because you have to kill the robot to try something new.

The development model is meant to share code and expertise. A million roll your own microcontroller hackers aren't going to do anyone any good. Using Linux (or a BSD), it is possible to use more normalized API and build on open source.

lastly, while it is funny, I'm a bit curious about everyone so adamant about me using microcontrollers. Everyone is taking it so personally. I have simply said that (1) a PC can do everything the robot needs and I don't need any microcontrollers, and (2) that I wouldn't base my robot on a microcontroller because they are too limited.

Neither one of these statements is technically flawed. The first one is factual and rather hard to dispute unless you put artificial constraints on it like that buying an I/O board invalidates the assertion. The second one is clearly a subjective statement, and there are plenty of facts in support of my position and while my position is not one with which you may agree, it is certainly understandable from the design criteria I have stated.

Yet, you have resorted to insults, said I don't know something, called me ignorant, I think you have a problem.

Reply to

Actually $99.

I've not seen $40, seen $65.

Fire alarm/instrument batteries. Deep cycle gell cells. $35.

Kids toy with two motors and steel axil, $65~120

$60G Microcenter $29

Linksys or Belkin wireless router $30 (on-line or microcenter with rebates). EPIA board comes with ethernet jack. The router actually has a secret, you can install a custom Linux on it.

My total: $355

$5.00 or less.

I have almost $150 to play with on my budget. one or USB cameras, one or two ultrasonic sensors, and of course, bump sensors.

Using a PC based development model is very important. The tool chain you use to create applications should be usable for the robot as well.

Reply to

Hardware vs software. Hardware support is a lot easier to program for.

Also what latency or delay between the cpu and sensor or motor or motor controller ? Going to end up a similar time for both solutions just to get the data and again to get a control value back to the motor or sensor.

Depending on the way the solution is implemented, processing time is almost irrelevant of course the way you would do it on a pic and on a P4 would be different.

Because the cd burner or dvd burner have microcontrollers that run them the cpu just sends the data to the device in the correct format and at a rate it can hand via the drivers (its a bit more compilcated than that)

formatting link
Even the cpu offloads quite a bit to the peripherals

I think he means bus protocol or bus type like RS485 or can etc D.J , Brian , Randy and others came up with

formatting link
A similar sort of one is canopen and micro canopen
formatting link
Some people use rs232 or the uarts on the micros or i2c or spi for communications between the sensors (each sensor or group of sensors with a small micro) and main controller.

Also good for keeping wire runs short use hardware to help with error checking of signals.

formatting link

Reply to
Alex Gibson

How does this compare with your project?

formatting link

- John

Reply to

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.