Society of Robots - Robot Forum

Software => Software => Topic started by: timstirling on July 31, 2006, 10:50:53 AM

Title: RC car->robot mini project: motor/micro controller?
Post by: timstirling on July 31, 2006, 10:50:53 AM
hi all,

I've recently graduated with my A.I. degree and before starting work/PhD I'm looking to start making my own robots for testing etc. I have robotics experience but the components have all been provided so I haven't had to worry about electronics before.

I've had a look at robot kits, they all seem pretty pricey for what you get. But I don't want to go all out on making kmy own robot as I have little electronics experience and I'm completely broke!

Anyway, I have gathered up some parts, most useful being a few DC motors and some old RC car parts.  This has given me a chasis with a fixed 2 rear-wheel drive system. Not ideal as I would prefer a 2-wheel differential drive system and a holonomic robot. Still, it will add some fun to the navigation software!
Steeering I am having to build myself, luckily the RC car/truck has front wheels which will steer nicely but they will need to be powered. This shouldn't be a problem- I have a small DC motor and I'm hacking something togther from Lego based on rack-and-pinion turning.

The RC car has a small circuit board but unforunately I have no remote so will remove the circuitry from the system. I need a motor controller capable of driving 2 small DC motors. This is the first question. What reccomendations are there? Now although this robot maybe running at around 6v with low powered motors, later on I want a much more robust robot capable of  carrying a laptop/basic ATX  board and CPU (I have several spare PCs and parts).  Would it be best to buy a small cheap motor controller for this project then buy the real deal later or just go for it now?  any help most welcome.     


