View Issue Details

IDProjectCategoryView StatusLast Update
0001897CCdcielGeneralpublic18-03-07 11:15
Reporterhan Assigned ToPatrick Chevalley  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version1.0 
Summary0001897: Focus performance test, stored V-curve versus dynamic focus
DescriptionLate last night the sky condition became poor and I did a performance test between the V-curve focusing and dynamic focusing. The idea was to measure the spread but it showed a steady offset. A total of 50 focus tests where preformed, each time I switched between the focus methods. Both methods resulted in a good HFD value between 2.0 to 2.2. However the dynamic focus positioner values are statistical significant lower about 60 equals a theoretical HFD difference of 0.5.

See attached graph. It also indicates very clearly the slippage of the focuser 1:10 fine knob. The temperature was very stable.

I also noticed that the dynamic curve testing stopped at a lower HFD value then the start. E.g start value HFD=13 and end value HFD=10.

TagsNo tags attached.

Activities

han

18-02-19 09:35

reporter  

CCDciel focus test.png (38,659 bytes)   
CCDciel focus test.png (38,659 bytes)   
Log_20180218_231035.log (217,931 bytes)

han

18-02-19 09:59

reporter   ~0004457

Average slippage per focus action about 34 steps
Steps/HFD about 120
Average difference V-curve vs Dynamic focusing position (slippage corrected) about 75 steps

han

18-02-19 11:33

reporter   ~0004458

Last edited: 18-02-19 11:50

I entered two dynamic focusing logs in a spreadsheet. They are both indicate a different focus position compared with the CCDciel dynamic focus result. The first is strange. The second shows a position comparable with the V-curve focusing. I have to look into the code to understand why the spreadsheet calculation comes to a different result. I skipped the lowest HFD values.

I think the best approach next would be to build a simple V-curve simulator into the code. It should return the HFD as function of the focuser position. This will help detect any math bug. I will try this maybe tomorrow. First some other priorities.

CCDciel excel2.png (42,986 bytes)   
CCDciel excel2.png (42,986 bytes)   
CCDciel excel1.png (67,483 bytes)   
CCDciel excel1.png (67,483 bytes)   

Patrick Chevalley

18-02-19 13:52

administrator   ~0004459

Thank you for all this work.

I look at the dynamic method and I think I messed up the measurement index when doing the linear regression. I look to fix that.

The dynamic method use about the same method as vcurve to find the focus except it not use the focuser position as X axis but the measurement number to make it work with relative position focuser.

Yes, it can be interesting to have a simulator we can replay real measurement.
At the moment I use the INDI focuser simulator that interact with the camera simulator to make the thing about real. But this give a parabolic curve that is not good to track the details.

han

18-02-19 17:42

reporter   ~0004460

My idea was to overwrite the measured HFD value based on the focuser position. I kind of software shortcut. That should take only a few lines of code.

Patrick Chevalley

18-02-20 12:07

administrator   ~0004461

Han,

I have fixed a number of problem with the dynamic focus computation in rev 801, sorry for that.
https://sourceforge.net/p/ccdciel/code/801/

And in rev 802 I implement a retry if the curve is not centered because the start position was too far from the focus.
Now it also always end at the best observed position, even is the computation fail.
https://sourceforge.net/p/ccdciel/code/802/

han

18-02-20 12:10

reporter   ~0004462

I made quickly a simple simulation routine. The function below is called from TFits.GetHFD in the unit cu_fits to overwrite the measured HFD.

I get weird results both for dynamic and V-curve learning. See attached graphs. Note also that the curve near HFD 20 is not linear. I have less time the next days but this requires checking.


const
   old_focus_position: double=0;
function simulated_hfd(focus_position:double): double;{internal simulation loop, calculate a HFD based on focuser position}
var
  deadband: double;
