<div dir="ltr">Happy to talk more, perhaps a video chat if you want so we understand each other better. We're likely talking about two different thing, and perhaps I'm misunderstanding you, and I don't want to belabor things, but, FYI, here's how I see things:<div><br></div><div>Broadly speaking, there are two concepts:<div><div>1) (what I think you're talking about): the mount's internal representation of where it is pointing, which I think is related to SYNC, and how Ekos should manage that, and how to get the mount to point where the user wants it to point,</div><div>2) (what I think I'm talking about): the user's desired target (a certain RA and DEC) which is independent of the mount.</div><div><br></div><div>I know very little about #1, and so I leave it to you to get that working well. So, if you think there's a good way to manage that, please go ahead and do what you think is best.</div><div><br></div><div>If, by "Agreed", you are asking "should we store the user's intention in just one place", for sure my answer is yes.</div><div><br></div><div>I do think that the user's target (in RA and DEC) is "simple". It's just those two numbers. I think that target should be stored as those two numbers, and should be stored in one place, and should not be changed until the user (or scheduler) states a new preference.</div><div><br></div><div>I leave to you how we translate the user's target to mount movements--that is "not simple" and I really don't follow all the magic in the code related to that.</div><div><br></div><div>I am just talking about #2. I found a spot in the code where the user's desired target was changed. The user's target happens to be stored in the align module's target variable (at least the version of the user's target that's later used in alignment). I'm not suggesting that that is the right place to store it, I'm just saying "since it is stored there, we shouldn't change it". </div></div></div><div><br></div><div>Hy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 9, 2021 at 11:52 AM Wolfgang Reissenberger <<a href="mailto:sterne-jaeger@openfuture.de">sterne-jaeger@openfuture.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><br><div><blockquote type="cite"><div><div dir="ltr">I have no doubt there are other problems ;)</div></div></blockquote>:-)<br><blockquote type="cite"><div><div dir="ltr"><div>However, don't you agree that we should never over-write the user's desired target position?</div></div></div></blockquote><div><br></div><span style="color:rgb(0,0,0)">I’m fully with you, unintentional changes in the target through guiding drift is simply a bug. </span>But the general answer is not that digital. The definition of „the user’s target“ is not that simple - see the point I tried to make with the SYNC below. And if we want to have such a concept, it should be held in one place, not in more of them.</div><div><br></div><div>Agreed?<br><br><blockquote type="cite"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 9, 2021 at 11:37 AM Wolfgang Reissenberger <<a href="mailto:sterne-jaeger@openfuture.de" target="_blank">sterne-jaeger@openfuture.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Aaah, sorry, now I got the point. In this aspect, the alignment module behaves differently to the mount module. The mount module keeps always the last position that it had slewed to as target position. The alignment module does it differently.<div><br></div><div>But both have their ups and downs. If the last step a user does is a SYNC, the mount module still keeps the position of the last slew. This can lead to other problems with the MF. For this I have a MR!265 pending, since we are not sure what the right solution might be.</div><div><br></div><div>Wolfgang<br><div><br><blockquote type="cite"><div>Am 09.09.2021 um 20:01 schrieb Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>>:</div><br><div><div dir="ltr">You are misunderstanding the original conversation.<div><br></div><div>What I was complaining about is this: the code is changing "the original <u>target</u> position" by setting it to the mount's current position. This happen during a call to syncToMount, and that syncToMount happened at a job restart (e.g. the scheduler job was using "repeat until termination", and on the repeat, some change in capture status caused align to call syncToMount). So, syncToMount called at that time wound up changing the variable storing the user's target to the mount's current position, which had drifted from the user's target position. I claim we should never change the variable containing the user's target position once we know it. So, the user's target position was lost, and the subsequent alignment used the wrong target. </div><div><br></div><div>Hy</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 9, 2021 at 10:47 AM Wolfgang Reissenberger <<a href="mailto:sterne-jaeger@openfuture.de" target="_blank">sterne-jaeger@openfuture.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hm, not sure if I get your right.<div><br></div><div>This drifting, that you are describing, will be forgotten after the meridian flip, since the mount uses for the MF slew the original <u>target</u> position. The syncToMount happens <u>after</u> this slew of the MF, i.e. the position the mount should point is the original target position, not that one which happened through drifting.</div><div><br></div><div>Or am I wrong?<br></div><div><br></div><div><br><blockquote type="cite"><div>Am 09.09.2021 um 19:25 schrieb Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>>:</div><br><div><div dir="ltr">Wolfgang,<div><br></div><div>This is what I think is happening. For the sake of argument, let's say that the mount is perfectly sync'd with the target after some startup plate solving.However, then a job begins and the guider starts up, and sends guiding pulses for the next few hours. If there is some drift in DEC, let's say for the sake of argument 1 arc-second per minute of time, then after 3 hours the mount has been sent 180 arc-seconds of guide corrections or 3 arc-minutes of pushes in that DEC drift position, and the mount's internal representation of the position will differ from the target position by those 3 arc-minutes, even with all other things otherwise working perfectly. When we then meridian flip and align, we would not want to align to the mount's position, which is 3 arc-minutes off of the user's desired position, and in fact 3 minutes off of what the mount is really pointing to just before the meridian flip. Therefore we should not adjust the target position to where the mount is pointing at that time.</div><div><br></div><div>Hy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 9, 2021 at 10:14 AM Wolfgang Reissenberger <<a href="mailto:sterne-jaeger@openfuture.de" target="_blank">sterne-jaeger@openfuture.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I agree with you, Jasem, from my perspective this behavior of the align module makes perfectly sense. This reflects the position where the mount <u>thinks</u> it is pointing due to its internal pointing model.<div><br></div><div>When a meridian flip is issued, the mount module takes the last position it slewed to and re-issues a slew. Drifts during guiding should have no effect on this position. At its end, when the mount is tracking, it should be (again due to its internal model) at the target position, so a syncTargetToMount() should get exactly the target position.</div><div><br></div><div>Maybe a wild idea, but it would explain the behavior (and I didn't check it yet): if a slew command is issued to the mount and the mount ends the slew, are we 100% sure that it reports exactly the position we sent it to? I’ve never checked that, whether my mount reports exactly the coordinates after a slew where I sent it to.</div><div><br></div><div>But in the logs, I see slight variations, without any move in between:</div><div>[2021-09-08T21:03:46.172 CEST INFO ][ org.kde.kstars.ekos.align] - "Slewing to target coordinates: RA (20h 00m 33s) DEC ( <b>22° 46' 59</b>\").“</div><div>… slew + plate solving (no sync) ...<br>[2021-09-08T21:03:56.228 CEST INFO ][ org.kde.kstars.ekos.align] - „Solution coordinates: RA (20h 00m 32s) DEC ( 22° 47' 09\") Telescope Coordinates: RA (20h 00m 33s) DEC ( <b>22° 47' 09\</b>“)“<br><br>Its strange… And I can confirm, I observe a similar behavior, after a MF the position does sometimes not match perfectly.</div><div><br></div><div>Cheers</div><div>Wolfgang</div><div><div><br><blockquote type="cite"><div>Am 02.09.2021 um 22:38 schrieb Jasem Mutlaq <<a href="mailto:mutlaqja@ikarustech.com" target="_blank">mutlaqja@ikarustech.com</a>>:</div><br><div><div dir="ltr">Good question.<div><br></div><div>This was actually a solution to a problem we had. Align was always working on current telescope coordinates. When capture and solve is executed, and if SLEW to target is selected, the target was whatever the mount coordinates were WHEN you capture & solve was invoked. However, this DID result before in changing the actual target post alignment either due to mount drift or guiding pulses ..etc. This eliminates the issue, and sets an explicit target for align to SLEW to.</div><div><br></div><div>So when a user starts a sequence, the target is locked to whatever the mount is at that particular point in time and this is used throughout the session. This is intended for use with plate solving. Remember that after platesolving is done, the mount coords indeed matches the target (within the tolerance) because we perform SYNC followed by GOTO. I hope this clears things up.</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>--</div><div>Best Regards,<br>Jasem Mutlaq<br></div><div><br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 2, 2021 at 9:22 PM Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If you want, comment on my kstars-devel thread, but I want to ask you, why would we ever do what's on this line?<div><a href="https://invent.kde.org/education/kstars/-/blob/master/kstars/ekos/align/align.cpp#L3291" target="_blank">https://invent.kde.org/education/kstars/-/blob/master/kstars/ekos/align/align.cpp#L3291</a><br></div><div>I can see that you wrote or re-factored at least the last version of this in 65b0f85d535d179d1e11c22f7841527c49b15dda</div><div><br></div><div>We're changing the target to where the mount thinks it currently is, but, if we then align, then it doesn't matter what the mount thinks,</div><div>what matters is what the plate-solver thinks. But since we've changed the target coordinates, the plate solver will now move the image.</div><div>I think that's wrong, as far as I understand it--unless the user is running without plate solving. But I think everyone runs with plate solving these days.</div><div><br></div><div>What would go wrong if that line was eliminated?</div><div><br></div><div>Hy</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 1, 2021 at 9:52 PM Jasem Mutlaq <<a href="mailto:mutlaqja@ikarustech.com" target="_blank">mutlaqja@ikarustech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Hy,<div><br></div><div>That's right, setTargetCoords is what actually changes what align module aligns to. So the question now is why does the repeated job command a different coords?</div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>--</div><div>Best Regards,<br>Jasem Mutlaq<br></div><div><br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 2, 2021 at 5:48 AM Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hope you don't mind me sending you progress notes--it's therapeutic for me to debug this way ;)<div><br></div><div>So far, it seems like it isn't the meridian flip at all.</div><div><br></div><div>It turns out that the jobs is a scheduler "repeat until terminated" job.</div><div>It completed its first schedule about 10 minutes before the meridian flip, at around 2:36am.</div><div>At that point, the target coordinates are reset to this other spot. (Could it be a J2000 vs. JNow issue?)</div><div>Also, mountmodel.cpp may call setTargetCoords()--I'm not familiar with that code.</div><div><br></div><div>startup</div><div>[2021-08-31T22:28:12.385 PDT DEBG ][ org.kde.kstars.ekos.align] - Target Coordinates updated to JNow RA: "00h 04m 23s" DE: " 16° 15' 52\""<br><br></div><div>scheduler repeating job:</div><div>[2021-09-01T02:36:56.423 PDT DEBG ][ org.kde.kstars.ekos.align] - Target Coordinates updated to JNow RA: "00h 04m 33s" DE: " 16° 21' 09\""<br></div><div><br></div><div>I put some logging in, and will re-run tonight.</div><div><br></div><div>Let me know if you have any insight into this,</div><div>Hy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 1, 2021 at 6:20 PM Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Jasem,<div><br></div><div>Wanted to let you know that I saw an align issue that came up in my testing last night.</div><div>After a meridian flip, the align succeeded, but the resulting image was shifted too far away from the pre-flip image.</div><div><br></div><div><div>I think there's something wrong with the targets.</div><div>There are only two alignments in the log, the first one at the start of the evening (scheduler setting up the job),</div><div>and the alignment after the meridian flip late at night.</div><div><br></div><div>1st successful align shows: Solution coordinates: RA (00h 04m 24s) DEC ( 16° 15' 51\") ... Target is within 00° 00' 18\" degrees of solution coordinates</div><div>2nd successful align shows: Solution coordinates: RA (00h 04m 34s) DEC ( 16° 21' 03\") ... Target is within 00° 00' 19\" degrees of solution coordinates.</div><div><br></div><div>The target itself is not shown in the log, but as far as I know, it should be the same target for the two aligns.</div><div><br></div><div><b>Since the two solutions are a little more than 4 arc-minutes apart, they can't be within 18" and 19" of the same target.</b></div><div><br></div></div><div>Here's the lines near the last iteration of the original alignment early in the evening:</div><div><br></div><div>[2021-08-31T22:28:02.727 PDT INFO ][ org.kde.kstars.ekos.align] - "40 stars, 27 quads selected in the image. 30 database stars, 20 database quads required for the square search field of 0.4°. Search window at 192% based on the number of quads. Step size at 100% of image height"<br>[2021-08-31T22:28:02.793 PDT INFO ][ org.kde.kstars.ekos.align] - "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<br>[2021-08-31T22:28:02.798 PDT INFO ][ org.kde.kstars.ekos.align] - "Field center: (RA,Dec) = (0.818908, 16.1438) deg."<br>[2021-08-31T22:28:02.801 PDT INFO ][ org.kde.kstars.ekos.align] - "Field center: (RA H:M:S, Dec D:M:S) = (00:03:16.538, +16:08:37.712)."<br>[2021-08-31T22:28:02.803 PDT INFO ][ org.kde.kstars.ekos.align] - "Field size: 30.3647 x 22.9561 arcminutes"<br>[2021-08-31T22:28:02.805 PDT INFO ][ org.kde.kstars.ekos.align] - "Pixel Scale: 0.391297\""<br>[2021-08-31T22:28:02.808 PDT INFO ][ org.kde.kstars.ekos.align] - "Field rotation angle: up is 59.3579 degrees E of N"<br>[2021-08-31T22:28:02.810 PDT INFO ][ org.kde.kstars.ekos.align] - "Field parity: neg\n"<br>[2021-08-31T22:28:02.812 PDT INFO ][ org.kde.kstars.ekos.align] - "Loading WCS from file..."<br>[2021-08-31T22:28:02.813 PDT INFO ][ org.kde.kstars.ekos.align] - "Finished Loading WCS..."<br>[2021-08-31T22:28:02.815 PDT INFO ][ org.kde.kstars.ekos.align] - "Solver completed after 8.67 seconds."<br>[2021-08-31T22:28:02.817 PDT INFO ][ org.kde.kstars.ekos.align] - "Solver RA (0.81891) DEC (16.14381) Orientation (59.35789) Pixel Scale (0.39130) Parity (neg)"<br>[2021-08-31T22:28:02.851 PDT INFO ][ org.kde.kstars.ekos.align] - "<span style="background-color:rgb(255,255,0)">Solution coordinates: RA (00h 04m 24s) DEC ( 16° 15' 51\")</span> Telescope Coordinates: RA (00h 04m 23s) DEC ( 16° 15' 52\")"<br>[2021-08-31T22:28:02.858 PDT INFO ][ org.kde.kstars.ekos.align] - "Target is within 00° 00' 18\" degrees of solution coordinates."<br>[2021-08-31T22:28:02.871 PDT INFO ][ org.kde.kstars.ekos.align] - "Target is within acceptable range. Astrometric solver is successful."<br></div><div><br></div><div><br></div><div>and here are the corresponding lines at the end of the post-flip alignment:</div><div>[2021-09-01T02:47:35.334 PDT INFO ][ org.kde.kstars.ekos.align] - "57 stars, 44 quads selected in the image. 43 database stars, 33 database quads required for the square search field of 0.4°. Search window at 151% based on the number of quads. Step size at 100% of image height"<br>[2021-09-01T02:47:35.370 PDT INFO ][ org.kde.kstars.ekos.align] - "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<br>[2021-09-01T02:47:35.371 PDT INFO ][ org.kde.kstars.ekos.align] - "Field center: (RA,Dec) = (0.864281, 16.2303) deg."<br>[2021-09-01T02:47:35.371 PDT INFO ][ org.kde.kstars.ekos.align] - "Field center: (RA H:M:S, Dec D:M:S) = (00:03:27.428, +16:13:48.980)."<br>[2021-09-01T02:47:35.371 PDT INFO ][ org.kde.kstars.ekos.align] - "Field size: 30.3658 x 22.957 arcminutes"<br>[2021-09-01T02:47:35.372 PDT INFO ][ org.kde.kstars.ekos.align] - "Pixel Scale: 0.391312\""<br>[2021-09-01T02:47:35.372 PDT INFO ][ org.kde.kstars.ekos.align] - "Field rotation angle: up is -120.366 degrees E of N"<br>[2021-09-01T02:47:35.372 PDT INFO ][ org.kde.kstars.ekos.align] - "Field parity: neg\n"<br>[2021-09-01T02:47:35.373 PDT INFO ][ org.kde.kstars.ekos.align] - "Loading WCS from file..."<br>[2021-09-01T02:47:35.374 PDT INFO ][ org.kde.kstars.ekos.align] - "Finished Loading WCS..."<br>[2021-09-01T02:47:35.375 PDT INFO ][ org.kde.kstars.ekos.align] - "Solver completed after 3.60 seconds."<br>[2021-09-01T02:47:35.375 PDT INFO ][ org.kde.kstars.ekos.align] - "Solver RA (0.86428) DEC (16.23027) Orientation (-120.36600) Pixel Scale (0.39131) Parity (neg)"<br>[2021-09-01T02:47:35.382 PDT INFO ][ org.kde.kstars.ekos.align] - "<span style="background-color:rgb(255,255,0)">Solution coordinates: RA (00h 04m 34s) DEC ( 16° 21' 03\")</span> Telescope Coordinates: RA (00h 04m 34s) DEC ( 16° 21' 09\")"<br>[2021-09-01T02:47:35.382 PDT INFO ][ org.kde.kstars.ekos.align] - "Target is within 00° 00' 19\" degrees of solution coordinates."<br>[2021-09-01T02:47:35.388 PDT INFO ][ org.kde.kstars.ekos.align] - "Target is within acceptable range. Astrometric solver is successful."<br>[2021-09-01T02:47:35.389 PDT DEBG ][ org.kde.kstars.ekos.capture] - Align State changed from "In Progress" to "Complete"<br></div><div><br></div><div>Here are the images:</div><div><br></div><div>Just before the meridian flip</div><div><span id="gmail-m_1014481575136321558gmail-m_-8398663800901370553gmail-m_-5010913028161212057gmail-m_-118073543426459054cid:ii_kt27mzbe0"><Screen Shot 2021-09-01 at 5.48.34 PM.png></span><br></div><div><br></div><div>just after the meridian flip</div><div><span id="gmail-m_1014481575136321558gmail-m_-8398663800901370553gmail-m_-5010913028161212057gmail-m_-118073543426459054cid:ii_kt27o72t1"><Screen Shot 2021-09-01 at 5.49.24 PM.png></span></div><div><br></div><div>The entire log is here:</div><div><a href="https://drive.google.com/file/d/1T1jvXM12s7ZQKjKjwSSPU0Wl1MbacUV_/view?usp=sharing" target="_blank">https://drive.google.com/file/d/1T1jvXM12s7ZQKjKjwSSPU0Wl1MbacUV_/view?usp=sharing</a></div><div><br></div><div>I'll let you know if I find something as well,</div><div>Hy<br></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></blockquote></div>