The secondquestion is to do with the microcontroller.  I have read things about the STAMP controller etc, but it doesn't really satisfy my needs. Very underpowered for the algorithms I will be using. + I don't want something to be programmed in BASIC and designed at school kids. What are the more powerful alternatives?  Or maybe I should just start using my laptop/PC parts ASAP and provide a tethered link (since this first robot won't have anywhere near the power to lug  a heavy laptop etc.), thus saving money. But what kind of electronics would be needed to link the laptop to the motor controller and any sensors? 

 
Thanks for any help?
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: Admin on July 31, 2006, 11:43:00 AM
Have you considered simulation?

Microcontrollers will never have the processing power you are probably used to with PC's. You will have to make a lot of sacrifices . . . perhaps you can consider a palm pilot instead? I do AI stuff as well, but I like microcontrollers cause they are way smaller . . . A roach doesnt need human level reasoning abilities . . .

To control two small dc motors all you need is a motor driver IC. Just follow the datasheet for wiring instructions. You could instead use $9/each servos, which are even easier to interface with, and also have a built in control system.
http://www.societyofrobots.com/actuators_servos.shtml

To interface between a PC and robot components you would need a microcontroller with a rs232 serial connection. The microcontroller handles things like reading sensors and controlling hardware while your PC does all the upper level stuff.
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: Nyx on July 31, 2006, 12:42:12 PM
Maybe you should consider doing it the same way I'll be doing mine (or using a similar approach)...

Make a circular woodeen base with two DC motors (with gears) driving two symmetrically placed wheels under the chassis, and place two free rotating caster wheels at a percpendicular axis to the motor-driven wheels. Then you can add a level for batteries and motor control, and one for your laptop. I found some 12V motors-gearbox sets for $15 which will do the job of driving such a platform around... And I plan on directly interfacing the motors through relays using a USB-parallel port converter (which can drive at least 8 relays). My design for the actual base is very simple, it's basically a stack of wooden circles or squares, joined together with wooden "spacers". I personally prefer a circular design because that way the robot is always able to rotate around its central axis, even if it is very close to a wall.

I will rely on vision to control the guidance of my robot entirely, which eliminates the needs for servos or other accelerometers or rotation sensors in my case. If you need more than that, however, you can use more parallel/USB or serial/USB adapters for additional inputs and outputs.

Cost of the basic thing:

Wood and screws: 0 to $25, depending if you already have some, or can get some for free
Motors: $15 x2 in my case, $30
Wheels: $10 to $20
Battery: 12V SLA 7AH - $20, $30 for a more powerful one (12AH I believe)
Parallel-USB adapter: $10
Relays, wires, transistors, resistors, etc: $15 to $25

Total: between $85  and $125

Which imo isn't so bad. It has the advantage that it can be quite fast and carry alot of weight (my motors are 150 RPM, ~40W each), you can scale it easily by adding additional levels using wooden "spacers", you can make it as large as you want, you can have alot of battery power, and you can easily carry one or more laptops. Laptops also have tons of obvious benefits themselves, like the large amount of CPU power, the possibility of interfacing with several webcams, bundled Wi-Fi "for free", the convenience of a real OS and a real compiler, etc... Not to mention that you may already have a laptop, like me, which is something less to buy for the project!

If the look of wood really scares you, then you can always paint it, or encase the thing in metal or plastic eventually. Wood is also pretty light, which is another bonus.
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: timstirling on July 31, 2006, 02:14:35 PM
Have you considered simulation?

Microcontrollers will never have the processing power you are probably used to with PC's. You will have to make a lot of sacrifices . . . perhaps you can consider a palm pilot instead? I do AI stuff as well, but I like microcontrollers cause they are way smaller . . . A roach doesnt need human level reasoning abilities . . .

Yeah, my main intention is to use computer vision and run algorithms such as neuro SLAM for naviagtion/mapping etc. and using neuro-controller evolved through genetic algorithms as the control software, and then experimenting with artificial life. This is what my final year thesis was on and so i have all thr algorithms already. the unfortunate problem with my project is the universities robotics lab had some major hardware and software problems with the robots I was going to use so the neuro-controllers have never been fully tested. My aim is to carry on this research taking it to the next stage by doing robot testing.  This maywell form the basis of a PhD.

Quote
To control two small dc motors all you need is a motor driver IC. Just follow the datasheet for wiring instructions. You could instead use $9/each servos, which are even easier to interface with, and also have a built in control system.
http://www.societyofrobots.com/actuators_servos.shtml



The advantage of DC motors is I already have a fair few low powered ones. Although I will be making use of servos in the future.  Can you provide any more info/links on the motor driver IC? That would be very helpful.


Quote

To interface between a PC and robot components you would need a microcontroller with a rs232 serial connection. The microcontroller handles things like reading sensors and controlling hardware while your PC does all the upper level stuff.

So, even if I use a laptop/PC I would neeed a microcontroller. Well, this wouldn't be so bad because it means I have the option of making smaller/simpler robots with just the microcontroller, e.g. from the RC car basics I already have. Then when I want to make a larger robot with a laptop as a brain the microcontroller can handle the low level motor commands. I like this idea because it follows the Brooks subsumption hierarchical archtecture.  It would be nice having the laptop to some vision + navigation algorithms, which if they fail, the low level microcontroller could still override he drive control and prevent crashes via whisker detection etc.
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: timstirling on July 31, 2006, 02:26:43 PM
Maybe you should consider doing it the same way I'll be doing mine (or using a similar approach)...

Your way was my original aim but as I started adding up parts it got fairly expensive, but the prices you have listed look reasonable, especially without a microcontroller and motor driver IC etc.

Quote
Make a circular woodeen base with two DC motors (with gears) driving two symmetrically placed wheels under the chassis, and place two free rotating caster wheels at a percpendicular axis to the motor-driven wheels. Then you can add a level for batteries and motor control, and one for your laptop. I found some 12V motors-gearbox sets for $15 which will do the job of driving such a platform around...
Yep, I'm familiar with idea- here is a project I did last year with the same differential drive scheme: http://www.flickr.com/photos/timstirling/sets/72057594060800204/
(it navigated the maze mapping it, detected balls, oponent, wooden boxes, collected the ball and returned to the start position via the quickest path)

Quote
And I plan on directly interfacing the motors through relays using a USB-parallel port converter (which can drive at least 8 relays). My design for the actual base is very simple, it's basically a stack of wooden circles or squares, joined together with wooden "spacers". I personally prefer a circular design because that way the robot is always able to rotate around its central axis, even if it is very close to a wall.
The highlighted part is what I'm interested in. You'll have to excuse my ignorance, but could you spell out how such a system would work and cost.  I've been searching for the last week to find details of this and found very little useful info strangely. ... Holonomic symmetrix robots are always easier!

Quote
I will rely on vision to control the guidance of my robot entirely, which eliminates the needs for servos or other accelerometers or rotation sensors in my case. If you need more than that, however, you can use more parallel/USB or serial/USB adapters for additional inputs and outputs.

Cost of the basic thing:

Wood and screws: 0 to $25, depending if you already have some, or can get some for free
Motors: $15 x2 in my case, $30
Wheels: $10 to $20
Battery: 12V SLA 7AH - $20, $30 for a more powerful one (12AH I believe)
Parallel-USB adapter: $10
Relays, wires, transistors, resistors, etc: $15 to $25

Total: between $85  and $125

Which imo isn't so bad. It has the advantage that it can be quite fast and carry alot of weight (my motors are 150 RPM, ~40W each), you can scale it easily by adding additional levels using wooden "spacers", you can make it as large as you want, you can have alot of battery power, and you can easily carry one or more laptops. Laptops also have tons of obvious benefits themselves, like the large amount of CPU power, the possibility of interfacing with several webcams, bundled Wi-Fi "for free", the convenience of a real OS and a real compiler, etc... Not to mention that you may already have a laptop, like me, which is something less to buy for the project!

If the look of wood really scares you, then you can always paint it, or encase the thing in metal or plastic eventually. Wood is also pretty light, which is another bonus.

Thanks for that lot. Yeah, the cost looks great. Any info on linking the parallel port pins to motors... I'm guessing a bit of electronics skills needed. I know the basics upto and including MOSFEts etc but have never actualyl contstucted circuits - although I do have access to a solder iron.

Thanks for the reply. What you're doing is pretty much what I intend to do.

Tim
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: Admin on July 31, 2006, 02:31:13 PM
Typically any robot would cost an unavoidable MINIMUM of $100 . . . mine usually cost $400-ish . . .

And wood sucks, use HDPE!
http://www.societyofrobots.com/materials_hdpe.shtml

Quote
Yeah, my main intention is to use computer vision and run algorithms such as neuro SLAM for naviagtion/mapping etc. and using neuro-controller evolved through genetic algorithms as the control software, and then experimenting with artificial life.

Yea, a microcontroller is out of the question for that.


Quote
Can you provide any more info/links on the motor driver IC? That would be very helpful.

Go to digikey.com and search for LMD FET. There are many types of motor driver IC's out there, they are extremely common. These in particular I have used, and offer higher than normal current.

Quote
So, even if I use a laptop/PC I would neeed a microcontroller.

You could also make the microcontroller wirelessly controlled by a PC. So the robot gets the brains of a PC without having to lug it around.

Here is a thread that might help for that:
http://www.societyofrobots.com/robotforum/index.php?topic=104.0

I am currently designing a wireless robot microcontroller setup, and will post all details (schematic, code, parts list, etc) when I finish it . . . another 2+ months probably . . .
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: Nyx on July 31, 2006, 05:08:30 PM
The highlighted part is what I'm interested in. You'll have to excuse my ignorance, but could you spell out how such a system would work and cost.  I've been searching for the last week to find details of this and found very little useful info strangely. ... Holonomic symmetrix robots are always easier!

Well, the USB/parallel converter cable is because my laptop has no parallel port... So it's basically an extra parallel port for your computer that hooks to a USB port. The parallel port has 8 data pins which can all be set on and off individually. This procudes some currents (3 to 5 volts at something around 200ma I believe). This can be used to drive a triac/relay circuit. Basically, the point is that flipping one of those bits (and leaving them on or off) on can drive a relay on and off, which can switch on or off the power to a powerful motor with some fixed voltage/current.

I will keep things simple and drive the motors directly off the 12V battery, through the relay. Basically, I will use four relays (one for each rotational direction of the motor, wired so that they can't both let current flow at the same time to avoid shorts). It's possible to make this circuit more sophisticated by adding voltage regulators, and perhaps using more relays to provide the motor less power (eg: use 4 more relays to do the same but with 6 volts only, allowing your robot to move or rotate at a lower speed if necessary).

But you don't even have to build this kind of parallel port relay circuitry yourself if you don't want to, some people have already done the job:

http://www.electronickits.com/kit/complete/elec/ck1601.htm

Some more expensive USB versions with more outputs and some inputs are also available:

http://www.phidgets.com/index.php?module=pncommerce&func=itemview&KID=115439026165.92.156.50&IID=57

Parallel port pinout with the 8 data pins data 0 to data 7:

http://www.diyha.co.uk/electronics/parallel.html
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: timstirling on August 01, 2006, 12:17:59 PM
Typically any robot would cost an unavoidable MINIMUM of $100 . . . mine usually cost $400-ish . . .

And wood sucks, use HDPE!
http://www.societyofrobots.com/materials_hdpe.shtml

Quote
Yeah, my main intention is to use computer vision and run algorithms such as neuro SLAM for naviagtion/mapping etc. and using neuro-controller evolved through genetic algorithms as the control software, and then experimenting with artificial life.

Yea, a microcontroller is out of the question for that.


Quote
Can you provide any more info/links on the motor driver IC? That would be very helpful.

Go to digikey.com and search for LMD FET. There are many types of motor driver IC's out there, they are extremely common. These in particular I have used, and offer higher than normal current.

Quote
So, even if I use a laptop/PC I would neeed a microcontroller.

You could also make the microcontroller wirelessly controlled by a PC. So the robot gets the brains of a PC without having to lug it around.

Here is a thread that might help for that:
http://www.societyofrobots.com/robotforum/index.php?topic=104.0

I am currently designing a wireless robot microcontroller setup, and will post all details (schematic, code, parts list, etc) when I finish it . . . another 2+ months probably . . .


cheers. Nice to know there are cheaper motor drivers out there. I'm just struggling to find  a source of them in the Uk. I can only find more expensive motor drivers, cheapest I can find is this: http://www.active-robots.com/products/motorcon/mmc-details-1.shtml , which is designed for higher power motors but would be useful for when I build a larger robot carrying a laptop around. I'll need to start asking around UK forums for suppliers.

Wirelessly controlled would be cool, but wouldn't be autonomous. Good for debug purposes though. 
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: timstirling on August 01, 2006, 12:54:53 PM
The highlighted part is what I'm interested in. You'll have to excuse my ignorance, but could you spell out how such a system would work and cost.  I've been searching for the last week to find details of this and found very little useful info strangely. ... Holonomic symmetrix robots are always easier!

Well, the USB/parallel converter cable is because my laptop has no parallel port... So it's basically an extra parallel port for your computer that hooks to a USB port. The parallel port has 8 data pins which can all be set on and off individually. This procudes some currents (3 to 5 volts at something around 200ma I believe). This can be used to drive a triac/relay circuit. Basically, the point is that flipping one of those bits (and leaving them on or off) on can drive a relay on and off, which can switch on or off the power to a powerful motor with some fixed voltage/current.

I will keep things simple and drive the motors directly off the 12V battery, through the relay. Basically, I will use four relays (one for each rotational direction of the motor, wired so that they can't both let current flow at the same time to avoid shorts). It's possible to make this circuit more sophisticated by adding voltage regulators, and perhaps using more relays to provide the motor less power (eg: use 4 more relays to do the same but with 6 volts only, allowing your robot to move or rotate at a lower speed if necessary).

But you don't even have to build this kind of parallel port relay circuitry yourself if you don't want to, some people have already done the job:

http://www.electronickits.com/kit/complete/elec/ck1601.htm

Some more expensive USB versions with more outputs and some inputs are also available:

http://www.phidgets.com/index.php?module=pncommerce&func=itemview&KID=115439026165.92.156.50&IID=57

Parallel port pinout with the 8 data pins data 0 to data 7:

http://www.diyha.co.uk/electronics/parallel.html


Ok, that great. You basically end up with 8 controllable switches, which switch the relays turning motors on/off. This will definitely be a cheap method to get things up and running. Draw back of course is that there is no input, which isn't a problem if you are solely using a vision system.

Which brings me to the USB version, 16 inputs and 16 outputs. However, the inputs are digital so analogue LDRs/IRs etc wont be possible. Then again, with the vision system i would probably only want whisker/bump sensors, and some switches. I notice there is an 8/8/8 version with 8 analogue inputs. Sounds great, but these things are quite pricy, very poor exhange rate it seems, costing around £80 in the UK. Infact it seems theres lots of nice phidget stuff, sensors, motor and servo controllers etc., - they all have a not so nice price. But would be an easy solution if one had the money.  Would be cheaper to use a microcontroller and interface the laptop with the microcontroller and the microcontroller to sensors/motor driver.


Which brings me to the question of microontollers again. Anyone know much about the Mr-162 powered by the Atmega162 (Atmel AVR series). My research indicates its fairly powerful (because it is an efficient RISC CPU which performs 1 instruction per clock tick). Seems fairly popular. Can program it in C, has a free C compiler. Maybe not the fastest but more than enough if I'm having a dedicated laptop for the grunt work.
 I have a feeling through that I can't connect a laptop to it while running for I/O purposes, making it somewhat useless for my requirements.
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: Nyx on August 01, 2006, 03:53:43 PM
Surprises me that you can't get it for less than 80 pounds. The site I showed you says 100$ CAN for the 0/16/16... That's about 48 pounds.
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: dunk on August 01, 2006, 05:33:12 PM
hey timstirling,
so the PC parallel port can handle inputs as well as outputs.
some pins are outputs. some inputs and some bi-directional.
http://www.tldp.org/HOWTO/Coffee-3.html

so if you are looking at programming a microcontroller and connecting that to your laptop to handle IO you have a few options.
were you were asking if an AVR can communicate with a PC while running it's program or if that Mr-162 board can do it?
an AVR definitely can and i'd be surprised if a board built using one couldn't. it's all down to how you program the AVR.

most of the AVR range has analogue input pins as well as digital but if you end up with a controller without analogue input A/D (analogue to digital) converter chips are relatively straight forward to use. they do use up a lot of input pins though.

here's a link explaining how to connect an AVR directly to the PC serial port.
significantly cheaper than £80 but possibly a steeper learning curve:
http://homepage.hispeed.ch/peterfleury/avr-uart.html
i've used this method with great success with PIC microcontrollers but i'm new to AVRs so couldn't comment on how easily you can make them play with the serial port.

and since you mention USB controllers, here's a link to a project i'm just about to start working on for my own bot:
http://www.obdev.at/products/avrusb/index.html
again, all the components are far cheaper than any of the premade controllers you can buy.
i'll let you know how it goes when i get time to start building.

dunk
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: timstirling on August 02, 2006, 03:04:16 AM
Surprises me that you can't get it for less than 80 pounds. The site I showed you says 100$ CAN for the 0/16/16... That's about 48 pounds.

That surprised me as well, the UK really is a rip-off country though.
What you pay in dollars we have to pay in pounds, e.g. a $29 motor in the US sells for 29 pounds here..., $50 STAMP controller sells for 50 pounds... your $1000 computers sell for 1000 pounds.... so much for the 1.8 dollar->pound exchange rate!

heres the prices.
http://www.active-robots.com/products/phidgets/phidgets-interface.shtml
Title: Re: RC car->robot mini project: motor/micro controller?
Post by: robotvisionary on July 08, 2007, 08:20:03 AM
Typically any robot would cost an unavoidable MINIMUM of $100 . . . mine usually cost $400-ish . . .

And wood sucks, use HDPE!
http://www.societyofrobots.com/materials_hdpe.shtml

Quote
Yeah, my main intention is to use computer vision and run algorithms such as neuro SLAM for naviagtion/mapping etc. and using neuro-controller evolved through genetic algorithms as the control software, and then experimenting with artificial life.

Yea, a microcontroller is out of the question for that.


Quote
Can you provide any more info/links on the motor driver IC? That would be very helpful.

Go to digikey.com and search for LMD FET. There are many types of motor driver IC's out there, they are extremely common. These in particular I have used, and offer higher than normal current.

Quote
So, even if I use a laptop/PC I would neeed a microcontroller.

You could also make the microcontroller wirelessly controlled by a PC. So the robot gets the brains of a PC without having to lug it around.

Here is a thread that might help for that:
http://www.societyofrobots.com/robotforum/index.php?topic=104.0

I am currently designing a wireless robot microcontroller setup, and will post all details (schematic, code, parts list, etc) when I finish it . . . another 2+ months probably . . .

Can you get that in Puerto Rico?