begin
  if old_focus_position<focus_position then deadband:=0 {Going up, perfect focus at 10000}
    else deadband:=100;{Going down with backlash, hysteresis, perfect focus at 10100}

  result:=0.01*abs(focus_position-10000-deadband);{up perfect focus at 10000, down perfect focus at 10100}
  if result<3 then result:=3; {minimum HFD}
  if result>25 then
  begin
     result:=0; {maximum, star too faint}
  end;
  old_focus_position:=focus_position; {remember to find out focuser direction}
end;
focus out.png (12,349 bytes)   
focus out.png (12,349 bytes)   
focus in.png (12,448 bytes)   
focus in.png (12,448 bytes)   

Patrick Chevalley

18-02-20 14:30

administrator   ~0004463

Good idea, it work.

I think the problem is because all the bottom value are exactly 3.0, so it as problem to select the middle point.

I add this :
if (focus_position>9900)and(focus_position<10100) then result:=2.9;
And now the curve id much better.
focsim.png (37,447 bytes)   
focsim.png (37,447 bytes)   

han

18-02-20 14:38

reporter   ~0004464

Okay but this area near perfect focus is normally noisy. Should it not be purely based on the two slopes?
Did you try dynamic?

han

18-02-20 15:10

reporter   ~0004465

I tried 3.1, which should valid since the signal is noisy:
 if (focus_position>9900)and(focus_position<10100) then result:=3.1;

Get as focus 9927.

If noise is added in the HFD=3 range, the output should be consistent 10000 based on the two slopes.
focus with 3.1.png (10,422 bytes)   
focus with 3.1.png (10,422 bytes)   

han

18-02-20 15:43

reporter   ~0004466

Last edited: 18-02-20 15:45

If I understand the code well, the slope is calculated in Tf_vcurve.FindLinearPart. It starts with the maximum number of elements to find a leastsquares solution where ri>0.97.

This includes noisy HFD values near perfect focus. Maybe it is better to use the highest 4 values or avoid any measurement twice the minimum measured HFD if possible.

Patrick Chevalley

18-02-20 16:41

administrator   ~0004467

You can adjust that using the "Fit" slider, it exclude more or less points at the bottom of the curve.

The problem with FindLinearpart in your case is it take account the point only in the focus direction, so it exclude only the first point on the left and the right part is wrong. Maybe I need to change that to always use both side.

Then the focus error is because of the wrong right slope, both must be 0.01 with your simulator, but it is smaller because of the first central point include in the linear regression.

The other problem is I need to know approximatively the central point before to compute the slopes. This is to know if a point go to the left or right part of the curve, see pu_main.pas line 3344.
At the moment I use the minimum hfd position, but it may be better to use the mean position of the points within 10% of this minimum. This solve this case and also when all 3 point are at 3.0.

I look to do this two changes.

Patrick Chevalley

18-02-20 16:48

administrator   ~0004468

And for dynamic focus there is normally so few points it exclude only the central point.
The step movement must be set high enough to have a clear move on both side with only 5 or 7 points so this is normally not a problem.

han

18-02-20 17:31

reporter   ~0004469

>>The other problem is I need to know approximatively the central point before to compute the slopes. This is to >>know if a point go to the left or right part of the curve, see pu_main.pas line 3344.

Maybe you can start with the two highest HFD values and then add points till you reach a point which is an outlier. That should be a point near the perfect focus and to be excluded. This is opposite to the current setup where you remove points till you have a good fit.

Patrick Chevalley

18-02-20 17:55

administrator   ~0004470

With perfect measurement this can be good but if there is problem with the seeing or other I prefer to keep the maximum number of points.
Say on another meaner, the first two point have always r=1.000 but this is not necessary the right slope.

I make two change in rev 806 https://sourceforge.net/p/ccdciel/code/806/

- Use all the points within 10% of the minimal HFD to find the center of the curve. This solve the very flat or noisy case.

- Use the worst r value on both side to exclude the central points. This avoid to have one side wrong.

The criteria is not just r>0.97, this is (r>0.97)and(change_from_previous_r<0.01) , this meant we have few chance it go much higher by removing more points.
And the safety for very bad curve is we not remove more than the fourth of the total number of points.

han

18-02-20 21:46

reporter   ~0004471

