×

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: 15
  • Thank you received: 0

Hi John,

I think one of those moves was a manual move that I did. The last one I think. Once I seen it stop at 6166 I manually moved it to the bottom of the curve. The 6166 position was the #10 sample. I didn't get it in the screen shot but it's there. If it found a solution after 9 samples why would it do the 10th and then stay there?

Thanks for taking a look. To answer your questions:
1. No, there is nothing else controlling the focuser. INDI is running on a RPi with the latest version of all drivers.
2. There is no backlash control on the focuser itself. It just drives the stepper motor to absolute locations.
3. The INDI driver is part of the 3rd Party collection I believe. I see in the log file it's "org.kde.kstars.ekos] - "MyFocuserPro2" Version: "1.0" Interface: 8 is connected.". I believe the source is here github.com/indilib/indi/tree/master/drivers/focuser

Moving the focuser in and out manually goes to the count I specify every time. I didn't seem to have an issue with the 2-pass method in the past.

I've contacted the developer of the MyFocusPro2 to see if I'm running the most up to date firmware just in case.

Thanks
Ken
1 year 5 months ago #87008

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

  • Posts: 593
  • Thank you received: 276
Hi Willem Jan,
Thanks for the reply.
1. Can you configure logging like this please (I think I'm missing the Ekos focuser msgs)...

2. MountWizzard shouldn't be causing a problem but worth a try. I'm just been looking at the manual for the focuser online. I see there is some software that comes with it as well as the ability to control the focuser over wifi from another device. Are you using any of these methods?
3. Yes there is a problem here. The messages with [ org.kde.kstars.ekos.focus] are from the focuser algorithm and those from [ org.kde.kstars.indi] - Sesto Senso 2 are from the driver. Basically they should be consistent but they aren't. The focuser algorithm commands the focuser to move to a position but for some reason it moves somewhere else. I don't understand why yet.

One thing you could try is to set Backlash in the Mechanics tab of the Focuser screen from 0 to 1. I don't know if that will improve things or not but its a simple test. And of course, if you capture the focus images and another log with the config in point 1, that might give us some more clues.

Sorry not to have the answer but hopefully we'll figure it out and get it working.
1 year 5 months ago #87016
Attachments:

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

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

Thanks very much for the reply. I've been looking online at the MyFocuserPro2...
indilib.org/media/kunena/attachments/6151/myFP2-301b.pdf

Seems like you can setup backlash compensation in the firmware with this focuser. I was just wondering what values you have setup (maybe if you haven't set some explicit values it has some default values)?

I'll continue digging around and see if I can come up with something a bit more tangible.
1 year 5 months ago #87017

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

  • Posts: 207
  • Thank you received: 18
Thank you John, for your continued efforts to help solve this issue.
1. Apologies, I had not realised that there are two places to set the logging details. Found it now, and will do so as soon as I'm under the stars again. Forecast for tomorrow is ok-ish.
2. All software that comes with the focuser is windows-only and I am on Mac/Linux, so I'm not using any of Primalucelab's software. The connection from other devices via WiFi is rather limited. The focuser creates its own WiFi network. You can connect to that for example via your phone and then control the focuser via a web-based interface. It's kind of a modern hand controller more than a helpful tool for automated operation. So in my setting nothing is connected to that network.
3. Let's hope the more detailed logging may give a solution. I found in the driver also an option to log all the focuser information to file, so turned that on as well. I guess that is the same information as what goes to Ekos, but we'll see. Also I will set backlash compensation to 1.

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

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

  • Posts: 15
  • Thank you received: 0

Hi John,

I have it disabled in the settings. Here's a screenshot. I also see there's an error that's interesting! Not sure what that's all about.



I did notice there is new firmware available so I'll load that up tomorrow. I don't see anything in the release notes that would indicate it would address this but who knows. Maybe it'll address that error message I see on startup.

Thanks
Ken
1 year 5 months ago #87023

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

  • Posts: 593
  • Thank you received: 276
Hi Ken,
Thanks for sending the screenshot. I just looked at the driver code. Looks like that Backlash OUT enabled error is printed when there's an unexpected reply from the focuser on initialisation when its trying to get the value of Backlash out enabled. Obviously something isn't quite right but its not obvious to me that this would cause the issues you are having as even if the focuser thinks its compensating for Backlash Out itself the backlash value is still zero.

Still it would make sense to update to the latest firmware and try and fix this error.

If you still get the problem after the firmware update, the next thing to try is to set the backlash in the focus->mechanics tab from 0 to 1 when you next get a chance. This will minimise the backlash compensation performed by the Ekos autofocus algorithm (there is currently no way to turn it off completely). If the problem is due to a clash in backlash compensation between the focuser / driver / Ekos autofocus then this should improve things. If it makes no difference then the problem is likely to be somewhere else.
1 year 5 months ago #87029

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

  • Posts: 207
  • Thank you received: 18
Hi John, Some good news to report. Had some clear skies yesterday and could experiment a bit further. It seems like the problem is solved when adding a backlash of 1 instead of 0.... Attached the verbose log (wow, that is a lot more info indeed...).

File Attachment:

File Name: log_16-42-53.txt.zip
File Size:650 KB

There are multiple autofocus routines in there, with different settings, but lets compare two examples:
1. The autofocus routine that ends in line 89660 (19:57:58). It used backlash 0.
Solution is 57966, while V-curve suggest more something like 58440. Forgot to take screenshots, so curve here reconstructed from the datapoints in line 89656

2. The autofocus routine that ends in line 88170 (19:55:44). It used backlash 1.
Solution is 58530, confirmed by the reconstructed V-curve:


Later I also tried backlash values of 100, but they also had no good solutions. The rest of the night I kept using backlash value 1, which worked well.
Do you think this would help to find the root cause?

The individual images are also attached for both autofocus runs. I've recorded all images, so should you need other images, please let me know.
idexim.box.com/s/36d90z22y9kd5ssx4vc8175plawjdf79
idexim.box.com/s/4vompimal53tdrbmaptausg3ng6sfe36

Thanks again for all your efforts here, so much appreciated.

Willem Jan.
1 year 5 months ago #87067
Attachments:

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

  • 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.

Time to create page: 0.920 seconds