Go to Post A great mentor guides without giving the answers, teaches through discovery, demonstrates without lecturing, provides support from backstage, observes without hovering, and leads by example. - dlavery [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 21-01-2004, 22:05
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Tracking and Beacon off of one Edu

Our team's mentor decided its time for a vacation already, and so he's gone for the rest of the week. That means no access to the robot rc for me =( Luckily, I did manage to yoink the edu and beacon stuff before he left ;-)

Anyways, this makes me want to try and run the beacon and the tracking code off of one Edu. I got something, but well, it's not working (and unfortionately, this is the first day I've managed to really tackle this new c-programming micro stuffs). Anyways, one with what I did:
First, I downloaded the beacon code and the edu_tracker code (the version that doesn't have the navigation built in). I used the tracker project as a base.

I first changed the tracking servos to pwm03 and pwm04 so pwm01 and pwm02 could be used for the left and right beacons. The optical sensors were put on interrupts 3, 4, 5, 6.

I then brought beacon.c and beacon.h into the project and added #include "beacon.h" in the user_routines.c and user_routines_fast.c. In the init section of user_routines.c, I added Initialize_Tracker();

I might have done something else, but thats all I seem to remember. I added some printf's to tell me when the beacon was turned on.

In the console, I get "Tracker x: still searching" while the servos are going back and forth. These lines are interrupted by my "BEACON ON!" printf's, as expected. Basically, the beacon code is outputing, the servos are searching.

I put the servos in front of the infrared LEDs, but it still says "still searching." After a while, the console stops outputing my "BEACON ON!"'s. Soon after, the Program State LED turns blinking red, thus ending my hybrid program in a glorious infinite loop.

Any suggestions on how I can combine the beacon code and the tracking code onto one edubot?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #2   Spotlight this post!  
Unread 22-01-2004, 11:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,854
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: Tracking and Beacon off of one Edu

-I assume you meant to say you added "Initialize_Beacon();" to user_routines.c
-Did you select the correct beacon to track (digital input 7)?
-Did you add the beacon interrupt handler to user_routines_fast.c?

If you email me the code I can help you debug the problem.
I'm also within a couple of miles of you. I'll be at Hauppague robotics part of tonight if you'd like to come by and do it together.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2004 at 12:28.
  #3   Spotlight this post!  
Unread 22-01-2004, 15:50
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Re: Tracking and Beacon off of one Edu

- Yes, thats what I meant - I did add Initialize_Beacon(); to user_routines.c (right above Initialize_Tracker()

- I didn't select which beacon to track, but I changed the beacon PWM wire from PWM1 (left one) to PWM2 (right one), and nothing changed.

- I did add Timer_0_Int_Handler(); to user_routines_fast.c in the appropriate spot in InterruptHandlerLow().

I'm not available tonight, but I'll e-mail you the code. What really puzzles me is why the controller goes into an infinate loop. Does anyone know if the beacon and the tracker share an interrupt or a input or something, and maybe thats causing a conflict? I changed the tracker PWMs to 3 and 4, so its not that... the beacon uses timer0 while the tracker uses timer1... I don't believe the beacon uses interrupts 3, 4, 5, or 6... I'm clueless.
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #4   Spotlight this post!  
Unread 22-01-2004, 15:59
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,854
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: Tracking and Beacon off of one Edu

Quote:
Originally Posted by SuperDanman
- Yes, thats what I meant - I did add Initialize_Beacon(); to user_routines.c (right above Initialize_Tracker()

- I didn't select which beacon to track, but I changed the beacon PWM wire from PWM1 (left one) to PWM2 (right one), and nothing changed.

- I did add Timer_0_Int_Handler(); to user_routines_fast.c in the appropriate spot in InterruptHandlerLow().

I'm not available tonight, but I'll e-mail you the code. What really puzzles me is why the controller goes into an infinate loop. Does anyone know if the beacon and the tracker share an interrupt or a input or something, and maybe thats causing a conflict? I changed the tracker PWMs to 3 and 4, so its not that... the beacon uses timer0 while the tracker uses timer1... I don't believe the beacon uses interrupts 3, 4, 5, or 6... I'm clueless.
They don't conflict for timers or interrupts.
I duplicated what you did over my lunch hour, but I won't be able to test it until I get to the school tonight. If it works I'll send it to you.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #5   Spotlight this post!  
Unread 22-01-2004, 16:13
Tytus Gerrish's Avatar
Tytus Gerrish Tytus Gerrish is offline
IGAB, ADHD, and Dislexic
AKA: Ty
FRC #0179 (SwampThing)
Team Role: Tactician
 
Join Date: Feb 2003
Rookie Year: 2001
Location: West Palm Beach, Florida
Posts: 2,017
Tytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond repute
Re: Tracking and Beacon off of one Edu

it would be fun to have the emiters on the edu and have the big 130 pounder chace after it atonoumsly also dangerous bbut it would be a great promotion
  #6   Spotlight this post!  
Unread 23-01-2004, 02:29
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: Tracking and Beacon off of one Edu

This should work because the beacon, receiver and tracker code was developed on a single EDU-RC. I'll try to build it with the latest code and see it it works (or try to figure out what's broken).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 23-01-2004, 08:01
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,854
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: Tracking and Beacon off of one Edu

Quote:
Originally Posted by Kevin Watson
This should work because the beacon, receiver and tracker code was developed on a single EDU-RC. I'll try to build it with the latest code and see it it works (or try to figure out what's broken).

-Kevin
It works.
I took the reverse tack and added the tracker to the beacon s/w just because I already had our printf replacements in it.
BEWARE: printf isn't included in this, but replacement print statements are.

PWM1 = beacon type 0
PWM2 = beacon type 1
The beacon digital switch is currently hardcoded to the beacon on PWM1
PWM7 = servo A
PWM8 = servo B
IR sensors are on interrupts 1,2 and 4,5 from an earlier version of Kevin's tracker code.

You have to build a new project. I stripped out the project files because they sometimes don't port to new machines well.

I'll probably use your idea in a workshop we're running for local teams on the IR beacon, sensors and s/w.

[edit]
I left the wrong print statements in tracker.c. It's fixed now. It didn't affect execution of the code only the printout of the diagnostic messages.
[/edit]
Attached Files
File Type: zip EduBeaconTracker.zip (46.7 KB, 46 views)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 23-01-2004 at 19:14.
  #8   Spotlight this post!  
Unread 23-01-2004, 15:04
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Re: Tracking and Beacon off of one Edu

Quote:
Originally Posted by Mark McLeod
I'll probably use your idea in a workshop we're running for local teams on the IR beacon, sensors and s/w.
I'd call it more circumstance than idea. Anyways, thanks for the code... I'll try it out later tonight and let you know how it worked out for me.

[Edit] Alright, I rebuilt parts of the edubot and plugged everything in, and sure enough, your version works. Thanks.

Now to go figure out why my version doesn't work and/or adjust those sensors... didn't realize they're so sensitive that they can catch the reflection off just about anything...
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies

Last edited by DanL : 23-01-2004 at 19:58.
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
Official Beacon Tracking Code Posted Kevin Watson Programming 41 18-02-2004 21:04
IR Tracking & Navigation Tallman General Forum 3 20-01-2004 17:26
Example Beacon Tracking Code Posted Kevin Watson Programming 0 17-01-2004 02:25
An Example IR Beacon Tracking Assembly... Kevin Watson Electrical 0 14-01-2004 12:30


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