Version 806 works better. Still the result is not always 10000. With

     if (focus_position>9900)and(focus_position<10100) then result:=2.5;

the result is 9981. (with 16 steps.)

Also dynamic focus is not reaching the same position as the V-curve, so maybe there is something to improve. I like to study this topic more in detail but this has to wait a few days.

Patrick Chevalley

18-02-20 23:14

administrator   ~0004472

In rev 806 I not changed the way it computer the central point for the dynamic method, this is now done in rev 811.

Also in simulated_hfd() I remark that deadband do not work as expected because when the focuser do the first backlash move at the start of the autofocus we not take an image so the function is not called and old_focus_position is not set.
This make the first hfd to be wrong and shift the focus result. This can also explain the apparent flattening at the top of the vcurve.
By forcing deadband:=0 I get the dynamic method to return to 10000.

han

18-02-22 17:40

reporter   ~0004478

Last edited: 18-02-22 17:56

1) I have tested a hyperbola v.s. my focuser and they match. Hyperbola parameters for my focuser are: a=2.2 and b=227
2) Formulas HFD:=f(position,...) and the reverse, position:=f(HFD,...) are working. So from any HFD value you can calculate the focuser step to the perfect focus position! No need for calculating the tangent of the hyperbola.
3) Demo program made for above two function.

The math was simpler then expected. By describing the hyperbola by sinh and cosh the inverse functions are easy. See sketch attached.

So I only have find a way to convert the learned V-curve into the hyperbola parameters, Maybe to brute method works.

hyperbola_test.rar (127,454 bytes)

han

18-02-22 17:41

reporter   ~0004479

Here the other files
hyperbola formulas.png (127,581 bytes)   
hyperbola formulas.png (127,581 bytes)   

Patrick Chevalley

18-02-23 09:13

administrator   ~0004480

This is very good, so no more need for the tangent lines and intersect points.

How do you get the hyperbola parameters from your focuser measurement?

han

18-02-24 17:25

reporter   ~0004496

The procedure V-curve array => hyperbola parameters is ready. With brute force, I can find the focus position and hyperbola a&b parameters accurate within a fraction of a second. Will next week do some practical testing with real data to see if it is working reliable and performs.

Serg10

18-02-25 03:42

reporter   ~0004498

Here is the real data of my focuser for your experiments.
Pos HFD
992 16.0
1005 13.8
1019 12.5
1030 10.1
1044 8.5
1057 6.9
1070 6.7
1083 5.1
1095 5.7
1108 7.2
1122 7.0
1135 7.7
1148 9.6
1160 11.4
1173 13.2
1187 15.3

han

18-02-26 21:26

reporter   ~0004505

Hello Serg,

I was two day busy with other things, but I have put your data in my pascal routine. It gives the following hyperbola parameters:
a 5.41
b 36.72
Focus 1091.5

I have put the data and hyperbola parameters in attached spreadsheet to play with. The yellow marked fields are inputs.

Tomorrow I will make a unit which could run in the background of CCDciel to report an alternative calculated focus position in a message only. This could be used for testing and comparison with the existing routine. Patrick should be convinced It is an improvement compared with the existing routine and it should thoroughly be tested.

han

18-02-26 21:28

reporter   ~0004506

Excel files are not accepted, will try zipped now.
hyperbola5.zip (7,676 bytes)

Serg10

18-02-27 04:35

reporter   ~0004509

On my telescope, the left branch of the curve is steeper than the right. The focus point is to the left of about 1082.

han

18-02-28 21:22

reporter   ~0004516

Last edited: 18-02-28 21:48

Attached a new unit pu_hyperbola.pas proposed. It converts the existing v-curve into a focus position and a, b parameters. Included is an fu_starprofile.pas (v800, could not download the latest) where a call to pu_hyperbola is made and the estimated focus is reported in a MSG. This is implemented for v-curve and dynamic focusing. The message is generated for result comparison with the existing focus routines.

The focus position reported by the hyperbola routine matches the V-curve result and compared with dynamic focusing it looks better.

