HostInModule

HostInModule is the entry point for a remote host commanding motion — a teleoperation link, a vision system, a hand controller.
3.30–3.34

HostInModule is the entry point for a remote host commanding motion — a teleoperation link, a vision system, a hand controller. It turns a stream of positions arriving over a network into a setpoint the machine can safely follow.

Tracking is relative. The machine follows the host’s movement, not its absolute position, so the two do not need to start in the same place. You can engage tracking with the host anywhere and the machine will not jump.

flowchart LR
    i1(["input"]) --> B["HostInModule"]
    i2(["track/enable"]) --> B
    p1(["offset"]) --> B
    p2(["track/factor"]) --> B
    p3(["track/enableFader/fadeInTime, fadeOutTime"]) --> B
    p4(["track/syncFader/speed, enable"]) --> B
    p5(["track/watchdog/timeout, enable"]) --> B
    p6(["filter/order, omega, beta"]) --> B
    p7(["interpolator/sampleFactor"]) --> B
    B --> o1(["output"])
    B --> o2(["inputFilteredOffset"])
    B --> o3(["track/isTracking"])
    B --> o4(["track/enableFader/value"])
    B --> o5(["track/syncFader/value, fadeTime"])
    B --> o6(["filter/output"])
    B --> o7(["interpolator/output"])
    B --> o8(["reference, resetting"])

If the host stops writing track/enable, tracking is dropped after track/watchdog/timeout — a tenth of a second by default. This is the block’s main safety feature. Leave the watchdog on.

Two of the signals below are read-only in the tree. reference and resetting are published for you to watch, but only your application can set them. You cannot trigger a reset from the parameter tree.

Nothing here limits the machine’s speed. track/factor multiplies every movement the host makes, and it is not bounded. The limits belong in the blocks downstream — check they are in place before raising it.

An orientation instance has its signals under eulerZYX/ and quaternion/ instead of at the top level. Everything else below is the same.

Signals

Inputs

Path Unit Range Description
input host unit unbounded The host’s position stream, one value per channel. A value that is not a number poisons the output permanently — only a reset recovers it.
track/enable - true or false Engages tracking. The host must keep writing this, not just set it once: the watchdog drops tracking if writes stop.

Outputs

Path Unit Description
output machine unit The setpoint for the machine.
inputFilteredOffset host unit The host’s input after filtering and the offset — what tracking actually follows. Trace this against input to see what the filter is doing.
track/isTracking - Tracking authority is not zero.
track/enableFader/value - How much authority tracking currently has, 0 to 1. Ramps rather than stepping.
track/syncFader/value - How far through a sync move, 0 to 1.
track/syncFader/fadeTime s Computed, not set: how long the current sync move will take. -1 means no sync move will happen.
filter/output host unit The filtered input, before the offset.
interpolator/output host unit The interpolated input, before the filter.
reference machine unit Where a reset sends the output. Set by your application, not from the tree.
resetting - A reset is in effect. Also application-set.

Parameters

Path Unit Default Range Effect
offset host unit zeros unbounded Added to the host’s input after filtering. Changing it does not jump the machine — the block deliberately absorbs the discontinuity.
track/factor - 1 unbounded Motion scaling. 0.1 makes the machine move a tenth of what the host does; 10 makes it move ten times as much. Not limited.
track/enableFader/fadeInTime s 0.1 0 upward How long tracking takes to reach full authority. 0 means instant.
track/enableFader/fadeOutTime s 0.1 0 upward How long it takes to release.
track/syncFader/enable - false - Whether to move the machine to the host’s absolute position when tracking engages. Off means pure relative tracking from wherever the machine is.
track/syncFader/speed machine unit per second 0.1 0 upward How fast that sync move goes. A speed of 0 means the machine never syncs and the output stays put. On an orientation instance the default is 1 rad/s.
track/watchdog/enable - true - Whether to drop tracking when the host stops writing. Leave this on.
track/watchdog/timeout s 0.01 above 0 How long to wait before deciding the host is gone.
filter/order - 2 0, 1 or 2 The low-pass order. 0 disables filtering. Values outside the range are clamped.
filter/omega rad/s 15.7 (2.5 Hz) above 0 The cut-off. Negative values are used as their magnitude.
filter/beta - 0.707 above 0 Damping, order 2 only. 0.707 gives the flattest response.
interpolator/sampleFactor - 1 1 upward How many control cycles pass between host updates. 1 disables interpolation.

All are persistent and survive a controller restart. No parameters exist below this block beyond those listed.

Setup

  1. Connect the host’s stream to input and have it write track/enable every cycle it wants tracking.

  2. Leave track/enable false. Confirm output is stationary.

  3. Set interpolator/sampleFactor to how many control cycles pass between host updates. If the host writes at 100 Hz on a 1 kHz task, that is 10.

  4. Set filter/omega — go to Tuning.

  5. Set track/factor to 1 for a first test, and check the machine’s own speed and position limits are configured, because this block has none.

  6. Leave track/syncFader/enable false so tracking starts from wherever the machine is.

  7. Have the host raise track/enable and move slowly.

    Step 7 gives a remote operator control of the machine. Start with a small track/factor, a slow host, and someone at the stop button.

  8. Confirm output follows the host’s movement and track/isTracking is true.

  9. Have the host stop writing track/enable entirely, and confirm tracking drops within track/watchdog/timeout.

