nasa-jpl / fastcat

C++ EtherCAT Device Command & Control Library
Other
42 stars 11 forks source link

Adds ability to modify the timeout in Profile Disengaging states #130

Closed d-loret closed 10 months ago

d-loret commented 10 months ago

Summary: Adds a command to the interface of actuator drivers to modify the maximum time the driver will wait in a Profile Disengaging state before faulting.

This capability is useful, for example, for an actuator that executes a commutation search when the corresponding Elmo drive is first enabled. Commutation searches take considerably longer than the one second previously used as timeout (1 s is the maximum value for the drive's brake disengage parameter BP[2]). The new command allows to temporarily increase the timeout so that the Fastcat driver does not fault during the commutation search.

Test Plan: Tested on the Walking Arm testbed which has actuators with no hall sensors that require an initial commutation search when they are first commanded to move.

Reviewers: preston-rogers

d-loret commented 10 months ago

Test results

The figures below show the behavior of the Actuator driver before and after the fix.

The test consists on sequentially commanding each actuator in the Walking Arm testbed to hold its current position so that their initial commutation search is initiated. Only the data from the second actuator in the arm chain (i.e. state 1) is shown for simplicity.

Before fix

As it can be seen from the plot below, when first commanding the actuator to hold its position, the commutation search is attempted (see first plot). However, because the Fastcat driver has a timeout of 1 second for the drive's servo_enabled variable to become true after a profile command (see second plot), the driver faults after such timeout expires (see third plot).

image

After fix

With the fix implemented, the timeout is set large enough before the first profile command so that the commutation completes successfully. In this case no fault is present and all actuators were able to hold position properly (only shown data from second actuator, i.e. state 1).

image