Go to Post We can't quite define FIRST according to past standards and traditions, because it is shaping the future and does not conform to today's model of sports. - JaneYoung [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 21-01-2011, 15:06
Austin3324 Austin3324 is offline
Lead Programmer Team 3324
FRC #3324 (Metrobots)
Team Role: Programmer
 
Join Date: Apr 2010
Rookie Year: 2008
Location: Columbus, Ohio
Posts: 10
Austin3324 is an unknown quantity at this point
LabView Programming - Do we still need Watchdog?

All,

Since creating a new coding project and doing some programming within it, I noticed that Watchdog is no longer incorporated in any part of the program: Is it supposed to be that way?

Last year I remember getting into a lot of problems because we didn't "feed" Watchdog and I also seem to remember it coming standard in the robot project. (I was just a backup programmer last year and only really had experience programming when we got to the Buckeye Regionals last year.) Do we need to have Watchdog active this year or, if not, do you think it would still be a good idea to have it running just in case?

Thanks for your help in advance!

Sincerely,

Austin,
Lead Programmer, Team 3324
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2011, 15:11
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: LabView Programming - Do we still need Watchdog?

Quote:
Originally Posted by Austin3324 View Post
All,

Since creating a new coding project and doing some programming within it, I noticed that Watchdog is no longer incorporated in any part of the program: Is it supposed to be that way?

Last year I remember getting into a lot of problems because we didn't "feed" Watchdog and I also seem to remember it coming standard in the robot project. (I was just a backup programmer last year and only really had experience programming when we got to the Buckeye Regionals last year.) Do we need to have Watchdog active this year or, if not, do you think it would still be a good idea to have it running just in case?

Thanks for your help in advance!

Sincerely,

Austin,
Lead Programmer, Team 3324
I haven't looked at this year's LV code to tell you if the watch dog is included.

As for the second part of your post, Using a watchdog timer is a good practice to ensure you don't get stuck in a loop you don't want to be in. I would reccomend using a watch dog.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2011, 15:16
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: LabView Programming - Do we still need Watchdog?

Quote:
Originally Posted by Austin3324 View Post
All,

Since creating a new coding project and doing some programming within it, I noticed that Watchdog is no longer incorporated in any part of the program: Is it supposed to be that way?

Last year I remember getting into a lot of problems because we didn't "feed" Watchdog and I also seem to remember it coming standard in the robot project. (I was just a backup programmer last year and only really had experience programming when we got to the Buckeye Regionals last year.) Do we need to have Watchdog active this year or, if not, do you think it would still be a good idea to have it running just in case?

Thanks for your help in advance!

Sincerely,

Austin,
Lead Programmer, Team 3324
Austin -

The quick answer is "Nope, you are free to ignore the watchdog!"

The long answer is that last year's watchdog had a litter of watchpuppies. Each of the actuators has its own watchpuppy hidden inside of its set functions. For example: Whenever you set the speed of your lift motor, the lift motor's watchpuppy is fed. If the lift motor code gets stuck, that motor will be shut down and a message will be displayed - but the rest of your robot is free to continue!

Watchpuppies are automatically brought online the first time an actuator is spoken to, and automatically pet each time after that. As long as your code is perfect, you shouldn't ever get bitten by one. Here is a partial list of reasons that watchpuppies bite:
1) If you have your drive code in the same loop as your camera, and the camera is too slow.
2) If you use an actuator in autonomous but not in teleop, you will get a message and the actuator will stop moving.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2011, 15:19
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,862
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: LabView Programming - Do we still need Watchdog?

Don't worry James, there is a Watchdog...

It's implemented differently this year though, so Austin, you will not be doing what you did or saw done last year.


The old Watchdog vi's are still in the palette, but I would not use them.
They are there to maintain compatibility with last year's code.

This year NI has incorporated Safety VI's that are relatively invisible to you. They are optional, but enabled on the Open Drive Motors by default (not the generic Open Motor). The implementation is better than last year's generic Watchdog.

You will see the Safety VI enable if you double-click on the Drive Open in Begin.vi.
You can enable/disable it there.

------
P.S. I'm a wee bit behind Eric, but have one note to add.

Warning:
These Safety vi's force a particular style of coding and old code may no longer work correctly.
You can no longer set and leave a motor until the next change, for instance, in an autonomous flat sequence structure.
It needs to be set and reset at a fairly rapid pace, even if you're setting it to the same value over and over again.

I'm undecided myself how or if we will use these. It can make teaching autonomous needless complex to a beginning student.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 10:11.
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2011, 15:41
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: LabView Programming - Do we still need Watchdog?

Quote:
Originally Posted by Mark McLeod View Post
Warning:
These Safety vi's force a particular style of coding and old code may no longer work correctly.
You can no longer set and leave a motor until the next change, for instance, in an autonomous flat sequence structure.
It needs to be set and reset at a fairly rapid pace, even if you're setting it to the same value over and over again.
Yep. This bit us the other day when I was leading the team's lead programmer through the "easy" way to write an autonomous routine. It took longer than I want to admit before I slapped my forehead and remembered about the safety timeouts.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-01-2011, 15:45
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,537
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: LabView Programming - Do we still need Watchdog?

