Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: vivek9856 on January 12, 2008, 10:06:01 PM

Title: Distance Travelling Robot
Post by: vivek9856 on January 12, 2008, 10:06:01 PM
I need to build a robot that simply drives in a straight line and has an LCD screen on it with a few buttons. I need it to be able to do the following:

I type in a distance in centimeters
It gives me an estimated time to travel that distance
I click a button, it starts a timer, and it travels strait (no turns) for the entered distance, and is very accurate with that distance.
When it reaches the entered distance, the timer stops, and it displays the time taken on the screen.

I need some information as to how I should start to accomplish this. I am thinking about one of the Orangutan controllers
http://www.pololu.com/products/pololu/0225/
http://www.pololu.com/products/pololu/0775/
http://www.pololu.com/products/pololu/0715/

with either 1) some motors and encoders to determine distance traveled, or 2) stepper motors and encoders (just to be reallly accurate), or 3) just some stepper motors.

My questions are:
1) What method will result in the most accurate distance traveled? 1, 2, or 3? Why? Any other more accurate solutions?
2) Can I do a timer thing with the Orangutan controller? How? Plug a button into an IO port, that when clicked, starts the robot and timer, and program it to stop the timer when programming it?
3) Which version controller is best for me?
4) I can program the distance into the controller how, as I need to be able to change the distance on the fly.
5) Are there any other better controllers?

Note: I don't wanna spend more than $100

Thanks,
Vivek
Title: Re: Distance Travelling Robot
Post by: robonoob on January 13, 2008, 10:13:28 AM
first of all i personally would recommend the stepper motors and encoders cuz this way you can be really sure it traveled the distance u asked it to travel cuz you can measure the distance with encoders and the stepper motor steps(as far as i know)
second: the first two controllers have a built-in LCD so i assume that you could do the button thing( i mean i cant see why not?) all of these three controllers also have user buttons so u don't need to install them manually too.
third: i would buy this controller:http: //www.pololu.com/products/pololu/0775/ cuz it has motor outputs built in.
fourth: i think you should white a programme that calculates your entered centimeters into encoder clicks and then motors run until the amount of clicks are done(also i would recommend you to make the robot run very very slowly cuz then i will be much more accurate)

hope that helped :)
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 13, 2008, 01:06:00 PM
Thanks for the reply.

1) Should I use stepper motors or continuous servos? Which do you reccomend?
2) I am now debating whether to use the Orangutan, or get an OOPic controller and wire an LCD onto that
3) The Orangutan can be programmed using VB, like the OOPic's can, right?
4) How would I make a timer setup with either an OOPic or Orangutan (Pick the one you would use, and briefly tell me how I would go about doing it)

So, tell me if this would work:

Orangutan controller with stepper motor and encoder:

Input the distance into the controller through the three built in buttons.
Have it convert this distance into required encoder clicks.
Convert this into required number of motor pulses.
Have it wait for my start command.
I click a separate button wired to an I/O port.
A timer begins on the LCD
It travels the entered distance. The robot stops when the encoder clicks have been reached.
Timer stops when distance is achieved, and displays time taken on LCD screen.
I hit a button, and it calculates a ratio of time to distance traveled and displays this number on the LCD.

Is this possible? And, can it be done in VB, as thats the only language I am sorta comfortable with.
Title: Re: Distance Travelling Robot
Post by: cooldog on January 13, 2008, 01:35:14 PM
to make prograing easyer make your wheels small enough so that 30 encoder clicks equals 30 centemeters and so on
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 13, 2008, 02:04:57 PM
to make prograing easyer make your wheels small enough so that 30 encoder clicks equals 30 centemeters and so on

Yeah, but what controller should I use? Orangutan or OOPic?
Title: Re: Distance Travelling Robot
Post by: robonoob on January 13, 2008, 02:14:12 PM
to make prograing easyer make your wheels small enough so that 30 encoder clicks equals 30 centemeters and so on
yea this really is simpler BUT its a lot less accurate :) so i would recommend atleast 2 clicks for a cm
but if u are only going to enter full numbers like 10 ; 20 ; 30 etc and not numbers with commas like 3,5 ; 72,9 etc then this 1-click-per-cs may actually work :)
Title: Re: Distance Travelling Robot
Post by: Admin on January 13, 2008, 06:22:57 PM
these tutorials might help you:
http://www.societyofrobots.com/sensors_encoder.shtml
http://www.societyofrobots.com/actuators_steppers.shtml
http://www.societyofrobots.com/robot_faq.shtml#best_microcontroller


