Go to Post First'ers aren't 'normal' I guess. Whatever that word means now a days - dancingfool [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 24-03-2006, 05:24
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
Angry Got it working now theres another problem!

Ok, the camera is working fine (altho i have no clue what do for the autonomous coding with including the camera) but anyhow we are using 6 diff autonomy codes and we have a dip switch pluged into rc_dig_in11 - 16 and the coding looks for which one is true then goes to that code, i have the LEDs on the control board light green when one of those return true (as a way to easily tell which mode we are using for that match) but when i merge my coding (just the LED defining for the rc_dig_in ports) with the camera coding, the LEDs dont light up, also i have tried just the main camera coding (with out my modifications) can any one tell me what to do about this?
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
  #2   Spotlight this post!  
Unread 24-03-2006, 06:57
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: Got it working now theres another problem!

Where in the program did you put the code that controls the OI LEDs? If it's in Default_Routine(), did you remember to uncomment the call to it from Process_Data_from_Master_Up()? If it's somewhere else, did you remember to remove the original LED control code from the program?
  #3   Spotlight this post!  
Unread 24-03-2006, 07:04
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
Re: Got it working now theres another problem!

im not sure exactly, all i know its in the LED output section of User_Routines, i dont know really anything about the coding for the cam so i dont know what needs to be un commented or commented out and i did comment out the original LED output coding, and it works fine with my modified defult code but not with the modified camera code, in fact the LED that should light up when the camera has a green target doesnt light up either, even with an un modified cam User_Routines.
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
  #4   Spotlight this post!  
Unread 24-03-2006, 08:11
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: Got it working now theres another problem!

Quote:
Originally Posted by ghhs_1527
...its in the LED output section of User_Routines...
In the provided camera code, the call to Default_Routine() is commented out. You need to uncomment it before any of the motor/relay/LED outputs will do anything.
  #5   Spotlight this post!  
Unread 24-03-2006, 08:15
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
Re: Got it working now theres another problem!

i just un comment the one line that says defult_routine; (something like that) right? because i did that and the camera didnt track the green then
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
  #6   Spotlight this post!  
Unread 24-03-2006, 09:16
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: Got it working now theres another problem!

Make sure the pwm output code in Default_Routine() isn't conflicting with the camera servo control. As provided, the camera code wants the pan and tilt servos on pwm01 and pwm02. Also as provided, the default pwm code copies joystick inputs to those same pwm outputs. You'll have to either strip the pwm01/pwm02 control from Default_Routine() or move the camera servos to other outputs (details are in tracking.h).

Note: avoid using pwms 13-16. Hardware interrupts, including the interrupt-based serial communication, will interfere with the "fast update" pwm routine for those outputs and cause unwanted jitter in the servo or speed control signals.
  #7   Spotlight this post!  
Unread 24-03-2006, 15:56
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
Re: Got it working now theres another problem!

ok i uncommented Default_Routine() and went into tracking.h and chaned it from pwm01 - 02 to pwm11 - 12 and when i load the code the camera doesnt do anything (my LEDs light up) am i just not understanding that the camera isnt going to do anything till it has autonomy code? we want to use it as an aiming device during the match, i think im just confused
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
  #8   Spotlight this post!  
Unread 24-03-2006, 16:08
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: Got it working now theres another problem!

The very beginning of Default_Routine() has this code:
Code:
 /*---------- 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;
You need to take out anything that would override the outputs used in the Servo_Track() routine. If you want the pan and tilt servos on pwm11 and pwm12, comment out the last two lines in this section (or delete them outright).
  #9   Spotlight this post!  
Unread 24-03-2006, 22:16
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Got it working now theres another problem!

you know, for some reason when we set our camera's PWM output to a value other then 1 or 2, we got issues. maybe its the same for you?

also, do what alan anderson told you to, because that same error (my stupidity...) gave us that problem at the begging of the season.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
  #10   Spotlight this post!  
Unread 25-03-2006, 16:42
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Got it working now theres another problem!

Remember, when something is plugged into rc_dig_in[1-16] it is on, when the switch is actually off:

switch off == 1 in code
switch on == 0 in code

This caught me by surprise.

My team used rc_dig_in[1-3] to create 7 different modes:

000 = off
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7

Code is below for what you can use to do this. Stick it in user_routines_fast.c to make use of it, make sure to change it to what you need to use it for .

Code:
unsigned int Auton = 0;

unsigned char flip (unsigned char input) {
	if (input == 1)
		return 0;
	if (input == 0)
		return 1;
}


void User_Autonomous_Code(void)
{
  /* 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. 
  */
  pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
  pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
  relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
  relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
  relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
  relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;

  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! */
		// We have to shift the second and the third bits
		
		Auton = flip(rc_dig_in01) | flip(rc_dig_in02) << 1 | flip(rc_dig_in03) << 2;
		
		if (Auton == 0) {
			// do absolutely nothing
		}
		else {
			if (Auton == 1) {
				// see 7
			}
			if (Auton == 2) {
				// See 7
			}
					
				
			if (Auton == 7) {
			    // Do stuff when in binary added up together it is 7
			}
		}
        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
}
__________________
My Blog!
  #11   Spotlight this post!  
Unread 25-03-2006, 18:05
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
Re: Got it working now theres another problem!

Quote:
Originally Posted by X-Istence
Remember, when something is plugged into rc_dig_in[1-16] it is on, when the switch is actually off:

switch off == 1 in code
switch on == 0 in code

This caught me by surprise.

My team used rc_dig_in[1-3] to create 7 different modes:

000 = off
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7

Code is below for what you can use to do this. Stick it in user_routines_fast.c to make use of it, make sure to change it to what you need to use it for .

Code:
unsigned int Auton = 0;

unsigned char flip (unsigned char input) {
	if (input == 1)
		return 0;
	if (input == 0)
		return 1;
}


void User_Autonomous_Code(void)
{
  /* 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. 
  */
  pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
  pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
  relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
  relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
  relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
  relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;

  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! */
		// We have to shift the second and the third bits
		
		Auton = flip(rc_dig_in01) | flip(rc_dig_in02) << 1 | flip(rc_dig_in03) << 2;
		
		if (Auton == 0) {
			// do absolutely nothing
		}
		else {
			if (Auton == 1) {
				// see 7
			}
			if (Auton == 2) {
				// See 7
			}
					
				
			if (Auton == 7) {
			    // Do stuff when in binary added up together it is 7
			}
		}
        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
}

what type of switch did u use?
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
  #12   Spotlight this post!  
Unread 25-03-2006, 21:58
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Got it working now theres another problem!

Quote:
Originally Posted by ghhs_1527
what type of switch did u use?

PWM cable, connect the two outside ones. The signal line, and the ground line.

I believe it was black and white. Red was simply cut down as closely to the connector as possible, so that the 5v would not cause any trouble.

We had some bad PWM cables that got cut open by accident by scraping along the frame, so we cut them, and simple twisted them together, and then right before a match plugged in the ones we wanted, and removed the ones we did not want, and we were set.
__________________
My Blog!
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
Strange Encoder Problem AIBob Electrical 3 20-02-2005 22:20
Problem w/Mesh Kevin Thorp 3D Animation and Competition 4 17-02-2005 23:04
Programming Problem: Extremely Frustrating chantilly_team Programming 19 12-02-2005 23:00
Physics Problem Venkatesh Math and Science 13 30-11-2004 20:30
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11


All times are GMT -5. The time now is 22:59.

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