Automatically through the night

Questions, tips, information and discussions about using the SharpCap Sequencer and Sequence Planner tools
User avatar
admin
Site Admin
Posts: 17552
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatically through the night

#11

Post by admin »

Hi,

so I went to have a dig in the code to see what I could suggest, and I found that the code for the 'MOUNT SOLVEANDSYNC' step is already trying to override the default way that plate solving works when the live stacking is active to allow the correct position to be found, as does the MOUNT SOLVESYNCONLY step. The 'SAVE PLATE SOLVE COORDINATES' step doesn't do this.

Anyway, it rather deepens the mystery of why this is going wrong. It might be worth turning on the option to log additional info about plate solving in the logging settings, then trying it out. With the additional logging, SharpCap not only records details of every plate solving operation, it also keeps a copy of the image sent to the plate solver, which you can inspect to see if it is the stack image or a raw frame image.

After using the plate solve logging option, you will find a folder called 'PlateSolveImages' inside the default SharpCap capture folder, and in that you will find subfolders for each run of SharpCap, then each plate solve attempt.

cheres,

Robin
StarFlea
Posts: 175
Joined: Wed Dec 21, 2022 12:22 pm

Re: Automatically through the night

#12

Post by StarFlea »

OK, I have collected the log data about the behavior. The saved / used plate solver images reveal exactly what is causing the problems: They are identical, even though they should be different after the meridian flip.

There are 4 images in total: The first before the flip (but already within the live stacking pause) to synchronize again, the other three after the flip to perform auto-recentering.

All files are attached as a ZIP file.

Note: I also tried "CAPTURE 1 LIVE FRAMES" before plate solving, but unfortunately that didn't help either...
Attachments
Solve 4 at 2024-08-29T22.32.01.0571420+02.00.zip
(679.47 KiB) Downloaded 159 times
Solve 3 at 2024-08-29T22.31.38.0243751+02.00.zip
(679.46 KiB) Downloaded 164 times
Solve 2 at 2024-08-29T22.31.11.7772910+02.00.zip
(679.46 KiB) Downloaded 166 times
Solve 1 at 2024-08-29T22.29.56.1053691+02.00.zip
(679.47 KiB) Downloaded 164 times
Log_2024-08-29T22_09_58-21104.zip
(527.82 KiB) Downloaded 159 times
User avatar
admin
Site Admin
Posts: 17552
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatically through the night

#13

Post by admin »

Hi,

thanks, I can see that all the frames are identical, and have an identical timestamp - it looks as though they are all coming from about the point where live stacking was paused to allow the flip.

I'm going to have to dig into exactly the data path for the image under those circumstances. I have a feeling that maybe it asks live stacking for the last raw frame from the camera, but that doesn't get updated during a live stack pause (doing that would break the 'unstack' feature).

I will check further tomorrow.

cheers,

Robin
StarFlea
Posts: 175
Joined: Wed Dec 21, 2022 12:22 pm

Re: Automatically through the night

#14

Post by StarFlea »

Hello Robin,

I haven't had the chance to test it yet, but I have the following idea:

+ Run through the first stack series in Live Mode
+ Pause LiveStacking
+ Meridian Flip
+ Switch to Still Mode
+ Platesolving and Recentering with 3 purposive frames in Still Mode
+ Switch back to Live Mode
+ Continue LiveStacking

Would that be possible or could there be any side effects due to the mode change?

StarFlea
User avatar
admin
Site Admin
Posts: 17552
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatically through the night

#15

Post by admin »

Hi,

essentially I think that with the way the code works at the moment, the only solution would be to close live stacking completely - while live stacking is active at the moment, the code will always go through the buggy path when trying to fetch a frame to plate solve (regardless of live or still mode, pause or not).

Closing live stacking completely should bypass the issue, and there are steps that allow you to resume stacking without a reset from the sequencer.

* The 'Stop Live Stacking' step closes live stacking without causing a reset (although it will probably auto-save - worth doing at that point!)

