Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACU Sun Avoidance #559

Merged
merged 21 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
af62ef9
ACU: sun avoidance
mhasself Oct 16, 2023
89322ba
ACU sun: update .sun in the process
mhasself Oct 25, 2023
55104b8
ACU sun: working non-blocking state machine to seek safety
mhasself Oct 25, 2023
d31f5a7
ACU sun: faster sun map computation
mhasself Oct 25, 2023
1945049
ACU sun: capacity to time-shift the Sun's position, for testing
mhasself Oct 30, 2023
aed7aaa
ACU sun: generate_scan checks traj before starting
mhasself Oct 30, 2023
c339ea0
ACU sun: create Task to handle seek_to_sunsafe
mhasself Oct 30, 2023
3d3f52b
ACU sun: consolidate SunTracker code and organize policy
mhasself Oct 31, 2023
c6bccef
ACU sun: more clean up; catch edge cases
mhasself Oct 31, 2023
39146f7
ACU sun: args, more
mhasself Oct 31, 2023
63f4c5c
ACU sun: consistencyize, reterminologize.
mhasself Nov 1, 2023
b12092c
ACU sun: one more tweak to escape path computation
mhasself Nov 1, 2023
b6a418b
ACU sun: monitor_sun session.data + docs
mhasself Nov 1, 2023
d70ac29
ACU sun: fix direct path bug; remove "escape=True" switch
mhasself Nov 1, 2023
496d07a
ACU sun: generate_scan initial seek must be sun-safe too!
mhasself Nov 1, 2023
8844a61
ACU: fix bug where empty blocks were pushed to feed
mhasself Nov 3, 2023
857c166
ACU sun: docs and requirements
mhasself Nov 1, 2023
f4effc8
ACU sun: add tests, cleanup
mhasself Nov 1, 2023
ef96a66
ACU sunvoidance: more docs cleanup
mhasself Nov 6, 2023
330be86
ACU sun: Add new dependencies to setup.py
BrianJKoopman Nov 6, 2023
e2faba8
ACU sunvoidance: couple more docs fixes
mhasself Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions docs/agents/acu_agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ installed to use this Agent. This can be installed via:

$ pip install 'soaculib @ git+https://github.com/simonsobs/soaculib.git@master'

Additionally, ``socs`` should be installed with the ``acu`` group:

.. code-block:: bash

$ pip install -U socs[acu]

Configuration File Examples
---------------------------
Below are configuration examples for the ocs config file and for soaculib.
Expand Down Expand Up @@ -88,6 +94,61 @@ example configuration block is below::
}


Sun Avoidance
-------------

The Sun's position, and the potential danger of the Sun to the
equipment, is monitored and reported by the ``monitor_sun`` Process.
If enabled to do so, this Process can trigger the ``escape_sun_now``
Task, which will cause the platform to move to a Sun-safe position.

The parameters used by an Agent instance for Sun Avoidance are
determined like this:

- Default parameters for each platform (LAT and SATP) are in the Agent
code.
- On start-up the default parameters for platform are modified
according to any command-line parameters passed in by the user.
- Some parameters can be altered using the command line.

The avoidance policy is defined by a few key parameters and concepts;
please see the descriptions of ``sun_dist``, ``sun_time``,
``exclusion_radius``, and more in the :mod:`socs.agents.acu.avoidance`
module documentation.

The ``exclusion_radius`` can be configured from the Agent command
line, and also through the ``update_sun`` Task.

When Sun Avoidance is active (``active_avoidance`` is ``True``), the
following will be enforced:

- When a user initiates the ``go_to`` Task, the target point of the
motion will be checked. If it is not Sun-safe, the Task will exit
immediately with an error. If the Task cannot find a set of moves
that are Sun-safe and that do not violate other requirements
(azimuth and elevation limits; the ``el_dodging`` policy), then the
Task will exit with error. The move may be executed as a series of
separate legs (e.g. the Task may move first to an intermediate
elevation, then slew in azimuth, then continue to the final
elevation) rather than simulataneously commanding az and el motion.
- When a user starts the ``generate_scan`` Process, the sweep of the
scan will be checked for Sun-safety, and the Process will exit with
error if it is not. Furthermore, any movement required prior to
starting the scan will be checked in the same way as for the
``go_to`` Task.
- If the platform, at any time, enters a position that is not
Sun-safe, then an Escape will be Initiated. During an Escape, any
running ``go_to`` or ``generate_scan`` operations will be cancelled,
and further motions are blocked. The platform will be driven to a
position at due North or due South. The current elevation of the
platform will be preserved, unless that is not Sun-safe (in which
case lower elevations will be attempted). The Escape feature is
active, even when motions are not in progress, as long as the
``monitor_sun`` Process is running. However -- the Escape operation
requires that the platform be in Remote operation mode, with no
persistent faults.


Exercisor Mode
--------------

Expand Down Expand Up @@ -149,5 +210,14 @@ acquisition processes are running::
Supporting APIs
---------------

drivers (Scanning support)
``````````````````````````

.. automodule:: socs.agents.acu.drivers
:members:

avoidance (Sun Avoidance)
`````````````````````````

.. automodule:: socs.agents.acu.avoidance
:members:
2 changes: 2 additions & 0 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The different groups, and the agents they provide dependencies for are:
- Supporting Agents
* - ``all``
- All Agents
* - ``acu``
- ACU Agent
* - ``labjack``
- Labjack Agent
* - ``magpie``
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pyyaml

# acu agent
soaculib @ git+https://github.com/simonsobs/soaculib.git@master
so3g
pixell

# holography agent - python 3.8 only!
# -r requirements/holography.txt
Expand Down
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

# Optional Dependencies
# ACU Agent
# acu_deps = ['soaculib @ git+https://github.com/simonsobs/soaculib.git@master']
acu_deps = [
# 'soaculib @ git+https://github.com/simonsobs/soaculib.git@master',
'pixell',
'so3g',
]

# Holography FPGA and Synthesizer Agents
# holography_deps = [ # Note: supports python 3.8 only!
Expand Down Expand Up @@ -53,10 +57,9 @@
# 'xy_stage_control @ git+https://github.com/kmharrington/xy_stage_control.git@main',
# ]

# Note: Not including the holograph deps, which are Python 3.8 only
# all_deps = acu_deps + labjack_deps + magpie_deps + pfeiffer_deps + \
# pysmurf_deps + smurf_sim_deps + synacc_deps + xy_stage_deps
all_deps = labjack_deps + magpie_deps + pfeiffer_deps + \
# Note: Not including the holograph deps, which are Python 3.8 only. Also not
# including any dependencies with only direct references.
all_deps = acu_deps + labjack_deps + magpie_deps + pfeiffer_deps + \
smurf_sim_deps + synacc_deps + timing_master_deps
all_deps = list(set(all_deps))

Expand Down Expand Up @@ -111,7 +114,7 @@
],
extras_require={
'all': all_deps,
# 'acu': acu_deps,
'acu': acu_deps,
# 'holography': holography_deps,
'labjack': labjack_deps,
'magpie': magpie_deps,
Expand Down
Loading