I'm not fully happy about the curve fitting routine. The get good convergence, I make in each iteration cycle 20 investigation steps. With 2 steps only it doesn't always has convergence. Especially the b factor is cumbersome.

Attached also my test program.

in fu_starprofile add the following:

   vcsFocusL:begin
              // move to focus
              inc(FnumGraph);
              meanhfd:=SMedian(AutofocusVcCheckHFDlist);

+ {hyperbola test}
+ find_best_hyperbola_fit(AutofocusVc,AutofocusVcNum+1,p_hyp,a_hyp,b_hyp); {output: bestfocusposition, a, b of hyperbola}
+ msg('HYPERBOLA curve fitting focus at: '+
+ inttostr(round(focuser.FocusPosition +
+ steps_to_focus(meanhfd,a_hyp,b_hyp)))+ {calculate steps to focus using hyperbola parameters}
+ ' remaining curve fit error '+floattostr(lowest_error)+' iteration cycles '+inttostr(iteration_cycles) );
+ {end of hyperbola test}
..
..
 vcsFocusR:begin
              // move to focus
              inc(FnumGraph);
              meanhfd:=SMedian(AutofocusVcCheckHFDlist);

+ {hyperbola test}
+ find_best_hyperbola_fit(AutofocusVc,AutofocusVcNum+1,p_hyp,a_hyp,b_hyp); {output: bestfocusposition, a, b of hyperbola}
+ msg('HYPERBOLA curve fitting focus at: '+
+ inttostr(round(focuser.FocusPosition -
+ steps_to_focus(meanhfd,a_hyp,b_hyp)))+ {calculate steps to focus using hyperbola parameters}
+ ' remaining curve fit error '+floattostr(lowest_error)+' iteration cycles '+inttostr(iteration_cycles) );
+ {end of hyperbola test}


    afdMeasure: begin
              // store hfd
              inc(afmpos);
              ahfd[afmpos]:=Fhfd;

+ {hyperbola store curve}
+ setlength(v_curve,afmpos+1);
+ v_curve[afmpos,1]:=focuser.FocusPosition;
+ v_curve[afmpos,2]:=Fhfd;
+ {end of store curve}


              // compute focus
+ {hyperbola test}
+ find_best_hyperbola_fit(v_curve,afmpos+1,p_hyp,a_hyp,b_hyp); {output: bestfocusposition, a, b of hyperbola}
+ msg('HYPERBOLA curve fitting focus at: '+
+ inttostr(round(p_hyp))+
+ ' remaining curve fit error '+floattostr(lowest_error)+' iteration cycles '+inttostr(iteration_cycles) );
+ {end of hyperbola test}

hyperbola_test.zip (70,163 bytes)
hyperbola unit.zip (9,164 bytes)

han

18-02-28 21:39

reporter   ~0004517

Renamed one variable cycle to iteration_cycles, but not everywhere. Here the correction
hyperbola unit-2.zip (9,166 bytes)

Patrick Chevalley

18-03-01 10:02

administrator   ~0004518

Thank you Han.

I have merged the change in the current code with {$ifdef} so it is not compiled by default.
This is in revision 856:
https://sourceforge.net/p/ccdciel/code/856/

The hyperbola unit is added in revision 857:
https://sourceforge.net/p/ccdciel/code/857/

The only functional change I do in your code is to adjust the indices of the dynamic measurement because I change them a few time ago to fix the dynamic position.

So to continue testing it just require to recompile after uncommenting the {$define hyperbola_test} at the top of fu_starprofile.

I do a quick test of vcurve and dynamic using the INDI simulator and the values look good.
I will do real test after the snow stop.

han

18-03-01 13:08

reporter   ~0004519

Hello Patrick,

Note that hfd_calc function can be used as simulator. I put in cu_fits.pas at line 1647 the following line hfd:=hfd_calc(Focuser_Position,10000,2.5,200);

Using the hyperbola simulation under ideal condition, I can see that for V-curve focusing with near focus>=20 the existing asymptote solution and
hyperbola fit gave both perfect results. Below near focus=20, the error of the asymptote solution increases slowly.