* The 'Resume Live stacking'' step will re-activate live stacking and continue stacking without resetting

This does rely on the 'Start new stack when re-opening after being closed for 1 minute or more' option being turned off in the live stacking settings tab.

cheers,

Robin
StarFlea
Posts: 175
Joined: Wed Dec 21, 2022 12:22 pm

Re: Automatically through the night

#16

Post by StarFlea »

Hi Robin, after a long time, some news:

Last night, for the first time, I managed to conduct a fully automatic session using the sequencer without any major difficulties:
The guiding, the stacking, even the meridian flip with the subsequent realignment using the inline-platesolver worked perfectly! :) :-)

Only at the end of the sequence, things didn't go quite as planned (which doesn't diminish the success of this night, though):
The plan was for the telescope to take exposures until the nautical dawn, then end the guiding and stacking, park itself, and disconnect the mount
and the two cameras. However, it never came to that, as the guiding and stacking had already been interrupted some time before, as the target object and the guide stars were eventually obscured by the edge of my house's roof.
Nevertheless, I would have liked the telescope to shut down at the latest at the dawn. In practice, however, it tried to guide well after sunrise, and the tracking didn't shut down either.

Now I'm looking for a way to restructure the sequence to accomplish something like this...

I used the following sequence (note the end):

Code: Select all

SEQUENCE
    SAVE MOUNT COORDINATES
    LIVE STACKING START
    LIVE STACKING PAUSE
    PROMPT "Press OK (15 s countdown)." ENABLECONTROLS True
    COUNTDOWN FOR 15 SHOWING "starting..."
    BEFORE SEQUENCE FINISH DO
        LIVE STACKING SAVE AllFormats
        LIVE STACKING STOP
    END DO
    RETRY ERRORS UP TO 10 TIMES
        DELAY 2
        GUIDING CONNECT ABORT True
        GUIDING START
    END RETRY ERRORS
    GUIDING WAIT
    SHOW NOTIFICATION "Guiding active. Start stacking..." COLOUR Green DURATION 10
    LIVE STACKING RESET
    STOP AT 5 FROM HORIZON
        STOP AT -0.5 FROM MERIDIAN
            LOOP UNTIL NauticalDawn
                LIVE STACK FOR 2 MORE FRAMES THEN PAUSE
                GUIDING DITHER NOW
                DELAY 2
            END LOOP
        END STOP AT
        STOP AT NauticalDawn
            SHOW NOTIFICATION "Guiding paused..." COLOUR Green DURATION 10
            LIVE STACKING PAUSE
            BEGIN GUIDING PAUSE
                PRESERVE CAMERA SETTINGS
                    SHOW NOTIFICATION "Load Profile..." COLOUR Green DURATION 5
                    LOAD PROFILE "PlateSolving 2s 4000 (veTEC 1x1)"
                    WAIT FOR FRAME
                    MOUNT SOLVESYNCONLY
                    SHOW NOTIFICATION "Meridian flip..." COLOUR Amber DURATION 10
                    MOUNT FLIP
                    SHOW NOTIFICATION "Meridian flip completed. Wait 10 s..." COLOUR Green DURATION 5
                    DELAY 10
                    SHOW NOTIFICATION "Recentering: Step  1/3" COLOUR Amber DURATION 5
                    RETRY ERRORS UP TO 50 TIMES
                        WAIT FOR FRAME
                        MOUNT SOLVESYNCONLY
                    END RETRY ERRORS
                    GOTO SAVED COORDINATES
                    DELAY 2
                    SHOW NOTIFICATION "Recentering: Step  2/3" COLOUR Amber DURATION 5
                    RETRY ERRORS UP TO 50 TIMES
                        WAIT FOR FRAME
                        MOUNT SOLVESYNCONLY
                    END RETRY ERRORS
                    GOTO SAVED COORDINATES
                    DELAY 2
                    SHOW NOTIFICATION "Recentering: Step  3/3" COLOUR Amber DURATION 5
                    RETRY ERRORS UP TO 50 TIMES
                        WAIT FOR FRAME
                        MOUNT SOLVESYNCONLY
                    END RETRY ERRORS
                    GOTO SAVED COORDINATES
                    DELAY 2
                    SHOW NOTIFICATION "Recentering completed. Load old camera settings..." COLOUR Green DURATION 5
                END PRESERVE
                SHOW NOTIFICATION "Reactivate guiding..." COLOUR Amber DURATION 5
            END GUIDING PAUSE
            RETRY ERRORS UP TO 50 TIMES
                GUIDING START
                DELAY 2
            END RETRY ERRORS
            SHOW NOTIFICATION "Backlash: Wait 60 s..." COLOUR Amber DURATION 55
            DELAY 60
            SHOW NOTIFICATION "Guiding active. Continue with stacking..." COLOUR Green DURATION 10
            LIVE STACKING RESUME
        END STOP AT
        LOOP UNTIL NauticalDawn
            LIVE STACK FOR 2 MORE FRAMES THEN PAUSE
            GUIDING DITHER NOW
            DELAY 2
        END LOOP
    END STOP AT
    SHOW NOTIFICATION "Nautical Dawn! Stop stacking & guiding..." COLOUR Amber DURATION 10
    LIVE STACKING STOP
    GUIDING STOP
    GUIDING DISCONNECT
    CAMERA CLOSE
    MOUNT TRACKING None
    MOUNT PARK
    MOUNT DISCONNECT
    PROMPT "Stacking successful. Camera & mount disconnected. Press OK." ENABLECONTROLS True
