×

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: 593
  • Thank you received: 276
Hi Willem Jan,

Thanks very much for all the information, its very helpful.

I looked first at the "successful" run with backlash=1. Generally this looks to have worked. I think the solution is out by 1 tick but that is manageable at least temporarily.

The problem is that there appears to be a conflict whenever the algorithm moves the focuser outward. Basically, the algorithm says goto position x, but the focuser goes to position y. Looking at the Sesto Senso 2 driver code, it attempts to manage backlash within the driver which I think is conflicting with the focus algorithm trying to do the same thing. I need to spend more time going through the logs to convince myself that this really is the issue though.

The algorithm moves the focuser out in 2 places during a focus run. Firstly the initial move. You can see on the graphs you posted that all datapoints are evenly spaced (on the x-axis) except the first 2 (rightmost) which are much closer together. This is the first instance of the problem. The second, as we know, is when the algorithm tries to move the focuser to the point of optimum focus at the end of the run.

So I'll spend some more time looking at this tomorrow.
The following user(s) said Thank You: W J Drijfhout
1 year 5 months ago #87078

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

  • Posts: 593
  • Thank you received: 276
So it seems to be going wrong on an inward direction change. For the backlash=0 run from the log, the solver found a solution at 58423 when the focuser is at 57331.
[2022-10-09T19:57:46.860 CEST DEBG ][ org.kde.kstars.ekos.focus] - "LM Solver (Hyperbola): Solution found after 5 iterations. A=-276.89 B=1.40383, C=58422.7, D=-0.39721"
[2022-10-09T19:57:46.860 CEST DEBG ][ org.kde.kstars.ekos.focus] - "Linear: fit(12): 58422.7 = 1.00662 @ 57331 distToMin -1091"
[2022-10-09T19:57:46.860 CEST DEBG ][ org.kde.kstars.ekos.focus] - "Linear: Solution #4: 58422.7 = 1.00662 @ 57331"
[2022-10-09T19:57:46.860 CEST DEBG ][ org.kde.kstars.ekos.focus] - "Linear: 1stPass solution @ 57331: pos 58422.7 val 1.00662, min measurement 1.09409"


So the algorithm wants to move the focuser out by 58423 - 57331 ticks = 1092 ticks. It adds backlash of 5 * 200 =1000 so requests a move out of 2092 tocks to 59423.

[2022-10-09T19:57:50.145 CEST INFO ][ org.kde.kstars.ekos.focus] - "Focusing inward by 1.000 steps..."
[2022-10-09T19:57:50.149 CEST INFO ][ org.kde.kstars.indi] - Sesto Senso 2 : "[INFO] Focuser reached requested position. "
[2022-10-09T19:57:50.149 CEST DEBG ][ org.kde.kstars.indi] - Sesto Senso 2 : "[DEBUG] Sending command: {\"req\":{\"get\":{\"MOT1\":\"\"}}} with property: ABS_POS "
[2022-10-09T19:57:50.552 CEST DEBG ][ org.kde.kstars.indi] - Sesto Senso 2 : "[DEBUG] Received response: {\"res\":{\"get\":{\"MOT1\":{\"ABS_POS\":59423,\"EL_POS\":392,\"MARK\":0,\"SPEED\":0,\"ACC\":5,\"DEC\":5,\"MAX_SPEED\":4,\"MIN_SPEED\":0,\"TVAL_HOLD\":4,\"TVAL_RUN\":20,\"TVAL_ACC\":20,\"TVAL_DEC\":20,\"T_FAST\":25,\"TON_MIN\":41,\"TOFF_MIN\":41,\"FS_SPD\":1023,\"OC "


The focuser gets there and reports done so the algorithm tries to undo the backbash by moving in by 1000 ticks from 59423 to 58423.

The driver takes that request and modifies it to goto 57966...
[2022-10-09T19:57:50.553 CEST DEBG ][ org.kde.kstars.indi] - Sesto Senso 2 : "[DEBUG] Sending command: {\"req\":{\"cmd\":{\"MOT1\" :{\"GOTO\":57966}}}} with property: GOTO "