With the dynamic solution starting with an focus offset, the hyperbola solution performs much better.

So if this is confirmed in praxis without ideal conditions, my impression is that a hyperbola-fit will work much lower in the V-curve then the existing asymptote solution. A minor advance could be a simpler code. The step "start focus" could possible abandoned if only a hyperbola-fit is used. But that's something to consider after a rigorous testing program and hyperbola-fit my not work for you or others.

Note my comments in fu_starprofile.pas are wrong. Forgot to update. I my posting above they are correct.

- {calculate HFD from position and perfectfocusposition using hyperbola parameters}
+ {calculate steps to focus using hyperbola parameters}

han

18-03-01 17:49

reporter   ~0004520

I did more testing with the simulator and this time I converted the focus position differences back to HFD value. The difference are much too low to be measurable in practice. So using hyperbola fit will not give any significant improvement in focusing accuracy. Also the current dynamic focusing performed very well. See table:

Patrick Chevalley

18-03-02 10:47

administrator   ~0004521

Interesting result, this prove both computation are very good now.
I am surprised that asymptote method is so good when starting near the focus.

Maybe we can keep the asymptote method for the default case and try to use hyperbola for the dynamic method if the linear regression result is bad?

I fixed the comment in the source but I have a lot of problem to access the subversion repository this last days.
I take the opportunity it was accessible for a few hours yesterday to move it to Github.
So please get the new source code from:
https://github.com/pchev/ccdciel

I will remove the subversion the next time I can access it.

han

18-03-02 11:23

reporter   ~0004522

Around the focus area the curve is very flat so very forgiving for an focus error. The error is there but you will not see it in the HFD. However I think you should also take into account a positioning error. So look to the position including a +- tolerance. If you are in the focus area but at the edge then with the positioning error the HFD could rise more then expected.

At the moment the hyperbola fit is a different approach but I can't demonstrate a significant improvement. It looks mathematical more accurate but not noticeable in HFD. You could consider implement it as an option in options but I'm not sure if your willing to go that route.

