ls372: `servo_to_temperature` crashes if the control input (Channel A) is used for the servo
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17
- Forks
- 20
- Avg merge
- 1h 22m
- Merged PRs (30d)
- 2
Description
When calling the servo_to_temperature() task, if the sample heater is set to use the Control Input (Channel A), then this cast to int() fails:
https://github.com/simonsobs/socs/blob/0323abc4f687e64292c2322d54d93e5b5f96b2ef/socs/agents/lakeshore372/agent.py#L677-L680
Example error:
2026-02-19T19:53:44+0000 Current still output is +00.00
2026-02-19T19:53:44+0000 get_still_output:4 Current still output is +00.00
2026-02-19T19:53:44+0000 get_still_output:4 Status is now "done".
2026-02-19T19:54:19+0000 start called for servo_to_temperature
2026-02-19T19:54:19+0000 servo_to_temperature:5 Status is now "starting".
2026-02-19T19:54:19+0000 servo_to_temperature:5 Status is now "running".
2026-02-19T19:54:20+0000 servo_to_temperature:5 Changing control to Closed Loop mode for servo.
2026-02-19T19:54:20+0000 servo_to_temperature:5 CRASH: [Failure instance: Traceback: <class 'ValueError'>: invalid literal for int() with base 10: 'A'
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:269:inContext
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:285:<lambda>
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:117:callWithContext
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:82:callWithContext
/opt/venv/lib/python3.10/site-packages/ocs/ocs_agent.py:984:_running_wrapper
/opt/venv/lib/python3.10/site-packages/socs/agents/lakeshore372/agent.py:678:servo_to_temperature
]
2026-02-19T19:54:20+0000 servo_to_temperature:5 Status is now "done".
2026-02-19T19:56:08+0000 start called for servo_to_temperature
2026-02-19T19:56:08+0000 servo_to_temperature:6 Status is now "starting".
2026-02-19T19:56:08+0000 servo_to_temperature:6 Status is now "running".
2026-02-19T19:56:09+0000 servo_to_temperature:6 CRASH: [Failure instance: Traceback: <class 'ValueError'>: invalid literal for int() with base 10: 'A'
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:269:inContext
/opt/venv/lib/python3.10/site-packages/twisted/python/threadpool.py:285:<lambda>
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:117:callWithContext
/opt/venv/lib/python3.10/site-packages/twisted/python/context.py:82:callWithContext
/opt/venv/lib/python3.10/site-packages/ocs/ocs_agent.py:984:_running_wrapper
/opt/venv/lib/python3.10/site-packages/socs/agents/lakeshore372/agent.py:678:servo_to_temperature
]
2026-02-19T19:56:09+0000 servo_to_temperature:6 Status is now "done".
2026-02-19T19:56:46+0000 start called for set_heater_output
2026-02-19T19:56:46+0000 set_heater_output:7 Status is now "starting".
2026-02-19T19:56:46+0000 set_heater_output:7 Status is now "running".
2026-02-19T19:56:46+0000 display: power output: 0.0
2026-02-19T19:56:46+0000 Set sample heater display to power, output to 0.0
2026-02-19T19:56:46+0000 set_heater_output:7 Set sample display to power, output to 0.0
In practice, we've never used this input, but it appears to be the default control input for a freshly configured 372, and we should allow this configuration, since some users might make use of it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in socs/agents/lakeshore372/agent.py at the servo_to_temperature() code around lines 677-680, and trace how the sample heater control input is read. Confirm the task handles the default Control Input (Channel A) configuration without crashing, then verify the servo operation completes successfully for that configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100