×

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

Bi-monthly release with minor bug fixes and improvements

KStars/EKOS 3.5.0 and PHD2 trouble

  • Posts: 1009
  • Thank you received: 133
I'm having issues with latest git and PHD2.
Last night, my sequences were aborted twice after/during a dither. Here's a summary of the relevant steps happening:
[2020-08-12T23:07:09.085 WEST INFO ][   org.kde.kstars.ekos.capture] - "Received image 42 out of 120."
[2020-08-12T23:07:09.086 WEST INFO ][   org.kde.kstars.ekos.capture] - Dithering...
[2020-08-12T23:07:09.402 WEST INFO ][     org.kde.kstars.ekos.guide] - "Autoguiding started."
[2020-08-12T23:07:10.089 WEST INFO ][   org.kde.kstars.ekos.capture] - "Refocus starting because of temperature change of 1.06 °C..."
[2020-08-12T23:07:17.318 WEST INFO ][     org.kde.kstars.ekos.focus] - "Autofocus in progress..."
[2020-08-12T23:07:17.319 WEST INFO ][     org.kde.kstars.ekos.focus] - "Focusing outward by 200 steps..."
[2020-08-12T23:07:17.502 WEST INFO ][     org.kde.kstars.ekos.guide] - "PHD2: Guiding paused."
[2020-08-12T23:07:17.503 WEST INFO ][     org.kde.kstars.ekos.guide] - "Guiding suspended."
[2020-08-12T23:09:09.495 WEST INFO ][     org.kde.kstars.ekos.guide] - "PHD2: There was no dithering response from PHD2, but continue guiding."
[2020-08-12T23:09:09.496 WEST INFO ][   org.kde.kstars.ekos.capture] - Dithering succeeded, capture state "Focusing"
[2020-08-12T23:09:09.496 WEST INFO ][   org.kde.kstars.ekos.capture] - "Dithering succeeded."
[2020-08-12T23:09:09.497 WEST INFO ][     org.kde.kstars.ekos.guide] - "Dithering completed successfully."
[2020-08-12T23:09:09.498 WEST INFO ][     org.kde.kstars.ekos.guide] - "Guiding resumed."
[2020-08-12T23:09:34.542 WEST INFO ][     org.kde.kstars.ekos.focus] - "Autofocus complete after 16 iterations."
[2020-08-12T23:10:00.650 WEST INFO ][   org.kde.kstars.ekos.capture] - "Capturing 60.000-second G image..."
......
[2020-08-12T23:13:05.093 WEST INFO ][   org.kde.kstars.ekos.capture] - "Received image 45 out of 120."
[2020-08-12T23:13:05.093 WEST INFO ][   org.kde.kstars.ekos.capture] - Dithering...
[2020-08-12T23:13:05.094 WEST INFO ][   org.kde.kstars.ekos.capture] - "Dithering..."
[2020-08-12T23:13:05.094 WEST INFO ][     org.kde.kstars.ekos.guide] - "Dithering in progress."
[2020-08-12T23:13:05.109 WEST INFO ][   org.kde.kstars.ekos.capture] - Dithering failed, capture state "Dithering"
[2020-08-12T23:13:05.109 WEST INFO ][   org.kde.kstars.ekos.capture] - "Warning: Dithering failed. Resuming in 1 seconds..."
[2020-08-12T23:13:09.275 WEST INFO ][     org.kde.kstars.ekos.guide] - "PHD2: Settling failed, aborted."
[2020-08-12T23:13:09.276 WEST INFO ][   org.kde.kstars.ekos.capture] - "Autoguiding stopped. Aborting..."
[2020-08-12T23:13:09.276 WEST INFO ][   org.kde.kstars.ekos.capture] - "CCD capture aborted"

So EKOS starts a dither. As soon as that starts to settle, an AF run is triggered that suspends guiding, so PHD2 cannot settle.
During(!) the AF the guide module complains that no response is there, but declares the dither succeeded and claims to resume guiding. But that command is never sent to PHD2, as its logs show. Most likely because the capture state is 'Focusing'? Nevertheless, once AF finishes (successfully), the guiding is not resumed. PHD2 stays in pause mode (and internally still is in dither mode, wanting to settle).
EKOS takes the next frames (without guiding!) until the next dither request comes in. That then fails, as PHD2 is already/still in dither mode. But guiding is resumed now. Nevertheless, the dither and autoguiding get declared failed, and the sequence aborts. :(

The exact same sequence happened again starting at 01:56:10

IMO somehow it should be made sure that PHD2 only gets suspended if in 'Guiding' state, and not when settling/dithering...

I attach the kstars logfile, it's however without debug. The PHD2 debug log, containing the jsonrpc calls, is too large to attach here (40M). But if needed I can put it online somewhere, or try to cut it down to the relevant part....

Edit: It's actually the same thing that happened after a meridian flip
Last edit: 3 years 8 months ago by Peter Sütterlin. Reason: Add reference to other thread
3 years 8 months ago #58176
Attachments:

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

  • Posts: 1185
  • Thank you received: 370
Hi Pit,
it looks like there are a bundle of things that do not work properly:
  1. PHD2 reports that it is guiding although settling after dithering is still ongoing (I'm quite sure that the EKOS code is correct here). This is the source of the trouble.
  2. If EKOS changes to the Guiding state it does not check whether the dithering timeout timer is running. This should never happen (see first point), but here EKOS could be more robust.
  3. The dithering timeout timer is not stopped while guiding is paused. I would say that's an EKOS bug, pausing should pause this timer.
  4. When the dithering timeout timer expires, it sends a "Dithering error" or"Guiding" depending whether the "Abort guiding after dithering error" option is set or not. But in both cases it does not sync with PHD2 about its real state, which is not really a good idea. In your case (you haven't selected the option) EKOS assumes that it is in the Guiding state although guiding it still is paused

Pooh, not that easy... I'll have to take a closer look.

In the meantime, I would recommend that you set the "Abort guiding after dithering error" option - and use the scheduler.

Wolfgang
3 years 8 months ago #58272

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

  • Posts: 1185
  • Thank you received: 370
I think I found a solution that resolves this problem. In essence focusing and dithering (including settling afterwards) should not overlap. In the pre-capture-check loop for light frames the focusing check is executed before the dithering check. In the case that is reported here it happens, that during the first iterations of the loop the limit for starting the focuser is not met, hence dithering is started.

The problem is that while dithering is running, the check loop is run through again. If one of the limits for focusing is reached, focusing is started regardless whether dithering is running or not.

In my fix I changed the check sequence so that dithering is checked before the focus check is executed. Since dithering (currently) depends only upon the number of captured frames, it might not happen that the check starts dithering at a later change.

It would be great if this fix gets tested before we merge it into the master - so feedback warmly welcome.

The fix is available from my git clone: invent.kde.org/wreissenberger/kstars.git . Please use the branch bugfix_mf_overwrite_frame

Cheers
Wolfgang
3 years 8 months ago #58295

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

  • Posts: 1009
  • Thank you received: 133
Already sent via PM, but here for all the note that Wolfgangs fix indeed fixes the issues I had, both the collisions between dither and focus and the overwriting of files after a meridian flip. I did have 7.5 hours of undisturbed imaging last night :) So I think this will make it to the main branch soon.

Thanks a LOT Wolfgang!
3 years 7 months ago #58362

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

Time to create page: 0.482 seconds