|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Serial PWM motor controller
Hello, my name is Cody Smith. I'm a member of the Palm Bay Pirates team 2023 FIRST robotics team. But I'm here for a bit of help on a personal project. Let me first say that I myself am new to electronics and robotics but have a big computer background. I'm a web designer and experienced 3D modeler.
A friend and I are attempting to build our own robot using an old 1GHz Pentium III Dell motherboard we got our hands on (we actually have four or so). We like to call this the "Dell Bot" project. After building on teams FTC bot we decided that we wanted to step up to the big boy league but we wanted to do it differently and on a budget. So we figured instead of paying a large amount of money for a micro controller that has next to no CPU power to just use the abundance of computer parts I have in my garage. We have the Dell computer stripped down to bare components. Version 1 of this bot will be tethered for power and possibly communications. Version 2 will hopefully have a car battery on board to directly power the motherboard and various motors and be controlled via a wireless network card by a laptop. Version 3 will feature an arm, lights, speakers, a microphone and a USB webcam. A little note, we hope to use an omni-directional wheel system. The biggest problem we've ran into is how to interface the motherboard or as I like to call it the mega controller (big micro controller) with the various DC motors we need. The rest is relatively easy. The idea I had and hope to pull off is to make our own PWM output bread board. It would work by using the motherboards two serial ports (RS-232) hooked up to our own board to somehow create 10 or so PWM motor / servo outputs. I've looked pretty deep into this and really found no help. I'm hoping to use Python to program the serial port(s) but still the whole thing has me scratching my head. I'm wondering if anyone here has a better idea or could give me some insight on how PWM and/or serial ports work and communicate? Well, has anyone here attempted something like this before? Or maybe tell me I'm crazy for trying to do this lol. Thanks, -Smartkid |
|
#2
|
||||
|
||||
|
Re: Serial PWM motor controller
You could use a PIC microcontroller, like an 18F4550 that would connect over USB, show up as a serial port, and turn serial commands like A255 into an equivalant signal on PWM output a
The 18f2550/4550 series have lots of libraries for stuff just like this. Last edited by Binome : 28-12-2007 at 20:39. |
|
#3
|
||||
|
||||
|
Re: Serial PWM motor controller
Cool project. Here's what I've found.
Since you're packing around a whole computer, you're probably going to want motors along the lines of what's used in FIRST (correct me if I'm wrong), meaning that a lot of the low-current motor controllers would fizzle and die. So from there, really the best option that I know of is going with the IFI Victor controllers. Since they're controlled with servo PWM signals, you need a controller board like you said. There's a bunch of different options for this, most have 8 or 16 outputs, a couple I've found are: Pololu USB 16-Servo Controller Super Servo Controller There's also several guides if you want to DIY (like this one) For more just google serial servo controller Good luck! --Ryan |
|
#4
|
|||||
|
|||||
|
Re: Serial PWM motor controller
I'll toss in a few as well:
USB controller Another serial controller If you're investing in all your parts from scratch and not using anything scrounged from your FRC team, it's worth looking into serial and USB H-Bridge motor controllers or even looking at stepper motors and controllers, though. Also, if you are scrounging, make sure your PWM generator is compatible with IFI signaling. They're ever so slightly different from the R/C standard. |
|
#5
|
||||
|
||||
|
Re: Serial PWM motor controller
No way
You guys have no idea how hard I've searched for something like this. I actually did find this article: http://www.rentron.com/SerialServo.htm and I've been to Parallax (their $100+, 20MHz micro controller kit was what inspired me to do this project). But I was a bit confused as to exactly what it was about, I was knee-deep in servo-micro controller-PWM articles. A USB PWM controller is even better! A question: Is there a major difference between USB and RS-232 serial? To what RyanCahoon said, "you're probably going to want motors along the lines of what's used in FIRST [...] a lot of the low-current motor controllers would fizzle and die" Yes, the computer power supply uses 12V and 5V leads so the car battery we hope to use for power later on and the motors will all be 12V. The design calls for 4 12V DC motors to move the bot in an omni wheel system which I've already had to make and program for a various school robotics competition coming up that I'm not allowed to give details about using Vex parts. hehe The question that comes to mind though is do I really need to buy 4 $100+ speed controllers? I've worked on our teams FRC bot, what we're hoping to do is about 1.5 times smaller then that and shouldn't need quite as powerful motors. Another small question that I'm sure someone here knows is, how long would you think a car battery would power the motherboard and the motors? It's an important thing to consider, I know many factors apply but an estimate would be appreciated. And finally one last question, when working with Vex parts I noticed that the servos can work directly with the controller inputs (PWM output value of 0 set it all the way in one direction, PWM output of 255 spun it around the other way), do real servos work just like this? And do servos also need speed controllers (I assume yes and yes). Thanks so much guys! -Smartkid |
|
#6
|
|||||
|
|||||
|
Re: Serial PWM motor controller
It looks like minimum power dissipation on a P3 is around 20W. Max is 27W. Additional draw from the drives, etc would probably end up around 20W, so figure 40W to 47W from the PC, and just assume 100% efficiency for the power supply. That's about 4A draw, at a minimum, assuming a very plain video card. If you're using a car battery, they have a reserve capacity rating that says how long they'll last with a 25A load. 80 minutes is typical, so you'd get something like 8 hours out of that on a good day. Of course real world loads will be a good bit higher when you're running motors, etc. If you're really looking for long runtimes, I'd invest in a deep-cycle or SLA battery, as those are designed for lower draw levels and more capacity. Car batteries are primarily design to push a very large amount of current for less than a minute without significantly shortening the battery's life.
|
|
#7
|
|||||
|
|||||
|
Re: Serial PWM motor controller
Quote:
Quote:
http://www.mcmanis.com/chuck/Robotics/ http://www.barello.net/Papers/H-Bridge.pdf http://www.armory.com/~rstevew/Publi...d/h-bridge.htm There is also an online collaboration to create an "open source motor controller", or try googling robotics clubs such as the Seattle Robotics Society. They have some excellent information and links on their web site. Quote:
Quote:
Sounds like you've got a great project ahead of you and lots to learn, Good luck, Jason |
|
#8
|
||||
|
||||
|
Re: Serial PWM motor controller
Quote:
Quote:
On the topic of USB vs. Serial: On the PC end of things, USB really depends on how the device is set up. I noticed on the Pololu board that they're basically running a little USB-Serial module and it just looks like another serial port on the computer anyway. The one advantage to using USB over pure serial is USB is, of course, more modern and (in my experience) is less finicky with connection settings - no baud rate, stop bits, parity, etc to deal with. Hope I've helped some instead of just muddying the waters. --Ryan |
|
#9
|
||||
|
||||
|
Re: Serial PWM motor controller
Once again, wow. I've had to learn 90% of everything I know about computers, computer hardware, programming, web design, Photoshop, 3D Studio Max, etc. myself. I haven't taken any school computer class yet that I have actually learned anything in, they all teach very basic stuff, stuff that I considered below me.
However our schools robotics team is completely different. The first programming lesson they gave use showed us how basic binary worked in 8 bit applications and how PWM variables work in the Vex kits (and all robotics). My point is simple, I absolutely love the FIRST program. My brain has opened up and sucked in every drop of information it can from our schools robotics program. I'm basically the leader of FTC team #509 and will most likely be doing a large portion of the FRC bots programming this year. So theres a bit of info about me. Back to the Dell Bot project... After looking at the pages you guys showed me I've decided to attempt to build my own serial based motor controller from this article: http://www.rentron.com/SerialServo.htm The main motivation is price and learning more about the basics of how this stuff works. I like getting knee-deep in these projects, just how I work. The idea is to build two of these and program them independently. One will power the components on the base (wheels, etc) the other will handle the arm and claw we hope to build. One question about that article, the diagram shows a PIC: http://www.rentron.com/Files/Stamp/pc-servo2.gif I've located this PIC and priced it (around $5, not bad) but won't I need to program the PIC itself before it does anything? Another small question, the diagram shows one pin from the microchip connecting to each PWM output, well it's my understanding that PWN cables have three wires (black, white and red). If the microchip only outputs to one wire then I'm guessing that it's the white one and that black and red are battery and ground? Also, what is a 4MHz Ceramic Resonator? I've looked one up, a little $1 part that I've seen before but what does it do? On the subject of the battery. I've done my homework on car batteries. I knew that the batteries weren't designed to be completely discharged and I will take care to ensure that the battery we use won't get that low. But I didn't know how long it would last, please trust me 8 hours is PLENTY However two questions here: - I need a way to recharge the battery without a car, I'd like to build a battery charger that could charge it using a household 120V AC plug. How simple would that be? I assume I can't just plug one end of the plug to the + and - ends of the battery. - I'd like to be able to make something, perhaps a small LCD screen that could tell me the amount of charge left in the battery. So that I never drain it all the way and so that when it's charging we know when it's done. I believe the drop in voltage is how you can tell the amount of charge left? Like when the Vex controllers show voltage on the little LCD. Again thanks guys, I know this project is a big one but I feel that the experience and end result is well worth the effort. I'll make it a point to post pictures later and I may even make a little web page dedicated to the project so that others can have a reference. -Smartkid |
|
#10
|
||||
|
||||
|
Re: Serial PWM motor controller
This probably wont help you, but I think I will post it anyway. It seems sort of relevant.
There is a neat project in the book 101 SPY GADGETS FOR THE EVIL GENIUS It's on page 85 though 89. and is titled Project 41-Manual Controlled Servo Base. It looks pretty neat. It uses a 555 timer to help controll the PWM's. I have no idea as to how you would interface the circuit with a computer though. |
|
#11
|
||||
|
||||
|
Re: Serial PWM motor controller
Quote:
We'll I don't know about using a full fledged LCD, although that would be cool... and my encouragement if you decide to try. But, you might want to look into a Digital Panel Meter, or a regular panel meter. They are a simple solution giving you an idea of how much charge you have left. All Electronics has some pretty affordable ones. In fact we used one on our FRC robot last year. Ours was the only one that had one, and the engineer who inspected our robot kind of liked it. www.allelectronics.com |
|
#12
|
||||
|
||||
|
Re: Serial PWM motor controller
Quote:
Quote:
Car batteries usually have 40 Amp hours. 20% of that is 8 Amp hours. The battery would only last 8 hours if only 1 Amp is being drawn. The CIM motors will draw far more than that (upwards of 132 Amps at stall for each motor ). At that current (not advised) you would get under 4 minutes before you would surpass the 20% draw on the battery. Now you shouldn't be drawing that much current, but calculating and budgeting the amount of current you draw and calculating how long your battery will last will tell you what type of battery (car/marine) you'll need. |
|
#13
|
||||
|
||||
|
Re: Serial PWM motor controller
The battery is something for later. I don't have the money for it and the charging equipment right now. Honestly, I'm broke. It'll be a while before I can get any of this off the ground but time is something I have a lot of.
My dad seems to think that a car battery is massive overkill and too heavy. It's become a bit of a joke now. The more pressing matter is the motor controller circuit I hope to build... Quote:
|
|
#14
|
||||||
|
||||||
|
Re: Serial PWM motor controller
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Good luck, Jason |
|
#15
|
||||
|
||||
|
Re: Serial PWM motor controller
Extremely useful information, thanks dtengineering.
To Daniel_LaFleur: Quote:
While I'm here, whats the difference between a stepper motor and a regular DC motor? I remember finding a small stepper motor in a hard drive and doing a bit of research on it but besides that their foreign to me. Also, where would be a good place to look for cheap DC motors? I need something in between Vex motor size and FRC motor size. We'll call Vex small and FRC extra large, I want a medium. Thanks, -Smartkid Last edited by smartkid : 29-12-2007 at 20:26. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No PWM from controller | ctshirk7 | Control System | 10 | 27-01-2006 18:55 |
| USB to Serial converter for controller | Ryan Collings | Programming | 10 | 22-01-2005 13:14 |
| 25 FT SERIAL CABLES (controller tether) | sanddrag | General Forum | 10 | 06-09-2002 20:29 |
| Ugh...PWM pin vs. Speed Controller | archiver | 2001 | 1 | 24-06-2002 00:27 |
| Speed Controller/PWM problems.... | Clark Gilbert | Technical Discussion | 8 | 08-01-2002 00:14 |