Society of Robots - Robot Forum

Mechanics and Construction => Mechanics and Construction => Topic started by: yettti on January 25, 2007, 01:40:02 PM

Title: Starting Out
Post by: yettti on January 25, 2007, 01:40:02 PM
I am planning to start out building robots and am a bit confused over something. I am basically trying to start out simple; i can already program in C and can solder ect. but i am baffled when it comes to motor control i have heard of d.c motor controller what is, is it needed or can i wire a motor directly into a micro controller? If anyone could help it would be greatly appreciated.

Thanks in advance  ;D
Title: Re: Starting Out
Post by: annoyin_kid on January 25, 2007, 04:23:43 PM
well i only started electronics last year and over the last month my understanding of electronics has grown rapidly through trial and error and just like you when my school holidays finished i too wanted to wire a motor to an ic and get it to work but i realised there was more to it than doing just that. normal ic dont give you enough juice to run the motor and you need to use a transistor to amplify the signal. just recently i modifyed my first servo (steering device) so it runs like a motor.

i use picaxe (basicly a special pic with a bootstrap pogramme). it is really easy to learn the language and apperantely it is similar to pic basic stamp and the programming software costs just... well... nothing!!! you just need to make a programming cable around ($5 max) get a bread board, one of those chips, download the software (it comes with extensive help pdfs and there is also a support forum if you need help with almost anything electronic). the ics are really cheap. goto, get a few 08m chips (i only have 1 08m chip  and get along fine) a few leds a few 22k, 10k, 390r resistors 1-3 peizos and 1-2 ldrs and have a read through the pdf help files and learn how to use them in a circuit. at school i made an alarm which is triggered by someone stepping on a floor mat with a piezo underneath it. then leds and a sound is given off and to turn it off you push a reset button. then when you are ready you can do infrared and more complicated stuff.

Title: Re: Starting Out
Post by: yettti on January 26, 2007, 02:18:18 AM
Yes so what your saying is that the power going through the microprocesser isn't enough to run the motor. so would it be possible to wire the processor into a relay which operated the motors as i am not too worried about variable speeds
Title: Re: Starting Out
Post by: JesseWelling on January 26, 2007, 03:22:35 AM
Generaly what you want is an H-bridge.

Then using that you produce a square wave at a certain frequency. so let's say you can switch the motor on or off 100 times a second. Then if you turn you motor on 50% of the second you will be giving it 50% of the that's like half throttle, but remember on a some cars just giving 10% gas won't make them go. Same applies for DC motors, there is some point which you have to go past for movement to happen.

So that was the simple version. What you really want to do is look at Pulse Width Modulation (PWM) as it relates to voltage.

Most uC should be able to do PWM but you will need to take a look at it's data sheet, and also look at your motor to see what PWM duty cycle works best.

Se also:
Title: Re: Starting Out
Post by: JesseWelling on January 26, 2007, 03:25:22 AM
so would it be possible to wire the processor into a relay which operated the motors as i am not too worried about variable speeds

sorry didn't read the whole thing....
Yes a relay would work but if you need both directions of spin you still need an h-bridge (requiring 4 relays).
If you only need one direction of spin one relay would suffice as well.
Title: Re: Starting Out
Post by: Admin on January 26, 2007, 07:46:50 AM
a microcontroller cant drive a relay either . . . so you would need a MOSFET between the relay and your microcontroller.

relays also have poor switching speeds, so should only be used for really high current stuff that you dont plan to PWM :P

i recommend just buying an H-bridge IC or motordriver . . .
Title: Re: Starting Out
Post by: annoyin_kid on January 26, 2007, 03:40:28 PM
mate just get a servo and modify it. i played around with motors for a month and i got pissed off in the end and just ended up getting a servo and modifying it. also a servo uses only one pin on a micro controller and it can go foreward, backward and go slow and fast and it is easy to mount. an h bridge would use 2 pins and you need to use mosfets and transistors and all this other crap.
Title: Re: Starting Out
Post by: yettti on January 29, 2007, 10:14:58 AM
after looking all this stuff I'm quite surprised to how much more there is two it thanks for all your help

ill probably use a bridge and buy it to run a motor as its cheaper than buying two servo`s
Title: Re: Starting Out
Post by: quincy_archer on February 03, 2007, 02:42:24 PM
I am starting school and I am going to take Computer and Electronic Engineering technilogy. I woud like to know if after I graduate, I would have ebough experience to build a robot, and if not, what do I need.
Title: Re: Starting Out
Post by: Steve Joblin on February 03, 2007, 03:02:13 PM
quincy... I graduated with a Business degree and work in the corporate world, yet I have learned to build a robot...

The three main diciplines are mechanical engineering, electical engineering, and programming.

For someone like myself, I am pretty handy and and mechanically oriented, so although I can't engineer bipedial walking gates (for example), I can figure out how how to mount a motor on a frame and compute how fast my robot will travel if I know the speed of my motor and the circumference of the wheels.

I stuck a few paper clips in an electrical outlet and learned the difference between volts, amps, and resistance pretty quickly (no, just kidding), but there are a million "tutorials" on electronics that one can find on the web (which I continue to find and study!)

I took a BASIC programming class in high school over 25 years ago, so although I still think that "java" is a cup of coffee, I can program Parallax Stamps and PICAXE micro controllers.