Go to Post oooo can i get bear hugged at monty madness...please big mike, please - Rohith Surampudi [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 29-11-2006, 23:45
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Auto Mode!!! WHOA...what tha?

OK guys ... i found out that ... if u do not redeclare all of ur inputs, outputs, and pwm values to neutral... they willl bounce from 0 to 254 in 0.0262 of a second.. contiuously!!!...WOW ... anyone .. noe why that is?? or is my robotic dieing on me :'(
  #2   Spotlight this post!  
Unread 29-11-2006, 23:53
Noah Kleinberg Noah Kleinberg is offline
Registered User
FRC #0395 (2TrainRobotics)
Team Role: Driver
 
Join Date: Jan 2006
Rookie Year: 2006
Location: New York
Posts: 196
Noah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to behold
Send a message via AIM to Noah Kleinberg
Re: Auto Mode!!! WHOA...what tha?

Sounds like it could be a problem with your code? It would help if you could post the code in case that's the problem. You should try (if you haven't yet) loading the default code and seeing if the same problem happens, and also if this is happening on all of the PWMs or just the ones hooked up to your motors (or however you noticed this problem). You should also try another controller with the same code if you have an extra one somewhere, and then you'll know if it's a hardware problem or a software problem.
  #3   Spotlight this post!  
Unread 30-11-2006, 00:42
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,307
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: Auto Mode!!! WHOA...what tha?

I thought not redeclaring them for automode just caused them to freeze in their current state?

Interesting.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present
  #4   Spotlight this post!  
Unread 30-11-2006, 08:52
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Auto Mode!!! WHOA...what tha?

Quote:
Originally Posted by teh_pwnerer795
OK guys ... i found out that ... if u do not redeclare all of ur inputs, outputs, and pwm values to neutral... they willl bounce from 0 to 254 in 0.0262 of a second.. contiuously!!!...WOW ... anyone .. noe why that is?? or is my robotic dieing on me :'(
Noah is right. It is something that you have done in your code. The default code does not do this.

Regards,

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #5   Spotlight this post!  
Unread 30-11-2006, 18:32
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Auto Mode!!! WHOA...what tha?

lol, hm.. there isnt any code to post... im using the oringal code.... i hooked up the robot motors to the pwm01 and others that were acting up... nottin happed.. but it shows values on the controller... hm so i guess it may be hardware issues.... it works when i declare them (the varibles) all over again like in the default_routine....but i just thought it was kind of strange ...
  #6   Spotlight this post!  
Unread 30-11-2006, 19:19
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Auto Mode!!! WHOA...what tha?

Are you sure you are using code straight off www.ifirobotics.com or kevin.org/frc?
  #7   Spotlight this post!  
Unread 01-12-2006, 02:25
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Auto Mode!!! WHOA...what tha?

NO!! hahaha no actaully u do have to redeclare all the relay's pwms, inputs and outputs... this is because the controller will just remember the last stated value it was just received.... the only reason why i think this is cuz ... when in auto mode.... the values are not declared..so they are unsigned.. when asigned they keep that value.... get it? lolololol ... finally it makes sense
  #8   Spotlight this post!  
Unread 01-12-2006, 08:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Auto Mode!!! WHOA...what tha?

I suppose it's good that it makes sense to you. You're certainly not making much sense to me. Can you help me figure out what you're talking about?

When you say "controller", what do you mean? The Robot Controller (RC)? A Victor Speed Controller? Something else?

When you say "declare", what do you mean? The word has a specific use in C programs, but that doesn't seem to match how you're using it.

When you say "unsigned", what do you mean?

For that matter, what do you mean by "noe" and "nottin" and "IoIoIoIoI" (or is that supposed to be "101010101")?
  #9   Spotlight this post!  
Unread 01-12-2006, 09:36
Andy Baker's Avatar Woodie Flowers Award
Andy Baker Andy Baker is offline
President, AndyMark, Inc.
FRC #3940 (CyberTooth)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Kokomo, Indiana
Posts: 3,421
Andy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond reputeAndy Baker has a reputation beyond repute
Send a message via AIM to Andy Baker
Re: Auto Mode!!! WHOA...what tha?

Quote:
Originally Posted by Adam Richards
Pay no attention to him. I suggest that the moderators lock this thread as well, since no good will come of it.
Nope, I disagree.

Looking at all 10 of teh_pwnerer795's posts tells me that this person is in the middle of a project. While they need to improve how they ask questions, I believe they are sincere.

Andy B.
  #10   Spotlight this post!  
Unread 01-12-2006, 12:48
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Auto Mode!!! WHOA...what tha?

Wow, ok lock this post?...maybe i got off on the wrong foot?, and again no i do not have an IQ of a rock. And im srry if i cannot ask question to the best of my ablility because my skills lack in english class. Im srry to say that im not the brightest student in the world when it comes to robotics, but u dont make fun of someone when they are trying to learn and find out facts. Again i am srry for confusing anyone... or wasting anyones time with my posts..... my lololol, ne, w/, ... alll these things are msn short-cuts... i will try and not use them in the posts.....

When running in the user_routines_fast.c in auto-mode, all of the pwms, relays, digital/analog inputs are set to unsigned automaticaly.

example.

unsigned int pwm01;
unsigned int relay1_fwd;

Again, if u dont not redeclare all of ur varibles like in the user_routines.c the values that you state in user_routines_fast.c will stay at that value because their value has not been declared.

example.

pwm01 = pwm02 = pwm03 = pwm04 = 127;
digital_io_01 = digital_io_02 = digital_io_03 = 127;
relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;

Once you finish redeclaring all of ur values for pwm's, relay's, and digital/analog inputs, they will not give the same problem like i had before.

