×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

infinite loop focusing

  • 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 8 months ago by Derek.
4 years 8 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 8 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 8 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 8 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 8 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.

  • Posts: 1185
  • Thank you received: 370
OK, I could reproduce it with simulators.
  1. Start an autofocus sequence so that autofocus succeeds.
  2. Create an image sequence with HFR limit set and with more than one frame. Set EKOS / Capture Parameter "In-Sequence HFR Check" to 1.
  3. Start the image sequence
After the first image captured and before the second one starts, the Capture module loops in focusing.
The following user(s) said Thank You: Derek
4 years 7 months ago #42181

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

Great!! Thanks Wolfgang.
Derek
4 years 7 months ago #42182

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

  • Posts: 1185
  • Thank you received: 370
... and I can confirm - at least with simulators - setting "In-Sequence HFR Check" to 2 is a proper work around.

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

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

  • Posts: 1185
  • Thank you received: 370
The fix is on the way with diff D23258 .

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

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

Time to create page: 0.358 seconds