[FRC 2014] Safety Config Tutorial
Click here to load reader
-
Upload
nhstechnology -
Category
Documents
-
view
219 -
download
2
Transcript of [FRC 2014] Safety Config Tutorial
Safety Configuration Tutorial
For FRC 2010 and earlier, the Watchdog timer was used as a safety mechanism to prevent runaway
robots. LabVIEW FRC 2011 introduced a new way to implement similar functionality for MotorControl,
PWM, Relay, RobotDrive, and Solenoid operations with the Safety Configuration VIs. These safety
configuration VI’s are unchanged for newer versions of LabVIEW FRC. There are three main steps to
using the safety features:
1. Opening a new reference to a MotorControl, PWM, Relay, RobotDrive, or Solenoid creates a
“safety reference” for that device in the background.
2. Calling the Safety Config VI for the device allows you to enable or disable the safety feature for
that device and to set a timeout value.
3. The value written to that device must be updated at least every period of the timeout counter
or the safety mechanism will interrupt its output. The following actions are taken for each type
of device:
MotorControl – stops the motor
PWM – turns off PWM
Relay – resets the relay to its default value
RobotDrive – stops the motor
Solenoid – resets the solenoid to its default value
NOTE: Only the RobotDrive Open VIs enable the safety feature by default. For other devices, the safety
feature needs to be manually enabled by calling the Safety Config VI for that device.
Here is an example of the Safety Config VI being used for MotorControl:
When the MotorControlSafety VI is called it automatically creates a “safety reference” for that device in
the background. The MotorControlSafetyConfig VI is then used to enable the safety feature and set a
timeout value of 100ms. Inside the While Loop, the MotorControlSetOutput VI is called repeatedly. If
more than 100ms elapse between calls to the MotorControlSetOutput VI then the motor will be stopped
until the MotorControlSetOutput VI is called again. At the end of the program, calling the
MotorControlClose VI also closes the “safety reference” in the background.
For safety reasons it is recommended that you always enable the safety feature for your MotorControl,
PWM, Relay, RobotDrive, and Solenoid devices. However, if you prefer to use the Watchdog VIs to
implement a safety mechanism in your code, those are also still available to you in newer versions of
LabVIEW FRC.