From 6405d55353068eab33d51378b023da0e705c5366 Mon Sep 17 00:00:00 2001 From: Foniks Date: Mon, 29 Jun 2026 00:33:11 +0200 Subject: [PATCH 1/2] Add LCU and some cleanup --- boards.json | 3 +- boards/BLCU/BLCU.json | 2 +- boards/LCU/LCU.json | 14 + boards/LCU/LCU_measurements.json | 638 +++++++++++++++++++++++++++++++ boards/LCU/orders.json | 120 ++++++ boards/LCU/packets.json | 115 ++++++ boards/LCU/sockets.json | 13 + boards/VCU/VCU.json | 2 +- boards/VCU/sockets.json | 32 +- 9 files changed, 921 insertions(+), 18 deletions(-) create mode 100644 boards/LCU/LCU.json create mode 100644 boards/LCU/LCU_measurements.json create mode 100644 boards/LCU/orders.json create mode 100644 boards/LCU/packets.json create mode 100644 boards/LCU/sockets.json diff --git a/boards.json b/boards.json index de9f2ea..05bfe71 100644 --- a/boards.json +++ b/boards.json @@ -1,4 +1,5 @@ { "VCU": "boards/VCU/VCU.json", - "BLCU": "boards/BLCU/BLCU.json" + "BLCU": "boards/BLCU/BLCU.json", + "LCU": "boards/LCU/LCU.json" } diff --git a/boards/BLCU/BLCU.json b/boards/BLCU/BLCU.json index dee0cfb..2c98964 100644 --- a/boards/BLCU/BLCU.json +++ b/boards/BLCU/BLCU.json @@ -1,5 +1,5 @@ { - "board_id": 17, + "board_id": 27, "board_ip": "192.168.0.27", "measurements": ["BLCU_measurements.json"], "packets": [ diff --git a/boards/LCU/LCU.json b/boards/LCU/LCU.json new file mode 100644 index 0000000..41de0b0 --- /dev/null +++ b/boards/LCU/LCU.json @@ -0,0 +1,14 @@ +{ + "board_id": 4, + "board_ip": "192.168.1.4", + "measurements": [ + "LCU_measurements.json" + ], + "packets": [ + "packets.json", + "orders.json" + ], + "sockets": [ + "sockets.json" + ] +} diff --git a/boards/LCU/LCU_measurements.json b/boards/LCU/LCU_measurements.json new file mode 100644 index 0000000..a768649 --- /dev/null +++ b/boards/LCU/LCU_measurements.json @@ -0,0 +1,638 @@ +[ + { + "id": "master_state_machine", + "name": "Master SM", + "type": "enum", + "enumValues": [ + "Connecting", + "Idle", + "Operational", + "Fault" + ] + }, + { + "id": "slave_state_machine", + "name": "Slave SM", + "type": "enum", + "enumValues": [ + "SPI Connecting", + "Idle", + "Levitating", + "Current Control", + "Debug", + "Fault" + ] + }, + { + "id": "desired_current", + "name": "Desired current", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "fixed_vbat", + "name": "Fixed VBAT", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "desired_distance", + "name": "Desired Distance (mm)", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "lpu_id", + "name": "LPU ID", + "type": "uint32" + }, + { + "id": "fixed_pwm_duty_cycle", + "name": "Fixed PWM Duty Cycle", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_1", + "name": "Duty Cycle 1", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_2", + "name": "Duty Cycle 2", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_3", + "name": "Duty Cycle 3", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_4", + "name": "Duty Cycle 4", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_5", + "name": "Duty Cycle 5", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_6", + "name": "Duty Cycle 6", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_7", + "name": "Duty Cycle 7", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_8", + "name": "Duty Cycle 8", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_9", + "name": "Duty Cycle 9", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "pwm_duty_cycle_10", + "name": "Duty Cycle 10", + "type": "float32", + "podUnits": "%", + "displayUnits": "%" + }, + { + "id": "coil_current_1", + "name": "Coil Current 1", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_2", + "name": "Coil Current 2", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_3", + "name": "Coil Current 3", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_4", + "name": "Coil Current 4", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_5", + "name": "Coil Current 5", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_6", + "name": "Coil Current 6", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_7", + "name": "Coil Current 7", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_8", + "name": "Coil Current 8", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_9", + "name": "Coil Current 9", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "coil_current_10", + "name": "Coil Current 10", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "vbat_1", + "name": "LPU Voltage 1", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_2", + "name": "LPU Voltage 2", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_3", + "name": "LPU Voltage 3", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_4", + "name": "LPU Voltage 4", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_5", + "name": "LPU Voltage 5", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_6", + "name": "LPU Voltage 6", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_7", + "name": "LPU Voltage 7", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_8", + "name": "LPU Voltage 8", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_9", + "name": "LPU Voltage 9", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "vbat_10", + "name": "LPU Voltage 10", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "airgap_1", + "name": "Airgap 1", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_2", + "name": "Airgap 2", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_3", + "name": "Airgap 3", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_4", + "name": "Airgap 4", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_5", + "name": "Airgap 5", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_6", + "name": "Airgap 6", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_7", + "name": "Airgap 7", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "airgap_8", + "name": "Airgap 8", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + + { + "id": "desired_current_1", + "name": "Desired Current 1", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "desired_current_2", + "name": "Desired Current 2", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "desired_current_3", + "name": "Desired Current 3", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + { + "id": "desired_current_4", + "name": "Desired Current 4", + "type": "float32", + "podUnits": "A", + "displayUnits": "A" + }, + + { + "id": "state_0", + "name": "State 0", + "type": "float32" + }, + { + "id": "state_1", + "name": "State 1", + "type": "float32" + }, + { + "id": "state_2", + "name": "State 2", + "type": "float32" + }, + { + "id": "state_3", + "name": "State 3", + "type": "float32" + }, + { + "id": "state_4", + "name": "State 4", + "type": "float32" + }, + + { + "id": "local_airgap_1", + "name": "Airgap 1", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "local_airgap_2", + "name": "Airgap 2", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "local_airgap_3", + "name": "Airgap 3", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + { + "id": "local_airgap_4", + "name": "Airgap 4", + "type": "float32", + "podUnits": "m", + "displayUnits": "mm" + }, + + { + "id": "desired_voltage_1", + "name": "Desired Voltage 1", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "desired_voltage_2", + "name": "Desired Voltage 2", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "desired_voltage_3", + "name": "Desired Voltage 3", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + { + "id": "desired_voltage_4", + "name": "Desired Voltage 4", + "type": "float32", + "podUnits": "V", + "displayUnits": "V" + }, + + { + "id": "Fe_0", + "name": "Fe 0", + "type": "float32" + }, + { + "id": "Fe_1", + "name": "Fe 1", + "type": "float32" + }, + { + "id": "Fe_2", + "name": "Fe 2", + "type": "float32" + }, + + { + "id": "Fa_0", + "name": "Fa 0", + "type": "float32" + }, + { + "id": "Fa_1", + "name": "Fa 1", + "type": "float32" + }, + { + "id": "Fa_2", + "name": "Fa 2", + "type": "float32" + }, + { + "id": "Fa_3", + "name": "Fa 3", + "type": "float32" + }, + + { + "id": "Ef_0", + "name": "Ef 0", + "type": "float32" + }, + { + "id": "Ef_1", + "name": "Ef 1", + "type": "float32" + }, + { + "id": "Ef_2", + "name": "Ef 2", + "type": "float32" + }, + + { + "id": "P_0", + "name": "P 0", + "type": "float32" + }, + { + "id": "P_1", + "name": "P 1", + "type": "float32" + }, + { + "id": "P_2", + "name": "P 2", + "type": "float32" + }, + + { + "id": "R_0", + "name": "R 0", + "type": "float32" + }, + { + "id": "R_1", + "name": "R 1", + "type": "float32" + }, + { + "id": "R_2", + "name": "R 2", + "type": "float32" + }, + + { + "id": "Zz_0", + "name": "Zz 0", + "type": "float32" + }, + { + "id": "Zz_1", + "name": "Zz 1", + "type": "float32" + }, + { + "id": "Zz_2", + "name": "Zz 2", + "type": "float32" + }, + + { + "id": "Fe_L_0", + "name": "Fe_L 0", + "type": "float32" + }, + { + "id": "Fe_L_1", + "name": "Fe_L 1", + "type": "float32" + }, + { + "id": "Fe_L_2", + "name": "Fe_L 2", + "type": "float32" + }, + + { + "id": "A_0", + "name": "A 0", + "type": "float32" + }, + { + "id": "A_1", + "name": "A 1", + "type": "float32" + }, + { + "id": "A_2", + "name": "A 2", + "type": "float32" + }, + { + "id": "A_3", + "name": "A 3", + "type": "float32" + }, + { + "id": "A_4", + "name": "A 4", + "type": "float32" + }, + { + "id": "A_5", + "name": "A 5", + "type": "float32" + }, + { + "id": "A_6", + "name": "A 6", + "type": "float32" + }, + { + "id": "A_7", + "name": "A 7", + "type": "float32" + }, + + { + "id": "Ak_0", + "name": "Ak 0", + "type": "float32" + }, + { + "id": "Ak_1", + "name": "Ak 1", + "type": "float32" + }, + { + "id": "Ak_2", + "name": "Ak 2", + "type": "float32" + }, + { + "id": "Ak_3", + "name": "Ak 3", + "type": "float32" + }, + + { + "id": "Bk_0", + "name": "Bk 0", + "type": "float32" + }, + { + "id": "Bk_1", + "name": "Bk 1", + "type": "float32" + }, + { + "id": "Bk_2", + "name": "Bk 2", + "type": "float32" + }, + { + "id": "cinema_current", + "name": "Cinema Current", + "type": "float32" + } +] diff --git a/boards/LCU/orders.json b/boards/LCU/orders.json new file mode 100644 index 0000000..fc824ba --- /dev/null +++ b/boards/LCU/orders.json @@ -0,0 +1,120 @@ +[ + { + "type": "order", + "name": "Stop", + "variables": [], + "id": 9000 + }, + { + "type": "order", + "name": "Set Fixed VBAT", + "variables": ["fixed_vbat"], + "id": 9001 + }, + { + "type": "order", + "name": "Unset Fixed VBAT", + "variables": [], + "id": 9002 + }, + { + "type": "order", + "name": "Levitate", + "variables": ["desired_distance"], + "id": 9010 + }, + { + "type": "order", + "name": "Levitate Ramp", + "variables": ["desired_distance"], + "id": 9011 + }, + { + "type": "order", + "name": "Set Desired Distance", + "variables": ["desired_distance"], + "id": 9012 + }, + { + "type": "order", + "name": "Set Desired Distance Ramp", + "variables": ["desired_distance"], + "id": 9013 + }, + { + "type": "order", + "name": "Stop Ramp", + "variables": [], + "id": 9014 + }, + { + "type": "order", + "name": "Current Control", + "variables": [ + "lpu_id", + "desired_current" + ], + "id": 9020 + }, + { + "type": "order", + "name": "All Current Control", + "variables": ["desired_current"], + "id": 9021 + }, + { + "type": "order", + "name": "Stop Current Control", + "variables": [ + "lpu_id" + ], + "id": 9022 + }, + { + "type": "order", + "name": "PWM", + "variables": [ + "lpu_id", + "fixed_pwm_duty_cycle" + ], + "id": 9030 + }, + { + "type": "order", + "name": "All PWM", + "variables": ["fixed_pwm_duty_cycle"], + "id": 9031 + }, + { + "type": "order", + "name": "Stop PWM", + "variables": [ + "lpu_id" + ], + "id": 9032 + }, + { + "type": "order", + "name": "Reset All", + "variables": [], + "id": 9100 + }, + { + "type": "order", + "name": "Reset Slave", + "variables": [], + "id": 9101 + }, + { + "type": "order", + "name": "Cinema", + "variables": ["cinema_current"], + "id": 9200 + }, + { + "type": "order", + "name": "Stop Cinema", + "variables": [], + "id": 9201 + } +] diff --git a/boards/LCU/packets.json b/boards/LCU/packets.json new file mode 100644 index 0000000..24ba673 --- /dev/null +++ b/boards/LCU/packets.json @@ -0,0 +1,115 @@ +[ + { + "type": "data", + "name": "LPU PWM duties", + "variables": ["pwm_duty_cycle_1", "pwm_duty_cycle_2", "pwm_duty_cycle_3", "pwm_duty_cycle_4", "pwm_duty_cycle_5", "pwm_duty_cycle_6", "pwm_duty_cycle_7", "pwm_duty_cycle_8", "pwm_duty_cycle_9", "pwm_duty_cycle_10"], + "id": 9500, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + }, + { + "type": "data", + "name": "LPU coil currents", + "variables": ["coil_current_1", "coil_current_2", "coil_current_3", "coil_current_4", "coil_current_5", "coil_current_6", "coil_current_7", "coil_current_8", "coil_current_9", "coil_current_10"], + "id": 9501, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + }, + { + "type": "data", + "name": "LPU VBATs", + "variables": ["vbat_1", "vbat_2", "vbat_3", "vbat_4", "vbat_5", "vbat_6", "vbat_7", "vbat_8", "vbat_9", "vbat_10"], + "id": 9502, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + }, + { + "type": "data", + "name": "Airgaps", + "variables": ["airgap_1", "airgap_2", "airgap_3", "airgap_4", "airgap_5", "airgap_6", "airgap_7", "airgap_8"], + "id": 9503, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + }, + { + "type": "data", + "name": "State Machine", + "variables": [ + "master_state_machine", + "slave_state_machine" + ], + "id": 9520, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + }, + { + "type": "data", + "name": "General State", + "variables": [ + "desired_distance", + "desired_current_1", + "desired_current_2", + "desired_current_3", + "desired_current_4", + "state_0", + "state_1", + "state_2", + "state_3", + "state_4", + "local_airgap_1", + "local_airgap_2", + "local_airgap_3", + "local_airgap_4", + "desired_voltage_1", + "desired_voltage_2", + "desired_voltage_3", + "desired_voltage_4", + "Fe_0", + "Fe_1", + "Fe_2", + "Fa_0", + "Fa_1", + "Fa_2", + "Fa_3", + "Ef_0", + "Ef_1", + "Ef_2", + "P_0", + "P_1", + "P_2", + "R_0", + "R_1", + "R_2", + "Zz_0", + "Zz_1", + "Zz_2", + "Fe_L_0", + "Fe_L_1", + "Fe_L_2", + "A_0", + "A_1", + "A_2", + "A_3", + "A_4", + "A_5", + "A_6", + "A_7", + "Ak_0", + "Ak_1", + "Ak_2", + "Ak_3", + "Bk_0", + "Bk_1", + "Bk_2" + ], + "id": 9521, + "period_type": "us", + "period": 500.0, + "socket": "control_station_udp" + } +] diff --git a/boards/LCU/sockets.json b/boards/LCU/sockets.json new file mode 100644 index 0000000..6f49b6b --- /dev/null +++ b/boards/LCU/sockets.json @@ -0,0 +1,13 @@ +[ + { + "type": "ServerSocket", + "name": "vcu_tcp", + "port": 50500 + }, + { + "type": "DatagramSocket", + "name": "vcu_udp", + "remote_ip": "192.168.1.3", + "port": 50400 + } +] diff --git a/boards/VCU/VCU.json b/boards/VCU/VCU.json index 58b8546..4f4a339 100644 --- a/boards/VCU/VCU.json +++ b/boards/VCU/VCU.json @@ -1,5 +1,5 @@ { - "board_id": 11, + "board_id": 3, "board_ip": "192.168.1.3", "measurements": [ "VCU_measurements.json" diff --git a/boards/VCU/sockets.json b/boards/VCU/sockets.json index 6a7e581..0a124e3 100644 --- a/boards/VCU/sockets.json +++ b/boards/VCU/sockets.json @@ -4,45 +4,47 @@ "name": "control_station_tcp", "port": 50500 }, - { "type": "DatagramSocket", "name": "control_station_udp", "remote_ip":"192.168.0.9", "port": 50400 }, - { - "type": "Socket", - "name": "pcu_tcp", - "local_port": 50501, - "remote_ip": "192.168.1.5", - "remote_port": 50500 - }, + { "type": "DatagramSocket", "name": "pcu_udp", "remote_ip": "192.168.1.5", "port": 50402 }, + { + "type": "Socket", + "name": "pcu_tcp", + "local_port": 50505, + "remote_ip": "192.168.1.5", + "remote_port": 50500 + }, + { "type": "DatagramSocket", "name": "hvbms_udp", "remote_ip": "192.168.1.7", "port": 50403 }, - { - "type": "DatagramSocket", - "name": "lcu_udp", - "remote_ip": "192.168.1.4", - "port": 50405 - }, { "type": "Socket", "name": "hvbms_tcp", - "local_port": 50502, + "local_port": 50507, "remote_ip": "192.168.1.7", "remote_port": 50500 }, + + { + "type": "DatagramSocket", + "name": "lcu_udp", + "remote_ip": "192.168.1.4", + "port": 50405 + }, { "type": "Socket", "name": "lcu_tcp", From 614ec100d54f511f10de9ad652781afc2d0630fb Mon Sep 17 00:00:00 2001 From: Foniks Date: Mon, 29 Jun 2026 00:37:47 +0200 Subject: [PATCH 2/2] fix --- boards/LCU/packets.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/LCU/packets.json b/boards/LCU/packets.json index 24ba673..c282183 100644 --- a/boards/LCU/packets.json +++ b/boards/LCU/packets.json @@ -6,7 +6,7 @@ "id": 9500, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" }, { "type": "data", @@ -15,7 +15,7 @@ "id": 9501, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" }, { "type": "data", @@ -24,7 +24,7 @@ "id": 9502, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" }, { "type": "data", @@ -33,7 +33,7 @@ "id": 9503, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" }, { "type": "data", @@ -45,7 +45,7 @@ "id": 9520, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" }, { "type": "data", @@ -110,6 +110,6 @@ "id": 9521, "period_type": "us", "period": 500.0, - "socket": "control_station_udp" + "socket": "vcu_udp" } ]