Society of Robots - Robot Forum

Software => Software => Topic started by: SciOlyStudent on January 29, 2008, 04:15:59 PM

Title: Simple programming help
Post by: SciOlyStudent on January 29, 2008, 04:15:59 PM
I need to program a robot to move forward for a certain amount of time and then stop.  I was thinking I could take the 50$ robot program and just delete everything, then putting in for it to move straight and then delay a certain amount of time.  I have no programming experience whatsoever.  Can someone fill in the blanks for me?
Title: Re: Simple programming help
Post by: benji on January 29, 2008, 05:21:28 PM
Quote
I need to program a robot to move forward for a certain amount of time and then stop

1/turn motors on
2/delay
3/motors off(you can give it a reverse voltage if its dc motor for a short amount of time as a break)
Title: Re: Simple programming help
Post by: SciOlyStudent on January 29, 2008, 05:22:36 PM
Sorry, I forgot to say I was using servos... what command would I give the microcontroller to make the servos stop?
Title: Re: Simple programming help
Post by: benji on January 29, 2008, 05:27:24 PM
you just tell e servo to go to a specific angle, and when its there it stops, did you modify ur sercos to make full turns?
Title: Re: Simple programming help
Post by: SciOlyStudent on January 29, 2008, 05:54:14 PM
I did modify the servos for full rotations.  Now I have another problem... when I try to write the program I substituted for the photovore program, it wouldn't write... It says the device is missing or there is an unknown device.  Any solutions?
Title: Re: Simple programming help
Post by: ed1380 on January 29, 2008, 06:10:44 PM
search. million threads with the same question
Title: Re: Simple programming help
Post by: cooldog on January 29, 2008, 08:47:01 PM
won't you need encoders
Title: Re: Simple programming help
Post by: Trumpkin on January 30, 2008, 11:30:43 AM
how do you turn servos off?
Title: Re: Simple programming help
Post by: ed1380 on January 30, 2008, 02:42:35 PM
stop sending the pulse (http://i43.photobucket.com/albums/e398/RussianCommy/smilies/eyes.gif)
Title: Re: Simple programming help
Post by: Trumpkin on January 30, 2008, 02:43:41 PM
lol ok, thx
Title: Re: Simple programming help
Post by: SciOlyStudent on January 30, 2008, 04:49:17 PM
won't you need encoders


At first, I thought so too, but I'm going to run tests to see how long it takes the robot to travel a distance and then just make the program delay that long and then stop the servos
Title: Re: Simple programming help
Post by: airman00 on January 30, 2008, 06:46:42 PM
won't you need encoders


At first, I thought so too, but I'm going to run tests to see how long it takes the robot to travel a distance and then just make the program delay that long and then stop the servos

this might work  HOWEVER it will only be accurate if power to the servo is the same all the time , the same weight of robot , and the same surface.
Title: Re: Simple programming help
Post by: SciOlyStudent on January 30, 2008, 07:42:46 PM
this might work  HOWEVER it will only be accurate if power to the servo is the same all the time , the same weight of robot , and the same surface.

Hmmm... I've thought of the last two and they don't matter (always the same weight on a flat, smooth surface), but the power one concerns me... won't a servo run at the same speed you tell it to despite low battery power?
Title: Re: Simple programming help
Post by: airman00 on January 30, 2008, 07:48:47 PM
this might work  HOWEVER it will only be accurate if power to the servo is the same all the time , the same weight of robot , and the same surface.

Hmmm... I've thought of the last two and they don't matter (always the same weight on a flat, smooth surface), but the power one concerns me... won't a servo run at the same speed you tell it to despite low battery power?
well the servo will run slower with less power , im assuming since it is a DC motor inside

maybe this calls for a switching regulator for each servo?
Title: Re: Simple programming help
Post by: SciOlyStudent on January 30, 2008, 07:53:15 PM
At any rate, all I have to do is run the tests for my robot with fully charged batteries, the same for the competition.  It only has to go a maximum of 10 meters...
Title: Re: Simple programming help
Post by: airman00 on January 30, 2008, 09:22:06 PM
At any rate, all I have to do is run the tests for my robot with fully charged batteries, the same for the competition.  It only has to go a maximum of 10 meters...

ok but make sure the batteries are fully charged when you test it and after each run


if you use a voltage regulator ( a switching one, not a regulated one) then you can regulate the amount of voltage that they draw

use one regulator per servo .
Also, what is the voltage all the batteries, how many AAs or whatever battery you are using?
Title: Re: Simple programming help
Post by: SciOlyStudent on January 31, 2008, 05:07:14 PM

ok but make sure the batteries are fully charged when you test it and after each run


if you use a voltage regulator ( a switching one, not a regulated one) then you can regulate the amount of voltage that they draw

use one regulator per servo .
Also, what is the voltage all the batteries, how many AAs or whatever battery you are using?

Regular AAs... I know I know, its a waste but the competition limits me to using no more than 4 batteries at a maximum of 1.5V each... I would use NiMH except I couldn't find one with a voltage higher than 1.2V and I need 6V.
Title: Re: Simple programming help
Post by: ed1380 on January 31, 2008, 05:18:42 PM
rechargable AA are 1.2v  ;D