Go to Post Ya know...sometimes, design specs get changed at the last second. Or the market changes while you weren't watching. It Happens. - DonRotolo [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 26-01-2004, 12:48
hobbes hobbes is offline
Registered User
#0058
 
Join Date: Oct 2003
Location: South Portland, Maine
Posts: 8
hobbes is an unknown quantity at this point
Autonomous help please

Following all the information I can find, it appears that having the robot execute something in autonomous mode is as simple as placing the code, such as pwm01 = 200; into the autonomous portion of the default code (where it indicates, place autonomous code here) in fast user routines. My team has a dongle built up to switch the robot between user and autonomous mode (I know this switch works as indicated by a blinking disable light on the operator interface). I have written small changes to the default code and successufully uploaded them to the robot, so no problems getting the code to the robot. All I was trying to do is confirm some kind of autonomous operation of the robot, such as: pwm01=pwm02=200; but I got nothing . Any help anyone can provide would be greatly appreciated. I did search the forums, but could not find anyone else having similar problems.

Thanks
~David
  #2   Spotlight this post!  
Unread 27-01-2004, 12:18
hobbes hobbes is offline
Registered User
#0058
 
Join Date: Oct 2003
Location: South Portland, Maine
Posts: 8
hobbes is an unknown quantity at this point
Re: Autonomous help please

up
  #3   Spotlight this post!  
Unread 27-01-2004, 12:22
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Re: Autonomous help please

Could you post what your code says in user_routines? My guess is that you have something located in the wrong place. Have you tried using debug statements to print the current values of those PWMs on the output screen, and/or used the Dashboard viewer? If you post the code I'd know more about what your problem is.
__________________
Chopsaw? Chopsaw.
  #4   Spotlight this post!  
Unread 27-01-2004, 13:45
hobbes hobbes is offline
Registered User
#0058
 
Join Date: Oct 2003
Location: South Portland, Maine
Posts: 8
hobbes is an unknown quantity at this point
Re: Autonomous help please

There is really no code to show. In the user routines fast, there is a statement to put your autonomous code here. I place pwm## = 200;. I load the code into the robot. I put the robot into autonomous mode (using the switch built up as instructed, and it does work) and nothing happens (i.e. the motors programmed to drive forward do nothing). Im just at a loss, as to why the autonomous code does not execute.
  #5   Spotlight this post!  
Unread 27-01-2004, 13:51
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Autonomous help please

Quote:
Originally Posted by hobbes
There is really no code to show. In the user routines fast, there is a statement to put your autonomous code here. I place pwm## = 200;. I load the code into the robot. I put the robot into autonomous mode (using the switch built up as instructed, and it does work) and nothing happens (i.e. the motors programmed to drive forward do nothing). Im just at a loss, as to why the autonomous code does not execute.
I suppose it sounds obvious ... but are you sure you have the motors hooked up to pwm##? Try putting that same code in the Default_Routine function in user_routines.c, and see if it works without messing with autonomous mode. And still, it might be worthwhile to see the exact code you have ... I know from experience, that it is easy to overlook something simple if you aren't looking specifically for it.
  #6   Spotlight this post!  
Unread 27-01-2004, 13:59
hobbes hobbes is offline
Registered User
#0058
 
Join Date: Oct 2003
Location: South Portland, Maine
Posts: 8
hobbes is an unknown quantity at this point
Re: Autonomous help please

from user_routines.c (this is just the default 1 stick drive) we have our base built and are currently driving it around, so I know the PWMs are hooked up accordingly.

pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);


from user_routines_fast.c:

void User_Autonomous_Code(void)
{
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Add your own autonomous code here. */
pwm13 = pwm14 = 200;
pwm15 = pwm16 = 200;

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}

you can see from above, all I did was tell the robot to drive foward if in autonomous, but nothing happened . Thanks for any help you can provide. Has anyone else had this problem?

~David
  #7   Spotlight this post!  
Unread 27-01-2004, 14:04
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Autonomous help please

Quote:
Originally Posted by hobbes
There is really no code to show. In the user routines fast, there is a statement to put your autonomous code here. I place pwm## = 200;. I load the code into the robot. I put the robot into autonomous mode (using the switch built up as instructed, and it does work) and nothing happens (i.e. the motors programmed to drive forward do nothing). Im just at a loss, as to why the autonomous code does not execute.
Are you sure the robot is in autonomous mode and isn't disabled? The RC LED should be yellow and blinking. I know you said it blinks, just making sure its yellow. Which PWMs are you using?

In User_Autonomous_Code() they left out a call to Generate_Pwms(). That function sets the outputs for pwm13 - 16. If you're using one of those outputs then the value you set isn't getting sent to the motor. Insert the line "Generate_Pwms(pwm13,pwm14,pwm15,pwm16);" right before
"Putdata(&txdata);" in User_Autonomous_Code().

If that doesn't work, try putting a printf() in User_Autonomous_Code() to make sure that function is being executed.
  #8   Spotlight this post!  
Unread 27-01-2004, 14:08
hobbes hobbes is offline
Registered User
#0058
 
Join Date: Oct 2003
Location: South Portland, Maine
Posts: 8
hobbes is an unknown quantity at this point
Re: Autonomous help please

Quote:
Originally Posted by seanwitte
Are you sure the robot is in autonomous mode and isn't disabled? The RC LED should be yellow and blinking. I know you said it blinks, just making sure its yellow. Which PWMs are you using?

In User_Autonomous_Code() they left out a call to Generate_Pwms(). That function sets the outputs for pwm13 - 16. If you're using one of those outputs then the value you set isn't getting sent to the motor. Insert the line "Generate_Pwms(pwm13,pwm14,pwm15,pwm16);" right before
"Putdata(&txdata);" in User_Autonomous_Code().

If that doesn't work, try putting a printf() in User_Autonomous_Code() to make sure that function is being executed.

I think you nailed it Sean, thanks. The blinking light is yellow. I wasn't aware of the Generate_Pwm() function. I will give that a try. Thanks.
~David
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
A better autonomous method.. randomperson Programming 4 24-02-2004 18:02
crazy idea for autonomous Mike Ciance Programming 16 24-04-2003 21:50
autonomous location manodrum Programming 4 02-04-2003 08:05
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Kill Switch UCGL_Guy Programming 8 15-01-2003 17:39


All times are GMT -5. The time now is 09:34.

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