Tuning

  1. Set interpolator/sampleFactor first, from the host’s real update rate. Too low and you see a step at each host update; too high and the output is stale. Trace interpolator/output against input to check.
  2. Set filter/omega from the noise on the host’s signal. Lower is smoother and adds more lag. Trace filter/output against interpolator/output.
  3. Leave filter/order at 2 and filter/beta at 0.707 unless you have a reason. Order 1 has less lag and less rejection; order 0 is no filter at all.
  4. Set track/factor from the working ratio you want between the host’s motion and the machine’s. Raise it in steps, checking the machine’s limits hold at each one.
  5. Set the fade times from how abruptly you are willing for authority to change — a tenth of a second is a reasonable default for a hand controller.
  6. Turn on the sync move only if the machine should meet the host’s absolute position. Set track/syncFader/speed to a safe approach speed and read track/syncFader/fadeTime back to see how long it will take.
  7. Tighten track/watchdog/timeout as far as the host’s jitter allows. Too tight drops tracking on a network hiccup; too loose leaves the machine following a dead host for longer.

Tracking faded in at 0.2 seconds and out at 0.9. The output picks up thehost’s movement as authority ramps in, and holds where it was when authorityramps out.

The output holds at its last value when tracking releases. It does not spring back.

Symptom Cause Action
The machine jumped when tracking engaged The sync move is on and the host was far away Turn track/syncFader/enable off, or lower the sync speed
The machine never reaches the host’s position Expected without the sync move — tracking is relative Turn the sync move on if you want absolute
The sync move never happens track/syncFader/speed is 0 Set it above 0; check track/syncFader/fadeTime is not -1
Tracking dropped by itself The host stopped writing track/enable and the watchdog fired The host must write it continuously
Tracking drops on network hiccups track/watchdog/timeout is too tight Lengthen it
Tracking does not drop when the host dies track/watchdog/enable is false Set it true
The machine moves too far for the host’s movement track/factor is too high Lower it, and check the machine’s own limits
The machine overspeeds This block has no speed limit Set the limits downstream
The output is noisy filter/omega is too high, or the order is 0 Lower the cut-off, or use order 2
The machine lags the host The filter, the interpolator, or both Raise filter/omega; check sampleFactor matches the host’s real rate
The output steps at each host update interpolator/sampleFactor is too low Set it to the real ratio
The output is stale and smooth sampleFactor is too high Lower it
Changing offset did not move the machine Expected: the block absorbs the change deliberately Nothing
Authority switches abruptly The fade times are 0 Set them above 0
The output froze and stays wrong A value that is not a number reached the input Reset from your application; fix the link
I cannot reset from the tree reference and resetting are read-only there Your application must do it
A restart resumed tracking oddly The filter and interpolator keep their history across a restart Re-engage tracking after a start

A starting point for a hand controller at 100 Hz on a 1 kHz task:

track/factor                  = 1.0
track/enableFader/fadeInTime  = 0.1
track/enableFader/fadeOutTime = 0.1
track/syncFader/enable        = false
track/watchdog/enable         = true
track/watchdog/timeout        = 0.01
filter/order                  = 2
filter/omega                  = 15.7
filter/beta                   = 0.707
interpolator/sampleFactor     = 10

Limits and errors

Limit Set by What happens Reported
Tracking Fixed Relative. The machine follows increments, scaled by track/factor. The host’s absolute position is irrelevant unless the sync move is on track/isTracking
track/factor Nothing Not limited. It multiplies every host movement Not reported
Machine speed and position Nothing here This block imposes no limits at all. They belong downstream Not reported
Host loss track/watchdog/… Tracking is dropped if track/enable stops being written track/isTracking
Authority The enable fader Ramps in and out rather than switching track/enableFader/value
Sync move track/syncFader/… Speed-limited move to the host’s position on engage. Never completes before the fade-in does track/syncFader/value, …/fadeTime
syncFader/speed of 0 Fixed No sync move happens and the output holds …/fadeTime reads -1
Filtering filter/… Order clamped to 0, 1 or 2; omega and beta used as magnitudes. Cannot be made unstable from the tree filter/output
Interpolation interpolator/sampleFactor Interpolates between the last two host samples, so the output lags by one host period interpolator/output
offset changes Handled Neither a filter transient nor a position jump — the block absorbs both Not reported
Values that are not numbers Nothing Not checked. One bad sample poisons the output permanently until a reset Not reported
Reset and reference Application only Not writable from the tree, only published resetting, reference
Startup Fixed The filter and interpolator keep their history; the watchdog defaults tracking to off Not reported
Channel count Fixed at build time Cannot be changed from the tree Not reported

This block logs nothing, ever. Every condition above shows as a value on a trace, or not at all.


Verified against motorcortex-control3 3.30.0 (bc348fd).