×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

infinite loop focusing

  • Posts: 456
  • Thank you received: 76

infinite loop focusing was created by Derek

Has anyone experienced a problem where the focusing keeps getting re-triggered by the capture module? It goes on forever and basically only the first image of the sequence gets taken.

I experienced this yesterday when using the scheduler. I watched it for a while and everything was ok, It took the first image in the sequence but then I noticed focusing was taking a long time. Clicking on the capture and focus tabs I could see it was in a loop. The capture tab log window kept showing focus complete and then triggering focus again. Possibly related, guiding was not suspended as far as I could see. I clicked cancel in the focus tab and it just started it again. Also it was not really focusing as it didn't move the focuser, rather it just kept taking focus captures.

I think I have logs. Will dig them out and attach later.

Derek
4 years 7 months ago #41958

Please Log in or Create an account to join the conversation.

  • Posts: 456
  • Thank you received: 76

Replied by Derek on topic infinite loop focusing

OK I've found logs from last night. Here is the interesting part. This pattern of **Focus Complete --> Check Focus requested** continues with no end in sight.
Any ideas? I've also attached my Schedule and Sequence file.
Thanks""
Derek
[2019-08-11T23:57:35.585 IST DEBG ][     org.kde.kstars.ekos.focus] - Focus newFITS # 1 : Current HFR  1
[2019-08-11T23:57:35.589 IST DEBG ][     org.kde.kstars.ekos.focus] - Current HFR: 1 is below required minimum HFR: 1.4 . Autofocus successful.
[2019-08-11T23:57:35.589 IST DEBG ][     org.kde.kstars.ekos.focus] - AutoFocus result: true
[2019-08-11T23:57:35.592 IST DEBG ][     org.kde.kstars.ekos.focus] - State: "Complete"
[2019-08-11T23:57:35.594 IST INFO ][   org.kde.kstars.ekos.capture] - "Focus complete."
[2019-08-11T23:57:35.596 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Focus State "Complete"
[2019-08-11T23:57:35.766 IST DEBG ][     org.kde.kstars.ekos.focus] - Check Focus requested with minimum required HFR 1.4
[2019-08-11T23:57:35.767 IST INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
[2019-08-11T23:57:35.767 IST DEBG ][   org.kde.kstars.ekos.capture] - In-sequence focusing started...
[2019-08-11T23:57:35.769 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Capture State "Focusing"
[2019-08-11T23:57:36.164 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking job stage for "SS Cyg" startup 2 "11/08/19 23:41" state 3
[2019-08-11T23:57:36.165 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking Park Wait State...
[2019-08-11T23:57:37.164 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking job stage for "SS Cyg" startup 2 "11/08/19 23:41" state 3
[2019-08-11T23:57:37.165 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking Park Wait State...
[2019-08-11T23:57:37.941 IST INFO ][           org.kde.kstars.fits] - Loading FITS file  "/tmp/fitsiQ1956.fits"
[2019-08-11T23:57:38.164 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking job stage for "SS Cyg" startup 2 "11/08/19 23:41" state 3
[2019-08-11T23:57:38.164 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking Park Wait State...
[2019-08-11T23:57:38.429 IST INFO ][   org.kde.kstars.ekos.capture] - "CCD capture aborted"
[2019-08-11T23:57:38.435 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Capture State "Aborted"
[2019-08-11T23:57:38.435 IST INFO ][ org.kde.kstars.ekos.scheduler] - "Warning: job 'SS Cyg' failed to capture target."
[2019-08-11T23:57:38.437 IST INFO ][ org.kde.kstars.ekos.scheduler] - "Warning: job 'SS Cyg' failed its capture procedure, restarting capture."
[2019-08-11T23:57:38.438 IST INFO ][ org.kde.kstars.ekos.scheduler] - "Job 'SS Cyg' capture is in progress..."
[2019-08-11T23:57:38.445 IST DEBG ][   org.kde.kstars.ekos.capture] - "Client module indicates that storage for '/home/dokeeffe/Pictures/Landed/SSCyg/Light/PV/Light' has already 1 captures processed."
[2019-08-11T23:57:38.445 IST DEBG ][   org.kde.kstars.ekos.capture] - Preparing capture job "/home/dokeeffe/Pictures/Landed/SSCyg/Light/PV/Light" for execution.
[2019-08-11T23:57:38.448 IST INFO ][   org.kde.kstars.ekos.capture] - "Job requires 60.000-second PV images, has 1/100 frames captured and will be processed."
[2019-08-11T23:57:38.449 IST DEBG ][     org.kde.kstars.ekos.focus] - Check Focus requested with minimum required HFR 1.4
[2019-08-11T23:57:38.449 IST WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.
[2019-08-11T23:57:38.449 IST DEBG ][   org.kde.kstars.ekos.capture] - In-sequence focusing started...
[2019-08-11T23:57:38.449 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Capture State "In Progress"
[2019-08-11T23:57:38.452 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Capture State "Focusing"
[2019-08-11T23:57:39.165 IST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking job stage for "SS Cyg" startup 2 "11/08/19 23:41" state 3
4 years 7 months ago #41978
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
Hi Derek,
I would say the problem starts earlier:
[2019-08-11T23:54:04.822 IST INFO ][   org.kde.kstars.ekos.capture] - "Received image 1 out of 100."
[2019-08-11T23:54:04.823 IST INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."
What you could see is that the Focus module immediately starts capturing after the first image has been received. But when it receives the image, it states that it has already completed and reports this to the Capture module.

It seems like from now on Scheduler, Capture and Focus seems to be out of sync.


Could you reproduce this with simulators? Just reading code does not give me a clue what happens.

- Wolfgang
The following user(s) said Thank You: Derek
4 years 7 months ago #41988

Please Log in or Create an account to join the conversation.

  • Posts: 456
  • Thank you received: 76

Replied by Derek on topic infinite loop focusing

Thanks Wolfgang,

Yes I'll try with simulators later today on that same machine (I hope to get time).

Derek
4 years 7 months ago #41989

Please Log in or Create an account to join the conversation.

  • Posts: 456
  • Thank you received: 76

Replied by Derek on topic infinite loop focusing

I've reproduced this problem again just now under clear skies. I tried with the simulators but couldnt seem to reproduce it.
I've increased the logging level and attached logs. It captured 1 image out of my sequence, then gets stuck in a focusing loop.

I also tried to avoid using the scheduler. I closed EKOS and kstars, opened up again and instead of using the scheduler, just used the guide, focus and captue panels in EKOS. I get the same result. Captures 1 and then gets stuck in a focus loop.
I've captured a video from the PC here


Anyone have any ideas of what I could be doing wrong?
Thanks
Derek

File Attachment:

File Name: log_22-12-18.txt
File Size:519 KB
The following user(s) said Thank You: Eric
Last edit: 4 years 7 months ago by Derek.
4 years 7 months ago #42124
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
Hi Derek,
that's really weird! Could you please also post the log from the time you shot the video?

It seems to be a problem with the HFR limit that triggers a re-focus. Are you using the HFR limit in your sequence?
In the sequence where you posted the log, everything goes well until the first image is received. Then a re-focus is triggered since the HFR in the image is above the level from focusing and then it starts to loop.

One thing might is slightly strange: in the video you posted, the focuser uses 2x2 binning. This might explain, why the image has a HFR worse than the focuser returns, since the focuser uses a coarser grid than capture. But this is only an idea...

- Wolfgang
The following user(s) said Thank You: Derek
4 years 7 months ago #42128

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Re:infinite loop focusing

Wolfgang, good point on the difference in binning between the focus frame and the capture frame! That's an interesting situation.

-Eric
The following user(s) said Thank You: Derek
4 years 7 months ago #42134

Please Log in or Create an account to join the conversation.

  • Posts: 456
  • Thank you received: 76

Replied by Derek on topic infinite loop focusing

Wolfgang / Eric,

Thanks for looking at this. Yes I generally use the HFR limit in the sequence and also I generally always bin 2x2 both in the capture and focus. I've always done this and never had a problem. 2x2 gives a better image scale for photometry with my camera/scope.

The sequence file I used was 'old' as in I have a library of them saved for the last year or more that I use. I've attached it here too (renamed to .txt because of forum restrictions)

File Attachment:

File Name: 100x60PV.esq.txt
File Size:1 KB

This sequence used to work fine until I recently did an apt-get update & upgrade and have this problem since.

I've also attached the log from the time of the video. Although I was doing a lot of 'messing' trying to fix it. Switching on/off the in-sequence HFR, switchin on/off in-sequence-guide limit.
I think its around 23:50:11.... There are probably a few attempts in this log file as I was stopping/starting desperately trying to fix it :-)
Maybe try `cat log_23-31-49.txt | grep 'In-sequence focusing'` to see the times

I'm going to have a look at the code later to see if I can figure it out?

BTW: This is just a hunch but is it possible that there is something around floating point numbers and rounding?
Previously when I focus (2x2 bin) on nights of good seeing my hfr would be about 0.95 and on nights of poor seeing it would be 1.23 or something like that.
However now I noticed its always rounded to 1....

Derek

File Attachment:

File Name: log_23-31-49.txt
File Size:983 KB
4 years 7 months ago #42135
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
Hi Derek,
I think I found the problem. It looks like the focus status for HFR based refocusing is broken.

As far as I understand the code, it should be a workaround changing the EKOS / Capture Parameter "In-Sequence HFR Check" to a value > 1.

- Wolfgang
4 years 7 months ago #42153

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic infinite loop focusing

What's broken exactly? possible to reproduce the issue with simulators?
4 years 7 months ago #42174

Please Log in or Create an account to join the conversation.

  • Posts: 1185
  • Thank you received: 370
I haven't reproduced it with simulators yet. The problem is this line in Capture::startFocusIfRequired():
else if (isInSequenceFocus && --inSequenceFocusCounter == 0)
isInSequenceFocus is only updated in resumeSequence(), but startFocusIfRequired() is called in startNextExposure(), i.e. it loops here as soon as the first image has been completed.
This is what I found out from the logs and reading the code. As a next step I will try to reproduce it - and then fix it...

- Wolfgang
The following user(s) said Thank You: Derek
4 years 7 months ago #42177

Please Log in or Create an account to join the conversation.

  • Posts: 456
  • Thank you received: 76

Replied by Derek on topic infinite loop focusing

Awesome, thanks a million!!!

I also noticed a small commented out block where it sets isInSequenceFocus, not sure if that could be something. Although, like you say, It seems it does not get to this line.
isInSequenceFocus = (m_AutoFocusReady && autofocusCheck->isChecked()/* && HFRPixels->value() > 0*/);

Derek
4 years 7 months ago #42180

Please Log in or Create an account to join the conversation.

Time to create page: 0.411 seconds