note that using an encoder with a stepper motor doesn't make sense :P
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 15, 2008, 09:36:22 PM
So, I decided I will use steppers and a controller. But deciding on the controller still:

I realized that if I get an OOPic, I would need to get an LCD screen and make a motor driver circuit. The LCD would have to be parallel because of the price of serial LCDs, and the driving circuit would be extra work.

So I may just get an Orangutan. However, I don't know C very well. Can the Orangutan be programmed in VBasic?

And if I get an Orangutan (LV-168), I get a build in LCD and motor driver. However, would it be possible for me to change out the LCD? Possibly put a 4x20 on it?
Title: Re: Distance Travelling Robot
Post by: airman00 on January 16, 2008, 06:12:32 AM
it depends...

if the LCD works with a one wire serial interface  then you probably could switch it out with a bigger one with serial interface ( as long as they both take the same power , which they probably do)

If it is not a one wire serial interface it gets more difficult


alternatively you could just connect a serial LCD to one of the I/O pins and control it from there
Title: Re: Distance Travelling Robot
Post by: Admin on January 20, 2008, 09:16:34 PM
Quote
Can the Orangutan be programmed in VBasic?
nope. you should learn C, its *the* language to use for robots . . .

Quote
And if I get an Orangutan (LV-168), I get a build in LCD and motor driver. However, would it be possible for me to change out the LCD? Possibly put a 4x20 on it?
yeap, but you'd probably have to rewire the pins . . . check datasheets
Title: Re: Distance Travelling Robot
Post by: airman00 on January 20, 2008, 09:21:17 PM
Quote
Can the Orangutan be programmed in VBasic?
nope. you should learn C, its *the* language to use for robots . . .



I agree that C is an essential language. I myself am starting to learn  to program in C for PICs . You can get around in BASIC with microcontrollers fine, but you would need to know ASM(assembly)  to have complete control of the mcu . Either learn BASIC and ASM together or just C  .

P.S. Assembly is the biggest pain in the butt language to learn, even though it was my first. 
Assembly language programmers will get the following joke

MOVLW  headache
MOVWF Your Head
Title: Re: Distance Travelling Robot
Post by: SmAsH on January 20, 2008, 09:23:22 PM
this should help with the c thing.... i found it moderatley easy to learn basics. http://www.google.com.au/search?hl=en&q=learn+c+programing+launguage&meta= lol i dont get it ;D
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 21, 2008, 05:49:52 PM
I guess I'll have to get around to C.

Any thoughts on possibly using a Basic Stamp to do this? Or is that too minimalistic?
Title: Re: Distance Travelling Robot
Post by: airman00 on January 21, 2008, 06:13:01 PM
this should help with the c thing.... i found it moderatley easy to learn basics. http://www.google.com.au/search?hl=en&q=learn+c+programing+launguage&meta= lol i dont get it ;D
what programming language did you use on the MCU I saw on your website smash



@vivek9856 
you could probably use a BASIC stamp. First make a list in this form and then Ill get back to you
Here is a sample list
1. LCD
2. two motors
3. 10 buttons???

like that then we'll help you better
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 21, 2008, 09:03:37 PM
this should help with the c thing.... i found it moderatley easy to learn basics. http://www.google.com.au/search?hl=en&q=learn+c+programing+launguage&meta= lol i dont get it ;D
what programming language did you use on the MCU I saw on your website smash



@vivek9856 
you could probably use a BASIC stamp. First make a list in this form and then Ill get back to you
Here is a sample list
1. LCD
2. two motors
3. 10 buttons???

like that then we'll help you better

Alright. Heres my list:

