×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Manual slewing on EQ6-R Pro using built in USB port results in slewing forever

  • Posts: 9
  • Thank you received: 0
Man I hope it clears up for you soon. I guess clear nights is one of a very few number of benefits of living so close to a desert :)

I compiled the new code and, unfortunately, the uncontrollable slewing came back. I included the entire modified StopWaitMotor function at the end just for you to check (old code is commented out instead of deleted)

Good news though, is that the "Slew to Target" and tracking accuracies went back to what they were before.

I tested a few other functions and can pretty much confirm that the only time problems occur is when I use manual slew via my ipad vnc client, which is the cause of the second spurious start and immediately stopped slew command. All programmatic slews work properly, such as "GoTo target", "Slew to Target", and perhaps what matters to me the most, "Park" command (It's the last large movement during an unattended imaging session, occurs 4:30AM while I'm asleep). Since the second slew command is not really caused by anything KStars or Ekos/INDI related stuff, it's technically not a bug anymore :) On the other hand, knowing a specific sequence of action can leads to potential equipment damage is a bit nerve wracking.

I'm running a capture sequence now. What I can do tomorrow during day-time is to try another "socat" recording, but this time with timestamps included so you can take a look at the intervals these commands are sent. What I don't understand is, even if the second K1 command gets ignored, the mount should just keep moving regularly, instead of moving erratically with loud noise and not responding to subsequent stop commands, all the while reporting (via f1) that the motor is stopped.

Here is the code I tested:
void Skywatcher::StopWaitMotor(SkywatcherAxis axis)
{
    bool *motorrunning;
    struct timespec wait;
    ReadMotorStatus(axis);
    if (axis == Axis1 && RARunning)
        LastRunningStatus[Axis1] = RAStatus;
    if (axis == Axis2 && DERunning)
        LastRunningStatus[Axis2] = DEStatus;
 
    //DEBUGF(telescope->DBG_MOUNT, "%s() : Axis = %c", __FUNCTION__, AxisCmd[axis]);
    //dispatch_command(NotInstantAxisStop, axis, nullptr);
    //read_eqmod();
 
    if (axis == Axis1)
        motorrunning = &RARunning;
    else
        motorrunning = &DERunning;
 
    //wait.tv_sec  = 0;
    //wait.tv_nsec = 100000000; // 100ms
    //ReadMotorStatus(axis);
    //while (*motorrunning)
    //{
    //    nanosleep(&wait, nullptr);
    //    ReadMotorStatus(axis);
    //}
    if (*motorrunning)
    {
        DEBUGF(telescope->DBG_MOUNT, "%s() : Axis = %c", __FUNCTION__, AxisCmd[axis]);
        dispatch_command(NotInstantAxisStop, axis, nullptr);
        wait.tv_sec  = 0;
        wait.tv_nsec = 100000000; // 100ms
        ReadMotorStatus(axis);
        while (*motorrunning)
        {
            nanosleep(&wait, nullptr);
            ReadMotorStatus(axis);
        }
    }
}
Last edit: 1 year 7 months ago by Yi.
1 year 7 months ago #85868

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

  • Posts: 421
  • Thank you received: 102
Well that's disappointing. It is definitely working a lot better for me with this change, although I could only test during the day. It is now raining outside.

A log with timestamps would probably help. Thanks!
1 year 7 months ago #85871

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

  • Posts: 421
  • Thank you received: 102
I'm able to replicate the problem even with my fix, by rapidly double and triple clicking the direction buttons. So far the only reliable fix has been to add a delay after every command. I'll keep investigating...
1 year 7 months ago #85887

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

  • Posts: 9
  • Thank you received: 0
I used my socat hack today to record what happens during a problematic slew. The full log is attached but here is what's most relevant:
## this is probably in response to the second, spurious slew command
[14:10:10.650601] :f1.                  [14:10:10.651333] =101.
[14:10:10.651754] :G130.                [14:10:10.652651] =.
[14:10:10.652836] :f1.                  [14:10:10.653530] =501.
[14:10:10.653844] :I1BA0000.            [14:10:10.655067] =.
[14:10:10.655282] :J1.                  [14:10:10.656078] =.
[14:10:10.656259] :f1.                  [14:10:10.656958] =501.
[14:10:11.650969] :j1.                  [14:10:11.652099] =08387D.
[14:10:11.652672] :j2.                  [14:10:11.653672] =97BE7B.
[14:10:11.654226] :f1.                  [14:10:11.654882] =101.
[14:10:11.655379] :f2.                  [14:10:11.655995] =101.
[14:10:12.658263] :j1.                  [14:10:12.659286] =A54D7E.
[14:10:12.660084] :j2.                  [14:10:12.661261] =97BE7B.
[14:10:12.661986] :f1.                  [14:10:12.662842] =101.
 
## this is probably when I turned off the mount power
[14:10:12.663561] :f2.                  [14:10:12.664345] =101.............8...l.............
[14:10:13.666533] :j1.                  [14:10:13.667306] j.

First column is what sent to the mount, second column is what the mount responded. Timestamps are in square brackets. This is what happened after the mount had come to a complete stop, and started to handle the second spurious slew command. Notice that, after the J1 command is sent, the motor status as reported by the mount is "motor stopped" (:f1 -> =501. and :f1 -> =101.). But if you look at the axis position queries (j1 commands), you can see that the axis was indeed moving (from 0x08387D to 0xA54D7E before I shut the mount off).

Another thing I noticed is that the second K1 was never sent. This is probably because of the new
if(*motorrunning)
code you introduced last night. Since f1 never responded that the motor was running, *motorrunning was probably never true, hence the if block was never executed.

I got the sense that it is whatever action before the J1 command that was causing the mount control board to be in an undefined state... I'll keep playing with this and report back if I find anything.
Last edit: 1 year 7 months ago by Yi.
1 year 7 months ago #85893
Attachments:

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

  • Posts: 9
  • Thank you received: 0
Also, just another observation: even with the global delay, the slewing problem is definitely better but not completely gone. I experimented with the mount quite extensively today. Turns out, even with the global delay, I'm seeing the mount go out of control in about one in 4 to 5 manual slews.
1 year 7 months ago #85896

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

  • Posts: 421
  • Thank you received: 102
Well, removing all my changes, and just adding a small delay after the StartMotor command, in the SlewDE and SlewRA methods, improves stability without impacting guiding.

However, there's something wrong with the mount control dialog in Ekos I think. It seems to be missing some key presses, resulting in occasional runaway behavior. The logs show the driver is receiving a start command from ekos, but no corresponding stop command (sometimes). I also see sometimes multiple stop commands in a row, with no corresponding start command. So something is definitely wrong there.

I think this might run deeper than the amount of time I have right now to dedicate to tracking this down.

May I suggest not using manual slewing for now? :D
Last edit: 1 year 7 months ago by Kevin Ross.
1 year 7 months ago #85897

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

  • Posts: 9
  • Thank you received: 0
Of course!! Thank you so much for your help so far. This is really helpful. I'm also more familiar with the indi-eqmod code base now that I can keep tweaking it if I have time. I have mostly got rid of my manual slew needs. About the only time it's necessary is occasionally the mount would wrongfully believe it is pointed below the horizon, therefore refusing to turn on tracking, which in turn prevent the alignment module from syncing to plate solving solutions. But I can slew from my desktop. It looks like it's my iPad setup that is causing the spurious second slew which is really the cause of the problem.

Thank you again! I wish there is a way I can send you a beer :)
1 year 7 months ago #85899

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

Time to create page: 5.931 seconds