Go to Post Swisscheeseafy - Cutting holes in the robot to decrease weight - alithanar8 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2007, 18:50
waiakea2024's Avatar
waiakea2024 waiakea2024 is offline
ZOMGWTHKTHXBAIBBQ!!!!
FRC #1056 (Kekoa o Haaheo)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hawaii
Posts: 122
waiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the rough
Delay Help!

We have been working on our autonomous mode and we cant figure out how to make a delay. Our mentor has tried to make his own but the bot wont recive it. Any Suggestions or ideas? Thanks!

Last edited by waiakea2024 : 19-02-2007 at 19:06.
  #2   Spotlight this post!  
Unread 19-02-2007, 18:59
waiakea2024's Avatar
waiakea2024 waiakea2024 is offline
ZOMGWTHKTHXBAIBBQ!!!!
FRC #1056 (Kekoa o Haaheo)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hawaii
Posts: 122
waiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the rough
Re: Delay Help!

We are trying to make our arm move and then stop without it hitting the ground and messing up the motor.
  #3   Spotlight this post!  
Unread 19-02-2007, 19:18
Ari Allyn-Feuer Ari Allyn-Feuer is offline
Registered User
FRC #0753
 
Join Date: Feb 2006
Location: Bend, OR
Posts: 22
Ari Allyn-Feuer is on a distinguished road
Re: Delay Help!

Quote:
Originally Posted by waiakea2024 View Post
We have been working on our autonomous mode and we cant figure out how to make a delay. Our mentor has tried to make his own but the bot wont recive it. Any Suggestions or ideas? Thanks!
I would like to say that FFR, the real best way to do this is to have a quadrature encoder on the arm. But let's do it your way since that's the hardware!

Basically to make a delay, without going into using the onboard timers, is to increment a loop counter every loop and have a test statement which will do something when a certain number of loops has elapsed.

Pseudocode:

if(arm_is_moving && loops < NEEDED_LOOPS)
{
loops++;
}

if(arm_is_moving && loops = NEEDED_LOOPS)
{
arm_pwm=127;
arm_is_moving=0;
loops=0;
}

This is quick and ugly, and it would be more elegant to use the timers or have an encoder. But it'll work in a pinch.

I hope this helps. If we see each other at a regional I can help you some more, or post again or use a PM.

Ari.
  #4   Spotlight this post!  
Unread 19-02-2007, 21:58
waiakea2024's Avatar
waiakea2024 waiakea2024 is offline
ZOMGWTHKTHXBAIBBQ!!!!
FRC #1056 (Kekoa o Haaheo)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hawaii
Posts: 122
waiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the rough
Re: Delay Help!

that didnt work :l thanks for the help though
  #5   Spotlight this post!  
Unread 19-02-2007, 22:49
buddy.smith buddy.smith is offline
Master Control
FRC #1795
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: atlanta
Posts: 20
buddy.smith is an unknown quantity at this point
Re: Delay Help!

Well if you copied and pasted his code, then you should change the '=' to '=='

Also 'loops' will need to be static

ttyl,

--buddy
  #6   Spotlight this post!  
Unread 20-02-2007, 00:04
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Delay Help!

Quote:
Originally Posted by waiakea2024 View Post
We are trying to make our arm move and then stop without it hitting the ground and messing up the motor.
This is where a limit (either a software one from a shaft encoder or potentiometer) is good. Otherwise, if you really want a delay, let us know (there are several ways of doing this, ranging from crude (loop counting) to good (setting up a timer and interrupt routine to get real-time clocks)
  #7   Spotlight this post!  
Unread 20-02-2007, 12:47
waiakea2024's Avatar
waiakea2024 waiakea2024 is offline
ZOMGWTHKTHXBAIBBQ!!!!
FRC #1056 (Kekoa o Haaheo)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hawaii
Posts: 122
waiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the rough
Re: Delay Help!

well we just downloaded the WPILib and are currently trying to get it to download into our controller. Thanks to all for your advice. We have been trying many different things and we have officially run out of ideas. We are currently waiting for our mentor to see if he has any new ideas.
  #8   Spotlight this post!  
Unread 21-02-2007, 12:41
waiakea2024's Avatar
waiakea2024 waiakea2024 is offline
ZOMGWTHKTHXBAIBBQ!!!!
FRC #1056 (Kekoa o Haaheo)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hawaii
Posts: 122
waiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the roughwaiakea2024 is a jewel in the rough
Re: Delay Help!

Thanks to everyone for the help and expertice. We finally got it and we are well on our way. Thanks again!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NERDS Delay... Andy Grady General Forum 21 14-03-2006 21:52
CMUCam 3 second startup Delay? Chris_Elston Programming 4 19-02-2006 09:33
Delay in autonomous mode SpeakerSilenced Programming 1 22-02-2005 10:58
Delay Gal Longin Programming 1 09-12-2004 10:37
NEED HELP with Delay loop for compressor relay switch archiver 2001 10 24-06-2002 02:11


All times are GMT -5. The time now is 00:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi