In my sub-$500 robot project, I am currently using the output of two D/A converters to drive direction and power.
0V = stop.
0 -> +5V forward
0 -> -5V reverse
The voltage goes into two comparitors. One for direction, the other for PWM. The PWM is basically a comparison against an integrating ramp generator.
While electrically very cheap to make (A quad comparitor, op amp, resisters, capacitors, and a few transistors.) It puts a burden on the computer system to *have* two D/A outputs.
The question is, is there an easier, more cheaper way?
I thought about parallel port, but the parallel port is such a powerful resource, I'd hate to use it up.
USB, but that increases the cost of the system even more.
I thought about an I2C bus, with two I2C D/A converters, and while that is cheap, if forces an I2C bus.
Should I just assume that there are two D/A outputs for use?
Don't be silly! Of course! Just assume there are D/A outputs. Sure! That's been exactly what you've been telling us all along, isn't it? Just use the OS and make the system call. It doesn't matter if there's no hardware there. That's what the OS is for, making up stuff that doesn't exist. That's the advantage of using a PC. The OS makes up for all that stuff you need to do robotics, but don't really have, doesn't it?
Of course, all us using microcontrollers are using a single PWM pin output. The PWM pin goes directly into commercially available H-bridges. And there's hardware inside the micro which takes all the software burden off the CPU, so the micro makes one write into a hardware register and everything else is automatic. So we take the PWM pin, hook it to the Hbridge input, then hook the motor to the Hbridge output, and we're done.
But you should be able to search around and find a PWM or D/A driver for Linux and just call it and get the same thing, right? Great! Let us know what you find.
Oh, please. On your micro-controller, just run apache and PHP for a web interface, just use MPI and networking for distributed processing, use SQLite for a small self contained SQL database for information processing and logging, use the V4L infrastructure to develop your vision systems, use the PC sound system for speech synthesis, use the video out for a display, use a PC joystick for manual control, etc. etc. Micro-controllers don't even count.
You need at least two signals to run H-Bridge electronics, direction and PWM. A single pin is not a solution, do you have two pins? How many motors can you drive? One? Two? Three?
For the cost of a $1.29 chip per D/A channel, I can create an I2C bus off the parallel or serial port. I am looking for a more comprehensive solution.
The question I was asking is which interface is easier and more cost effective to use.
The D/A and A/D converters as well as a number of I/O devices are well supported on Linux. Linux has, as a native kernel driver, an I2C bus. It has full parallel port access as well. I don't have to "find" anything, I was curious about what people think about the best methodology was and maybe someone may have had a constructive opinion to share.
An I/O solution for a PC is no more than about $49 and a little more if the user wants more sophisticated hardware.
My robot's target price is less than $500, and it would be REALLY cool if I can make it for less than $400.
The sn74lv8153 chip below may be what you are talking about. I got some free samples a while back, but have never figured out how to get them to work with a PC serial port. If anybody has ever used these with a PC, please post up the how-to info. The bottom board from futurlec seems to have a good bit of serial port I/O for $49.
The last computer I bought did not have a either a parallel port or serial port, only USB ports. I'm sure that there are some mini-ITX boards out there that have both parallel and serial ports, but I have real doubts about how long these ports will remain in production -- 1 year (probably), 3 years (maybe), 5 years (I kind of doubt it.) I'm not a big fan of USB (actually I
*detest* USB) but it seems to be winning in the market place. Do you want to design your platform such that it requires features that are being progressively designed out of motherboards?
Yup. USB is a real pain in the rear for us hobbyest types. Lot's of people are using FTDI chips to get USB to serial these days. Pololu sells a converter , although I've never used it that particular product.
I'd recommend getting real used to USB for talking to mass produced motherboards.
I2C has its pros and cons. I'd recommend reading the spec. very carefully. Pay particular attention to the recommended bus lengths.
No.
Most of us use a dedicated microcontroller hooked up to an H-bridge to drive our motors. You are welcome to try different solutions, but microcontrollers are probably cheaper than anything you have proposed so far.
My $.02,
-Wayne
P.S. To contact me directly, send mail to Wayne .at. Gramlich @dot@ Net.
Actually they do, especially for larger robots. I wouldn't even THINK about trying to control a larger robot with a single PC, unless the board is using a *real* real time operating system. A tried-and-true approach is to use a microcontroller to control the motors; the controller includes a dead man's feature that will stop the robot if A) the motors stall, B) last-ditch mechanical switches make contact, or C) some other condition that indicates the robot needs to stop
*immediately*. These sensors are routed to the controller, separately from the PC, so you have a fail-safe system. You can parallel them to the PC if you want to.
On robots that weigh less than 20-35 pounds fail safe's are not as critical, but as the machine gets heavier, it's important to build in safety features. Cost should not be the overriding factor.
A $5 programmable PIC or AVR will run two motors, or you can splurge and use one chip per motor. Connect the fail safes to hardware interrupt pins. Reaction time is in the hundreds of nanoseconds. Several of these controllers have D/A, though I don't think you need to go the D/A route. They all have internal timers as part of their core, and PWM through timer interrupts is very stable and glitchfree, especially if the chip is crystal controlled.
This approach is not unlike how a a modern PC uses co-processors for graphics, network connections, and other services. Microcontrollers, including the more robust ones that Randy's company sells, go a long way to offloading mundane processing, allowing for faster speech, vision, and other processes where a PC really shines.
Not really. FTDI sells USBRS232/FIFO modules in the $25 range. One module can control a number of external hardware, and they do have Linux drivers. I know of several robots that use these modules.
Wayne is right that parallel and serial will not be with us for very much longer. We will all have to do down the USB road sooner or later.
Sure you have. Just use the OS. Make D/A pins out of the parallel port. Make D/A pins out of the audio channel. Make D/A pins out of the video. Any of these are possible. What's the big problem?
If you use a parallel port, Just use a 100,000 Hz interrupt, count each time, and then along some part of 65536 of those interrupts make the pin go hi, and the remaining make it go low. That will give you a 16-bit D/A output that has about a 1.5 Hz update rate. Easy! right? Maybe there's already some driver written that could do this for you.
Or how about that stereo sound channel? There's two audio outputs, and you can probably shape those waveforms to be just what you need right?
Just assume the D/A's are there, like you suggested. Use the OS. Just pick a couple pins on your PC, and make 'em work. No cost! Easy! You've got them right there on your ITX mobo.
I think you are in over your head. Better toss mlw a lifer saver, er, microcontroller.
Microcontrollers count for plenty. PC motherboards are not some great novel idea ripe for robotics use that everyone in the robotics community just somehow hasn't thought of. The VIA Mini ITX's are interesting, but they sure aren't a complete solution. In fact, the only thing interesting about them is the fairly low price. For actual usefulness in robotics, you'll do better with PC/104 type boards, some of which actually do have hardware facilities suitable for robotics applications; but they are generally $$$. There are a number of problems with motherboards intended for PC's - large power requirements, lack of needed hardware interfaces, stability issues regarding mounting espcially for the PCI cards (robots do move and sometimes hit things), etc, etc.
You don't really think you can do this without microcontrollers do you? Let me rephrase: if your time is worthless to you, you might be able to pinch a few pennies by building all your hardware interfacing from scratch. It will take you many years, lots of proto board, lots of scrapped attempts in the refuse pile, and in the end, you _might_ be where you would have been in a few weeks by simply purchasing a ready-made microcontroller board, reading the datasheet, learning a few development tools, and programming it to do exactly what you need.
You do know that a microcontroller is, don't you? You realize that chip makers go to great pains to include features that are demanded by their customers - people who create and build embedded systems. PC motherboad makers go to great pains to include features that are, well, expected on a typical desktop computer. Which do you think is more suitable for use in robotics?
Microcontroller do what is required, cost effectively. I realize your target is a $500 robot. Are you looking to commercialize this robot? Is $500 your cost or your target price? Or is this an "open source" robot? You know there are already a bazillion of those around, don't you?
I'm betting that you'll spend close to $500 just on the frame, batteries, and heavy duty motors neaded to cart around your Pentium 4, running your MySQL database and Apache web server. Heck, maybe you'll even want a cluster - there are a number of clustering solutions out there - you can run dozens of boards all working on complex gene factoring problems, because you never know when you might want your mobile robot to do some gene analysis on the go.
I'm still waiting to see your mouse encoder. I honestly think its much more cost effective to simply buy a motor with the encoder built in. They add a bit to the cost but look seriously at what you get. You get time. Time to work on the things that are really interesting instead of cutting apart a mouse with a dremel and trying to salvage a few chips and encoder wheels, and then, god forbid, trying to mechanically attach those to your motor / wheel in a way that it won't fall apart if you look at it sideways. I like to just spend an extra $10 for my motor and get one with an encoder - you will get good resolution, pristine signal output and a bomb-proof mechanical connection and housing - no fuss, no muss. Then I save that time to focus on a problem that is more interesting to solve.
Instead of dismissing the advice you are getting, may I suggest that you pick up a few books from your local bookstore on this subject. You'll probably recognize some of the authors on those bookshelves as some of the folks replying to you - some several times over. You are getting some quite expert advice - only a fool would ignore that.
I guess we sometimes need to make our own mistakes for the lessons to sink in.
Wouldn't a fuse (or resetable electronic fuse) be required for protection. Why would a PIC be any more reliable than a PC when it comes to reading sensors for a current overload? I learnt the importance of this with my first robot that ran amuck, hit a wall, and the motors promptly went up in smoke!
I have always seen the PC as a rather oversized programmable IC chip with built developmental software.
How fast are these PICS? A quick web search seemed to return a clock speed of 4MHz with the ability to overclock up to 20MHz?
With say a 800MHz PC couldn't you emulate a few PICs and pump the data in/out the parallel or serial ports to some hardware and still have enough grunt to do "higher" level processing?
I have always thought about playing with these PICs but haven't seemed to find the time. I will have to search the net for some good tutorials on using PICs in circuits. I have done a lot of assembler programming on the 6502, Z80, 68000 and x86 so it shouldn't be that hard to learn yet another instruction set and cpu architecture.
I had thought to use an old 8085A and some 8155s, that have been collecting dust for some years now, for a simple robot brain but found the PC easier to play with and now see it as having more potential.
No matter what other protection there is, adding a fuse is a good idea, assuming that you can get at the machine to fix it. Take the fuse out and nobody's going to switch it on when they're not meant to. Possibly not a good solution for Mars landers, etc...
I've also got 100A DC circuit breakers (eBay, surplus) for those "whoops, I just dropped my screwdriver across the motor power rails" moments.
If you're looking at Microcontrollers, don't forget to have a look at Atmel's AVR range. (Have a look at )
I'm also looking at some of the Dallas 8051-compatible microcontrollers; the DS80C400 has CAN, 1-Wire, 3 x serial AND an Ethernet MAC all on chip. I would be a happy man if I could get hold of some suitable PHYs for these in sensible quantities (like 1 - 4). Dallas also has a range of higher-speed 8051-compatibles, up to 33MHz. Samples available - what nice people they are.
All the uCs I've mentioned have in-circuit Flash programming facilites. I rather like the idea of being able to re-programme without pulling everything apart.
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.