Linear Autofocus Abort Issue

Matthew Wong snoopy_94555 at yahoo.com
Fri Apr 3 01:27:07 BST 2020


Hi Hy, 

Thanks for the guide. I can work off my decade+ old MacBook, so I’ll try to get that set up. But will take the advice to wait until the refactoring is done. No point in throwing a monkey wrench into the works. 

I don’t think it’s affecting the linear algorithm only, but it’s the only time I’ve seen it drive the focuser off the rails (almost literally the first time, to the INDI limits the second time). It might be that previously, the auto star select failure might hold up everything, but that’s just a guess. 

I prefer the auto star because the plot seems much less noisy on a single star. It looks like when I use full field, the HFR calculations are not based off the same sample of stars so the data points don’t fit on the curve as well. Perhaps it’s user error on my end. 

Best, 
Matt

Sent from my iPhone

> On Apr 2, 2020, at 4:49 PM, Hy Murveit <murveit at gmail.com> wrote:
> 
> 
> Matt,
> 
> I wrote up a little guide to contributing to Kstars (broken up into 5 posts) here: https://indilib.org/forum/development/6171-how-to-start-developing-for-kstars.html
> based on my experience and instructions I got from Jasem when I was getting started.
> 
> In general, you send your PRs to jasem who will submit them after review or send you back suggestions.
> For things related to focus, I'd appreciate being cc'd.
> 
> This sounds like a good issue to fix. Why do you think this only affects the Linear focus algorithm (as opposed to the other focus algorithms) or do you think it affects all of them?
> It's true that I don't think I tested for this issue when I wrote the Linear focus algorithm.
> 
> I believe that right now Eric (TallFurryMan) is refactoring the focus module and adding tests, and it may not be ideal to be making changes until he sends in his refactor for review, but you can coordinate that with Jasem and Eric.
> 
> I'm happy to answer any questions as well,
> 
> Thanks for your help!
> Hy
> 
> PS, Though it'd be good to fix this, if you're looking for best focus performance, I'd recommend using the Full Field HFR calculation, which would not involve any star selection.
> 
>> On Thu, Apr 2, 2020 at 4:30 PM Matthew Wong <snoopy_94555 at yahoo.com> wrote:
>> Hello, 
>> 
>> This is my first time posting here, so go easy on me and let me know if I’m at the wrong place. 
>> 
>> I noticed that while using the linear algorithm for autofocus, if the auto select star fails, it would abort the autofocus as expected. However, unlike when autofocus fails to achieve focus, this abort does not return the focuser to its initial position. When used with the scheduler, the autofocus keeps retrying after failure. With enough retries, it moves the focuser to its stop. I’m not even sure if this is a bug rather than user error or faulty expectations, so I figured I’d bring it up here first. 
>> 
>> In any case, I took the liberty to read through the code on github and I think I found why this is happening. In focus.cpp, under Focus::checkAutoStarTimeout, line 2874-2876, initialFocuserAbsPosition is set to -1 before setAutoFocusResult(false) is called. Since the setAutoFocusResult is where the focuser gets returned to the initial position, line 2874 essentially disables this. Again, I’m not sure if this was done in this order for any other specific purposes, but I figure this is why the focuser runs to its stops whenever this happens. 
>> 
>> I’m not normally a C++ programmer outside of the occasional Arduino projects. I mostly work in C# on Win10, so I’m not tool-ed to test this readily. Hopefully, if this is indeed an issue, that this is an easy fix. If anyone want to help me get started on how to contribute, I’ll give it a shot when I get a chance. This would be my first foray into contributing to an open source project, so I’m unfamiliar with the procedures and etiquette. Again, go easy on me. Thanks!
>> 
>> Have a good day, 
>> Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kstars-devel/attachments/20200402/f4ce87bc/attachment-0003.html>


More information about the Kstars-devel mailing list