I will play with the simulation adding tolerances. Unfortunately my real focuser failed after two night with -10 degrees Celsius, so field tests have to wait.:(

han

18-03-02 12:38

reporter   ~0004523

I put the V-curve focusing results with starting near_focus=3 and 4 in a perfect hyperbola V-curve. The existing asymptote solution performs well.

Only the dynamic method shows some error when the focus is "out of focus" while starting focusing. See log:

12:15:13:Autofocus start Dynamic curve
12:15:13:Focuser temperature: 3.2
12:15:13:AutoFocus started, initial position: 9900
12:15:13:Autofocus running, hfd=2.8 peak:110.5 snr:9.0
12:15:13:FocusSim.Focuser: Focuser move to 10350
12:15:14:Autofocus running, hfd=5.0 peak:119.3 snr:9.5
12:15:14:FocusSim.Focuser: Focuser move to 10200
12:15:16:Autofocus running, hfd=3.5 peak:118.1 snr:9.4
12:15:16:FocusSim.Focuser: Focuser move to 10050
12:15:17:Autofocus running, hfd=2.6 peak:118.1 snr:9.4
12:15:17:FocusSim.Focuser: Focuser move to 9900
12:15:19:Autofocus running, hfd=2.8 peak:124.9 snr:9.7
12:15:19:FocusSim.Focuser: Focuser move to 9750
12:15:20:Autofocus running, hfd=4.0 peak:108.1 snr:9.0
12:15:20:FocusSim.Focuser: Focuser move to 9600
12:15:22:Autofocus running, hfd=5.6 peak:120.8 snr:9.5
12:15:22:FocusSim.Focuser: Focuser move to 9450
12:15:23:Autofocus running, hfd=7.3 peak:114.0 snr:9.2
12:15:24:HYPERBOLA curve fitting focus at: 10000 remaining curve fit error 0.00111042599890954 iteration cycles 7
12:15:24:Focus quality = 0.992
12:15:24:FocusSim.Focuser: Focuser move to 10079
12:15:25:FocusSim.Focuser: Focuser move to 9929
12:15:26:Hyperbola HFD 2.50000076293934
12:15:26:Asymptote HFD 2.6528581285097
12:15:27:Autofocus finished, POS=9929 HFD=2.7 PEAK:119.1 SNR:9.4 TEMP:2.8
hyperbola2.png (41,275 bytes)   
hyperbola2.png (41,275 bytes)   

Patrick Chevalley

18-03-03 14:53

administrator   ~0004525

Too bad for your focuser :(

This last example show the interest of hyperbola for the dynamic method.
In this case the asymptote solution is not good because there is only 2 points (10350 and 10200) for the left part and this points are too near of the focus to make a good approximation of the left asymptote.
The printed quality 0.992 is high because the left fit is 1.0 and the right is not bad with 4 points, so this is not a criteria in this case.
Maybe a good solution is to always use hyperbola for the dynamic method.

For the V curve method it is much more easy to get a good asymptote because you have all the control when you learn the curve to make any necessary correction, which is not the case with the dynamic method.

At the moment the advantage of the asymptote is you can have a different slope for the left and right part of the curve, and this better match the reality as with many optic the in and out focus images show a different radial repartition of the light that influence the HFD value.
To take account for that the hyperbola must be tilted.

So my current feeling is to change the dynamic method to use hyperbola and keep the asymptote for the Vcurve.

I have hope of clear sky for tonight to make some testing.

han

18-03-03 15:49

reporter   ~0004526

Last edited: 18-03-03 16:06

>> So my current feeling is to change the dynamic method to use hyperbola and keep the asymptote for the Vcurve.
For me a good approach. The dynamic method has a beauty of simplicity and to work without doing "homework" which could help newcomers to get started. I will start using it with the hyperbola since it performs well and to collect experience.

My focuser should be operational again after a software reset using dedicated software. Also the glued stepper motor came off the gearbox (poor design) most likely due to the low temperatures. All fixed now.

Serg10

18-03-03 17:42

reporter   ~0004527

When focusing on stars of different stellar magnitude, the minimum curve will be different. For example, for a bright star HFD will be 5, and for a small star 3. This is taken into account in the algorithms focus?

Patrick Chevalley

18-03-03 18:36

administrator   ~0004528

Han,
I make the change to use hyperbola with dynamic focus when the program is compiled with {$define hyperbola_test}
I also change the v_curve[] array content to make it compatible with relative movement.
This is the change:
https://github.com/pchev/ccdciel/commit/de684ef617716bcca59b4544bebe9cc4d058b490
From my testing with the simulator it work very well, even if starting at a defocused position.

Serg10,
All the focusing algorithm we use are resilient to change in the focus HFD, for example when the seeing condition change.
But all the stars bright or faint have the same HFD.
You can observe some difference because the exposure time is not set correctly.
If too long the bright star is saturated and increase it's diameter.
If too short the external part of the faint star may be mixed in the noise resulting in a too small HFD.
So be careful of the exposure time you set in the autofocus parameters.

han

18-03-03 20:56

reporter   ~0004529

Did a field test with the new code with hyperbola fit implemented.

1) Switched 5 times between V-curve focusing and Dynamic focusing and took one image. For all images V-curve and Dynamic focusing gave using image inspection similar HFD values.
2) Then I tested the dynamic focusing for a large positive and negative focus offset. In both cases the focus result was good and same HFD's where achieved.

So this mod works fine works fine for me. Was initially a little puzzled by the single steps in the array and temporary focus position reporting.

One minor complain is that the focus exposure time is copied to the preview. Would prefer if preview time is not touched.

Serg10, If this version is released officially, will be interesting if you have similar good results with one steeper branch of the V-curve. As Patrick indicated saturation of the imaged star could influence the HFD value, so the star should not be too bright. For me intensity <64K.

And an other conclusion is that my focuser is working again! :)

Patrick Chevalley