Here is the driver code
IPState SestoSenso2::MoveAbsFocuser(uint32_t targetTicks)
{
targetPos = targetTicks;

if (isSimulation() == false)
{
backlashDirection = targetTicks < lastPos ? FOCUS_INWARD : FOCUS_OUTWARD;
if(backlashDirection == FOCUS_INWARD)
{
targetPos -= backlashTicks;
}
else
{
targetPos += backlashTicks;
}
char res[SESTO_LEN] = {0};
if (command->go(static_cast<uint32_t>(targetPos), res) == false)
return IPS_ALERT;


So the driver has adjusted the request by 58423 - 57966 = 423 ticks which must be value of backlashTicks.

Any idea where this number would come from?

So i'm currently diffing into this.
1 year 5 months ago #87089

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

  • Posts: 207
  • Thank you received: 18
Hi John, just looked into the driver, and nowhere I can see anything that would lead to 423 ticks anywhere.
Also checked directly 'in' the focuser, by means of its own WiFi network that it creates, but there it also says backlash 0, and nowhere a number that could lead to 423 or the like.

Sorry I have no further clues.
1 year 5 months ago #87091

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

  • Posts: 593
  • Thank you received: 276
Hi Willem Jan,
Thanks very much for checking. So what's going on is still a bit mysterious.

There are a couple of focuser specific log files mentioned in the log you've already posted. Could you post these please.
/home/awc/.indi/logs/2022-10-09/indi_sestosenso2_focus/indi_sestosenso2_focus_14:43:45.log
/home/awc/.indi/logs/2022-10-09/indi_sestosenso2_focus/indi_sestosenso2_focus_14:45:02.log

Would you also be able to post screenshots of the indi panel for the focuser as well please. All tabs please.
1 year 5 months ago #87097

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

  • Posts: 207
  • Thank you received: 18
Hi John,

Yes, certainly. The requested logs are:

File Attachment:

File Name: indi_sesto...4345.log
File Size:1 KB

File Attachment:

File Name: indi_sesto...4502.log
File Size:12 KB


The screenshots are:


Please let me know if you need more. Thank you for your continued efforts here. Very much appreciated.

Best regards, Willem Jan.
1 year 5 months ago #87098
Attachments:

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

  • Posts: 593
  • Thank you received: 276
Thanks Willem Jan. Have you tried with Backlash set to Disabled on the Main Control tab? If that doesn't work then it would be worthwhile persisting with the settings you currently have (backlash=1).

I think I'll make a change to the L1P algorithm to allow its backlash compensation to be switched off completely. I don't know if this will help or not (as I don't exactly know what the problem is) but if it doesn't help at least the L1P algorithm code can be ruled out as the cause.

It will take me a few days to make the change and test it (weather permitting of course). I won't be able to test on the Senso Sesto 2 as I don't have one. Are you able to take the daily Kstars builds?
1 year 5 months ago #87101

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

  • Posts: 207
  • Thank you received: 18
Hi John, no, I have not disabled backlash on the main control. Next time I will try that, but anyway the workaround with backlash 1 works, so already very happy with that.
Yes, happy to test the new version. It has been a long time since I used a nightly build, so will have to figure that out, but I'm sure that can be done.
1 year 5 months ago #87129

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

  • Posts: 593
  • Thank you received: 276
Hij Willem Jan,
The code change is done and has just been merged so will be in the daily build...




I would be interested in your feedback if you get a chance to try it.
The following user(s) said Thank You: Alfred
1 year 5 months ago #87350
Attachments:

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

  • Posts: 207
  • Thank you received: 18
Thanks John, that looks good! I am currently traveling, but will try out as soon as I have a chance, probably early next week.
1 year 5 months ago #87355

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

  • Posts: 207
  • Thank you received: 18
Hi John, I think I'm getting a bit stuck with installing nightly builds. I have tried the set of commands from both here and here , but neither seems to alter anything about my setup. It remains the stable version 3.6.1 from 19 October.
That is also the feedback when I'm trying to install:
indi-full is already the newest version (1.9.9~202210191247~ubuntu20.04.1).
kstars-bleeding is already the newest version (6:3.6.1+202210191503~ubuntu20.04.1).


Do I need to uninstall the stable version first? Sounds a bit scary...
I've got a Pi with Stellarmate lying here as well. If I'm not mistaken in Stellarmate there is a switch to use nightly builds or not. Would that be an alternative for testing the new version?

Thanks, Willem Jan.
1 year 5 months ago #87499

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

  • Posts: 460
  • Thank you received: 69
This may help (or not)...
I have a git repository for a shell script to clone and build Kstars/indi from their respective source-code git repositories. It does not install the resultant binary, so that you can continue to have both an "official" version and this version from nightly source code (launched from it's own directory).

This was based off of information kindly provided by Hy Murveit earlier on the forum.
Please see the github repository for more information...
github.com/JerryBlack/buildKstarsNightlyFromGit

The script may be executed with one of these parameter options:
all - run everything
dependencies - install the dependencies
clone - clone the repositories
update - update the repositories \(git pull\)
stellarsolver - clone and install stellarsolver
indicore - compile and install indi-core
indi3rdpartylibs - compile and install indi-3rdparty-libs
indi3rdparty - compile and install indi-3rdparty
kstars - compile kstars
help - describe the parmeter options (sic).
1 year 5 months ago #87505

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

  • Posts: 593
  • Thank you received: 276
I'm not familiar with the linux process as I run kstars on mac, but looks like Jerry's script would be useful to allow you to have 3.6.1 stable as well as the latest (bleeding-edge) version.

My change was just to Ekos so no need to update anything other than Kstars/Ekos as far as I know (although there could, theoretically, be another change in bleeding-edge requiring an updated indi for example).

3.6.2 should be released early Jan which will contain this change.
1 year 5 months ago #87514

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

Time to create page: 0.703 seconds