1. One LCD (Preferably 4x20, and Parallel because they are cheaper)
2. Two stepper motors
3. Some button form of input (I need to be able to enter a distance travelled. I'll describe this below)
4. Two wheel encoders

About the buttons: I could use a 10 button keypad to enter a distance, or use two buttons (One to adjust the cursor position, one to change the value. Eg: Select hundreds place w/ button 1, press button 2 five times to set digit to 5, click  button one to move cursor to tenths position, etc). Also, I would need one button to start the robot.

I want stepper motors and encoders because I want to take into account possible skidding of the stepper motors.

Thanks for helping me airman.
Title: Re: Distance Travelling Robot
Post by: airman00 on January 21, 2008, 09:32:23 PM
ok  vivek9856   you only need 13 I/O pins on your microcontroller

1. SERIAL LCD   - this allows one wire interface and its easier to control
2.  Stepper motor #1
3. Stepper motor #2
4. button #1
5. button #2
6. button #3
7. button #4
8. button #5
9. button #6
10. button #7
11. button #8
12. button #9
13. button #10  ( p.s. i copied and pasted those button #1 , #2 , etc.   :D )

You don't need encoder really for stepper motors , since you are controlling the number of steps directly. And since  you know the amount of distance traveled for each step, you can just add it up.  OK so you can say that maybe the stepper motor got stuck and didnt move, and the microcontroller added up an extra step! Well in that case where you feel your robot will get its wheels stuck on something ,then you would need an encoder . But I doubt your robot's wheels will get stuck at all , so just use steppers.


Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 21, 2008, 09:49:41 PM
Alright. No encoders. But I have to use a driver circuit to drive the steppers right? I can't directly plug them into a Basic Stamp I/O port, can I?

And could I use a parallel LCD? How? Or is it not possible? I am asking because Serial LCDs are a tad bit out of my budget, but if it makes a big difference, I could get one.
Title: Re: Distance Travelling Robot
Post by: airman00 on January 21, 2008, 09:56:36 PM
you have to control stepper motors with a special controller , such as this http://hobby_elec.piclist.com/e_step.htm (http://hobby_elec.piclist.com/e_step.htm)

also, you could use whatever LCD you want, as long as you have enough leftover pins to do it . I would buy serial since its easy to interface, and I bought one LCD a while ago and reuse it so much times, just one wire and one pin , interface the LCD in less than a minute
 

Have you ever used parallel LCDs?
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 26, 2008, 10:09:38 PM
Okay. I am just going to go with an Orangutan because its easy because of its integrated LCD.

My one question: How would I drive stepper motors from an Orangutan? Connect a stepper motor controller like the one in the above post, and plug that into an I/O port of the Orangutan?
Title: Re: Distance Travelling Robot
Post by: airman00 on January 26, 2008, 10:24:51 PM
yea, but it depends on which controller you get
Title: Re: Distance Travelling Robot
Post by: Ro-Bot-X on January 27, 2008, 02:18:32 AM
I am sorry I didn't cach this thread before, I have some info to share.

Orangutan is based on ATmega168 (have the LV variant for 3-4 NiMh batteries). That means it can be programmed easy with Bascom-AVR or Arduino software. It does not have a special UART connector, so you have to use it from the general I/O pins. A RS232->TTL adapter have to be used if you want to program directly from Arduino, but it is not required, since you can develop the code, compile it and upload using the USB programmer.

You can use the (both) onboard motor connectors to power ONE bipolar stepper. You will need an other H-bridge to power the second bipolar stepper. You can use 2 SN754410 stacked one on top of the other to get 2 amps per stepper coil, similar with what the Orangutan H-bridge offers. In software, you need to make functions (or subroutines) that will generate the corect clockwise and counterclockwise stepper sequence. I believe Arduino has a library to drive steppers.

You can use the 3 user push buttons to input your distance, however they are tied in paralel with some LCD pins. This means that some LCD segments will flicker during the actual push of the buttons. If you think is not desirable, you can look into hoocking a 3x3+1 keypad (not sure if there are enough free pins on Orangutan).

Good luck with your project!
Title: Re: Distance Travelling Robot
Post by: paulstreats on January 27, 2008, 06:37:57 AM
Also if you use a keypad with 0-9 and * and # on it, then you wont have to use an individual pin for each button since they are matriced. You could use * for moving the cursor then the numbers for distance then the # for enter or go.

You could try to build your own stepper motor driver, the commercial ones are quite expensive
Title: Re: Distance Travelling Robot
Post by: vivek9856 on January 31, 2008, 06:18:49 PM
Okay.

So, I got an OOPic controller.

I have a question about motor drivers for driving stepper motors.

Could I just buy two of these http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=403-1009-ND

and

to control these motors,

two of these http://www.sparkfun.com/commerce/product_info.php?products_id=8368#

I had come across this http://www.seattlerobotics.org/encoder/200108/jlgirard.html , but it seems kinda sketchy. Any opinions?
Title: Re: Distance Travelling Robot
Post by: Admin on February 04, 2008, 10:44:36 PM
yes