Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion Config/slicecamd.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,19 @@ FINE_ACQUIRE_MIN_SAMPLES=3
#
FINE_ACQUIRE_SETTLE_FRAMES=2

# FINE_ACQUIRE_SETTLE_SEC=<sec>
# Time-based settle <sec> applied after each move, in addition to SETTLE_FRAMES,
# to let the TCS physically finish the move before sampling resumes. This matters
# when autoexpose shortens the exposure (e.g. bright targets): the frame-count
# settle then elapses too quickly in wall-clock. Set to 0 to disable.
#
FINE_ACQUIRE_SETTLE_SEC=3.0

# FINE_ACQUIRE_GAIN=<g>
# Proportional gain <g> = {0..1} applied to the commanded offset when the residual
# is at or below FINE_ACQUIRE_GAIN_THRESHOLD arcsec.
#
FINE_ACQUIRE_GAIN=0.7
FINE_ACQUIRE_GAIN=1.0

# FINE_ACQUIRE_GAIN_LARGE=<g>
# Proportional gain <g> applied when the residual exceeds FINE_ACQUIRE_GAIN_THRESHOLD.
Expand Down
21 changes: 21 additions & 0 deletions slicecamd/slicecam_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,14 @@ namespace Slicecam {
return;
}

// time-based settle: wait for the TCS to physically finish the move before
// sampling resumes. The frame-count settle (settle_frames) is too short in
// wall-clock when autoexpose shortens the exposure (e.g. bright targets), so
// apply a configurable time-based settle on top of it; settle_sec=0 disables.
if ( this->fineacquire_state.settle_sec > 0.0 ) {
std::this_thread::sleep_for( std::chrono::duration<double>( this->fineacquire_state.settle_sec ) );
}

// reset samples and discard settle_count frames for telescope settling
this->fineacquire_state.reset();
this->fineacquire_state.settle_frames = this->fineacquire_state.settle_count;
Expand Down Expand Up @@ -1332,6 +1340,19 @@ namespace Slicecam {
applied++;
}
else
if ( config.param[entry] == "FINE_ACQUIRE_SETTLE_SEC" ) {
try { this->fineacquire_state.settle_sec = std::stod( config.arg[entry] ); }
catch ( const std::exception &e ) {
message.str(""); message << "ERROR invalid FINE_ACQUIRE_SETTLE_SEC "
<< config.arg[entry] << ": " << e.what();
logwrite( function, message.str() );
return ERROR;
}
message.str(""); message << "SLICECAMD:config:" << config.param[entry] << "=" << config.arg[entry];
logwrite( function, message.str() );
applied++;
}
else
if ( config.param[entry] == "FINE_ACQUIRE_GAIN" ) {
try { this->fineacquire_state.gain = std::stod( config.arg[entry] ); }
catch ( const std::exception &e ) {
Expand Down
7 changes: 4 additions & 3 deletions slicecamd/slicecam_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ namespace Slicecam {
std::vector<double> ddec_samp; ///< dDEC samples, degrees
int max_samples = 10; ///< samples before evaluating a move
int min_samples = 3; ///< minimum samples before scatter-gated early exit
double prec_arcsec = 0.1; ///< MAD scatter threshold per axis for early exit (arcsec)
double goal_arcsec = 0.3; ///< convergence threshold, arcsec
double gain = 0.7; ///< gain applied when offset <= gain_threshold_arcsec
double prec_arcsec = 0.35; ///< MAD scatter threshold per axis for early exit (arcsec)
double goal_arcsec = 0.4; ///< convergence threshold, arcsec
double gain = 1.0; ///< gain applied when offset <= gain_threshold_arcsec
double gain_large = 1.0; ///< gain applied when offset > gain_threshold_arcsec
double gain_threshold_arcsec = 2.0; ///< offset above which gain_large is used
int settle_frames = 0; ///< countdown of frames to discard while telescope settles
int settle_count = 2; ///< configured: frames to discard after each move
double settle_sec = 3.0; ///< time-based settle (sec) after each move; 0 disables (needed when autoexpose shortens frames so the frame-count settle is too brief in wall-clock)
int consecutive_centroid_failures = 0; ///< counts consecutive centroid failures
// exposure compensation (shared by the reactive trim and, later, autoexpose)
double exptime_min = 0.1; ///< clamp: minimum auto-adjusted exposure (sec)
Expand Down
Loading