×

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

Bi-monthly release with minor bug fixes and improvements

Linear 1 Pass gives wrong solution

  • Posts: 54
  • Thank you received: 5
Thanks a lot John. I'll take a log as soon (two weeks apparently) as the "monsoon" pass by.

However, my guess is that I'm facing the same problem faced by others of a fight between the backlash compensation of the driver and Ekos. I tried all the possible settings in the Indi driver but I got only "scattered results": some times the algorithm moves to the solution, some times it sticks to the last measurement (as in the attached pictures). I'll keep trying and record a log.

For what I understand in the nightly and in 3.6.2 it is possible to overcome this by muting the backlash compensation in Ekos... right?
1 year 4 months ago #88343

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

  • Posts: 15
  • Thank you received: 0

I have the same focuser and firmware. Unfortunately, the same problem as well. I don't think it's the focuser firmware because it did it with the older firmware as well. I'm awaiting the new release but for now I use 1-pass parabola and it seems to work OK for me.

Ken
Last edit: 1 year 4 months ago by Ken. Reason: Wrong word
1 year 4 months ago #88344

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

  • Posts: 593
  • Thank you received: 274
Hi Massimo,

Yes, there is a new option in 3.6.2 (currently in the nightly releases if you can take them) to disable the backlash compensation in the Linear 1 Pass algorithm. For now if you set backlash=1 you will minimise (but not completely disable) backlash. My "guess" is that the Linear 1 Pass backlash compensation is somehow conflicting with the myFocuserPro2's own backlash processing so by disabling it in Linear 1 Pass it may improve things.

Of course, this is just a theory so may prove not to be correct, in which case we'll have to look further into things.
1 year 4 months ago #88347

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

  • Posts: 54
  • Thank you received: 5
Hi John, I red about the "set backlash=1" thing in previous posts... what I still do not understand is why in the focus module of my Ekos installation the backlash compensation is greyed out. It looks like the driver is not recognizing the myfocuser2 as backlash capable... the more I dwell into Ekos the more mysteries I found, I think it's part of the game!
1 year 4 months ago #88350

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

  • Posts: 54
  • Thank you received: 5
Question: is there a way to test that the software side of the focusing operation is working without waiting for a starry night? In the end, at least on a first basis, I have just to check that the last move issued to the focuser is the same number as that calculated from the curve fitting process.
1 year 4 months ago #88352

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

  • Posts: 593
  • Thank you received: 274
Ah yes, i just checked the driver code (myfocuserpro2.cpp) and is doesn't support Backlash. So in this case Ekos will grey out the backlash field. So you can't set it to zero.
1 year 4 months ago #88353

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

  • Posts: 593
  • Thank you received: 274
Generally I use the focus simulator but here the issue is with a specific focuser so you'll have to connect that. The issue (from Ken's log for example) is that Ekos issues a command to move to position X but, for some reason, the focuser moves to Y and reports "done". Seems like this happens on a direction change from inward to outward (hence my suspicion that this is backlash related).

You could try imitating the focuser motion by connecting the focuser. You can enter a position to move to, then hit the goto button. So start at say 1000 (or whatever makes sense for your equipment). Move in to 800. Then 600, then 400, then 200. Then simulate the move to the final position by Move 1100, followed by Move 1000. Somewhere in the last couple of moves things go wrong in the autofocus routine - be interesting if you could replicate it with individual moves.
1 year 4 months ago #88354

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

  • Posts: 15
  • Thank you received: 0
John,

I've not been able to reproduce this at all. When I manually move the focuser in and out using Ekos it behaves perfectly, accurately moving to where I tell it to. For me I really think it's something in the Ekos Hyperbola algorithm. It runs through the moves but at the end rather than choosing the solution, Ekos chooses the last sample as the focus point. It doesn't seem to happen on parabola. You can see this in the screen shots Massimo and I posted. Backlash compensation is disabled in my driver settings and in the firmware.

Here's an example from the image I posted above.


And the log. This is the key line. Note the HFR values. The best sample was 10183 but Ekos picked 10084 as the solution which is one count from the final sample it took and is way out of focus. The focuser then moved to 10084 as requested.

