# Watchdog on joint velocity

**URL:** <https://forum.hello-robot.com/t/watchdog-on-joint-velocity/619>\
**Category:** Knowledge Base\
**Created:** [March 4, 2023, 12:16am UTC](https://forum.hello-robot.com/t/watchdog-on-joint-velocity/619 "2023-03-04T00:16:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aedsinger](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/aedsinger/32/6_2.png) [@aedsinger](https://forum.hello-robot.com/u/aedsinger)\
**Post date:** [March 4, 2023, 12:16am UTC](https://forum.hello-robot.com/t/watchdog-on-joint-velocity/619/1 "2023-03-04T00:16:37Z")

</div>

With Stretch Body 0.4.25 and firmware Stepper.v0.2.7p1 we have introduced a watchdog on the stepper velocity controllers. This was introduced primarily as a safety feature when doing velocity control on the base.

This watchdog requires that a new command is sent to the motor at least every 1 second. Otherwise, the controller will automatically switch to its SAFETY mode (equivalent to hitting the runstop).

For example, the script below sets a wheel in velocity control mode.

**Without the watchdog** : Ctrl-C out of this script and the base will continue to move.

**With the watchdog** : Ctrl-C out of this script and the base will stop after 1 second

```auto
#!/usr/bin/env python

import stretch_body.stepper
import time

motor = stretch_body.stepper.Stepper('/dev/hello-motor-right-wheel')
motor.startup()
motor.disable_sync_mode()
motor.enable_vel_traj()
motor.push_command()

motor.set_command(v_des=4.0)
motor.push_command()
time.sleep(20.0)
motor.stop()

```

**Default settings**

By default the watchdog is turned on for the base wheels but not for the arm and lift. You can turn it off/on by overwriting the default settings in your `stretch_user_params.yaml`.

```auto
>>$ stretch_params.py | grep watchdog
stretch_body.robot_params.nominal_params param.hello-motor-arm.gains.enable_vel_watchdog 0                             
stretch_user_params.yaml param.hello-motor-left-wheel.gains.enable_vel_watchdog 1                             
stretch_body.robot_params.nominal_params param.hello-motor-lift.gains.enable_vel_watchdog 0                             
stretch_user_params.yaml param.hello-motor-right-wheel.gains.enable_vel_watchdog 1 

```

**Upgrading / Installing**  
If you don’t have Stretch Body 0.4.25 and firmware Stepper.v0.2.7p1, then:

`pip3 install -U hello-robot-stretch-body`  
and  
`REx_firmware_updater.py --install`