18-03-03 22:43

administrator   ~0004530

I also do some testing on the sky tonight.

First I make comparison of the result of Vcurve and dynamic with hyperbola, this also give me the same HFD and very small focuser offset.

Then I only do dynamic testing with special condition.

I also get good result when starting with a focus offset.
Even if the offset is so large you only get one side of the curve, now it restart the measure using the position with the minimal observed HFD as the starting point and the final result is good.

Then I tested the condition of "in place autofocus" with only a faint star available.

I confirm that the reported star SNR must be at least 5 to get a reliable HFD, I will set this value by default.

But I was surprised to get very good focusing by reducing the focuser travel using a smaller "movement between point", even when starting with an offset.
I change the test I do on the difference between min and max HFD so that maxhfd can be only 1.5*minhfd.
This way the star is less defocused and the SNR remain good for fainter stars.
I think this is a major gain of using the hyperbola.

Maybe I can improve the position reporting when using an absolute position focuser, I agree that measurement number is not the best.

I use the preview loop for the focus exposure, but it is easy to reset the exposure time when it complete. I already do that for the binning.

I will do a bit more checking on the change I do tonight before to release a new version with the hyperbola, maybe tomorrow.

han

18-03-03 23:46

reporter   ~0004531

Yes, it can go very low in HFD since it doesn't need a linear part of the curve. For this reason it is probably better to remove the menu setting "near focus hfd" for dynamic focusing. As long the SNR value is good it will find the best fit. Makes it simpler for the user.

han

18-03-04 01:17

reporter   ~0004532

Just some after toughts about about mathematical names.The asymptote of a hyperbola cross each other at HFD=0. The asymptotes of an hyperbola are its tangents at infinity points. In the line fit routne for V-curve you calculate two straight lines which fit best (wings?). They are neither asymptote nor tangents. They are very similar to the tangents but a tiny bit closer to middle of the hyperbola. So I don't think these "line fits" of the V-curve wings have a proper name.

han

18-03-04 18:40

reporter   ~0004534

Hello Patrick,