[2022-11-02T20:47:08.081 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: points=[(10263, 3.21188, 1), (10243, 2.54503, 1), (10223, 1.8966, 1), (10203, 1.41915, 1), (10183, 1.40694, 1), (10163, 1.66297, 1), (10143, 2.0336, 1), (10123, 2.74896, 1), (10103, 3.32861, 1), (10083, 4.26049, 1)];iterations=10;duration=170;solution=10084;HFR=4.25412;filter='';temperature=8.75;focusalgorithm=3;backlash=0;curvefit=0;useweights=0"

thekenr.com/temp/focus.log

Thanks
Ken
Last edit: 1 year 4 months ago by Ken.
1 year 4 months ago #88366

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

  • Posts: 1009
  • Thank you received: 133

Edit: This is a reply/quote to Johns post #88347.
Unfortunately, quoted text is still not displayed :(

Not sure if that's the right spot, or should go into another thread. But something is messed up with this backlash compensation in the AF module. I never understood why that value should in any respect be related to the BL compensation of the focuser driver (if that offers one), as it is done at the moment. IMO, this has to be a completely separate action: If BL comp is enabled for the focus module, then it will just always do this additional overshoot-and-return with the amount specified for the focus module. You do not need to know if the driver will (also) do some BL correction or not. If it does, both of the positions you go to will be correct. If it doesn't the first one (likely) will be wrong, but you're not interested in that one anyhow.
I do not see how, in such a scheme, the two corrections can interfere. All you do is tell the focus to be set to some value. If that does not work properly, then it is an issue of the focus driver only, and needs to be solved there. But don't touch the drivers BL setting.
(For me that even completely messes up the BL settings: I have two trains, with different telescope/camera/focuser, and switching between them with the 'BL correction' active, will erase my BL settings in the driver when toggling between the two. Status git as of yesterday)
Last edit: 1 year 4 months ago by Peter Sütterlin.
1 year 4 months ago #88389

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

  • Posts: 593
  • Thank you received: 274
Hi Ken,

Unfortunately the log only has the higher level Ekos messages (not the verbose ones) and not the Indi driver messages so it only tells half the story, but that said, it looks to be consistent with your previous log I analysed. So...
1. The autofocus run starts with the focuser at 10163. Step size =20, Number steps = 5. Backlash =0 so the algorithm with use 5 * Step size = 100
2. Ekos commands the focuser to move out by Step size * Number Steps + backlash = 5 * 20 + 100 = 200. So requests 10163 + 200 = 10363. This looks fine.
3. Ekos unwinds the backlash by commanding the focuser to move in by backlash = 100. So requests 10263. This looks line.
4. Ekos then takes 9 frames and calculates the V-curve. The focuser is at 10083 and after curve fitting it calculates a minimum at 10184.6. This is as expected - solution = 10185

[2022-11-02T20:46:47.421 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: 1stPass solution @ 10083: pos 10184.6 val 1.49838, min measurement 1.40694"

5. Ekos now tries to move the focuser from 10083 to 10185. It does this in 2 parts:
i) Ekos commands the focuser to move outward by (10185 - 10083) + backlash = 102 + 100 = 202. So requests 10285.

[2022-11-02T20:46:47.434 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: extending outward movement by 100"
[2022-11-02T20:46:47.435 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Focusing outward by 202 steps..."
[2022-11-02T20:46:48.558 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10184 State: Busy

So this is where something has gone wrong. The focuser has started to move and has got to 10184 but is still busy. This is where the extra indi focuser msgs would be useful. Ekos waits until the focuser reports "done" before moving to the next stage. This is the part that I don't understand. It would "appear" that the focuser reports "done" when its at 10184. This is an assumption on my part but it fits the rest of the log. As to why the focuser would do that I don't know.

ii) Ekos now unwinds the backlash and commands the focuser to move in by backlash = 100. So if the focuser is at 10184 then it would request a move to 10084. This is what appears to happen.

[2022-11-02T20:46:50.750 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: un-doing extension. Moving back in by 100"
[2022-11-02T20:46:50.750 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Focusing inward by 100 steps..."
[2022-11-02T20:46:52.802 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10106 State: Busy
[2022-11-02T20:46:54.955 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Focus position reached at 10106, starting capture in 0 seconds."
[2022-11-02T20:46:54.956 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Capturing image..."
[2022-11-02T20:46:57.012 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10084 State: Ok



So the question is: when Ekos commanded a move 10285 why didn't the focuser do that? It appears as if it got to 10184. There are no new clues in the log to explain this unfortunately. It would appear to be intermittent in that you say it sometimes works and sometimes doesn't. Also, the starting move of the focuser (out by 200 and back in by 100) appears to have worked as expected. All the 9 moves to create the V-curve worked fine as well.

So what's special about the final move that sometimes goes wrong? Well 2 things spring to mind:
1. Its a direction reversal move. Hence by suspicion that its somehow related to backlash.
2. Its a large move. However the first move in the autofocus run is comparable and that works. And moving 200 ticks is not an especially big move.

So I still think its worth taking the code with the "AF Backlash Comp" flag and trying it with this disabled. If it fixes the problem great, if not then we can rule out some sort of backlash conflict and see what we can see in a fresh log with all the msgs enabled.

Sorry this isn't a great answer. I'm sure if I had this focuser I could debug it and find the problem much faster, but I don't so we're left with this trial and error approach. I suppose another approach would be to go to the focuser manufacturer and explain the problem to them and see if they could shed some light on things. I'm not saying its their problem, it may well be an Ekos problem, but by discussing the issue the cause may become apparent. If they are happy to chat I'm more than happy to be on a call or emails.
1 year 4 months ago #88399

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

  • Posts: 593
  • Thank you received: 274
Hi Peter,
I'll create a separate thread for this here:
indilib.org/forum/ekos/12678-focus-backlash-issue.html#88401
The following user(s) said Thank You: Peter Sütterlin
Last edit: 1 year 4 months ago by John.
1 year 4 months ago #88400

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

  • Posts: 15
  • Thank you received: 0
John,

Thanks for the detailed explanation! I understand much better now. Yes, I see what you're talking about now. There does appear to be a problem here. Below is the debug messages from the driver for this example. I think I'll share this with Robert Brown as well who developed this focuser.

BTW, I tried 1-pass Hyperbolic and Parabola again tonight and both failed in the same way! Therefore my statement that Parabola works is in fact false. Also, the backlash setting is greyed out for me. For now I switched back to the Linear mode.

Does this log shed any additional light on the topic? I'm not sure if the focuser commands are standard or specific to this focuser. I'll check with Robert on this.

[2022-11-02T20:46:47.421 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: Solution #4: 10184.6 = 1.49838 @ 10083"
[2022-11-02T20:46:47.421 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: 1stPass solution @ 10083: pos 10184.6 val 1.49838, min measurement 1.40694"
[2022-11-02T20:46:47.429 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Error in CurveFitting::calculateR2 called for Quadratic"
[2022-11-02T20:46:47.434 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: extending outward movement by 100"
[2022-11-02T20:46:47.435 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Focusing outward by 202 steps..."
[2022-11-02T20:46:47.617 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:47.617 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I0#> "
[2022-11-02T20:46:47.617 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:0510285#> "
[2022-11-02T20:46:47.618 Atlantic Daylight Time INFO ][ org.kde.kstars.indi] - MyFocuserPro2 : "[INFO] Focuser is moving to position 10285 "
[2022-11-02T20:46:48.516 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:00#> "
[2022-11-02T20:46:48.557 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <P10184#> "
[2022-11-02T20:46:48.558 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10184 State: Busy
[2022-11-02T20:46:48.558 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:48.606 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I1#> "
[2022-11-02T20:46:48.646 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:48.687 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I1#> "
[2022-11-02T20:46:50.658 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:50.709 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I0#> "
[2022-11-02T20:46:50.750 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: un-doing extension. Moving back in by 100"
[2022-11-02T20:46:50.750 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Focusing inward by 100 steps..."
[2022-11-02T20:46:50.752 Atlantic Daylight Time INFO ][ org.kde.kstars.indi] - MyFocuserPro2 : "[INFO] Focuser reached requested position. "
[2022-11-02T20:46:50.791 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:50.921 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I0#> "
[2022-11-02T20:46:50.961 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:0510084#> "
[2022-11-02T20:46:50.962 Atlantic Daylight Time INFO ][ org.kde.kstars.indi] - MyFocuserPro2 : "[INFO] Focuser is moving to position 10084 "
[2022-11-02T20:46:52.711 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:00#> "
[2022-11-02T20:46:52.761 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <P10106#> "
[2022-11-02T20:46:52.802 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10106 State: Busy
[2022-11-02T20:46:52.803 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:52.842 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I1#> "
[2022-11-02T20:46:52.842 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:52.883 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I1#> "
[2022-11-02T20:46:54.863 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:01#> "
[2022-11-02T20:46:54.914 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <I0#> "
[2022-11-02T20:46:54.955 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Focus position reached at 10106, starting capture in 0 seconds."
[2022-11-02T20:46:54.956 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Capturing image..."
[2022-11-02T20:46:54.958 Atlantic Daylight Time INFO ][ org.kde.kstars.indi] - MyFocuserPro2 : "[INFO] Focuser reached requested position. "
[2022-11-02T20:46:56.917 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:00#> "
[2022-11-02T20:46:57.012 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <P10084#> "
[2022-11-02T20:46:57.012 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Abs Focuser position changed to 10084 State: Ok
[2022-11-02T20:46:59.005 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:06#> "
[2022-11-02T20:46:59.049 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <Z8.50#> "
[2022-11-02T20:47:01.047 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:00#> "
[2022-11-02T20:47:01.088 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <P10084#> "
[2022-11-02T20:47:05.116 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] CMD <:00#> "
[2022-11-02T20:47:05.157 Atlantic Daylight Time DEBG ][ org.kde.kstars.indi] - MyFocuserPro2 : "[DEBUG] RES <P10084#> "
[2022-11-02T20:47:07.189 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Image received."
[2022-11-02T20:47:07.190 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Detecting sources..."
[2022-11-02T20:47:08.076 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Detection complete."
[2022-11-02T20:47:08.078 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Focus newFITS # 1 : Current HFR 3.89144 Num stars 242
[2022-11-02T20:47:08.080 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "matchStars: Inputs sized 100 100 found 46 matches, RMS dist 2.3"
[2022-11-02T20:47:08.081 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "RelativeHFR: sizes: 242 749 hfr: (4.97 (4.27) / 1.64 (1.43)) * 1.41 = 4.25"
[2022-11-02T20:47:08.081 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "RelativeHFR: orig 3.89144 computed 4.26935 relative 4.25412"
[2022-11-02T20:47:08.081 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Linear: solution @ 10084 = 4.25412 (expected 1.40694) delta=2.84718"
[2022-11-02T20:47:08.081 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - "Linear: points=[(10263, 3.21188, 1), (10243, 2.54503, 1), (10223, 1.8966, 1), (10203, 1.41915, 1), (10183, 1.40694, 1), (10163, 1.66297, 1), (10143, 2.0336, 1), (10123, 2.74896, 1), (10103, 3.32861, 1), (10083, 4.26049, 1)];iterations=10;duration=170;solution=10084;HFR=4.25412;filter='';temperature=8.75;focusalgorithm=3;backlash=0;curvefit=0;useweights=0"
[2022-11-02T20:47:08.089 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - "Focus procedure completed after 11 iterations."
[2022-11-02T20:47:08.090 Atlantic Daylight Time INFO ][ org.kde.kstars.ekos.focus] - Autofocus values: position, 10084 , temperature, 8.25 , filter, "" , HFR, 3.89144 , altitude, 49.4518
[2022-11-02T20:47:08.090 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Stopping Focus
[2022-11-02T20:47:08.100 Atlantic Daylight Time DEBG ][ org.kde.kstars.ekos.focus] - Settled. State: "Complete"
1 year 4 months ago #88434

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

Time to create page: 1.451 seconds