Skip to content

Support HRC 15V On from SCS-85 activation#384

Merged
taldcroft merged 2 commits intomasterfrom
hrc-scs-85-commanding
Apr 1, 2026
Merged

Support HRC 15V On from SCS-85 activation#384
taldcroft merged 2 commits intomasterfrom
hrc-scs-85-commanding

Conversation

@taldcroft
Copy link
Copy Markdown
Member

@taldcroft taldcroft commented Mar 31, 2026

Description

With the release of MATLAB tools 2026_020, load commanding is updated so that the HRC 15V power supply is turned on via activation of SCS-85. Previously this was done via SCS-134.

This PR adds support for setting the hrc_15v state to ON at a time 22.166 seconds after the SCS-85 activation command. The time delay was provided by K. Gage.

To support the time delay, a new time_delay class attribute was added to the FixedTransition class. The code for this is straightforward.

Interface impacts

None.

This is back-compatible with older loads that use SCS-134 since the state-changing class that watches for SCS-134 has not been removed. There are currently no plans to repurpose SCS-134 since that SCS is quite small. If that did happen it would be possible to have the state transition depend on the date of the command.

Testing

Unit tests

  • Mac
(ska3) ➜  kadi git:(hrc-scs-85-commanding) git rev-parse --short HEAD
b630b31
(ska3) ➜  kadi git:(hrc-scs-85-commanding) pytest 
======================================================================= test session starts =======================================================================
platform darwin -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/aldcroft/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 313 items                                                                                                                                               

kadi/commands/tests/test_commands.py ...............................................................s..............................                         [ 30%]
kadi/commands/tests/test_commands_v2.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                            [ 58%]
kadi/commands/tests/test_filter_events.py ..                                                                                        [ 58%]
kadi/commands/tests/test_states.py ...............................................x..........................                       [ 82%]
kadi/commands/tests/test_validate.py ......................                                                                         [ 89%]
kadi/tests/test_events.py ..........                                                                                                [ 92%]
kadi/tests/test_occweb.py .......................                                                                                   [100%]

========================================= 223 passed, 89 skipped, 1 xfailed in 109.54s (0:01:49) ==========================================

Independent check of unit tests by Jean

  • Linux
(ska3-matlab-2026.4rc1) jeanconn-kady> pytest
==================================================================================================== test session starts ====================================================================================================
platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: timeout-2.4.0, anyio-4.12.1
collected 313 items                                                                                                                                                                                                         

kadi/commands/tests/test_commands.py ...............................................................s..............................                                                                                   [ 30%]
kadi/commands/tests/test_commands_v2.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                                                                                      [ 58%]
kadi/commands/tests/test_filter_events.py ..                                                                                                                                                                          [ 58%]
kadi/commands/tests/test_states.py ...............................................x..........................                                                                                                         [ 82%]
kadi/commands/tests/test_validate.py ......................                                                                                                                                                           [ 89%]
kadi/tests/test_events.py ..........                                                                                                                                                                                  [ 92%]
kadi/tests/test_occweb.py .......................                                                                                                                                                                     [100%]

================================================================================== 223 passed, 89 skipped, 1 xfailed in 326.94s (0:05:26) ===================================================================================
(ska3-matlab-2026.4rc1) jeanconn-kady> git rev-parse HEAD
b630b319017b3b15292b011c651408a2e6e875e3

Functional tests

The following script (run in this repo directory) provides the following output.

Script

import kadi.commands as kc
import kadi.commands.states as kcs

# Read the backstop file for the FEB1626T test loads and get the HRC states
cmds = kc.read_backstop("FEB1626T.backstop")
states = kcs.get_states(cmds=cmds, state_keys=["hrc_s", "hrc_i", "hrc_15v", "hrc_24v"])

states.pprint_exclude_names = ["tstart", "tstop"]
states.pprint_all()

Output

The SCS-85 activation times are listed below:

  • 2026:048:18:51:11.027
  • 2026:049:13:09:34.924

The hrc_15v ON times are 22 seconds afterward.

      datestart              datestop       hrc_s hrc_i hrc_15v hrc_24v trans_keys
--------------------- --------------------- ----- ----- ------- ------- ----------
2026:046:22:04:13.413 2026:048:18:51:33.193   OFF   OFF     OFF     OFF           
2026:048:18:51:33.193 2026:048:18:52:37.027   OFF   OFF      ON     OFF    hrc_15v
2026:048:18:52:37.027 2026:048:20:07:44.027   OFF    ON      ON     OFF      hrc_i
2026:048:20:07:44.027 2026:048:20:07:45.027   OFF    ON      ON     OFF      hrc_s
2026:048:20:07:45.027 2026:048:20:07:57.027   OFF   OFF      ON     OFF      hrc_i
2026:048:20:07:57.027 2026:049:13:09:57.090   OFF   OFF     OFF     OFF    hrc_15v
2026:049:13:09:57.090 2026:049:13:11:00.924   OFF   OFF      ON     OFF    hrc_15v
2026:049:13:11:00.924 2026:049:14:37:47.924   OFF    ON      ON     OFF      hrc_i
2026:049:14:37:47.924 2026:049:14:37:48.924   OFF    ON      ON     OFF      hrc_s
2026:049:14:37:48.924 2026:049:14:38:00.924   OFF   OFF      ON     OFF      hrc_i
2026:049:14:38:00.924 2026:054:01:55:44.837   OFF   OFF     OFF     OFF    hrc_15v

I also confirmed that without this patch, the states show hrc_15v in the OFF state for the entire load.

@taldcroft taldcroft requested a review from jeanconn March 31, 2026 18:34
@jzuhone
Copy link
Copy Markdown
Collaborator

jzuhone commented Mar 31, 2026

@taldcroft pardon me if I should know this already, but how is the transition from previous commands which used SCS-134 to the new SCS-85 commanding handled? I'm thinking about situations like when one sets the "now" CxoTime to some point in the past and we rely on the commanding to create the right states.

@jeanconn
Copy link
Copy Markdown
Contributor

We should probably update the description to indicate that the SCS134 code was left alone, so there should not be issues with historical compatibility. Operationally this should be acceptable as there is no plan to reuse SCS134 at this time.

Copy link
Copy Markdown
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Optional comment is to update the description to note that it is back compatible with the previous SCS134 commanding. It would also be nice to add a unit test for the time_delay attribute, but I agree this is straightforward and the functional testing is fine.

@taldcroft
Copy link
Copy Markdown
Member Author

I updated the description accordingly. Agreed that a unit test might be nice but I'd like to leave that as an action for when there are flight loads that include this commanding. Then it will be quite easy to replicate my functional test in a unit test. Right now it is possible but a bit tedious.

@jskrist
Copy link
Copy Markdown
Member

jskrist commented Mar 31, 2026

For the MATLAB release, I noted that for SCS85 we are tracking the HRC 15V turn on (215PCAST) as well as the 2S2ONST state. I didn't see this MSID in the states.py file or elsewhere in kadi, so perhaps it doesn't matter for python, but I wanted to mention it incase it needed to be tracked as well. I think this was only ever set via direct command in the backstop previously, and now it is set as part of SCS85 also.

@jeanconn
Copy link
Copy Markdown
Contributor

Good point @jskrist . Ken noted this but as you guessed from your search, kadi wasn't tracking the shield / 2S2ONST state anyway, so that half of the scs85 change is presently not impacting for the kadi commanded states.

@taldcroft taldcroft merged commit d664b33 into master Apr 1, 2026
5 checks passed
@taldcroft taldcroft deleted the hrc-scs-85-commanding branch April 1, 2026 15:03
This was referenced Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants