Rigel sys focuser can't reverse direction to help sgp autofocus

Hi Randy-

I see people talking about what backlash should be in terms of numbers that they exchange with each other - but without knowing what those numbers mean in terms of how much the knob is actually turning - you have no idea what to use.

Some systems may be set up so that a full turn of the knob is 400 steps - and others like yours it might be many thousands.

I would ignore the numbers that other people use unless it is exactly the same setup and all the parameters are set the same way. A given stepper controller could be doing fine microsteps for one system - and not for another - so the actual step sizes would be very different.

So for setting up automatic focus I would do two things. First I would get a feel for how the focus system works manually - either with an eyepiece or video camera. Feel with your hand and watch how the stars change as you reverse direction. Get a sense of how much of a turn will remove backlash and make it move smoothly and consistently after a reverse. And note how much of a turn makes the star go noticeably out of focus.

For SCT’s I find the backlash is about 1/4-1/2 turn of the knob, and the full focus range for a nice parabola is about 1/8th turn or 45 degrees.

So at a minimum I would set things so you have 1/4 turn of the knob for backfocus compensation - and if your system has 8000 steps per full turn - yes that means 2000-4000. The numbers by themselves don’t really matter - but the time it takes to do those steps may be a problem. For me it is about 20 seconds or so to wind out and back - so the total autofocus process takes 2-3 minutes - which isn’t bad.

So yes - 500 is probably way to small to get consistent curves - and I would use 2000-4000 as long as it doesn’t take too much time.

If you can’t make the knob turn ccw as the numbers go from high to low - then at least make sure backlash compensation is big enough - and the compensation is only invoked when you go from low numbers to high - i.e. at the start of the curve.

If you have 9 focusing steps in the curve, then each step should be about 100-200 steps - so that in 9 steps it goes about 45 degrees. That part is easy to adjust because you will see either a very flat parabola or a very sharp V - and you can tune it.

I disable smart focus - and I have crop set to 30%. And I have min star size at 2 pixels - and my focus images are 2s and binned 2x2.

Frank

By the way - I’m just talking in terms of an SCT focusing knob here - and other OTA’s like a refractor would have different amounts of backlash and focus ranges.

Frank

Agree that it is unfortunate SGP cannot be user switchable from taking focus graph low-to-high, vs high-to-low.

However, there is another approach you could consider. That is to switch the IN/OUT (Focuser Backlash Compensation Direction) setting so that SGP will finish each individual focus point by moving the focus numbers upwards. Because the graph is generated from high to low, this will mean that backlash will be implemented for most points needed to generate the curve. But at least you will finish each individual focus point by moving CCW (assuming that CCW for you means pushing the SCT mirror against gravity).

Also, getting the backlash steps correct is important - good advice above from Frank on that. Everyone’s setup is different, don’t be shy to use larger numbers for step size if necessary.

DaveNL

Hmm. I’m afraid I doubt that would be a good idea especially when unwinding backlash takes many seconds. It would be unusable for me. But I guess it might be something to try if it unwinds very quickly.

Frank

As I mentioned in the thread on CN, about a year ago the Rigel Sys guys modified the firmware to reverse the direction the motor winds on focus curves. This completely solved the issue for me. Hopefully Gene from Rigel Systems will drop by. But if not, just write to them and they’ll send you the modified firmware.

Kevin

Next 2.6 beta of SGP should better implement “Reverse focuser direction”. This has existed for a while but it didn’t work great. It should have been refactored when we implemented auto focus but that never happened…so it’s been like this for a long while.

What does this mean for auto focus?

Glad you asked. We’re essentially reversing things internally; however, rather than having auto focus algorithm reverse its behavior, we’ve implemented it such that the focuser masks its position and handles the reversing “in the focuser object”.

For instance let’s say you have a focuser that has 50,000 max steps and you’re currently at 25,000 steps (as reported by the focuser…this is important…although at this value SGP will also report 25,000 as it’s right in the middle). If you tell SGP to move to 23,000 steps the actual focuser hardware will move to 27,000 steps but SGP will report 23,000 steps.

SGPPosition = MaxSteps - focuserReportedPosition

This behavior effectively masks the “reversed” state to our Auto Focus and backlash compensation routines. So rather than reinvent the wheel on those which would have been CONSIDERABLY more error prone and much more difficult we decided to fake the focuser reversal.

What does this mean for backlash compensation?

Excellent question. “IN” and “OUT” remain unchanged with their direction relative to the change in direction as reported by SGP. Essentially “IN” and “OUT” moves trigger compensation based on the position and change in position that SGP is reporting…NOT the change in direction that the actual focuser reports.

Thanks,
Jared

Phew…too much for my tired brain but I assume that if I’m getting a good focus routine “and I am” then I do not need to change anything or worry about this beta change?

Ray

@libraryman2

If AF is working for you, don’t change a thing. This is for folks that want to come at the final AF position from the other direction.

Just a heads up, for the nStep I added new firmware and ascom driver that supports selection of reversing motor in firmware transparent to the firmware and higher level programs. This is accomplished by adding 3 more ‘phase selects’ with 0,1 and 2 being the original and 3,4,5 added being opposite motor direction moves. It basically just reverses the stepper phase drive order. Phase selects are used to tell the nStep what the wiring order to the stepper is so it drives the coils correctly. Search for gcusb_nstep on the web for a link to my page for the nStep if interested.

1 Like

Hi Gene-

Thank you for adding that feature. I’m the original poster of this thread - and it’s great that at this point both sgp and rigel have helped accommodate this direction reversal issue. I think Rigel may be one of the few focusers that lets you change the meaning of direction in terms of the number system. I will try installing the latest firmware soon - mainly so that I am up to date.

Do you erase any presets that had been stored? I assume they lose meaning? Not a big issue but I wondered.

Separately - another request that I and a few others had for SGP is to delay after a focuser move - so that things settle. The SGP developers didn’t like this because it means they are writing code to handle what is effectively slop in the system. And like many things - it ends up being pushed down to the device (focuser in this case).

But would you consider adding an optional delay on “Focuser Moving” so that ASCOM apps will pause a bit after a focuser motion? I find that I can’t use SGP autofocus very well with shutterless cameras that act quickly.

It’s ok if you don’t want to. It would at least clarify that this is a real problem that prevents autofocus from working well for some systems - and neither app nor device side wants to provide a fix. I don’t know if any focuser allows such a delay - and it’s somewhat kludgy anyway since it says the focuser is moving when it isn’t. As opposed to an explicit “delay after focuser move” in sgp that does exactly what it says.

Thanks,
Frank

Hi Frank,
Sorry to say updating the firmware does clear out all settings stored in the device (just about everything except comments on the stored goto positions is in the device).

As far as a delay after move, hmmm. This would require delaying when ASCOM ‘IsMoving’ is returned false after a move. It starts in the device but would be easier in the ASCOM driver itself most likely. Let me think on it.

Question please, what is ‘settling’, scope wiggles after focus motor runs?

Gene

Hi Gene-

For the reversal issue I was talking about a user who has the new firmware and everything is set up - and then they reverse the direction with a different phase value. It’s a minor point but people should be aware: They would probably need to change the current position value and any setpoints they had. Unless your code did all the changes to recognize the new direction - a key one being where you are in the focuser range.

For the focuser delay - I am focusing EdgeHD11 with the primary focuser knob and a robofocus motor - driven by your Rigel controller. It all works fine for autofocusing with a typical shuttered ccd camera - but with SX interline or ZWO cmos - with no shutter - the picture is taken immediately after the movement and the mirror is settling for about a second at most.

Being able to wait perhaps 1 second would make the difference between elongated stars that are hard to measure for the focus curve - vs. nice round ones.

This is analogous to the issue when changing a filter - and sgp does provide a user settable delay for that.

Anyway - just thought I would ask. A few others have made the same request for a delay after focus movement.

Frank

I agree with Frank. A small delay between focusing moves would be a big help for those of us using the primary mirror to focus with and shutter-less cameras… I think a delay would allow the system to “ring out” and allow the mirror and all of the mechanical things to settle down before taking an exposure.

Thanks,
mahaffm

I have been unable to get any sort of curve at all since upgrading to 2.6.0.08 and using the rigel upgrade. At least the rigel focuser will now turn CCW as the numbers go down, but I only get a flat line for my curve. Once again I have had to resort to manual focusing. I will give it a try again tonight or tomorrow night but I’m tired of spending my imaging time just trying to get auto focus to work.

8000 steps in a full knob turn, backlash set at 2000, using 9 points with 112 step size…flat line.

Randy

Hi Frank,

When the new firmware is loaded to support reversing, the new firmware is not aware of what was in flash saved previously, the flashing program clears it all out.

The algorithm to do the calculations and save stuff away pre-update is relatively straight forward
Given MaxStep = upper limit and current position is known pr-update, then when everything is reversed the MaxPosition does not change but the new current position is (Max - old Current). Same applies to all Stored Goto Positions. Also reset is the Max

Now for a ‘small delay’ after a higher level program commands a move (which has finished), how would ~1.2 seconds do? I can drop a test ASCOM driver with a fixed delay for trying out if interested. About 12 lines of code in total in ASCOM driver side with a fixed delay.

Gene

Hi gene. I think 1.2 seconds would be ok. I’d be happy to try it. Thanks. Frank

Hi Randy,

Just a couple of questions and/or comments:
1, Are you starting out with your scope close to focus? You need to be close to focus before using the spg Auto focus?
2. Not sure what kind of scope you have. I have an HD11 with the Rigel nSTEP & STEPPER Motor kit tied to the primary mirror focuser. My backlash is set to 1,500 steps and my steps is set to 250 with 9 points.

Not sure if this helps any.

Regards,
mahaffm

Hi Gene,

Thanks for getting on this. I agree the 1.2 seconds should allow for any mechanical ringing to settle down in that amount of time.

Where are you going to post the driver update? if the weather ever clears I’d like to give it a try as well.

Regards,
mahaffm

Hi mahaffm,

For testing purposes only, a fixed, not selectable delay.

Here is a link
http://www.astrogene1000.com/products/gcusb_nstep/GCUSB_nSTEP_v6.0.7_sgpdelay.zip

Download and extract to someplace
Copy the file inside over to
C:\Program Files (x86)\Common Files\ASCOM\Focuser>

Rename C:\Program Files (x86)\Common Files\ASCOM\Focuser\GCUSB_nSTEP.exe to GCUSB_nSTEP.6.0.7.exe
Rename GCUSB_nSTEP_v6.0.7_sgpdelay.zip to GCUSB_nSTEP.exe

With an admin CMD prompt
C:\Program Files (x86)\Common Files\ASCOM\Focuser>gcusb_nstep.exe /regserver

You will need to do the /regserver thing again if you copy the original back to GCUSB_nSTEP.exe

It should be somewhere between 2 and 3 seconds.

You can see the results in the Traffic Window with “IsMoving” check box ticked. Please remember, do not try and minimize the traffic window, it really does not like that! You can close the traffic window, just not minimize.

Let me know!

Gene

Thanks Gene. It will be the weekend before I get time to test the update, (Indoors only - Weatherman says rain/snow for the foreseeable future). Do I need to do anything with updating the Firmware? I do not have the latest firmware loaded, I do not have the one that allows for motor reversing.

Regards,
mahaffm