| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "$id": "https://prod2u.local/schemas/prod2u-p4-normal-host-contract-v4.schema.json",
- "title": "Prod2U Profile 4 Normal minimal actuator host contract v4",
- "type": "object",
- "additionalProperties": false,
- "required": [
- "schema",
- "profile",
- "profile_id",
- "protocol",
- "version_source",
- "wire",
- "frame_types",
- "commands",
- "unsupported_commands",
- "responses",
- "motion",
- "limit",
- "watchdog",
- "programming"
- ],
- "properties": {
- "schema": {"const": "prod2u-p4-normal-host-contract-v4"},
- "profile": {"const": "prod2u-p4-normal-actuator-binary921-v3"},
- "profile_id": {"const": 4},
- "protocol": {"const": "binary921-v3"},
- "version_source": {"const": "full_git_commit"},
- "wire": {
- "type": "object",
- "required": [
- "magic_hex",
- "version",
- "seq",
- "timestamp_tick",
- "header_offsets",
- "crc16",
- "request_compatibility",
- "ordinary_response_order",
- "motor_status_response_order",
- "unsolicited_frames"
- ],
- "properties": {
- "magic_hex": {"const": "A55A"},
- "version": {"const": 2},
- "seq": {"const": 0},
- "timestamp_tick": {"const": 0},
- "header_offsets": {
- "const": {
- "magic": [0, 1],
- "version": 2,
- "profile_id": 3,
- "frame_type": 4,
- "seq_u32_le": [5, 8],
- "timestamp_tick_u32_le": [9, 12],
- "payload_length_u8": 13,
- "payload": [14, "14+payload_length-1"],
- "crc16_le": ["14+payload_length", "15+payload_length"]
- }
- },
- "crc16": {
- "const": {
- "name": "CRC-16/CCITT-FALSE",
- "polynomial": 4129,
- "initial": 65535,
- "reflect_input": false,
- "reflect_output": false,
- "xor_output": 0,
- "coverage": "version_through_payload_inclusive",
- "wire_byte_order": "little-endian"
- }
- },
- "request_compatibility": {"const": "BYTE_EXACT_FROZEN"},
- "ordinary_response_order": {"const": ["HOST_ACK"]},
- "motor_status_response_order": {"const": ["HOST_ACK", "MOTION_STATUS"]},
- "unsolicited_frames": {"const": false}
- },
- "additionalProperties": false
- },
- "frame_types": {
- "const": {
- "HOST_CMD": 5,
- "HOST_ACK": 6,
- "HOST_BATCH_CMD": 7,
- "MOTION_CMD": 17,
- "MOTION_STATUS": 18
- }
- },
- "commands": {
- "type": "object",
- "required": ["get_status", "disable", "set_output_snapshot", "jog", "mark_closed", "get_motor_status"],
- "properties": {
- "get_status": {"$ref": "#/$defs/command"},
- "disable": {"$ref": "#/$defs/command"},
- "set_output_snapshot": {"$ref": "#/$defs/snapshotCommand"},
- "jog": {"$ref": "#/$defs/jogCommand"},
- "mark_closed": {"$ref": "#/$defs/command"},
- "get_motor_status": {"$ref": "#/$defs/command"}
- },
- "additionalProperties": false
- },
- "unsupported_commands": {
- "type": "object",
- "required": ["0x29", "0x36"],
- "properties": {
- "0x29": {"$ref": "#/$defs/unsupported"},
- "0x36": {"$ref": "#/$defs/unsupported"}
- },
- "additionalProperties": false
- },
- "responses": {
- "type": "object",
- "required": ["host_ack", "motion_status"],
- "properties": {
- "host_ack": {
- "type": "object",
- "required": ["frame_type", "payload_length", "full_frame_length", "byte_offsets", "state_hash16", "snapshot_detail_bits", "snapshot_result_flag_bits", "status_codes"],
- "properties": {
- "frame_type": {"const": 6},
- "payload_length": {"const": 8},
- "full_frame_length": {"const": 24},
- "byte_offsets": {"type": "object"},
- "state_hash16": {
- "type": "object",
- "required": ["algorithm", "encoding", "input_order", "semantic"],
- "properties": {
- "algorithm": {"const": "CRC-16/CCITT-FALSE"},
- "encoding": {"const": "u16_le"},
- "input_order": {"type": "array", "minItems": 3, "maxItems": 3},
- "semantic": {"const": "ACTUAL_APPLIED_SYNCHRONOUS_OUTPUTS"}
- },
- "additionalProperties": false
- },
- "snapshot_detail_bits": {
- "const": {
- "x_busy": 0,
- "y_busy": 1,
- "z_busy": 2,
- "x_invalid": 3,
- "y_invalid": 4,
- "z_invalid": 5,
- "solenoid_change_ignored": 6,
- "reserved_zero": 7
- }
- },
- "snapshot_result_flag_bits": {"type": "object"},
- "status_codes": {"type": "object"}
- },
- "additionalProperties": false
- },
- "motion_status": {
- "type": "object",
- "required": ["frame_type", "payload_length", "full_frame_length", "layout", "position_values", "standard_motion_valid_during_busy", "jog_or_limit_stop_position", "busy_semantic", "busy_role", "setup_busy", "active_not_busy_allowed", "fault_mask", "z_current_target", "z_valid_busy_fault"],
- "properties": {
- "frame_type": {"const": 18},
- "payload_length": {"const": 10},
- "full_frame_length": {"const": 26},
- "layout": {"type": "string"},
- "position_values": {"type": "object"},
- "standard_motion_valid_during_busy": {"const": false},
- "jog_or_limit_stop_position": {"const": 255},
- "busy_semantic": {"const": "FIRST_STEP_RISE_THROUGH_FINAL_LOW"},
- "busy_role": {"const": "READ_ONLY_TELEMETRY_NOT_JOG_ADMISSION"},
- "setup_busy": {"const": false},
- "active_not_busy_allowed": {"const": true},
- "fault_mask": {"const": 0},
- "z_current_target": {"const": 255},
- "z_valid_busy_fault": {"const": 0}
- },
- "additionalProperties": false
- }
- },
- "additionalProperties": false
- },
- "motion": {
- "type": "object",
- "required": ["axes", "execution", "snapshot_arbitration_signal", "same_axis_standard_while_active", "same_axis_jog_while_active", "peer_axis_may_start", "standard_open", "standard_close", "repeated_standard_command", "dir_setup_us", "normal_step_stop", "hard_stop_sources"],
- "properties": {
- "axes": {"const": ["X", "Y"]},
- "execution": {"const": "TWO_INDEPENDENT_PARALLEL_EXECUTORS"},
- "snapshot_arbitration_signal": {"const": "AXIS_ACTIVE"},
- "same_axis_standard_while_active": {"const": "BUSY_OR_PARTIAL"},
- "same_axis_jog_while_active": {"const": "REPLACE_LATEST_AFTER_CURRENT_FULL_STEP"},
- "peer_axis_may_start": {"const": true},
- "standard_open": {"$ref": "#/$defs/standardMove"},
- "standard_close": {"$ref": "#/$defs/standardMove"},
- "repeated_standard_command": {"const": "START_NEW_3200_STEP_MOVE"},
- "dir_setup_us": {"const": 1000},
- "normal_step_stop": {"const": "COMPLETE_CURRENT_HIGH_AND_LOW_PHASE"},
- "hard_stop_sources": {"const": ["DISABLE", "WATCHDOG_EXPIRY"]}
- },
- "additionalProperties": false
- },
- "limit": {
- "type": "object",
- "required": ["axes", "polarity", "open_voltage_v", "closed_voltage_v", "synchronizer_stages", "used_only_for", "motion_effect", "dir0_jog_ignores_limit", "dir1_jog_ignores_limit", "standard_motion_ignores_limit", "position_memory", "direction_learning"],
- "properties": {
- "axes": {"const": ["X", "Y"]},
- "polarity": {"const": "ACTIVE_HIGH"},
- "open_voltage_v": {"const": 0.0},
- "closed_voltage_v": {"const": 3.3},
- "synchronizer_stages": {"const": 3},
- "used_only_for": {"const": "NOT_USED_BY_FORCE_JOG_IMAGE"},
- "motion_effect": {"const": "NONE"},
- "dir0_jog_ignores_limit": {"const": true},
- "dir1_jog_ignores_limit": {"const": true},
- "standard_motion_ignores_limit": {"const": true},
- "position_memory": {"const": false},
- "direction_learning": {"const": false}
- },
- "additionalProperties": false
- },
- "watchdog": {
- "type": "object",
- "required": ["timeout_seconds", "accepted_output_or_motion_arms", "armed_get_motor_status_refreshes", "status_query_cannot_arm_or_revive", "expiry_beats_same_cycle_refresh", "expiry_requires_disable_before_rearm", "next_valid_jog_clears_timeout_and_rearms"],
- "properties": {
- "timeout_seconds": {"const": 5},
- "accepted_output_or_motion_arms": {"const": true},
- "armed_get_motor_status_refreshes": {"const": true},
- "status_query_cannot_arm_or_revive": {"const": true},
- "expiry_beats_same_cycle_refresh": {"const": true},
- "expiry_requires_disable_before_rearm": {"const": false},
- "next_valid_jog_clears_timeout_and_rearms": {"const": true}
- },
- "additionalProperties": false
- },
- "programming": {
- "type": "object",
- "required": ["operation", "speed_hz", "attempt_limit", "automatic_retry", "flash_allowed"],
- "properties": {
- "operation": {"const": "PROGRAM_SRAM"},
- "speed_hz": {"const": 200000},
- "attempt_limit": {"const": 1},
- "automatic_retry": {"const": false},
- "flash_allowed": {"const": false}
- },
- "additionalProperties": false
- }
- },
- "$defs": {
- "command": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length"],
- "properties": {
- "frame_type": {"type": "integer", "minimum": 0, "maximum": 255},
- "command": {"type": "integer", "minimum": 0, "maximum": 255},
- "payload_length": {"type": "integer", "minimum": 0, "maximum": 255}
- },
- "additionalProperties": true
- },
- "snapshotCommand": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length", "full_frame_length", "input_layout", "ptc_range", "fan_range", "binary_values", "ptc_fan_commit_when_motion_busy", "solenoid_change_when_any_xy_busy", "axis_policy", "active_axis_precedence", "response"],
- "properties": {
- "frame_type": {"const": 7},
- "command": {"const": 42},
- "payload_length": {"const": 34},
- "full_frame_length": {"const": 50},
- "input_layout": {"const": "2A flags PTC1..24 FAN1..4 solenoid X Y Z"},
- "ptc_range": {"const": [0, 100]},
- "fan_range": {"const": [0, 100]},
- "binary_values": {"const": [0, 100]},
- "ptc_fan_commit_when_motion_busy": {"const": true},
- "solenoid_change_when_any_xy_busy": {"const": "IGNORE_AND_SET_DETAIL_BIT_6"},
- "axis_policy": {"const": "INDEPENDENT_ACCEPT_BUSY_INVALID"},
- "active_axis_precedence": {"const": "BUSY_IGNORED_BEFORE_TARGET_VALIDATION"},
- "response": {"const": "HOST_ACK"}
- },
- "additionalProperties": false
- },
- "jogCommand": {
- "type": "object",
- "required": ["frame_type", "command", "payload_length", "full_frame_length", "input_layout", "axes", "cli_axes", "reserved_z_status", "direction", "speed_codes", "step_range", "executed_step_cap", "over_cap_status", "over_cap_behavior", "same_axis_active_policy", "multiple_pending_policy", "replacement_dir_setup_us", "limit_policy", "rejects_busy", "admission_ignores", "watchdog_timeout_recovery", "peer_axis_busy_does_not_block", "response"],
- "properties": {
- "frame_type": {"const": 17},
- "command": {"const": 53},
- "payload_length": {"const": 8},
- "full_frame_length": {"const": 24},
- "input_layout": {"const": "35 axis raw_dir speed_code steps_u16_le 00 00"},
- "axes": {"type": "object"},
- "cli_axes": {"const": ["X", "Y"]},
- "reserved_z_status": {"const": "BAD_VALUE"},
- "direction": {"type": "object"},
- "speed_codes": {"const": [0, 1, 2, 3]},
- "step_range": {"const": [1, 65535]},
- "executed_step_cap": {"const": 800},
- "over_cap_status": {"const": "OK"},
- "over_cap_behavior": {"const": "EXECUTE_800_STEPS_WITH_REQUEST_BYTES_UNCHANGED"},
- "same_axis_active_policy": {"const": "REPLACE_LATEST_AFTER_CURRENT_FULL_STEP"},
- "multiple_pending_policy": {"const": "LATEST_WINS_EACH_COMMAND_ACKED"},
- "replacement_dir_setup_us": {"const": 1000},
- "limit_policy": {"const": "IGNORE_ALL_INPUTS"},
- "rejects_busy": {"const": false},
- "admission_ignores": {"const": ["AXIS_ACTIVE", "SNAPSHOT_VALID", "LIMIT_INPUTS", "WATCHDOG_TIMEOUT"]},
- "watchdog_timeout_recovery": {"const": "CLEAR_TIMEOUT_REARM_WITHOUT_DISABLE"},
- "peer_axis_busy_does_not_block": {"const": true},
- "response": {"const": "HOST_ACK"}
- },
- "additionalProperties": false
- },
- "unsupported": {
- "type": "object",
- "required": ["status", "status_code", "changes_state", "arms_watchdog"],
- "properties": {
- "status": {"const": "UNSUPPORTED_IN_PROFILE"},
- "status_code": {"const": 1},
- "changes_state": {"const": false},
- "arms_watchdog": {"const": false},
- "request_payload_hex": {"type": "string"}
- },
- "additionalProperties": false
- },
- "standardMove": {
- "type": "object",
- "required": ["direction", "steps", "checks_limit"],
- "properties": {
- "direction": {"enum": [0, 1]},
- "steps": {"const": 3200},
- "checks_limit": {"const": false}
- },
- "additionalProperties": false
- }
- }
- }
|