Alan, I'm curious if you saw a warning or error on the driver station diagnostics. If you did see one, what the message that folks should look for that tells them their watchpuppies (Nice Eric...) are biting and they have something wrong?
Reply With Quote
  #7   Spotlight this post!  
Unread 21-01-2011, 16:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: LabView Programming - Do we still need Watchdog?

Quote:
Originally Posted by Tom Line View Post
Alan, I'm curious if you saw a warning or error on the driver station diagnostics.
Sorry, I wasn't looking anywhere near the Driver Station during the process. I was rotating the cart the robot was sitting on while the lead programmer watched the gyro-computed heading and monitored the progress of the flat sequence we had placed in Autonomous Independent.
Reply With Quote
  #8   Spotlight this post!  
Unread 21-01-2011, 16:49
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,862
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: LabView Programming - Do we still need Watchdog?

I take it back...
I re-checked my notes and I misremembered one part.

This is what happens when a Safety vi trips.

The status on the Driver Station remains "Autonomous Enabled" or whatever field mode we're in.
The Diagnostics Message Window shows this error message each time it happens:
Code:
ERROR <Code> -44061 occurred at "Left and Right Motors" in the VI path: Robot Main.vi
<time>23:15:45 01/21/2011
FRC:  The loop that contains RobotDrive is not running fast enough. 
This error can occur if the loop contains too much code, or if one or 
more other loops are starving the RobotDrive loop.
If you have an autonomous that makes several drive moves then it will:
  1. do the first drive move for .1 second
  2. stop and display the error above
  3. do the second drive move for .1 second
  4. stop and display the error above
  5. etc.
If you have a bunch of moves close together you'll think the cRIO is pulsing.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-01-2011 at 10:13.
Reply With Quote
  #9   Spotlight this post!  
Unread 29-01-2011, 19:07
wazcodez's Avatar
wazcodez wazcodez is offline
Registered User
AKA: Megh Suthar
FRC #2076 (Blackscots)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2008
Location: Toronto
Posts: 19
wazcodez is infamous around these partswazcodez is infamous around these parts
Send a message via MSN to wazcodez
Re: LabView Programming - Do we still need Watchdog?

Quote:
Originally Posted by Mark McLeod View Post
I take it back...
I re-checked my notes and I misremembered one part.

This is what happens when a Safety vi trips.

The status on the Driver Station remains "Autonomous Enabled" or whatever field mode we're in.
The Diagnostics Message Window shows this error message each time it happens:
Code:
ERROR <Code> -44061 occurred at "Left and Right Motors" in the VI path: Robot Main.vi
<time>23:15:45 01/21/2011
FRC:  The loop that contains RobotDrive is not running fast enough. 
This error can occur if the loop contains too much code, or if one or 
more other loops are starving the RobotDrive loop.
If you have an autonomous that makes several drive moves then it will:
  1. do the first drive move for .1 second
  2. stop and display the error above
  3. do the second drive move for .1 second
  4. stop and display the error above
  5. etc.
If you have a bunch of moves close together you'll think the cRIO is pulsing.
How do you fix it ?
__________________
" When you copy from one source it's called plagiarism when u copy from multiple it's Research .. ! " - Megh Suthar
Reply With Quote
  #10   Spotlight this post!  
Unread 29-01-2011, 19:26
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,862
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: LabView Programming - Do we still need Watchdog?

To fix it, you should analyze your code to really understand if you've got slow code that needs to be sped up. If your code really is laggy then it'll be sluggish in responding to the driver controls even without the Safety vi and it must be fixed.

There's a drop-in tool NI included with the framework this year called Elapsed Times.vi
You'll find it in your project under the Support Code folder.
Just drop it into teleop.vi, Run the project from Robot Main.vi, and bring up the Elapsed Times.vi front panel to watch how long everything takes.

If it's just a coding style that's the problem, then the Safety vi can be turned off.
Inside Open 2/4 Motor (used in Begin.vi) there is an enable/disable.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 29-01-2011 at 23:20.
Reply With Quote
  #11   Spotlight this post!  
Unread 29-01-2011, 20:55
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,753
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: LabView Programming - Do we still need Watchdog?

The LV team fully intended to come up with a good replacement for the Delay and Feed VI. Since it never managed to be completed, I'll relate the concept.The idea is to save a copy of Delay and Feed and create a Delay and Update. One step inside the Robot Drive VIs, you'll find a call to Safety Update. You don't need to wire values or anything except the refnum for RobotDrive. Add the appropriate refnums to the connector. If the correct updates are called in place of the Feed of the old VI, I believe the piecewise autonomous will work as before, and I believe that pausing a VI or hitting a breakpoint will typically halt the robot. I say typically because unlike the watchdog, it is possible to pause some of the lower level safety VIs and bypass the safety. This shouldn't happen unless someone is way off the mark in their debugging.

Since I haven't implemented this, and certainly haven't tested it, please test the breakpoint in auto carefully before trusting it.

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


All times are GMT -5. The time now is 16:58.

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