Go to Post I need a This-Is-What-I-Meant checker. - N7UJJ [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 01-02-2004, 11:54
alexrobotics alexrobotics is offline
Registered User
#0874
 
Join Date: Dec 2003
Location: Alexander, ND
Posts: 9
alexrobotics is an unknown quantity at this point
IR Sensor-tracker.zip

We have a question regarding the IR Sensing system using tracker.zip. We are experiencing no servo motion to find the IR Beacon. Our current set-up is as follows:

Left joystick is in port 1, right joystick in port 2.

Our left servo is in PWM 1, right servo in PWM 2.

Left motor is in PWM 3 through a Victor 884 Speed Controller, right motor is in PWM 4 through a Victor 884 Speed Controller.

Our IR Sensors for left to right go as follows: Left most sensor is in Digital I/O 3, the other left sensor is in Digital In/Out 4, the right sensor is in Digital In/Out 5, and the right most sensor is in Digital In/Out 6.

We have read about the robot doing a spin to find the beacon, and our robot seems to move but the servos show no motion. We’ve also read about a beacon type selector switch. Is this something we make???? Little to nothing is known about this switch. We saw it referred to in the tracker.c file.
  #2   Spotlight this post!  
Unread 01-02-2004, 12:04
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: IR Sensor-tracker.zip

Do you have the 7.2v backup battery connected to the robot controller? The servos won't operate without it.
  #3   Spotlight this post!  
Unread 02-02-2004, 11:46
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR Sensor-tracker.zip

Quote:
Originally Posted by alexrobotics
We have a question regarding the IR Sensing system using tracker.zip. We are experiencing no servo motion to find the IR Beacon. Our current set-up is as follows:

Our left servo is in PWM 1, right servo in PWM 2.

Our IR Sensors for left to right go as follows: Left most sensor is in Digital I/O 3, the other left sensor is in Digital In/Out 4, the right sensor is in Digital In/Out 5, and the right most sensor is in Digital In/Out 6.

We have read about the robot doing a spin to find the beacon, and our robot seems to move but the servos show no motion. We’ve also read about a beacon type selector switch. Is this something we make???? Little to nothing is known about this switch. We saw it referred to in the tracker.c file.
If you are using tracker.zip "as is" then your robot will not move at all. It has no driving commands incorporated. It only moves the servos to search for the beacon. The "navigate" code demonstrates how you can move your robot.

Dave's note on the 7.2v battery sounds like the most likely explanation of your problem. The servos (on PWM01 & 02) should "search" even if the IR sensors aren't connected at all.

The beacon switch is something you'll need to have eventually, like the left/right field switch. It might be easier to think of it and implement it as a Blue/Red alliance switch. (There is a way to automate this, but I wouldn't suggest you try it.) For now you can hardcode it to the type-0 beacon on the EDU controller PWM1 output. In tracker.h you'll find the line:
Code:
#define DESIRED_BEACON_TYPE rc_dig_in07 // this assumes that rc_dig_in07 is a digital input
For testing just change it to:
Code:
#define DESIRED_BEACON_TYPE 0 // hardcode beacon to type-0 (PWM1 on EDU)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 02-02-2004 at 11:52.
  #4   Spotlight this post!  
Unread 02-02-2004, 11:46
alexrobotics alexrobotics is offline
Registered User
#0874
 
Join Date: Dec 2003
Location: Alexander, ND
Posts: 9
alexrobotics is an unknown quantity at this point
Re: IR Sensor-tracker.zip

Quote:
Originally Posted by Dave Flowerday
Do you have the 7.2v backup battery connected to the robot controller? The servos won't operate without it.
Well no we didn't we were using that battery to power the edubot to make the wavelengths for our big robot. We will try it. Thank you.
  #5   Spotlight this post!  
Unread 03-02-2004, 11:56
dmellich dmellich is offline
Registered User
AKA: Mr. E
FRC #1251 (TechTiger Robotics)
Team Role: Mentor
 
Join Date: Dec 2002
Rookie Year: 2000
Location: Coconut Creek, FL
Posts: 79
dmellich has a spectacular aura aboutdmellich has a spectacular aura aboutdmellich has a spectacular aura about
Re: IR Sensor-tracker.zip

We were able to get the system working great - IR sensors tracking the beacon.

