Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Benefits of "Periodic Tasks VI"? (http://www.chiefdelphi.com/forums/showthread.php?t=102574)

Tom Line 12-02-2012 21:15

Re: Benefits of "Periodic Tasks VI"?
 
Ok, this brings up another question I've been thinking about.

Greg, if a speed has not changed from the last loop, is there any reason to call the set speed command? Will not calling it result in a watchdog?

ratdude747 12-02-2012 21:17

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by Tom Line (Post 1125322)
Ok, this brings up another question I've been thinking about.

Greg, if a speed has not changed from the last loop, is there any reason to call the set speed command? Will not calling it result in a watchdog?

yes, it would if the delay was long enough. it used to be 100ms last I checked.

(safety measure to prevent runaway robots)

Joe Ross 12-02-2012 21:18

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by Tom Line (Post 1125322)
Greg, if a speed has not changed from the last loop, is there any reason to call the set speed command? Will not calling it result in a watchdog?

The motor safety will trigger if it isn't updated every 100ms (assuming that you didn't disable the motor safety or change the timeout limit). It will not affect the watchdog.

Tom Line 12-02-2012 21:19

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by ratdude747 (Post 1125324)
yes, it would if the delay was long enough. it used to be 10ms last I checked.

(safety measure to prevent runaway robots)

Shouldn't be 10ms, since setspeed commands in teleop aren't called that often.

ratdude747 12-02-2012 21:21

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by Tom Line (Post 1125326)
Shouldn't be 10ms, since setspeed commands in teleop aren't called that often.

yeah, it is 100ms. typo. fixing original

Tom Line 12-02-2012 21:21

Re: Benefits of "Periodic Tasks VI"?
 
Thanks Joe. So - if you've disabled the motor safeties, what happens if set speed is not called for say, 2 or 3 seconds. Does the motor stay at the last set point?

I ask because some of the Beta teams saw a noticeable improvement in CPU usage by putting a simple if/then around their set speed and only calling it on a change.

Alan Anderson 12-02-2012 21:25

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by Tom Line (Post 1125322)
Ok, this brings up another question I've been thinking about.

Greg, if a speed has not changed from the last loop, is there any reason to call the set speed command? Will not calling it result in a watchdog?

I'm not Greg, but I know the answer. If a motor has its Motor Safety watchpup enabled, you must continue to set it at least as often as the safety configuration requires. Drive motors have the safety period set at 100 milliseconds. Other motors have the safety disabled by default. If you let a motor's safety timeout elapse without setting its output, that motor will be shut off.

If a motor's safety feature is not enabled, it will keep its last commanded output value indefinitely. That includes switching from autonomous to teleoperated mode (or vice versa, which can happen during testing), so you should make sure your motors are initialized to something reasonable when such things happen.

Greg McKaskle 12-02-2012 21:26

Re: Benefits of "Periodic Tasks VI"?
 
There are several watchdog and safety mechanisms in effect.

The system watchdog will shutdown the robot outputs when the DS communications is interrupted or an estop takes place. The 100ms timeout is controlled by the Robot Safety mechanism and it automatically zeroes configured robotDrive motors after 100ms. Not setting RobotDrive every 20ms will lower CPU usage, but I'm curious as to how much.

Greg McKaskle

Pirate programe 13-02-2012 17:01

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

The system watchdog will shutdown the robot outputs when the DS communications is interrupted or an estop takes place.
What could cause Driver Station communications to be interrupted?

our team is using UDP to transmit between the Dashboard and the cRIO, which appears to be delaying the watchdog being fed, and interrupting robot communications. the port we're using for the socket isn't being used anywhere else in the code, from what we can see, so what could it be?

ratdude747 13-02-2012 17:58

Re: Benefits of "Periodic Tasks VI"?
 
Quote:

Originally Posted by Pirate programe (Post 1125872)
What could cause Driver Station communications to be interrupted?

our team is using UDP to transmit between the Dashboard and the cRIO, which appears to be delaying the watchdog being fed, and interrupting robot communications. the port we're using for the socket isn't being used anywhere else in the code, from what we can see, so what could it be?

wireless failure on the robot, wireless failure of the field, loose cable at the robot, loose able on the field, loose cable at the driver's station, software/hardware glitch on the robot/field/driver's station, random acts of god, solar flares :D , etc.

Greg McKaskle 13-02-2012 19:23

Re: Benefits of "Periodic Tasks VI"?
 
Can you describe more? Perhaps post some code?

Greg Mckaskle


All times are GMT -5. The time now is 20:18.

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