Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZWO AM5 Mount - Reset home position [I have a solution] #2089

Closed
pawel-soja opened this issue Jul 27, 2024 · 4 comments · Fixed by #2093
Closed

ZWO AM5 Mount - Reset home position [I have a solution] #2089

pawel-soja opened this issue Jul 27, 2024 · 4 comments · Fixed by #2093

Comments

@pawel-soja
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I have a ZWO AM5 mount, I know that by sending the appropriate command, you can save a new home position in the mount. The problem often appears on forums, where a newly purchased AM5 has a position shifted by a few degrees.
For example: https://www.cloudynights.com/topic/886794-zwo-am5-help-with-home-position/

Describe the solution you'd like
The problem can be solved by using other software, but I wish such functionality was available with KStars/EKOS.
I can add a button to the lx200am5 driver, but I'm not sure where.

Describe alternatives you've considered
I can't imagine anything outside of KStars ❤️

Additional context
I found these buttons, I've never used them and I'm not sure if this is the right place. I just want to send the appropriate command by pressing the button. Mount remembers and considers this as the starting position.
image

Where can I implement resetting the home position?

@knro
Copy link
Contributor

knro commented Jul 28, 2024

There is Homing support in the AM5 driver already, so there needs to be another one to set as-is and it would accept whatever current position as home?

@pawel-soja
Copy link
Contributor Author

I see that big changes are coming: #2090

For example, I was thinking about something like this:
image

  1. First, to do something, you need UnPark
  2. Driving to home position, without parking, so mount returns correct position (opto sync)
  3. You set the correct position. The new position cannot be too far away, or the process will fail.
  4. Saving position in mount.

I would extend HomeSP, but I see that your latest modifications are causing a conflict.

HomeSP[GoHome].fill("GO", "Go", ISS_OFF);
HomeSP[SaveHome].fill("SAVE", "Save", ISS_OFF);
HomeSP.fill(getDeviceName(), "TELESCOPE_HOME", "Home", MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE);

/* ... */

switch (HomeSP.findOnSwitchIndex())
{
    case GoHome:
        LOG_INFO("Homing in progress...");
        HomeSP[GoHome].setState(ISS_ON);
        HomeSP.setState(goHome() ? IPS_BUSY : IPS_ALERT);
        break;
    case SaveHome:
        if (saveHome())
        {
            HomeSP.setState(IPS_OK);
            LOG_INFO("Current position written as home position in the mount.");
        }
        else
        {
            HomeSP.setState(IPS_ALERT);
            LOG_WARN("Failed to write current home position in the mount. It is possible that the position is too far from the factory position.");
        }
        HomeSP[SaveHome].setState(ISS_OFF);
        break;
}

@pawel-soja pawel-soja linked a pull request Jul 28, 2024 that will close this issue
@knro
Copy link
Contributor

knro commented Jul 28, 2024

For this, HOME_SET and HOME_GO can be used. I already modified the driver in #2090 so you just need to add saveHome() there.

@pawel-soja pawel-soja linked a pull request Jul 29, 2024 that will close this issue
@pawel-soja
Copy link
Contributor Author

Mission complete!
image

Thanks Jasem!

@knro knro closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants