Go to Post Do it the good ol' American way and throw money at the problem. In other words, get out of there and call a professional to take care of it. - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2010, 17:51
brianelite brianelite is offline
Registered User
FRC #2898
 
Join Date: Feb 2009
Location: oregon
Posts: 36
brianelite has a spectacular aura aboutbrianelite has a spectacular aura aboutbrianelite has a spectacular aura about
Watchdog not fed

Hi - I am running 2010imagedemo code...

when I enable the robot in the driver station it says "watchdog not fed" for a few seconds and then the message goes away... and it goes into one of the three modes.

Is this normal? And if not what can I do to fix it?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2010, 20:26
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Watchdog not fed

yes, this is normal due to the line that says

GetWatchdog().SetExpiration(1.0);
Wait(3.0);

Whoever wrote this was not thinking clearly
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2010, 09:29
pilum40 pilum40 is offline
Steve Miller-Coach-Team 3355
AKA: Steve Miller
FRC #3355 (Bigg Redd)
Team Role: Coach
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Arlington, Texas
Posts: 143
pilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud ofpilum40 has much to be proud of
Re: Watchdog not fed

Quote:
Originally Posted by brianelite View Post
Hi - I am running 2010imagedemo code...

when I enable the robot in the driver station it says "watchdog not fed" for a few seconds and then the message goes away... and it goes into one of the three modes.

Is this normal? And if not what can I do to fix it?
We're noobs so our question may be dumb...
If the driver's station goes into auto mode after a few seconds, one, what do we do if it STAYS in watchdog not fed mode, two, does anyone have a patch we could install to overwrite the existing code that doesn't work, three, how do we turn watchdog off? There is not a switch (green switch) on our copy of the software.
I know y'all are laughing but hey...we gotta' ask! Cut us some slack already!

Steve Miller
Coach 3355
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2010, 15:45
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Watchdog not fed

GetWatchdog().SetEnabled(false);

HOWEVER, YOU SHOULD NOT DO THIS UNLESS YOU HAVE A VERY GOOD REASON, LIKE A BUNCH OF Wait STATEMENTS.

GetWatchdog().Feed(); is your friend
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2010, 16:47
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 333
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Watchdog not fed

Rather than disabling the watchdog (not a safe thing to do), you can also set the expiration of the watchdog to something like 5 seconds. That way, if your system hoses, the robot will automatically stop after 5 seconds.

e.g.,

GetWatchdog().SetExpiration(5.0);
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2010, 02:44
NullEntity's Avatar
NullEntity NullEntity is offline
Registered User
AKA: Bryce
FRC #0093 (N.E.W. Apple Corps Robotics)
Team Role: Scout
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Appleton
Posts: 108
NullEntity is an unknown quantity at this point
Re: Watchdog not fed

I know (using LabVIEW) our team had this issue. Turns out we had to reset the robot each time. I'm not sure if they solved it though.

My Analogy:
  • Buy dog = Turn on robot
  • Dog is hungry so he doesn't listen to you = Watchdog Not Fed
  • Shoot dog = Turn off robot
  • Repeat = ...
__________________
FRC Team 93 Alumni
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2010, 10:19
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Watchdog not fed

you don't have to kill the robot to solve the watchdog not fed error, just feed it (or give it a larger Expiration)

my interpretation of the watchdog analogy:
there are two Watchdogs, System and user. The user watchdog is a poodle that you can kill at will. you also have a poodle re-animation device. On usercode load, you create a new poodle, and you can set its fatness (time to starve) via the SetExpiration. You must feed the poodle within this period, or it dies, falls down, and shorts the motors, so you cannot move until you re-animate it and it gets off the shorted circuts. so you feed it, and re-animate it, and you can continue
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #8   Spotlight this post!  
Unread 25-02-2010, 18:16
NullEntity's Avatar
NullEntity NullEntity is offline
Registered User
AKA: Bryce
FRC #0093 (N.E.W. Apple Corps Robotics)
Team Role: Scout
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Appleton
Posts: 108
NullEntity is an unknown quantity at this point
Re: Watchdog not fed

Quote:
Originally Posted by byteit101 View Post
you don't have to kill the robot to solve the watchdog not fed error, just feed it (or give it a larger Expiration)
I think it was fixed by now (I''m not on Controls), but that's what we had to do.
__________________
FRC Team 93 Alumni
Reply With Quote
  #9   Spotlight this post!  
Unread 06-03-2010, 23:06
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,296
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Watchdog not fed

I don't know if this is useful at this point, but after struggling with watchdog issues throughout the build season, we corrected it by putting a 5 ms wait statement in our main loop. That cured the problem instantly, and it didn't come back.

(I'm not at all a programmer, but I know that's what they did, so I thought I'd share it here. Good luck teams!)

Patrick
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
Reply With Quote
  #10   Spotlight this post!  
Unread 07-03-2010, 12:56
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Watchdog not fed

Quote:
Originally Posted by pfreivald View Post
I don't know if this is useful at this point, but after struggling with watchdog issues throughout the build season, we corrected it by putting a 5 ms wait statement in our main loop. That cured the problem instantly, and it didn't come back.

(I'm not at all a programmer, but I know that's what they did, so I thought I'd share it here. Good luck teams!)

Patrick
I'll expand upon what we did :-)

We were experiencing system level watchdog "not fed" errors. For awhile we couldn't figure out what exactly was happening except that it had to do with the camera feed on the dashboard. It turned out that we were starving the background task/thread that was responsible for serving the dashboard with the camera image packets by hogging CPU time with our main task/thread (the thread that OperatorControl() runs within). This affected our communication between our driver station and cRIO, effectively timing-out the watchdog that monitored communication.

The fix was to suspend the main thread for 5/100 of a second, thus giving other threads (ie, the camera feed thread) more time to execute.
Code:
void OperatorControl() {
    while(IsOperatorControl()) {
        ... do you own work ..
        .. then at the end of the loop, suspend the task ..
        Wait(0.05f);
    }
}

Last edited by bronxbomber92 : 07-03-2010 at 14:15.
Reply With Quote
  #11   Spotlight this post!  
Unread 07-03-2010, 13:47
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,296
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Watchdog not fed

Thanks, Jedd.
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
Reply With Quote
  #12   Spotlight this post!  
Unread 09-03-2010, 09:21
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: Watchdog not fed

the 5/100 of a second seems plausible, any guesses if this will work for labview too? I'm sure it would, but i'd like other input
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #13   Spotlight this post!  
Unread 14-03-2010, 14:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Watchdog not fed

All loops in the LV framework delay either until an occurrence is sent or for a timed amount. If you do not put a delay into a loop, you are informing the compiler and scheduler that it must run as fast a resources allow, which is often way faster than you need. The way to tell it how fast you need is to put in either a time delay or a notifier.

Since it isn't obvious, the LV framework suspends inside the Get Mode subVI waiting for the next packet to arrive. It does this using the Wait for Occurrence primitive. That is why no waits are inside the Robot Main loop.

Greg McKaskle
Reply With Quote
Reply


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
"watchdog not fed" error Lumit NI LabVIEW 8 04-02-2010 18:45
Watchdog Not Fed but, All Systems Are Go. DHSrobotics Java 4 24-01-2010 22:01
Watchdog not fed ahudson Programming 1 22-01-2010 11:26
Fed Ex Airbill Troubles Eric Reed General Forum 12 19-02-2007 14:31
fed-ex shipping question brennerator General Forum 2 23-03-2005 07:09


All times are GMT -5. The time now is 03:23.

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