From 0c99bc9d1154599c363234bc250324b29de3956a Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Wed, 11 Aug 2021 16:49:32 +0200
Subject: [PATCH 1/9] star tracker on command
---
.idea/runConfigurations/PDU1_Test_UDP.xml | 4 ++--
config/hook_implementations.py | 3 ++-
pus_tc/pdu1.py | 25 ++++++++++++++---------
pus_tc/tc_packer_hook.py | 7 ++-----
4 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/.idea/runConfigurations/PDU1_Test_UDP.xml b/.idea/runConfigurations/PDU1_Test_UDP.xml
index 22ea5c2..7e5d81c 100644
--- a/.idea/runConfigurations/PDU1_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU1_Test_UDP.xml
@@ -6,9 +6,9 @@
-
+
-
+
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 2dfb5e2..b3154dc 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -52,6 +52,7 @@ class EiveHookObject(TmTcHookBase):
op_code_dict_srv_pdu1 = {
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
@@ -151,7 +152,7 @@ class EiveHookObject(TmTcHookBase):
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
- service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu2_tuple
+ service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
service_op_code_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
service_op_code_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index fc52e65..083511f 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -30,46 +30,51 @@ class PDU1TestProcedure:
turn_channel_3_off = True
-def pack_pdu1_test_into(
- pdu1_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT
-):
- tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1"))
+def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+ tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
+
+ if op_code == 1:
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker on"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size, Channel.on)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- command = pack_ping_command(pdu1_object_id, ping_data)
+ command = pack_ping_command(object_id, ping_data)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
command = pack_get_param_command(
- pdu1_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
+ object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size
)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 on (MTQ)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 off (MTQ)"))
- command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_3.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 322c1b5..3ef0797 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -48,11 +48,8 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
object_id = P60_DOCK_HANDLER
return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue)
if service == CustomServiceList.PDU1.value:
- pdu1_object_id = PDU_1_HANDLER_ID
- p60dock_object_id = P60_DOCK_HANDLER
- return pack_pdu1_test_into(
- pdu1_object_id=pdu1_object_id, p60dock_object_id=p60dock_object_id, tc_queue=service_queue
- )
+ object_id = PDU_1_HANDLER_ID
+ return pack_pdu1_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.PDU2.value:
pdu2_object_id = PDU_2_HANDLER_ID
p60dock_object_id = P60_DOCK_HANDLER
From c7f5db0f5373d4a86ecd336d75d2d9bcb757eced Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Wed, 11 Aug 2021 17:14:30 +0200
Subject: [PATCH 2/9] op_code fix
---
.idea/runConfigurations/PDU1_Test_UDP.xml | 2 +-
pus_tc/pdu1.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.idea/runConfigurations/PDU1_Test_UDP.xml b/.idea/runConfigurations/PDU1_Test_UDP.xml
index 7e5d81c..5c13b3b 100644
--- a/.idea/runConfigurations/PDU1_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU1_Test_UDP.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 083511f..1f1a78d 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -27,13 +27,13 @@ class PDU1TestProcedure:
turn_channel_2_on = False # Star Tracker connected to this channel (5V)
turn_channel_2_off = False
turn_channel_3_on = False # MTQ connected to this channel (5V)
- turn_channel_3_off = True
+ turn_channel_3_off = False
-def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
+def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
- if op_code == 1:
+ if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker on"))
command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on)
From 30bb3c87780f1aefa9f845d8ebfbffb7ae1b967a Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Thu, 12 Aug 2021 15:07:03 +0200
Subject: [PATCH 3/9] pdu2 star tracker switch on
---
config/hook_implementations.py | 1 +
pus_tc/pdu1.py | 3 +++
2 files changed, 4 insertions(+)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index b3154dc..c0fb98f 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -53,6 +53,7 @@ class EiveHookObject(TmTcHookBase):
op_code_dict_srv_pdu1 = {
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("PDU1: Get switch state of star tracker", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 1f1a78d..2b790ff 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -39,6 +39,9 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+
+
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
From e5dc68c819a2dfd6b50610627e4e4df9aedc72e6 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Thu, 12 Aug 2021 17:17:28 +0200
Subject: [PATCH 4/9] turn sus nominal on
---
config/hook_implementations.py | 1 +
pus_tc/pdu1.py | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index c0fb98f..b0b561d 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -54,6 +54,7 @@ class EiveHookObject(TmTcHookBase):
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PDU1: Get switch state of star tracker", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 2b790ff..762909a 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -39,9 +39,12 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
- if op_code == "1":
-
-
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size, Channel.on)
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
From 950adf36ed8807c308350c8ddb63140f7a767934 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Fri, 13 Aug 2021 09:34:44 +0200
Subject: [PATCH 5/9] op_code to turn star tracker and sus nominal off
---
config/hook_implementations.py | 2 ++
pus_tc/pdu1.py | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index b0b561d..30043e7 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -55,6 +55,8 @@ class EiveHookObject(TmTcHookBase):
"1": ("PDU1: Turn star tracker on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PDU1: Get switch state of star tracker", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("PDU1: Turn star tracker off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 762909a..be2ba43 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -45,6 +45,18 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
PDUConfigTable.out_en_4.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star racker off"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
+ PDUConfigTable.out_en_2.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_4.parameter_address,
+ PDUConfigTable.out_en_4.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
From 95c5aa46d979328fd13244d042dfc440c400d924 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Mon, 16 Aug 2021 10:03:40 +0200
Subject: [PATCH 6/9] star tracker ping command
---
config/definitions.py | 1 +
config/hook_implementations.py | 6 ++++++
config/object_ids.py | 2 +-
pus_tc/pdu1.py | 2 +-
pus_tc/star_tracker.py | 39 ++++++++++++++++++++++++++++++++++
pus_tc/tc_packer_hook.py | 6 +++++-
6 files changed, 53 insertions(+), 3 deletions(-)
create mode 100644 pus_tc/star_tracker.py
diff --git a/config/definitions.py b/config/definitions.py
index 4e9809f..16884fc 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -31,3 +31,4 @@ class CustomServiceList(enum.Enum):
PLOC_SUPV = "ploc_supv"
PLOC_UPDATER = "ploc_updater"
CORE = 'core'
+ STAR_TRACKER = 'star_tracker'
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 30043e7..7747761 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -154,6 +154,11 @@ class EiveHookObject(TmTcHookBase):
}
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
+ op_code_dict_srv_star_tracker = {
+ "0": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
+
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
@@ -166,6 +171,7 @@ class EiveHookObject(TmTcHookBase):
service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
service_op_code_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
+ service_op_code_dict[CustomServiceList.STAR_TRACKER.value] = service_star_tracker_tuple
return service_op_code_dict
def get_json_config_file_path(self) -> str:
diff --git a/config/object_ids.py b/config/object_ids.py
index 33ee78c..932dc50 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -23,7 +23,7 @@ RW1_ID = bytes([0x44, 0x12, 0x00, 0x1])
RW2_ID = bytes([0x44, 0x12, 0x00, 0x2])
RW3_ID = bytes([0x44, 0x12, 0x00, 0x3])
RW4_ID = bytes([0x44, 0x12, 0x00, 0x4])
-START_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
+STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index be2ba43..8497fe2 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -46,7 +46,7 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
- tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star racker off"))
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker off"))
command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
diff --git a/pus_tc/star_tracker.py b/pus_tc/star_tracker.py
new file mode 100644
index 0000000..8edb2ed
--- /dev/null
+++ b/pus_tc/star_tracker.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+"""
+@file star_tracker.py
+@brief Star tracker commanding
+@author J. Meier
+@date 14.08.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.ecss.tc import PusTelecommand
+
+
+class StarTrackerActionIds:
+ PING = 0
+ REQ_TEMPERATURE = 25
+
+
+def pack_star_tracker_commands_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT,
+ "Generate command for star tracker with object id: 0x" + object_id.hex())
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Ping"))
+ command = pack_ping_command(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+
+
+def pack_ping_command(object_id: bytearray) -> bytearray:
+ data = int(input("Specify ping data: "))
+ command = bytearray()
+ command = object_id + struct.pack('!I', StarTrackerActionIds.PING)
+ command = command + struct.pack('!I', data)
+ return command
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 3ef0797..ffe5cb8 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -28,10 +28,11 @@ from pus_tc.reaction_wheels import pack_single_rw_test_into
from pus_tc.rad_sensor import pack_rad_sensor_test_into
from pus_tc.ploc_upater import pack_ploc_updater_test_into
from pus_tc.core import pack_core_commands
+from pus_tc.star_tracker import pack_star_tracker_commands_into
from config.definitions import CustomServiceList
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_MPSOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID, \
- RAD_SENSOR_ID, PLOC_SUPV_ID, PLOC_UPDATER_ID
+ RAD_SENSOR_ID, PLOC_SUPV_ID, PLOC_UPDATER_ID, STAR_TRACKER_ID
LOGGER = get_console_logger()
@@ -95,6 +96,9 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
if service == CustomServiceList.PLOC_UPDATER.value:
object_id = PLOC_UPDATER_ID
return pack_ploc_updater_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.STAR_TRACKER.value:
+ object_id = STAR_TRACKER_ID
+ return pack_star_tracker_commands_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.CORE.value:
return pack_core_commands(tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")
From 84485a245b3febea7d81fa4a96ac3bea90005c2b Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Tue, 17 Aug 2021 10:37:13 +0200
Subject: [PATCH 7/9] turn acs board side A on
---
.../{PDU1_Test_UDP.xml => PDU1_Test.xml} | 2 +-
config/hook_implementations.py | 2 ++
pus_tc/pdu1.py | 13 +++++++++++++
pus_tc/pdu2.py | 1 +
4 files changed, 17 insertions(+), 1 deletion(-)
rename .idea/runConfigurations/{PDU1_Test_UDP.xml => PDU1_Test.xml} (88%)
diff --git a/.idea/runConfigurations/PDU1_Test_UDP.xml b/.idea/runConfigurations/PDU1_Test.xml
similarity index 88%
rename from .idea/runConfigurations/PDU1_Test_UDP.xml
rename to .idea/runConfigurations/PDU1_Test.xml
index 5c13b3b..2ad5775 100644
--- a/.idea/runConfigurations/PDU1_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU1_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 7747761..032a865 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -57,6 +57,8 @@ class EiveHookObject(TmTcHookBase):
"3": ("PDU1: Turn SUS nominal on", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("PDU1: Turn star tracker off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("PDU1: Turn SUS nominal off", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("PDU1: Turn ACS Side A on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("PDU1: Turn ACS Side A off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu1_tuple = ("PDU1 Device", op_code_dict_srv_pdu1)
diff --git a/pus_tc/pdu1.py b/pus_tc/pdu1.py
index 8497fe2..503849c 100644
--- a/pus_tc/pdu1.py
+++ b/pus_tc/pdu1.py
@@ -2,6 +2,7 @@
"""
@file tmtcc_tc_pdu1.py
@brief PDU2 tests
+@details PDU2 is mounted on the X4 slot of the P60 dock
@author J. Meier
@date 17.12.2020
"""
@@ -57,6 +58,18 @@ def pack_pdu1_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str)
PDUConfigTable.out_en_4.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A on"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size, Channel.on)
+ command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A off"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py
index 2beede5..6ea1f04 100644
--- a/pus_tc/pdu2.py
+++ b/pus_tc/pdu2.py
@@ -2,6 +2,7 @@
"""
@file tmtcc_tc_pdu2.py
@brief PDU2 tests
+@details PDU2 is mounted on the X2 slot of the P60 dock
@author J. Meier
@date 17.12.2020
"""
From 5574fe91c7873df128d35c62851a530bb067025d Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Tue, 17 Aug 2021 11:49:37 +0200
Subject: [PATCH 8/9] turn on stack 3V3
---
...k_Test_UDP.xml => P60_Dock_Commanding.xml} | 2 +-
.../{PDU1_Test.xml => PDU1_Commanding.xml} | 2 +-
...{PDU2_Test_UDP.xml => PDU2_Commanding.xml} | 2 +-
config/hook_implementations.py | 4 ++
pus_tc/p60dock.py | 37 ++++++++++++++---
pus_tc/pdu2.py | 41 +++++++++++--------
pus_tc/tc_packer_hook.py | 9 ++--
7 files changed, 67 insertions(+), 30 deletions(-)
rename .idea/runConfigurations/{P60_Dock_Test_UDP.xml => P60_Dock_Commanding.xml} (87%)
rename .idea/runConfigurations/{PDU1_Test.xml => PDU1_Commanding.xml} (88%)
rename .idea/runConfigurations/{PDU2_Test_UDP.xml => PDU2_Commanding.xml} (87%)
diff --git a/.idea/runConfigurations/P60_Dock_Test_UDP.xml b/.idea/runConfigurations/P60_Dock_Commanding.xml
similarity index 87%
rename from .idea/runConfigurations/P60_Dock_Test_UDP.xml
rename to .idea/runConfigurations/P60_Dock_Commanding.xml
index 8e873b7..0b80151 100644
--- a/.idea/runConfigurations/P60_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/P60_Dock_Commanding.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/PDU1_Test.xml b/.idea/runConfigurations/PDU1_Commanding.xml
similarity index 88%
rename from .idea/runConfigurations/PDU1_Test.xml
rename to .idea/runConfigurations/PDU1_Commanding.xml
index 2ad5775..f88e80d 100644
--- a/.idea/runConfigurations/PDU1_Test.xml
+++ b/.idea/runConfigurations/PDU1_Commanding.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/PDU2_Test_UDP.xml b/.idea/runConfigurations/PDU2_Commanding.xml
similarity index 87%
rename from .idea/runConfigurations/PDU2_Test_UDP.xml
rename to .idea/runConfigurations/PDU2_Commanding.xml
index fbf8adf..469e4d3 100644
--- a/.idea/runConfigurations/PDU2_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU2_Commanding.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 032a865..261b39d 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -47,6 +47,8 @@ class EiveHookObject(TmTcHookBase):
op_code_dict_srv_p60 = {
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("P60 Dock: Turn stack 3V3 on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("P60 Dock: Turn stack 3V3 off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
@@ -64,6 +66,8 @@ class EiveHookObject(TmTcHookBase):
op_code_dict_srv_pdu2 = {
"0": ("PDU2 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("PDU1: Turn ACS Side B on", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("PDU1: Turn ACS Side B off", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_pdu2_tuple = ("PDU2 Device", op_code_dict_srv_pdu2)
diff --git a/pus_tc/p60dock.py b/pus_tc/p60dock.py
index 9b1bef8..ba19e0a 100644
--- a/pus_tc/p60dock.py
+++ b/pus_tc/p60dock.py
@@ -33,10 +33,19 @@ class P60DockTestProcedure:
class P60DockConfigTable:
- out_en_0 = TableEntry(bytearray([0x00, 0x68]), TableEntry.uint8_size) # ACU
- out_en_1 = TableEntry(bytearray([0x00, 0x69]), TableEntry.uint8_size) # PDU1
- out_en_2 = TableEntry(bytearray([0x00, 0x6A]), TableEntry.uint8_size)
- out_en_3 = TableEntry(bytearray([0x00, 0x6B]), TableEntry.uint8_size) # PDU2
+ out_en_0 = TableEntry(bytearray([0x00, 0x68]), TableEntry.uint8_size) # ACU VCC
+ out_en_1 = TableEntry(bytearray([0x00, 0x69]), TableEntry.uint8_size) # PDU1 VCC
+ out_en_2 = TableEntry(bytearray([0x00, 0x6A]), TableEntry.uint8_size) # unused
+ out_en_3 = TableEntry(bytearray([0x00, 0x6B]), TableEntry.uint8_size) # PDU2 VCC
+ out_en_4 = TableEntry(bytearray([0x00, 0x6C]), TableEntry.uint8_size) # ACU VBAT
+ out_en_5 = TableEntry(bytearray([0x00, 0x6D]), TableEntry.uint8_size) # unused
+ out_en_6 = TableEntry(bytearray([0x00, 0x6E]), TableEntry.uint8_size) # PDU1 VBAT
+ out_en_7 = TableEntry(bytearray([0x00, 0x6F]), TableEntry.uint8_size) # PDU2 VBAT
+ out_en_8 = TableEntry(bytearray([0x00, 0x70]), TableEntry.uint8_size) # Stack VBAT
+ out_en_9 = TableEntry(bytearray([0x00, 0x71]), TableEntry.uint8_size) # Stack 3V3
+ out_en_10 = TableEntry(bytearray([0x00, 0x72]), TableEntry.uint8_size) # Stack 5V
+ out_en_11 = TableEntry(bytearray([0x00, 0x73]), TableEntry.uint8_size) # GS 3V3 (unused)
+ out_en_12 = TableEntry(bytearray([0x00, 0x74]), TableEntry.uint8_size) # GS 5V (unused)
# When channel consumes more than cur_lu_lim, channel is turned of immediately
cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xF8]), TableEntry.uint16_size)
@@ -48,7 +57,25 @@ class P60DockHkTable:
wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
-def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
+def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 on"))
+ parameter = 0 # set channel off
+ command = pack_set_param_command(object_id, P60DockConfigTable.out_en_9.parameter_address,
+ P60DockConfigTable.out_en_9.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
+ parameter = 0 # set channel off
+ command = pack_set_param_command(object_id, P60DockConfigTable.out_en_9.parameter_address,
+ P60DockConfigTable.out_en_9.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
command = pack_reboot_command(object_id)
diff --git a/pus_tc/pdu2.py b/pus_tc/pdu2.py
index 6ea1f04..ca7123f 100644
--- a/pus_tc/pdu2.py
+++ b/pus_tc/pdu2.py
@@ -36,70 +36,79 @@ class PDU2TestProcedure:
request_hk_table = False
-def pack_pdu2_test_into(pdu2_object_id: bytearray, p60dock_object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
+def pack_pdu2_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU2"))
- command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_3.parameter_address,
- P60DockConfigTable.out_en_3.parameter_size, Channel.on)
- command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
- tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B on"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size, Channel.on)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B off"))
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_7.parameter_address,
+ PDUConfigTable.out_en_7.parameter_size, Channel.off)
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ return tc_queue
if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot"))
- command = pack_reboot_command(pdu2_object_id)
+ command = pack_reboot_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_gnd_wdt:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value"))
- command = pack_get_param_command(pdu2_object_id, TableIds.hk, PDUHkTable.wdt_gnd_left.parameter_address,
+ command = pack_get_param_command(object_id, TableIds.hk, PDUHkTable.wdt_gnd_left.parameter_address,
PDUHkTable.wdt_gnd_left.parameter_size)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.gnd_wdt_reset:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing ground watchdog reset"))
- command = pack_gnd_wdt_reset_command(pdu2_object_id)
+ command = pack_gnd_wdt_reset_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- command = pack_ping_command(pdu2_object_id, ping_data)
+ command = pack_ping_command(object_id, ping_data)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing setting output channel 2 on (TCS Heater)"))
- command = pack_set_param_command(pdu2_object_id, PDUConfigTable.out_en_2.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading"))
- command = pack_get_param_command(pdu2_object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
+ command = pack_get_param_command(object_id, TableIds.hk, PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_channel_2_state:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)"))
- command = pack_get_param_command(pdu2_object_id, TableIds.config, PDUConfigTable.out_en_2.parameter_address,
+ command = pack_get_param_command(object_id, TableIds.config, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size)
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_cur_lu_lim_0:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reading current limit value of output channel 0 (OBC)"))
- command = pack_get_param_command(pdu2_object_id, TableIds.config, PDUConfigTable.cur_lu_lim_0.parameter_address,
+ command = pack_get_param_command(object_id, TableIds.config, PDUConfigTable.cur_lu_lim_0.parameter_address,
PDUConfigTable.cur_lu_lim_0.parameter_size)
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off"))
- command = pack_set_param_command(pdu2_object_id, PDUConfigTable.out_en_2.parameter_address,
+ command = pack_set_param_command(object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.request_hk_table:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Requesting housekeeping table"))
- command = pack_request_full_hk_table_command(pdu2_object_id)
+ command = pack_request_full_hk_table_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index ffe5cb8..f7022ff 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -47,16 +47,13 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
return pack_service200_test_into(tc_queue=service_queue)
if service == CustomServiceList.P60DOCK.value:
object_id = P60_DOCK_HANDLER
- return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue)
+ return pack_p60dock_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.PDU1.value:
object_id = PDU_1_HANDLER_ID
return pack_pdu1_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.PDU2.value:
- pdu2_object_id = PDU_2_HANDLER_ID
- p60dock_object_id = P60_DOCK_HANDLER
- return pack_pdu2_test_into(
- pdu2_object_id=pdu2_object_id, p60dock_object_id=p60dock_object_id, tc_queue=service_queue
- )
+ object_id = PDU_2_HANDLER_ID
+ return pack_pdu2_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.ACU.value:
object_id = ACU_HANDLER_ID
return pack_acu_test_into(object_id=object_id, tc_queue=service_queue)
From 5b2ff49555f0cfee51cd53c7772a147575a825a3 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Tue, 17 Aug 2021 11:55:38 +0200
Subject: [PATCH 9/9] fixed 3v3 switch double off
---
pus_tc/p60dock.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pus_tc/p60dock.py b/pus_tc/p60dock.py
index ba19e0a..6c9ed46 100644
--- a/pus_tc/p60dock.py
+++ b/pus_tc/p60dock.py
@@ -63,7 +63,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 on"))
parameter = 0 # set channel off
command = pack_set_param_command(object_id, P60DockConfigTable.out_en_9.parameter_address,
- P60DockConfigTable.out_en_9.parameter_size, Channel.off)
+ P60DockConfigTable.out_en_9.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue