DriveTests

class ingeniamotion.drive_tests.DriveTests(motion_controller)
digital_halls_test(servo='default', axis=1, apply_changes=True)

Executes the digital halls feedback test given a target servo and axis. By default test will make changes in some drive registers like feedback polarity and others suggested registers. To avoid it, set apply_changes to False.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • apply_changes (bool) – if True, test applies changes to the servo, if False it does not. True by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers":
        {"FBK_DIGHALL_POLARITY": 0},
    # (str) Human readable result message
    "result_message": "Feedback test pass successfully"
}

Raises

TestError – In case the servo or setup configuration makes impossible fulfilling the test

incremental_encoder_1_test(servo='default', axis=1, apply_changes=True)

Executes the incremental encoder 1 feedback test given a target servo and axis. By default test will make changes in some drive registers like feedback polarity and other suggested registers. To avoid it, set apply_changes to False.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • apply_changes (bool) – if True, test applies changes to the servo, if False it does not. True by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers":
        {"FBK_DIGENC1_POLARITY": 0},
    # (str) Human readable result message
    "result_message": "Feedback test pass successfully"
}

Raises

TestError – In case the servo or setup configuration makes impossible fulfilling the test

incremental_encoder_2_test(servo='default', axis=1, apply_changes=True)

Executes incremental encoder 2 feedback test given a target servo and axis. By default test will make changes in some drive registers like feedback polarity and other suggested registers. To avoid it, set apply_changes to False.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • apply_changes (bool) – if True, test applies changes to the servo, if False it does not. True by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers":
        {"FBK_DIGENC2_POLARITY": 0},
    # (str) Human readable result message
    "result_message": "Feedback test pass successfully"
}

Raises

TestError – In case the servo or setup configuration makes impossible fulfilling the test

absolute_encoder_1_test(servo='default', axis=1, apply_changes=True)

Executes absolute encoder 1 feedback test given a target servo and axis. To know more about it see digital_halls_test().

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

absolute_encoder_2_test(servo='default', axis=1, apply_changes=True)

Executes absolute encoder 2 feedback test given a target servo and axis. To know more about it see digital_halls_test().

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

secondary_ssi_test(servo='default', axis=1, apply_changes=True)

Executes secondary SSI feedback test given a target servo and axis. To know more about it see digital_halls_test().

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

get_feedback_test(feedback, servo='default', axis=1)
Return type

Feedbacks

commutation(servo='default', axis=1, apply_changes=True)

Executes a commutation calibration given a target servo and axis. By default commutation will make changes in some drive registers like commutation angle offset and other suggested registers. To avoid it, set apply_changes to False.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • apply_changes (bool) – if True, test applies changes to the servo, if False it does not. True by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers":
        {"COMMU_ANGLE_OFFSET": 0.12},
    # (str) Human readable result message
    "result_message": "Phasing process finished successfully"
}

Raises
  • TestError – If servo or setup configuration makes impossible complete the calibration.

  • TypeError – If some parameter has a wrong type.

phasing_check(servo='default', axis=1)

Checks servo phasing.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers": {},
    # (str) Human readable result message
    "result_message": "Phasing process finished successfully"
}

sto_test(servo='default', axis=1)

Check STO

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers": {},
    # (str) Human readable result message
    "result_message": "Phasing process finished successfully"
}

brake_test(servo='default', axis=1)

Run brake test.

Parameters
  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

Return type

Brake

Returns

Instance of Brake test. Call Brake.finish() to end the test.

polarity_feedback_single_phase_test(feedback, servo='default', axis=1, apply_changes=True)

Executes polarity feedback test for single phase motors given a target servo and axis. By default, test will make changes in feedback polarity. To avoid it, set apply_changes to False.

Parameters
  • feedback (SensorType) – feedback sensor type

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • apply_changes (bool) – if True, test applies changes to the servo, if False it does not. True by default.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (dict) Suggested register values
    "suggested_registers":
        {"FBK_DIGENC2_POLARITY": 0},
    # (str) Human readable result message
    "result_message": "Feedback test pass successfully"
}

Raises
  • TestError – In case the servo or setup configuration makes impossible fulfilling the test

  • TypeError – If some parameter has a wrong type.

resolution_feedback_single_phase_test(feedback, servo='default', axis=1, kp=None, ki=None, kd=None)

Executes resolution feedback test for single phase motors given a target servo and axis. This test needs a human check to ensure the feedback is well configured. The test will move the motor with the number of counts set in the feedback resolution, if the motor does not move exactly one revolution this means that the feedback is not configured correctly.

Parameters
  • feedback (SensorType) – feedback sensor type

  • servo (str) – servo alias to reference it. default by default.

  • axis (int) – axis that will run the test. 1 by default.

  • kp (Optional[float]) – overrides test velocity Kp. If None use test default Kp value. At the end of the test initial drive value is restored.

  • ki (Optional[float]) – if ki is None is ignored, overrides test velocity Ki. If None use test default Ki value. At the end of the test initial drive value is restored.

  • kd (Optional[float]) – if kd is None is ignored, overrides test velocity Kd. If None use test default Kd value. At the end of the test initial drive value is restored.

Return type

Optional[Dict[str, Union[SeverityLevel, Dict[str, Union[int, float, str]], str]]]

Returns

Dictionary with the result of the test:

{
    # (int) Result code
    "result_severity": 0,
    # (str) Human readable result message
    "result_message": "Feedback test pass successfully"
}

Raises

TestError – In case the servo or setup configuration makes impossible fulfilling the test