Now the question is, how do we get the tracker code integrated with the default code so that all systems (drive, pneumatics, other motors) can operate simultaneously with IR? Are there certain files from tracker code (*.c, *.h) that need to be placed into the FRCcode to allow them to be compiled and linked?

Thanks for everyones help, couldn't have done it without you.
__________________
David M. Ellich
Team 1251, TechTiger Robotics
South Florida Regional Planning Committee
"It's Cool to be Smart"
  #6   Spotlight this post!  
Unread 03-02-2004, 12:52
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR Sensor-tracker.zip

Quote:
Originally Posted by dmellich
Now the question is, how do we get the tracker code integrated with the default code so that all systems (drive, pneumatics, other motors) can operate simultaneously with IR? Are there certain files from tracker code (*.c, *.h) that need to be placed into the FRCcode to allow them to be compiled and linked?
Add these to your MPLAB project.
tracker.c
tracker.h

Use the routines in the tracker s/w as a guide to changes in the rest of the code.
Add in user_routines.c:
Code:
#include "receiver.h"
#include "tracker.h"
in User_Initialization()
Code:
Initialize_Receiver(); /* not required as it's also called by Initialize_Tracker() */
Initialize_Tracker();
In user_routines_fast.c add the whole "// external interrupts 3 through 6" interrupt section for the IR sensor interrupts.
Code:
	else if (INTCONbits.RBIF) // external interrupts 3 through 6
	{
		Port_B = PORTB; // remove the "mismatch condition" by reading port b            
		INTCONbits.RBIF = 0; // clear the interrupt flag
		Port_B_Delta = Port_B ^ Old_Port_B; // determine which bits have changed
		Old_Port_B = Port_B; // save a copy of port b for next time around
	 
		if(Port_B_Delta & 0x10) // did external interrupt 3 change state? - IR sensor 1
		{
			Int_3_Handler(Port_B & 0x10 ? 1 : 0); // call the interrupt 3 handler (in receiver.c)
		}

		if(Port_B_Delta & 0x20) // did external interrupt 4 change state? - IR sensor 2
		{
			Int_4_Handler(Port_B & 0x20 ? 1 : 0); // call the interrupt 4 handler (in receiver.c)
		}

		if(Port_B_Delta & 0x40) // did external interrupt 5 change state? - IR sensor 3
		{
			Int_5_Handler(Port_B & 0x40 ? 1 : 0); // call the interrupt 5 handler (in receiver.c)
		}
		
		if(Port_B_Delta & 0x80) // did external interrupt 6 change state? - IR sensor 4
		{
			Int_6_Handler(Port_B & 0x80 ? 1 : 0); // call the interrupt 6 handler (in receiver.c)

		}
	}
And add the tracker servo processing in Process_Data_From_Local_IO()

Code:
	static unsigned int Old_Clock = 0;

	if (Clock > Old_Clock) // stay synchronized to beacon data updates (this is important)
	{
		Track_Beacon(LEFT); // allow the left beacon tracker state machine to run
		Track_Beacon(RIGHT); // allow the right beacon tracker state machine to run
		
		if ((Tracker_Data[left].Status == BOTH_IN_VIEW) &&
			(Tracker_Data[right].Status == BOTH_IN_VIEW))
		{
			// both trackers have an angular solution; calculate beacon vector
			// here using the known baseline distance between the trackers and
			// angles derived from the two Tracker_Data[].Position variables

			// calculate new drive motor PWM values here

		}
	// finally, update the servo motor positions
	LEFT_TRACKER_SERVO = Tracker_Data[left].Position;
	RIGHT_TRACKER_SERVO = Tracker_Data[right].Position;
	
	Old_Clock = Clock; // take a snapshot of the clock
	}
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 03-02-2004 at 14:31.
  #7   Spotlight this post!  
Unread 05-02-2004, 19:38
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: IR Sensor-tracker.zip

Quote:
Originally Posted by Mark McLeod
Add these to your MPLAB project.
tracker.c
tracker.h
Don't forget receiver.c & receiver.h. BTW, if you're going through the trouble of adding the tracking functionality to your existing code, you might as well use the newer code found in tracker.zip.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #8   Spotlight this post!  
Unread 06-02-2004, 09:09
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR Sensor-tracker.zip

Quote:
Originally Posted by Kevin Watson
Don't forget receiver.c & receiver.h.
-Kevin
There's always somethin' I forget.
I guess it's hard to #include files you forgot to add in.

Thanks Kevin!
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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


All times are GMT -5. The time now is 12: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