moteus_tool --read
moteus_tool has long served as the primary interface to moteus
controllers from the command line for provisioning and diagnostics,
especially so when used in headless environments where running a
graphical tool like tview is not an option. As anyone who has
debugged a moteus system from the command line can attest to, finding
the contents of diagnostic stream channels is annoying at best and
that is only if you know how to do it. In short, you have to use
--console, and then type some undocumented text incantations .
Thus a new feature in moteus_tool: the --read CHANNEL command line
flag, which reads a single instance of an arbitrary diagnostic channel
from the device, then prints it to the console as JSON formatted
structured data. Let’s check out what that looks like:
As a first example, if you are examining a system which failed with a fault 33 gate driver fault, you can now do:
python -m moteus_tool -t 1 --read drv8323
and you’ll get something that looks like:
{
"fault": false,
"vds_ocp": false,
"gdf": false,
"uvlo": true,
"otsd": false,
"vds_ha": false,
"vds_la": false,
"vds_hb": false,
"vds_lb": false,
"vds_hc": false,
"vds_lc": false,
"fsr1": 128,
"sa_oc": false,
...
That way you can clearly see the problem is "uvlo": true
Any diagnostic channel available in tview can be displayed, including useful ones like servo_stats and motor_position. Unfortunately, enumerated values are not decoded, but at least it is a start.
Integration with moteus_tool --calibrate
It is also somewhat common to get a fault 33 during the moteus_tool --calibrate process, if your motor is faulty, your PSU has too low of
a current limit, or your soldering is faulty. Now, moteus_tool uses
this new facility to automatically print the contents of the drv8323
tree in those cases, which is what you would have had to do yourself
with tview immediately after anyways.
Upgrading
To get the new feature, upgrade your moteus package from pypi using:
python -m pip install --upgrade moteus
That’s all!