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 04-10-2006, 16:23
travmizer's Avatar
travmizer travmizer is offline
Head of Programming
AKA: Travis Schmidt
FRC #0617 (Springer Express)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2004
Location: Highland Springs HS Virginia
Posts: 13
travmizer is an unknown quantity at this point
Send a message via AIM to travmizer
Unhappy Program doesn't effect robot

Ok, now my computer loads programs. The default loads, but only makes one wheel and our gatherer work. When I try to load my program, however, The robot is completely unresponsive of the joysticks.

This is my code from user_routines :

void Default_Routine(void)
{

/*---------- Analog Inputs (Joysticks) to PWM Outputs-----------------------
*--------------------------------------------------------------------------
* This maps the joystick axes to specific PWM outputs.
*/
/*
pwm01 = p1_y;
pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;
pwm09 = p1_wheel;
pwm10 = p2_wheel;
pwm11 = p3_wheel;
pwm12 = p4_wheel;
*/
/*---------- 1 Joystick Drive ----------------------------------------------
*--------------------------------------------------------------------------
* This code mixes the Y and X axis on Port 1 to allow one joystick drive.
* Joystick forward = Robot forward
* Joystick backward = Robot backward
* Joystick right = Robot rotates right
* Joystick left = Robot rotates left
* Connect the right drive motors to PWM13 and/or PWM14 on the RC.
* Connect the left drive motors to PWM15 and/or PWM16 on the RC.
*/
// pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
// pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);



if (p1_sw_trig == 1)
{
pwm03 = 200; // turn on the shooters
pwm04 = 200;

if (p2_sw_top == 0)
{
relay1_fwd = 0;
relay1_rev = 0; //no gather movement durring aiming
pwm08 = 120; //closed

if (p2_sw_trig == 1)
{
pwm06 = p2_x/4; //pan
pwm07 = p2_y/4; //tilt
}
else
{
pwm06 = 127;
pwm07 = 127; //NOTE NOTE! this is for the auto aim code
}
}
else
{
pwm08 = 50; //open
}
if (p2_sw_top == 1)
{
relay1_fwd = 1; //with both tops down, activates gatherer
relay1_rev = 0;
}
else
{
relay1_fwd = 0;
relay1_rev = 0;
}
}

else
{
pwm01 = p1_y; //again, make a #define, probably pwm_1
pwm02 = p2_y; //Also a #define, pwm_2, make sure p1 joystic is on right
}

if (p1_sw_top == 1 && p2_sw_top == 0)
{
relay1_fwd = 0;
relay1_rev = 1; //rev gatherer
}
else if (p1_sw_top == 0 && p2_sw_top == 1)
{
relay1_fwd = 1;
relay1_rev = 0;
}
else
{
relay1_fwd = 0;
relay1_rev = 0;
}

Also, when the terminal window opens, it reads <IFI> and thats it. (Unless it's the default code, and then it only reads the information for the joystick in port one

ANY HELP??? PLEASE???
__________________
Isaac Asimov once said:

If knowledge can create problems, it is not through ignorance that we can solve them.
  #2   Spotlight this post!  
Unread 04-10-2006, 17:23
Fuzzy's Avatar
Fuzzy Fuzzy is offline
Registered User
AKA: Mark Hawthorne
FRC #0011 (Mount Olive Robotics Team); FRC #0190 (Gompei and the Herd)
Team Role: College Student
 
Join Date: Apr 2006
Rookie Year: 2004
Location: Mount Olive
Posts: 73
Fuzzy is a jewel in the roughFuzzy is a jewel in the roughFuzzy is a jewel in the rough
Send a message via AIM to Fuzzy
Re: Program doesn't effect robot

Are you sure that all the PWM wires are connected properly in correspondence with the program(s)?
  #3   Spotlight this post!  
Unread 04-10-2006, 17:36
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Program doesn't effect robot

Did you try inserting printfs for the joystick values (including buttons), to make sure the robot is getting the joystick input?

printf("%d\t%d\t%d\t%d\n", p1_y, p2_y, p2_sw_trig, p2_sw_top);

Is everything plugged in (the motors)?

I'm not sure if it was a problem with copying, but there's no ending curly brace for Default_Routine.

Oh, also, a few other things, that probably aren't causing your problem, but might cause other problems:
(In the code, I changed all "x == 1" to just "x" and "x == 0" to just "!x". It's still exactly the same.)

Code:
		if (p2_sw_trig)
		{
			pwm06 = p2_x / 4; //pan
			pwm07 = p2_y / 4; //tilt
		}
That will cause PWMs 6 and 7 to always have a value from 0 to 64, depending on the joystick value (0 to 255). Never mind if that's what you were trying to do.

Code:
	if (!p2_sw_top)
	{
//some code here...
	}
	else
	{
//more code...
	}
	if (p2_sw_top)
	{
//even more code...
	}
If you're pressing down p2_sw_top, both what is in the else and what is in the if (p2_sw_top) will execute. This probably won't cause problems, but it's just sort of redundant.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law


Last edited by Eric Finn : 04-10-2006 at 17:39.
  #4   Spotlight this post!  
Unread 04-10-2006, 20:07
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,112
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: Program doesn't effect robot

Make doubly sure the call to Default_Routine() is not commented out. (If you're starting with the 2006 code with camera support, it is unless you changed it.)
  #5   Spotlight this post!  
Unread 05-10-2006, 06:58
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Program doesn't effect robot

Quote:
Originally Posted by Alan Anderson
Make doubly sure the call to Default_Routine() is not commented out. (If you're starting with the 2006 code with camera support, it is unless you changed it.)
Right, It was commented out so people testing camera code didnt have there robots motors turn on and start causing havoc. Check into that.
  #6   Spotlight this post!  
Unread 23-01-2008, 10:05
Cesar Cabrera Cesar Cabrera is offline
Registered User
FRC #2567
 
Join Date: Jan 2008
Location: Puerto Rico
Posts: 1
Cesar Cabrera is an unknown quantity at this point
Re: Program doesn't effect robot

How many Joistick can I use in the competition...
  #7   Spotlight this post!  
Unread 23-01-2008, 10:24
ctclass ctclass is offline
Registered User
FRC #2389
 
Join Date: Jan 2008
Location: Drumright
Posts: 2
ctclass is an unknown quantity at this point
Re: Program doesn't effect robot

can anyone help explain rewriting the c programming were a rookie team struggling with it
  #8   Spotlight this post!  
Unread 23-01-2008, 10:50
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Program doesn't effect robot

Quote:
Originally Posted by ctclass View Post
can anyone help explain rewriting the c programming were a rookie team struggling with it
Lots of people in here will help you. Ask a specific question and someone will give you an answer.

Steve
  #9   Spotlight this post!  
Unread 23-01-2008, 10:52
ctclass ctclass is offline
Registered User
FRC #2389
 
Join Date: Jan 2008
Location: Drumright
Posts: 2
ctclass is an unknown quantity at this point
Re: Program doesn't effect robot

how to wire the pressure switch right for our nuematics
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
Robot doesn't drive straight bush Control System 14 09-02-2006 00:00
How to program Hall Effect sensors. chantilly_team Programming 1 17-02-2005 14:08
How to keep a program running at a school which doesn't get it? Jimmy General Forum 9 03-04-2003 10:08
Minor Problem, our robot DOESN'T work! Cobra Motors 1 15-02-2003 14:43
Robot reset on OI doesn't work Carl Owenby General Forum 1 07-02-2003 07:23


All times are GMT -5. The time now is 10:32.

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