so-artn / ARTN

Arizona Robotic Telescope Network
MIT License
8 stars 4 forks source link

Parking bug #60

Open davner opened 3 years ago

davner commented 3 years ago

RTS2 Parking Bug

Context

Sometimes the telescope cannot be moved by RTS2 and the logger displays something about the telescope cannot be moved during parking

This has been documented by multiple users.

10/29/2020

I'm having a problem where the telescope doesn't want to move through rts2. It moves fine when using xephem. I've had this issue a few times in this run, but this is the first time that it happened right on start. 2020-10-29 18:00:08.729440: command end with error -4 description: telescope move blocked 2020-10-29 18:00:08.729380: telescope cannot move during parking

12/20/2020

rts2 is having problems communicating with the telescope I think I added an object to the queue, and it never moved to it. I looked at rts2mon and it is throwing errors like: “cannot move during park” “telescope move blocked” But its still stowed, and I can move it with xephem indi controls

Problem

The telescope cannot be moved by RTS2 in certain states and issues a error "telescope cannot move during parking".

Solution

I believe this is happening anytime a move is sent by RTS2 and the motion boolean value is not being configured correctly. Looking at the TCS-NG telescope driver, you can see that in the startmovefixed function, the motion value is never set to TCSNG_MOVE_CALLED...unlike the parking function and the move to RA/DEC function. This only happens when moving to an AZ/EL position, like moving to the flat field.

The motion variable is referenced numerous times in the isMoving function.

I suggest we add on line 375 of the driver

int TCSNG::startMoveFixed (double tar_az, double tar_alt)
{
    char cmd[200];

    waitMove = NAN;
    snprintf (cmd, 200, "ELAZ %lf %lf", tar_alt, tar_az);

    ngconn->command (cmd);
        tcsngmoveState->setValueInteger (TCSNG_MOVE_CALLED);
    return 0;
}

and this could fix all or part of the parking bug.

davner commented 3 years ago

This is not as simple as adding in that one line of code. It required adding in a ramp up time, modifying timeouts, and changing the logic of motion flags in our telescope driver.

We are happy with our modifications so far, however we are not closing this issue just yet.

I plan on merging the parking-bug branch into so-artn.