Go to Post My brain is borderline mush, I don't have much of a voice, and I don't think I could be much happier. - Billfred [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 17-01-2004, 11:47
Phil Roth Phil Roth is offline
Registered User
#0011 (BASF)
 
Join Date: Jan 2003
Location: Mt. Olive New Jersey
Posts: 31
Phil Roth is an unknown quantity at this point
Send a message via AIM to Phil Roth Send a message via Yahoo to Phil Roth
Re: Official Beacon Tracking Code Posted

I'm trying to fully understand the code and working with the External ISRs first. It seems their sole purpose is to measure the amount of time of the active low pulse, categorize it as beacon 1 or 2, and then update Sensor_Stats[0].Beacon_Count[n] accordingly. Beacon 0 pulses every 1 MS and Beacon 2 pulses every 2 MS.


SO:
SENSOR #1
Sensor_Stats[0].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[0].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #2
Sensor_Stats[1].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[1].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #3
Sensor_Stats[2].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[2].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #4
Sensor_Stats[3].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[3].Beacon_Count[1] increments a running count of pulses from beacon 2


Ideally counts for beacon #1 should be incremented 26 times for beacon 1 and 13 times for beacon 2 when the Timer_1_Int_handler runs
Every 26.2MS, Timer_1_int_handler subtracts the "last" running count of pulses from the "new" running count of pulses to determine the number of pulses that occured over the last 26.2MS perion.

SO:
Sensor_Stats[0].Beacon_Quality[0] = Number of pulses that sensor #1 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[0].Beacon_Quality[1] = Number of pulses that sensor #1 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[1].Beacon_Quality[0] = Number of pulses that sensor #2 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[1]Beacon_Quality[1] = Number of pulses that sensor #2 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[2].Beacon_Quality[0] = Number of pulses that sensor #3 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[2].Beacon_Quality[1] = Number of pulses that sensor #3 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[3].Beacon_Quality[0] = Number of pulses that sensor #4 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[3].Beacon_Quality[1] = Number of pulses that sensor #4 received from beacon 2 that occurred during the last 26.2 MS


End result is:
The values held in the element Beacon.Quality[n] are the number of pulses from each sensor that occurr every 26.2MS where n = beacon #1 or #2. These values are updated every 26.2MS

AND

There are 4 sensors index by Sensor_Stats[n]
where n = of of 4 sensors

Ideally Beacon.Quality[n] should be contain 26 for beacon #1 and 13 for beacon #2.


Is this basically what's happenning in receiver.c ??
Sorry to be so "anal" but I like to fully understand how the code works in order to understand the entire system and move on to understanding tracker.c and then navigate.c where the rubber meets the road. All this while trying to work out out an approach to manage current and software optomization of a 4 motor drive system. I guess my weekend is shot.

-Phil

Last edited by Phil Roth : 17-01-2004 at 12:16.
  #2   Spotlight this post!  
Unread 17-01-2004, 13:33
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: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Phil Roth
I'm trying to fully understand the code and working with the External ISRs first. It seems their sole purpose is to measure the amount of time of the active low pulse, categorize it as beacon 1 or 2, and then update Sensor_Stats[0].Beacon_Count[n] accordingly. Beacon 0 pulses every 1 MS and Beacon 2 pulses every 2 MS.
Actually, the beacon 0 pulse width is 1ms, the beacon 1 pulse width is 2ms. The beacon flashes every 10ms for a beacon rate of 100Hz.



Quote:
Originally Posted by Phil Roth
SO:
SENSOR #1
Sensor_Stats[0].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[0].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #2
Sensor_Stats[1].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[1].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #3
Sensor_Stats[2].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[2].Beacon_Count[1] increments a running count of pulses from beacon 2

SENSOR #4
Sensor_Stats[3].Beacon_Count[0] increments a running count of pulses from beacon 1
Sensor_Stats[3].Beacon_Count[1] increments a running count of pulses from beacon 2


Ideally counts for beacon #1 should be incremented 26 times for beacon 1 and 13 times for beacon 2 when the Timer_1_Int_handler runs
Every 26.2MS, Timer_1_int_handler subtracts the "last" running count of pulses from the "new" running count of pulses to determine the number of pulses that occured over the last 26.2MS perion.
As the beacon rate is 100Hz (=10ms), the counts for both beacon types will increment by 2 or 3 everytime the timer_1_int_handler executes.



Quote:
Originally Posted by Phil Roth
SO:
Sensor_Stats[0].Beacon_Quality[0] = Number of pulses that sensor #1 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[0].Beacon_Quality[1] = Number of pulses that sensor #1 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[1].Beacon_Quality[0] = Number of pulses that sensor #2 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[1]Beacon_Quality[1] = Number of pulses that sensor #2 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[2].Beacon_Quality[0] = Number of pulses that sensor #3 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[2].Beacon_Quality[1] = Number of pulses that sensor #3 received from beacon 2 that occurred during the last 26.2 MS

Sensor_Stats[3].Beacon_Quality[0] = Number of pulses that sensor #4 received from beacon 1 that occurred during the last 26.2 MS
Sensor_Stats[3].Beacon_Quality[1] = Number of pulses that sensor #4 received from beacon 2 that occurred during the last 26.2 MS


End result is:
The values held in the element Beacon.Quality[n] are the number of pulses from each sensor that occurr every 26.2MS where n = beacon #1 or #2. These values are updated every 26.2MS
Yes, this is correct except the beacons are #0 and #1



Quote:
Originally Posted by Phil Roth
There are 4 sensors index by Sensor_Stats[n]
where n = of of 4 sensors
Yes, with index values of 0-3. How the individual sensors map to loacations on the tracker assembly is noted at the top of tracker.c



Quote:
Originally Posted by Phil Roth
Ideally Beacon.Quality[n] should be contain 26 for beacon #1 and 13 for beacon #2.
No, ...Beacon.Quality[n] should contain 2 or 3 when the beacon is in view. The algorithm in tracker.c assumes the beacon is in view of that particular sensors "quality" is greater than 0.



Quote:
Originally Posted by Phil Roth
Is this basically what's happenning in receiver.c ??
Yes, you have a very good grasp of how it works



Quote:
Originally Posted by Phil Roth
Sorry to be so "anal" but I like to fully understand how the code works in order to understand the entire system and move on to understanding tracker.c and then navigate.c where the rubber meets the road.
No problem at all. This is a great discussion that other folks can hopefully learn from.



Quote:
Originally Posted by Phil Roth
All this while trying to work out out an approach to manage current
Have a look at Rich Petras' code in navigate.c for an example of motor stall detection using the new current sensors.



Quote:
Originally Posted by Phil Roth
I guess my weekend is shot.
Sorry, dude, whether you know it or not, your next five weekends are shot .

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 17-01-2004, 14:12
Atheist Atheist is offline
Registered User
#0555
 
Join Date: Jan 2004
Location: New Jersey
Posts: 22
Atheist is on a distinguished road
Re: Official Beacon Tracking Code Posted

What if both sensors are in view?
  #4   Spotlight this post!  
Unread 17-01-2004, 14:26
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: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Atheist
What if both sensors are in view?
Assuming the tracking assembly is correctly constructed, it means the tracker is pointed at the beacon. If you really meant to ask what if both beacons are in view?, the system is designed to easilly handle this because the type-0 and type-1 beacons are never flashing at the same time (assuming both beacons are being driven by one EDU-RC).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 17-01-2004, 14:30
Atheist Atheist is offline
Registered User
#0555
 
Join Date: Jan 2004
Location: New Jersey
Posts: 22
Atheist is on a distinguished road
Re: Official Beacon Tracking Code Posted

Heh, pretty early in the morning for me, ye I meant beacons not sensors. So if both beacons are in view, then the trackers would keep switching back and forth from one beacon to the other depending on which one is flashing???
  #6   Spotlight this post!  
Unread 17-01-2004, 14:37
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: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Atheist
Heh, pretty early in the morning for me, ye I meant beacons not sensors. So if both beacons are in view, then the trackers would keep switching back and forth from one beacon to the other depending on which one is flashing???
No, the trackers will only track the beacon you want it to track (as selected by a switch on digital I/O 7).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 12-01-2004, 16:01
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Kevin Watson
The folks at IFI will also be posting the code on their website.
Beacon.zip and navigate.zip are on Innovation First's website now.
  #8   Spotlight this post!  
Unread 17-01-2004, 12:52
Krash Krash is offline
Registered User
AKA: Steve K
#0836 (RoboBee's)
 
Join Date: Jan 2004
Location: St. Mary's County, MD
Posts: 1
Krash is an unknown quantity at this point
Re: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Kevin Watson
I've posted the official IR beacon and IR beacon tracking and navigation code that was used at the kick-off here: http://kevin.org/frc. The folks at IFI will also be posting the code on their website. If you have questions about the code, please leave 'em here and I'll try to keep up .

-Kevin

Kevin,
Is there a "Theory of Operation" or White paper available to explain how this all works? I am assuming that type-0 operates on one side of the field and type-1 operates on the other side. Is this correct?

Also, is the waveform chart on your website accurate? I assume that the pulse repetition interval's (PRI) are fixed as depicted on the chart.

Thanks,
Steve...
  #9   Spotlight this post!  
Unread 17-01-2004, 13:42
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: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Krash
Kevin,
Is there a "Theory of Operation" or White paper available to explain how this all works?
Not yet. I need to find the time to complete it.


Quote:
Originally Posted by Krash
I am assuming that type-0 operates on one side of the field and type-1 operates on the other side. Is this correct?
Yes, this is correct.


Quote:
Originally Posted by Krash
Also, is the waveform chart on your website accurate? I assume that the pulse repetition interval's (PRI) are fixed as depicted on the chart.
Yes, the waveforms are accurate. The beacon flash rate is fixed at 100Hz.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #10   Spotlight this post!  
Unread 25-01-2004, 18:28
Guest
 
Posts: n/a
Re: Official Beacon Tracking Code Posted

Quote:
Originally Posted by Kevin Watson
I've posted the official IR beacon and IR beacon tracking and navigation code that was used at the kick-off here: http://kevin.org/frc. The folks at IFI will also be posting the code on their website. If you have questions about the code, please leave 'em here and I'll try to keep up .

-Kevin
Can you add this to the repository?

http://nrg.chaosnet.org/repository - You'll need to register
  #11   Spotlight this post!  
Unread 25-01-2004, 20:03
tml240's Avatar
tml240 tml240 is offline
bahh
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Ann Arbor, MI
Posts: 63
tml240 is on a distinguished road
Re: Official Beacon Tracking Code Posted

we uploaded beacon code on the edurobot and the navigate code on the FRC robot to test if the IR things work. we got the ir beacons and the receivers on the right spot....are those the codes that suppose to work together?

or how do we test the beacon?
__________________

OHL 2004- ultimate NHL 2004 MOD
  #12   Spotlight this post!  
Unread 25-01-2004, 20:26
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: Official Beacon Tracking Code Posted

Quote:
Originally Posted by tml240
we uploaded beacon code on the edurobot and the navigate code on the FRC robot to test if the IR things work. we got the ir beacons and the receivers on the right spot....are those the codes that suppose to work together?

or how do we test the beacon?
If all you want to do is test the beacon and trackers, load beacon.hex into the EDU-RC and tracker.hex (included in tracker.zip) into the FRC-RC. The code in navigate.zip assumes that it's running on a real 'bot.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #13   Spotlight this post!  
Unread 26-01-2004, 10:40
cbolin's Avatar
cbolin cbolin is offline
Programming & Electrical
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Charleston, SC
Posts: 72
cbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to behold
Re: Official Beacon Tracking Code Posted

Hi,
We began experimenting with the IR sensors. We're waiting on our mechanics to get the robot assembled so we can wire it and begin to tweak the code.

The beacon works well...looks cool through a digital camera set to night vision. We are using an IR sensor to drive an LED. Tapping off signal between 33 ohm resistor and LED cathode and sending to oscilloscope.

We are curious about the IR sensitivity. About 12 feet from beacon we realize how sensitive the IR sensors are in terms of orientation (azimuth and elevation). We placed a tube around the sensor to improve detection. Turning lighting off in room seems to improve signal detection...however, this may simply be allowing us to see the waveform a little better.

Has anyone experimented with improving detection range? Other than optics of some sort, there is no way to amplify the signal inside the IR sensor since an ON/OFF signal is produced.

Regards,
ChuckB
  #14   Spotlight this post!  
Unread 26-01-2004, 13:53
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
Re: Official Beacon Tracking Code Posted

I'm currently studying the program, but i just can't get how the robot follows the signal, does the motors get activated based on the pwm that the program send to the servos that have the sensors ?

The way i get it, i think it would be like this

If the sensor pwm is 100 the motors would be activated to make a left turn with the robot, is that corrent ?!

Thanks for your help
  #15   Spotlight this post!  
Unread 27-01-2004, 02:30
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
Re: Official Beacon Tracking Code Posted

i found out what was wrong. before i was unable to download some of the code posted and a project i was building. if any of you have trouble downloading projects between 12,000 and 18,000 bytes, and you get an error.mcp file, or the frc doesnt leave the program state, it probably is because you are running a version of ifi loader before 1.06. apparently, the previous versions cant handle medium sized files. anyways, thanks for people's help!

becca
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
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
InfraRed autonomous code ... mtrawls Programming 1 11-01-2004 00:25
Autonomous code PBoss Programming 7 14-01-2003 15:29
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46
Patent source code? Kyle Fenton Chit-Chat 3 20-10-2001 17:53


All times are GMT -5. The time now is 00:31.

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