Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Motor Safety vs. Watchdog issues (http://www.chiefdelphi.com/forums/showthread.php?t=111154)

JacobGH 13-01-2013 15:41

Motor Safety vs. Watchdog issues
 
Hey guys,
Has the Watchdog module been deprecated in place of Motor Safety? In the last few days, we've had tremendous trouble with that message everyone dreads to see: "Robot Drive... Output not updated often enough." So we tried messing with the Watchdog. First we set the expiraton time to several seconds. Then I tried feeding it in my methods, and finally just disabling it alltogether (I know that's bad form and safety procedures, but we're just trying to debug right now). But the message just comes all the time and the robot refuses to move.

So do I use Motor Safey? And if so, does it work the same way?

I should also note that we get the "output not updated..." error whenever we an image processing algorithm, which I find irritating. It appears that any algorithm which takes more than about 1/10 of a second to run will create this error. Is that by design, because if so, then we can't run any interesting algorithms without freezing up the robot.

calcmogul 13-01-2013 16:08

Re: Motor Safety vs. Watchdog issues
 
In C++, if you call "mainDrive.SetExpiration( 1.f );" the expiration for mainDrive's motors will be increased to 1 second, given that mainDrive is an instance of RobotDrive.

JacobGH 13-01-2013 16:23

Re: Motor Safety vs. Watchdog issues
 
Ok, that makes sense. So it's just a method I call on the RobotDrive object. I forgot to mention in my question that I'm using Java with the latest cRIO image, the 2013 version 46. But what you mentioned regarding your C++ code still makes sense when translating to Java, so thank you.

Greg McKaskle 13-01-2013 19:53

Re: Motor Safety vs. Watchdog issues
 
To answer the original question in more detail, the watchdog isn't depricated, but it isn't used by default. The Safety config isn't required, but it is on by default for the drive base. You are free to turn if off once you trust that a badly behaved loop won't force you to disable or estop the robot in panic. You can increase the timeout, as just discussed. You can also time your code to see how often you are actually updating the motors and determine if that is what you deem reasonable. Perhaps you need to speed things up or break things up.

Greg McKaskle

JacobGH 13-01-2013 19:56

Re: Motor Safety vs. Watchdog issues
 
You said:
Quote:

Originally Posted by Greg McKaskle (Post 1214561)
The Safety config isn't required, but it is on by default for the drive base.
Greg McKaskle

Are you referring to the safety controls that are manipulated using methods that are members of the robotDrive class? (I'm in java).

Greg McKaskle 13-01-2013 20:04

Re: Motor Safety vs. Watchdog issues
 
That may be the way it was exposed in Java. I am more familiar with LV and thought I was using generic terminology. By drive base, I meant the RobotDrive class.

I suspect that in addition to the timeout, there is also a safety disable/enable property.

cjlane1138 14-01-2013 11:17

Re: Motor Safety vs. Watchdog issues
 
You have to do (RobotDrive variable)->SetSafetyEnabled(false); and GetWatchdog().SetEnabled(false);

That should work. We have always had issues and doing this works perfectly every year!

BradAMiller 14-01-2013 19:49

Re: Motor Safety vs. Watchdog issues
 
In Java the motor safety stuff is enabled by default only for the RobotDrive class. Those messages are because you aren't updating the RobotDrive values often enough for the default timeout.

For example, if in some autonomous code you do:

drive.arcadeDrive(1, 0);
Timer.delay(1);

The 1 second delay will cause the motors to not be updated and you'll get lots of those messages.

Brad


All times are GMT -5. The time now is 02:15.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi