Skip to content

hall_check

Runs at once IDLE mode Takes control

Start or stop the Hall sensor check: its joint goes limp. The joint that homes on a Hall sensor (J6 on PAR6) gets a current limit of 0 and turns freely, and the robot reads the sensor's pin every control tick. Turn the joint by hand through its magnet and watch the status field hall_check: joint (the limp joint, 0 while the check is off), pin (the pin's level, 0 or 1, None until read), changes (the pin changes seen) and edge_deg (the joint's angle in degrees at the last change to 0 and at the last change to 1, None until seen). It works enabled or disabled, homed or not; every other joint keeps its IDLE behaviour.

The robot stops the check by itself on any mode change (homing, a jog, an error, the E-stop) and gives the joint its limits back, and 2 minutes after the last hall_check(True): calling it again while it runs starts the 2 minutes again. Stop it sooner with hall_check(False).

Syntax

robot.hall_check(on=True)

Arguments

Name Type Default Description
on bool True True starts the check, False stops it.

Returns

Any

None: the robot sends no data back.

Examples

robot.hall_check(True)
robot.wait(lambda s: s["hall_check"]["changes"] >= 2, 60)
robot.latest_status()["hall_check"]["edge_deg"]
robot.hall_check(False)

Further details

Warning

The joint holds nothing while the check runs: a load off its axis turns it by itself. Support the tool first.

Usage restrictions 5 codes

This command runs at once; it is not queued. The robot accepts it only when it is in IDLE mode, from the client that holds control or when no client does.

It answers with one of these codes when it does not carry the command out:

  • [6010] Command not allowed now — the message names the mode or state it needs
  • [6101] Control held by another client — another client holds control; the message names it
  • [6003] Invalid arguments — a raw client sent a value other than true / false or 1 / 0
  • [6025] RTI not running or not answering — rTI did not answer within 1 s: it is not running or not responding. The command may still have taken effect
  • [4006] Hall sensor check refused — the check cannot start: the arm has no Hall sensor joint, the robot software started less than 1.2 s ago, or a joint is free or a test move runs. The message says why; joint stays 0

In Python, a code above raises CommandRejected; its number is the code. The call raises:

  • CommandRejected: The robot refused it: it is not in IDLE mode, or another client holds control. Or RTI refused it or did not answer within 1 s (Errors:).
  • RobotTimeout: The robot did not answer within 5 s.
  • RobotConnectionError: The client is not connected.

If the connection drops while the call waits for the robot's answer, it raises CommandRejected with the code CONNECTION_LOST (DISCONNECTED after disconnect()); while it waits for the robot's status, RobotConnectionError.

Like every immediate command, it also answers BAD_ARGS when a raw client sends a value the robot cannot read at all, and INTERNAL when it fails inside the robot.

Protocol

A client that does not use robotclient sends this over the TCP command protocol (port 29000) for the example above:

{"id": "c1", "cmd": "hall_check", "args": [1]}

See also