{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "required": [ "project_id", "profile", "display_name", "device", "uart", "outputs", "doors", "motors", "limits", "temperature", "pins", "resource_policy", "protocol", "timeouts", "watchdog" ], "properties": { "project_id": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "profile": { "type": "string" }, "display_name": { "type": "string", "minLength": 1 }, "device": { "type": "object", "required": [ "family", "part", "clock_hz", "clock_ball" ], "properties": { "family": { "type": "string" }, "part": { "type": "string" }, "clock_hz": { "type": "integer" }, "clock_ball": { "type": "string" } }, "additionalProperties": false }, "uart": { "type": "object", "required": [ "baud", "data_bits", "parity", "stop_bits", "flow_control", "clks_per_bit", "inter_byte_timeout_ms", "rx_ball", "tx_ball" ], "properties": { "baud": { "type": "integer" }, "data_bits": { "type": "integer" }, "parity": { "type": "string" }, "stop_bits": { "type": "integer" }, "flow_control": { "type": "string" }, "clks_per_bit": { "type": "integer" }, "inter_byte_timeout_ms": { "type": "integer" }, "rx_ball": { "type": "string" }, "tx_ball": { "type": "string" } }, "additionalProperties": false }, "outputs": { "type": "object", "required": [ "ptc_count", "fan_count", "chamber_ptc_count", "chamber_ptc_pairs", "ptc_channels", "fan_channels", "pwm_bits", "pwm_internal_width", "pwm_max_duty", "pwm_phase_count", "pwm_slot_clks", "pwm_frequency_hz", "pwm_actual_frequency_hz", "ptc_polarity", "fan_polarity", "ptc_default", "fan_default", "fan_connector_active_level", "fan_board_inverts", "boot_targets" ], "properties": { "ptc_count": { "type": "integer" }, "fan_count": { "type": "integer" }, "chamber_ptc_count": { "type": "integer" }, "chamber_ptc_pairs": { "type": "array", "minItems": 1, "maxItems": 16, "items": { "type": "object", "required": [ "chamber", "ptc_indices" ], "properties": { "chamber": { "type": "integer" }, "ptc_indices": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer" } } }, "additionalProperties": false } }, "ptc_channels": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/channel" } }, "fan_channels": { "type": "array", "minItems": 1, "maxItems": 64, "items": { "$ref": "#/$defs/channel" } }, "pwm_bits": { "type": "integer" }, "pwm_internal_width": { "type": "integer" }, "pwm_max_duty": { "type": "integer" }, "pwm_phase_count": { "type": "integer" }, "pwm_slot_clks": { "type": "integer" }, "pwm_frequency_hz": { "type": "integer" }, "pwm_actual_frequency_hz": { "type": "number" }, "ptc_polarity": { "type": "string" }, "fan_polarity": { "type": "string" }, "ptc_default": { "type": "integer" }, "fan_default": { "type": "integer" }, "fan_connector_active_level": { "type": "string" }, "fan_board_inverts": { "type": "boolean" }, "boot_targets": { "type": "object", "required": [ "ptc", "fan" ], "properties": { "ptc": { "type": "integer" }, "fan": { "type": "integer" } }, "additionalProperties": false } }, "additionalProperties": false }, "doors": { "type": "object", "required": [ "scope", "chamber_controlled", "door_axes" ], "properties": { "scope": { "type": "string" }, "chamber_controlled": { "type": "integer" }, "door_axes": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "string", "enum": [ "x", "y", "z" ] } } }, "additionalProperties": false }, "motors": { "type": "object", "required": [ "count", "order", "role", "execution", "step_rate_hz", "step_half_cycles", "motion_service_us", "motion_service_clks", "phase_factor", "profile_full", "profile_scale_q8", "cal_ramp_unit", "scheme", "dir_setup_cycles", "open_dir_value", "close_dir_value", "dir_close_level", "positioning", "mapping", "enable_n" ], "properties": { "count": { "type": "integer" }, "order": { "type": "array" }, "role": { "type": "string" }, "execution": { "type": "string" }, "step_rate_hz": { "type": "integer" }, "step_half_cycles": { "type": "integer" }, "motion_service_us": { "type": "integer", "minimum": 1, "maximum": 50 }, "motion_service_clks": { "type": "integer" }, "phase_factor": { "type": "integer" }, "profile_full": { "type": "integer" }, "profile_scale_q8": { "type": "array", "minItems": 16, "maxItems": 16, "items": { "type": "integer" } }, "cal_ramp_unit": { "type": "integer" }, "scheme": { "type": "string" }, "dir_setup_cycles": { "type": "integer" }, "open_dir_value": { "type": "integer" }, "close_dir_value": { "type": "integer" }, "dir_close_level": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "integer", "enum": [0, 1] }, "description": "AUTHORITATIVE per-axis physical DIR level for logical close (1 or 0); index0=X,1=Y,2=Z (bit0=X). Must be integer 0/1, not boolean." }, "positioning": { "type": "object", "required": [ "mode", "percent_min", "percent_max", "open_endpoint_percent", "close_endpoint_percent", "mid_percent_min", "mid_percent_max", "rounding", "mid_clamp", "latest_wins", "idempotent_same_target", "command_interrupt", "shared_percent_planner", "planner_count", "endpoint_guard_extra_steps" ], "properties": { "mode": { "type": "string", "enum": ["percent_close"] }, "percent_min": { "type": "integer" }, "percent_max": { "type": "integer" }, "open_endpoint_percent": { "type": "integer" }, "close_endpoint_percent": { "type": "integer" }, "mid_percent_min": { "type": "integer" }, "mid_percent_max": { "type": "integer" }, "rounding": { "type": "string", "enum": ["half_up"] }, "mid_clamp": { "type": "string", "enum": ["1_to_travel_minus_1"] }, "latest_wins": { "type": "boolean" }, "idempotent_same_target": { "type": "boolean" }, "command_interrupt": { "type": "string", "enum": ["finish_current_high_pulse_then_replan"] }, "shared_percent_planner": { "type": "boolean" }, "planner_count": { "type": "integer" }, "endpoint_guard_extra_steps": { "type": "integer" } }, "additionalProperties": false }, "mapping": { "type": "object", "required": [ "x", "y", "z" ], "properties": { "x": { "$ref": "#/$defs/motor" }, "y": { "$ref": "#/$defs/motor" }, "z": { "$ref": "#/$defs/motor" } }, "additionalProperties": false }, "enable_n": { "type": "object", "required": [ "ball", "active_level", "policy" ], "properties": { "ball": { "type": "string" }, "connector": { "type": "string" }, "connector_pin": { "type": "integer" }, "active_level": { "type": "string" }, "policy": { "type": "string", "enum": [ "permanent_high", "shared_constant_low" ] }, "notes": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "limits": { "type": "object", "required": [ "limit_count", "active_level", "limit_active_high", "close_limit_is_ls", "functional_use", "runtime_use", "startup", "channels" ], "properties": { "limit_count": { "type": "integer" }, "active_level": { "type": "string", "enum": ["high", "low"], "description": "LEGACY SUMMARY / DEPRECATED / NON-AUTHORITATIVE. Kept for old configs only. Does not control RTL masks or reject mixed-axis polarity. Authority is limits.limit_active_high[] alone." }, "limit_active_high": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "boolean" }, "description": "AUTHORITATIVE per-axis limit active-high; index0=X,1=Y,2=Z (bit0=X). Sole polarity authority with motors.dir_close_level and limits.close_limit_is_ls." }, "close_limit_is_ls": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "boolean" }, "description": "AUTHORITATIVE per-axis: true means logical close limit is LS (else HS); index0=X,1=Y,2=Z." }, "functional_use": { "type": "boolean" }, "runtime_use": { "type": "boolean" }, "startup": { "type": "object", "required": [ "enabled", "mode", "max_steps", "min_travel_steps", "step_rate_hz", "axis_order", "calibration_schedule", "runtime_overlap_allowed", "final_position", "limit_stop_during_move", "stop_semantics", "additional_rising_edges_after_synchronized_limit", "runtime_limit_use", "partial_axis_failure_allowed", "fault_lock_until_reset" ], "properties": { "enabled": { "type": "boolean" }, "mode": { "type": "string", "enum": ["seek_close_then_measure_open"] }, "max_steps": { "type": "integer" }, "min_travel_steps": { "type": "integer" }, "step_rate_hz": { "type": "integer" }, "axis_order": { "type": "array", "items": { "type": "string" } }, "calibration_schedule": { "type": "string", "enum": ["serial_xyz"] }, "runtime_overlap_allowed": { "type": "boolean" }, "final_position": { "type": "string", "enum": ["open"] }, "limit_stop_during_move": { "type": "boolean" }, "stop_semantics": { "type": "string", "enum": [ "truncate_current_high_pulse_immediately_after_synchronized_limit" ], "description": "After synchronized direction-selected limit, truncate the current STEP high pulse immediately; no further rising edges." }, "additional_rising_edges_after_synchronized_limit": { "type": "integer" }, "runtime_limit_use": { "type": "boolean" }, "partial_axis_failure_allowed": { "type": "boolean" }, "fault_lock_until_reset": { "type": "boolean" } }, "additionalProperties": false }, "channels": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "$ref": "#/$defs/limit_channel" } } }, "additionalProperties": false }, "temperature": { "type": "object", "required": [ "value_count", "device_addresses", "registers", "scl_ball", "sda_ball", "bus", "device", "invalid_value", "maximum_celsius", "conversion" ], "properties": { "value_count": { "type": "integer" }, "device_addresses": { "type": "array" }, "registers": { "type": "array" }, "scl_ball": { "type": "string" }, "sda_ball": { "type": "string" }, "bus": { "type": "string" }, "device": { "type": "string" }, "invalid_value": { "type": "integer" }, "maximum_celsius": { "type": "integer" }, "conversion": { "type": "object", "required": [ "profile", "raw_shift", "raw_width", "reject_sign_bit" ], "properties": { "profile": { "type": "string" }, "raw_shift": { "type": "integer" }, "raw_width": { "type": "integer" }, "reject_sign_bit": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, "pins": { "type": "object", "required": [ "host_uart_rx", "host_uart_tx", "temp_scl", "temp_sda", "ptc_pwm", "fan_pwm", "motor_en_n", "x_step", "x_dir", "y_step", "y_dir", "z_step", "z_dir", "x_limit_ls", "x_limit_hs", "y_limit_ls", "y_limit_hs", "z_limit_ls", "z_limit_hs" ], "properties": { "host_uart_rx": { "type": "string" }, "host_uart_tx": { "type": "string" }, "temp_scl": { "type": "string" }, "temp_sda": { "type": "string" }, "ptc_pwm": { "type": "array", "minItems": 1, "maxItems": 64 }, "fan_pwm": { "type": "array", "minItems": 1, "maxItems": 64 }, "motor_en_n": { "type": "string" }, "x_step": { "type": "string" }, "x_dir": { "type": "string" }, "y_step": { "type": "string" }, "y_dir": { "type": "string" }, "z_step": { "type": "string" }, "z_dir": { "type": "string" }, "x_limit_ls": { "type": "string" }, "x_limit_hs": { "type": "string" }, "y_limit_ls": { "type": "string" }, "y_limit_hs": { "type": "string" }, "z_limit_ls": { "type": "string" }, "z_limit_hs": { "type": "string" } }, "additionalProperties": false }, "resource_policy": { "type": "object", "required": [ "target_ram", "request_ram", "temperature_ram", "dsp", "bram", "shared_pwm_comparators", "shared_percent_planner", "shared_i2c_readers" ], "properties": { "target_ram": { "type": "string", "enum": ["optional", "required", "forbidden"] }, "request_ram": { "type": "string", "enum": ["optional", "required", "forbidden"] }, "temperature_ram": { "type": "string", "enum": ["optional", "required", "forbidden"] }, "dsp": { "type": "string", "enum": ["optional", "required", "forbidden"] }, "bram": { "type": "string", "enum": ["optional", "required", "forbidden"] }, "shared_pwm_comparators": { "type": "integer" }, "shared_percent_planner": { "type": "integer" }, "shared_i2c_readers": { "type": "integer" } }, "additionalProperties": false }, "protocol": { "type": "object", "required": [ "header_hex", "crc", "commands", "set_all", "get_motor_status", "temperature_data", "motor_status_data" ], "properties": { "header_hex": { "type": "string" }, "crc": { "type": "object", "required": [ "name", "polynomial", "initial", "reflect_input", "reflect_output", "xor_output", "coverage", "wire_order" ], "properties": { "name": { "type": "string" }, "polynomial": { "type": "integer" }, "initial": { "type": "integer" }, "reflect_input": { "type": "boolean" }, "reflect_output": { "type": "boolean" }, "xor_output": { "type": "integer" }, "coverage": { "type": "string" }, "wire_order": { "type": "string" } }, "additionalProperties": false }, "commands": { "type": "object", "required": [ "set_all", "get_temperature", "get_motor_status", "temperature_data", "motor_status_data" ], "properties": { "set_all": { "type": "integer" }, "get_temperature": { "type": "integer" }, "get_motor_status": { "type": "integer" }, "temperature_data": { "type": "integer" }, "motor_status_data": { "type": "integer" } }, "additionalProperties": false }, "set_all": { "type": "object", "required": [ "payload_length", "fan_offset", "chamber_ptc_offset", "chamber_ptc_count", "z_door_offset", "exhaust_x_offset", "exhaust_y_offset", "legacy_payload_length_rejected", "duty_min", "duty_max", "door_percent_min", "door_percent_max", "response" ], "properties": { "payload_length": { "type": "integer" }, "fan_offset": { "type": "integer" }, "chamber_ptc_offset": { "type": "integer" }, "chamber_ptc_count": { "type": "integer" }, "z_door_offset": { "type": "integer" }, "exhaust_x_offset": { "type": "integer" }, "exhaust_y_offset": { "type": "integer" }, "legacy_payload_length_rejected": { "type": "integer" }, "duty_min": { "type": "integer" }, "duty_max": { "type": "integer" }, "door_percent_min": { "type": "integer" }, "door_percent_max": { "type": "integer" }, "door_percent_rejected_example": { "type": "integer" }, "response": { "type": "string" } }, "additionalProperties": false }, "get_motor_status": { "type": "object", "required": [ "payload_length", "response" ], "properties": { "payload_length": { "type": "integer" }, "response": { "type": "string" } }, "additionalProperties": false }, "temperature_data": { "type": "object", "required": [ "payload_length", "frame_length" ], "properties": { "payload_length": { "type": "integer" }, "frame_length": { "type": "integer" } }, "additionalProperties": false }, "motor_status_data": { "type": "object", "required": [ "payload_length", "frame_length", "layout" ], "properties": { "payload_length": { "type": "integer" }, "frame_length": { "type": "integer" }, "layout": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "timeouts": { "type": "object", "required": [ "frame_inter_byte_ms", "host_get_response_ms" ], "properties": { "frame_inter_byte_ms": { "type": "integer" }, "host_get_response_ms": { "type": "integer" } }, "additionalProperties": false }, "watchdog": { "type": "object", "required": [ "timeout_seconds", "tick_us", "tick_clks", "timeout_ticks", "enable_after_startup_complete", "target" ], "properties": { "timeout_seconds": { "type": "integer" }, "tick_us": { "type": "integer" }, "tick_clks": { "type": "integer" }, "timeout_ticks": { "type": "integer" }, "enable_after_startup_complete": { "type": "boolean" }, "target": { "type": "object", "required": [ "ptc", "fan" ], "properties": { "ptc": { "type": "integer" }, "fan": { "type": "integer" } }, "additionalProperties": false } }, "additionalProperties": false } }, "$defs": { "channel": { "type": "object", "required": [ "index", "name", "signal", "board_signal", "ball", "connector", "connector_pin", "polarity" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "name": { "type": "string", "pattern": "^(ptc|fan)[1-9][0-9]*$" }, "signal": { "type": "string", "pattern": "^(ptc|fan)_pwm_out\\[[0-9]+\\]$" }, "board_signal": { "type": "string", "minLength": 1 }, "ball": { "type": "string", "pattern": "^[A-Z][0-9]+$" }, "connector": { "type": "string", "pattern": "^CON[0-9]+$" }, "connector_pin": { "type": "integer", "minimum": 1, "maximum": 14 }, "polarity": { "type": "string", "enum": [ "active_high", "active_low" ] } }, "additionalProperties": false }, "motor": { "type": "object", "required": [ "axis", "role", "step_ball", "dir_ball" ], "properties": { "axis": { "type": "string", "enum": [ "x", "y", "z" ] }, "role": { "type": "string" }, "step_ball": { "type": "string", "pattern": "^[A-T](?:[1-9]|1[0-6])$" }, "dir_ball": { "type": "string", "pattern": "^[A-T](?:[1-9]|1[0-6])$" }, "step_connector": { "type": "string" }, "step_connector_pin": { "type": "integer" }, "dir_connector": { "type": "string" }, "dir_connector_pin": { "type": "integer" } }, "additionalProperties": false }, "limit_channel": { "type": "object", "required": [ "name", "ball", "connector", "connector_pin", "side" ], "properties": { "name": { "type": "string", "pattern": "^(x|y|z)_limit_(ls|hs)$" }, "ball": { "type": "string", "pattern": "^[A-Z][0-9]+$" }, "connector": { "type": "string", "pattern": "^CON[0-9]+$" }, "connector_pin": { "type": "integer", "minimum": 1, "maximum": 14 }, "side": { "type": "string", "enum": [ "low", "high" ] } }, "additionalProperties": false } }, "additionalProperties": false }