Made one improvement in the unit hyperbola. The calculation of the initial value for factor b was not optimal. Changed it to:

  {Alternative hyperbola formula: sqr(y)/sqr(a)-sqr(x)/sqr(b)=1 ==> sqr(b)=sqr(x)*sqr(a)/(sqr(y)-sqr(a)} {rev1}
  b:=sqrt(sqr(highest_position- lowest_position)*sqr(a)/(sqr(highest_hfd)-sqr(a)) );{rev1}

Added one extra check for zero's in the data to avoid wrong lowest HFD. Maybe overkill:
    if ((data[i,2]<lowest_hfd) and (data[i,2]>0.1){avoid zero's}{rev1}) then

And two small textual corrections.
pu_hyperbola.zip (2,388 bytes)

Patrick Chevalley

18-03-04 21:19

administrator   ~0004541

Thank you, I change the pu_hyperbola file.
I also make to use only hyperbola for dynamic focus and I remove the "Near focus" option except for Vcurve.

I try to find what the problem is with 0001910 before to make a new version.

Patrick Chevalley

18-03-07 11:15

administrator   ~0004557

Version 0.9.28 is now available with this new focus method.

I close this issue now and it is probably best to open a new one if more adjustment are require after testing.

Issue History

Date Modified Username Field Change
18-02-19 09:35 han New Issue
18-02-19 09:35 han File Added: CCDciel focus test.png
18-02-19 09:35 han File Added: Log_20180218_231035.log
18-02-19 09:59 han Note Added: 0004457
18-02-19 11:33 han File Added: CCDciel excel2.png
18-02-19 11:33 han File Added: CCDciel excel1.png
18-02-19 11:33 han Note Added: 0004458
18-02-19 11:50 han Note Edited: 0004458
18-02-19 13:52 Patrick Chevalley Note Added: 0004459
18-02-19 17:42 han Note Added: 0004460
18-02-20 12:07 Patrick Chevalley Assigned To => Patrick Chevalley
18-02-20 12:07 Patrick Chevalley Status new => assigned
18-02-20 12:07 Patrick Chevalley Target Version => 1.0
18-02-20 12:07 Patrick Chevalley Note Added: 0004461
18-02-20 12:10 han File Added: focus out.png
18-02-20 12:10 han File Added: focus in.png
18-02-20 12:10 han Note Added: 0004462
18-02-20 14:30 Patrick Chevalley File Added: focsim.png
18-02-20 14:30 Patrick Chevalley Note Added: 0004463
18-02-20 14:38 han Note Added: 0004464
18-02-20 15:10 han File Added: focus with 3.1.png
18-02-20 15:10 han Note Added: 0004465
18-02-20 15:43 han Note Added: 0004466
18-02-20 15:44 han Note Edited: 0004466
18-02-20 15:45 han Note Edited: 0004466
18-02-20 16:41 Patrick Chevalley Note Added: 0004467
18-02-20 16:48 Patrick Chevalley Note Added: 0004468
18-02-20 17:31 han Note Added: 0004469
18-02-20 17:55 Patrick Chevalley Note Added: 0004470
18-02-20 21:46 han Note Added: 0004471
18-02-20 23:14 Patrick Chevalley Note Added: 0004472
18-02-22 17:40 han File Added: hyperbola_test.rar
18-02-22 17:40 han Note Added: 0004478
18-02-22 17:41 han File Added: hyperbola versus focuser curve.png
18-02-22 17:41 han File Added: hyperbola formulas.png
18-02-22 17:41 han Note Added: 0004479
18-02-22 17:46 han Note Edited: 0004478
18-02-22 17:56 han Note Edited: 0004478
18-02-23 09:13 Patrick Chevalley Note Added: 0004480
18-02-24 17:25 han Note Added: 0004496
18-02-25 03:42 Serg10 Note Added: 0004498
18-02-26 21:26 han Note Added: 0004505
18-02-26 21:28 han File Added: hyperbola5.zip
18-02-26 21:28 han Note Added: 0004506
18-02-27 04:35 Serg10 Note Added: 0004509
18-02-28 21:22 han File Added: hyperbola_test.zip
18-02-28 21:22 han File Added: hyperbola unit.zip
18-02-28 21:22 han Note Added: 0004516
18-02-28 21:28 han Note Edited: 0004516
18-02-28 21:38 han Note Edited: 0004516
18-02-28 21:39 han File Added: hyperbola unit-2.zip
18-02-28 21:39 han Note Added: 0004517
18-02-28 21:48 han Note Edited: 0004516
18-03-01 10:02 Patrick Chevalley Note Added: 0004518
18-03-01 13:08 han Note Added: 0004519
18-03-01 17:49 han File Added: asymptote vs hyperbola focusing.png
18-03-01 17:49 han Note Added: 0004520
18-03-02 10:47 Patrick Chevalley Note Added: 0004521
18-03-02 11:23 han Note Added: 0004522
18-03-02 12:38 han File Added: hyperbola2.png
18-03-02 12:38 han Note Added: 0004523
18-03-03 14:53 Patrick Chevalley Note Added: 0004525
18-03-03 15:49 han Note Added: 0004526
18-03-03 16:06 han Note Edited: 0004526
18-03-03 17:42 Serg10 Note Added: 0004527
18-03-03 18:36 Patrick Chevalley Note Added: 0004528
18-03-03 20:56 han Note Added: 0004529
18-03-03 22:43 Patrick Chevalley Note Added: 0004530
18-03-03 23:46 han Note Added: 0004531
18-03-04 01:17 han Note Added: 0004532
18-03-04 18:40 han File Added: pu_hyperbola.zip
18-03-04 18:40 han Note Added: 0004534
18-03-04 21:19 Patrick Chevalley Note Added: 0004541
18-03-07 11:15 Patrick Chevalley Status assigned => resolved
18-03-07 11:15 Patrick Chevalley Resolution open => fixed
18-03-07 11:15 Patrick Chevalley Note Added: 0004557