Go to Post Students can learn to drive on whatever they give us. Ramps, carpet, grating, HDPE, lexan, diamond plate, regolith, other robots the driver station wall, referees, stairs, Dean, the bar, goals, the scorer's table, you name it, I've watched robots somehow manage to drive on it - Peter Matteson [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-02-2006, 17:04
sciguy125 sciguy125 is offline
Electrical Engineer
AKA: Phil Baltar
FRC #1351
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Sunnyvale, CA
Posts: 519
sciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond repute
Send a message via AIM to sciguy125 Send a message via MSN to sciguy125 Send a message via Yahoo to sciguy125
timer after restart

I set up Timer 1 as a simple timer. I initialize it via a function called from User_Initialization() - that's what it's called right? It uses the internal clock and has the prescaler set to 1:8. I also set up interrupts to increment a counter every time the timer overflows. I also have it initialized to a value such that it overflows every 50ms. The interrupt routine that handles the counter also toggles rc_dig_out18. I've verified that it works with an oscope.

The problem is that it doesn't work after I reset the controller. It's fine right after programming. After a power off or pressing the reset button, the output doesn't change any more. I'm not sure if it's because the timer isn't working any more or if something happened to the output. I suspect the former, however.

Is there some difference between what happens right after a download and after pressing reset? I have a feeling that I need to initialize something somewhere, but I can't find anything.
__________________

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------
  #2   Spotlight this post!  
Unread 17-02-2006, 22:04
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: timer after restart

My camera does not track anymore after a robot reset, the only way to get it to track again is to hit the power button, and restart it.
__________________
My Blog!
  #3   Spotlight this post!  
Unread 03-03-2006, 21:25
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: timer after restart

We have the same problem here on team 11 with out camera not tracking after a robot reset, we need to turn it off, turn it on, press reset before it works... does anyone have any ideas as to why this is happening?
  #4   Spotlight this post!  
Unread 04-03-2006, 11:00
RedBarons RedBarons is offline
Registered User
no team
 
Join Date: Feb 2006
Location: ERIE PA
Posts: 7
RedBarons is on a distinguished road
Re: timer after restart

I have experienced more or less random behaviors when hitting the reset button. For example, motors starting spinning for no reason. I also have a 50ms interrupt-triggered timer, and have experienced similar problems.
  #5   Spotlight this post!  
Unread 02-04-2006, 17:43
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
Re: timer after restart

I have been told, that many times the reason that many robots do random things after an "unclean" shutdown or just after a weird start up is that not all the values get reset.I'm not sure if that is all of your problems it may be so for those without the camera. I haven't found any fix to the problem except just play it by the book and cross your fingers.
  #6   Spotlight this post!  
Unread 02-04-2006, 19:33
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: timer after restart

I can not speak to the timer issue in this thread (I suspect your timer initialization routine is not complete). However:

The camera requires that the operator press and hold the reset button on the RC for 4 to 5 seconds for a reliable camera reset. This is true using both the 2005 or 2006 camera with any of 2004 or 2005 or 2006 RC.

The reset button on the RC must be used. The "RC reset" button on the OI will not work.

The results of power-on resets have been mixed. I have attempted to train our field team to always do a 4-5 second reset after they turn on the power.

Regards,

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #7   Spotlight this post!  
Unread 02-04-2006, 21:11
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: timer after restart

Quote:
Originally Posted by Mike Betts
I can not speak to the timer issue in this thread (I suspect your timer initialization routine is not complete). However:

The camera requires that the operator press and hold the reset button on the RC for 4 to 5 seconds for a reliable camera reset. This is true using both the 2005 or 2006 camera with any of 2004 or 2005 or 2006 RC.

The reset button on the RC must be used. The "RC reset" button on the OI will not work.

The results of power-on resets have been mixed. I have attempted to train our field team to always do a 4-5 second reset after they turn on the power.

Regards,

Mike
We've actually found a way in software to force a reset in under 2 seconds if the camera stops sending data, its also part of our initialization, so even if we have a bad power-up, the camera does come online, it simply takes a bit longer. I don't have specific code for you, I'll email Mark McLeod and ask him to post it when he has a chance, but it essentially clears out the involved variables and sends a few databursts to "wake" the camera, then re-runs the initialization packet sequence, it works pretty reliably for us.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #8   Spotlight this post!  
Unread 03-04-2006, 01:10
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: timer after restart

Quote:
Originally Posted by Matt Krass
We've actually found a way in software to force a reset in under 2 seconds if the camera stops sending data, its also part of our initialization, so even if we have a bad power-up, the camera does come online, it simply takes a bit longer. I don't have specific code for you, I'll email Mark McLeod and ask him to post it when he has a chance, but it essentially clears out the involved variables and sends a few databursts to "wake" the camera, then re-runs the initialization packet sequence, it works pretty reliably for us.
Matt/Mark,

I'd love to see it (and, I'd imagine, so would many other teams).

Regards,

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #9   Spotlight this post!  
Unread 03-04-2006, 22:41
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,801
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: timer after restart

Sorry, I've been sick and out of it for awhile.

Here's the re-initialization we're using that Matt referred to. Nothing fancy, it's only a simple check for dropped communications packets, followed by a reset and reinitialization of both the camera and Kevin Watson's camera.c state machine. We don't use the tracking code, so you might need more for that. A normal initialization takes 1.2 seconds, however, since we don't know how long power can be interrupted and because some states are funkier than others, we continue to periodically attempt to initialize the camera as long as it's not responding anyway.

Re-initializing doesn't help the roughly 1:30 chance the camera won't power up in any kind of state to communicate. For both that and the regular case we use rapidly blinking LEDs to indicate the camera has not (yet) initialized, because the camera LEDs can be in any state and aren't a good indicator of a hangup. The blinking LEDs are easier for the drive team to identify a camera initialization problem.

We tested this by repeatedly pulling the power connection for the camera, cycling the RC power, and mounting the camera on a jigsaw as a vibration source.

This file doesn't include checks we added for invalid and incomplete T packets we see periodically that can also affect results.

I forgot this was an rtf. Here's the true txt version.
Attached Files
File Type: txt reinit_camera.txt (5.5 KB, 50 views)
File Type: txt reinit_camera2.txt (4.6 KB, 42 views)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 04-04-2006 at 09:22.
  #10   Spotlight this post!  
Unread 04-04-2006, 01:03
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: timer after restart

Mark,

Thank you. I am sure that many teams will find this useful.

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #11   Spotlight this post!  
Unread 04-04-2006, 01:12
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: timer after restart

Back to Phil's first question: I just checked and we are initializing TIMER 1 almost exactly as outlined in the Timers White Paper.

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
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
Encoders and putdata theycallhimtom Programming 3 09-02-2006 19:24
Quick Timer Question et1337 Programming 3 02-02-2006 15:19
Accelerometer code ImmortalAres Programming 28 04-06-2005 01:02
Timer interrupt hic-cupping - HELP roknjohn Programming 9 15-03-2004 17:56
Interrupt timer, executing code asap? SeanCassidy Programming 10 07-03-2004 01:47


All times are GMT -5. The time now is 01:33.

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