END SEQUENCE
Note the loop:

Code: Select all

LOOP UNTIL NauticalDawn
    LIVE STACK FOR 2 MORE FRAMES THEN PAUSE
    GUIDING DITHER NOW
    DELAY 2
END LOOP

Would this perhaps be more robust:

Code: Select all

LOOP UNTIL NauticalDawn
    STOP AT NauticalDawn
        LIVE STACK FOR 2 MORE FRAMES THEN PAUSE
        GUIDING DITHER NOW
        DELAY 2
    END STOP AT
END LOOP
or

Code: Select all

STOP AT NauticalDawn
    LOOP UNTIL NauticalDawn
        LIVE STACK FOR 2 MORE FRAMES THEN PAUSE
        GUIDING DITHER NOW
        DELAY 2
    END LOOP
END STOP AT
or do you have a better suggestion?

StarFlea
User avatar
admin
Site Admin
Posts: 17552
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatically through the night

#17

Post by admin »

Hi,

glad to hear that you got so close to full automation!

Adding the 'STOP AT' is the key to solving the problem, as the 'LOOP UNTIL' step only checks the time when the loop is due to be restarted, so if that happens 5 minutes before dawn then it will start the loop again, which may take an hour to complete perhaps.

Either way round (stop at either inside or outside the loop until) should work, but I personally would put the stop at outside the loop I think.

cheers,

Robin
StarFlea
Posts: 175
Joined: Wed Dec 21, 2022 12:22 pm

Re: Automatically through the night

#18

Post by StarFlea »

Hi,
thank you very much, that's a good start.
Now I just need to make sure it can shut down promptly if, for example, the edge of the roof comes into view.
Is there any sequencer module that could accomplish something like this?

Greetings!
StarFlea
User avatar
admin
Site Admin
Posts: 17552
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Automatically through the night

#19

Post by admin »

Hi,

nothing that is really designed to do that job I'm afraid. The only thing I can think of is the 'stop at X degrees from the horizon step' - you could calculate the altitude at which the scope would be when the roof comes into view and use that. The trouble is that the altitude calculation would give different results for different target declinations, so you couldn't always use the same number.

cheers,

Robin
StarFlea
Posts: 175
Joined: Wed Dec 21, 2022 12:22 pm

Re: Automatically through the night

#20

Post by StarFlea »

How about developing a sequencer stop when the guiding star is detected as lost after a certain number of consecutive attempts?
Post Reply