The main reason how i found this out was this guy online told me
"Initialize all PWMs and Relays when entering Autonomous mode, or else it
will be stuck with the last values mapped from the joysticks. Remember,
even when Disabled it is reading inputs from the Operator Interface"

Again, I am very sry for any rudeness, or confusion i gave to anyone. Also i find that its quite rude how someone could have no sportsmanship in a SITE that helps people like me... HEY! i could be wrong? .... Maybe engineering inst for me if i got an IQ of a rock.
  #11   Spotlight this post!  
Unread 01-12-2006, 13:03
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Auto Mode!!! WHOA...what tha?

Here is an example of what would happen if you did not restate ur pwm's

NOT DECLARING

if (rc_dig_in01 == 0)
{
pwm01 = 0;
}

(pwm01 would stay at the value 0 when button is pressed. Once its unpressed, the value will stay at 0.)

DECLARING

if (rc_dig_in01 == 0)
{
pwm01 = 0;
}

(When button is pressed value will be 0. When it is unpressed, the value will be 127
  #12   Spotlight this post!  
Unread 01-12-2006, 13:36
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: Auto Mode!!! WHOA...what tha?

teh_pwnerer795,
I'm having a hard time understanding exactly what you mean. You are misusing special words in the programmer vocabulary. I would recommend you learn more about C programming fundamentals before you dive completely into the FIRST robotics code. Here is a good white paper by Eugene Brooks on C programming for FIRST. It also might be a good idea to stop by the library or book store and pick up a book or two on the C programming language.
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #13   Spotlight this post!  
Unread 01-12-2006, 14:02
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Auto Mode!!! WHOA...what tha?

Quote:
Originally Posted by teh_pwnerer795
When running in the user_routines_fast.c in auto-mode, all of the pwms, relays, digital/analog inputs are set to unsigned automaticaly.

example.

unsigned int pwm01;
unsigned int relay1_fwd;

Again, if u dont not redeclare all of ur varibles like in the user_routines.c the values that you state in user_routines_fast.c will stay at that value because their value has not been declared.
That's not quite how it works. In C, when you "declare" a variable, you merely define what kind of values it can hold. The unsigned keyword means it never has negative values, and int means it is 16 bits in size (using the C18 compiler, anyway). An unsigned int can range in value from 0-65535.

(You may also set an initial value for the variable at the same time as declaring it, but you don't have to.)

What's confusing me most, though, is why you'd want to "redeclare" things like pwm01 or relay1_fwd. They are already defined in the ifi_aliases.h file, and they are shortcuts to pieces of the internal data structure used for communication between the master and user processors in the Robot Controller. The pwm outputs are actually declared for you as unsigned char, meaning they can have values from 0-255, and the relay outputs are single bits holding either 0 or 1. You should never try to redefine them.

Quote:
The main reason how i found this out was this guy online told me
"Initialize all PWMs and Relays when entering Autonomous mode, or else it
will be stuck with the last values mapped from the joysticks. Remember,
even when Disabled it is reading inputs from the Operator Interface"
I believe you are misunderstanding the difference between "declare" and "initialize". To initialize a variable merely means to set it to a known value before using it. The pwm and relay variables are already declared for you; all you need to do is set them to safe values. His warning is for you not to assume anything about their value, and to make them explicitly what you want them to be.
  #14   Spotlight this post!  
Unread 01-12-2006, 14:13
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Auto Mode!!! WHOA...what tha?

Quote:
Originally Posted by teh_pwnerer795
Here is an example of what would happen if you did not restate ur pwm's

NOT DECLARING

if (rc_dig_in01 == 0)
{
pwm01 = 0;
}

(pwm01 would stay at the value 0 when button is pressed. Once its unpressed, the value will stay at 0.)
Unless something else assigns a different value to pwm01, that is correct.
Quote:
Originally Posted by teh_pwnerer795
DECLARING

if (rc_dig_in01 == 0)
{
pwm01 = 0;
}

(When button is pressed value will be 0. When it is unpressed, the value will be 127
Unless something else assigns a different value to pwm01, that is wrong.

You seem to be under the impression that "declaring" a variable works some magic that keeps setting it to a specific value. If you want pwm01 to always be 127 when the button is released, you'll have to do it yourself. Either
Code:
pwm01 = 127;
if (rc_dig_in01 == 0)
{
    pwm01 = 0;
}
or
Code:
if (rc_dig_in01 == 0)
{
    pwm01 = 0;
}
else
{
    pwm01 = 127;
}
  #15   Spotlight this post!  
Unread 01-12-2006, 15:47
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Auto Mode!!! WHOA...what tha?

Quote:
Originally Posted by Alan Anderson
Unless something else assigns a different value to pwm01, that is correct.

Unless something else assigns a different value to pwm01, that is wrong.

You seem to be under the impression that "declaring" a variable works some magic that keeps setting it to a specific value. If you want pwm01 to always be 127 when the button is released, you'll have to do it yourself. Either
Code:
pwm01 = 127;
if (rc_dig_in01 == 0)
{
    pwm01 = 0;
}
or
Code:
if (rc_dig_in01 == 0)
{
    pwm01 = 0;
}
else
{
    pwm01 = 127;
}



awesome thanxs alot
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
1902 auto dance mode 1902_Battery_SGT General Forum 10 14-06-2006 07:45
10 ball auto mode nuggetsyl Scouting 22 27-02-2006 20:39
auto mode nuggetsyl General Forum 12 13-02-2006 19:45
Auto mode help..... Moloch Programming 2 18-02-2005 09:18
Auto. mode!!! skitz547 Rules/Strategy 1 09-03-2003 22:37


All times are GMT -5. The time now is 20:41.

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