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.

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.

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.

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

You said:

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

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.

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!

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);

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