×

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

Bi-monthly release with minor bug fixes and improvements

Slew complete problem

  • Posts: 9
  • Thank you received: 2
Hi,

I have a problem with a telescope driver I have written. While most things work as expected there is a problem when the Ekos Planer/Scheduler issues a slew command. The slew is executed but the Ekos Scheduler immediately says "Job 'NGC1746' slew is complete" and starts the focus routine while the telescope is still slewing. So I guess I am missing something within my driver to tell Ekos that the slew has not finished yet.
Below is the code of my Goto method.
What am I missing?
Any help is highly appreciated.

bool RasPiMCDriver::Goto(double ra, double dec)
{
    LOG_INFO("Goto called");
 
    string url = baseUrl;
    url = url + "?cmd=GotoRaDec&ra=" + to_string(ra * DEGREE_PER_HOUR) + "&de=" + to_string(dec);
 
    // Mark state as slewing
    TrackState = SCOPE_SLEWING;
    //LOG_INFO(url.c_str());
 
    // Send slew command to telescope
    string resp = HttpGet(url);
 
    // Mark state as slewing
    TrackState = SCOPE_SLEWING;
    EqNP.s = IPS_BUSY;
 
    // Wait until the mount system status changes to SLEWING
    // up to 3000ms
    for (int i = 0; i < 15; i++)
    {
        if (isSlewing())
            break;
        std::this_thread::sleep_for(std::chrono::milliseconds(200));
    }
 
    //LOG_INFO(resp.c_str());
 
    return true;
}
 
bool  RasPiMCDriver::isSlewing()
{
        bool result = false;
        //LOG_INFO("isSlewing called.");
 
    	string url = baseUrl;
 
    	url = url + "?cmd=isSlewing";
 
    	string resp = HttpGet(url);
 
    	// convert to bool
    	istringstream(resp) >> std::boolalpha >> result;
        LOGF_INFO("isSlewing returned %d", result);
        if (result)
        {
        	// Mark state as slewing
        	TrackState = SCOPE_SLEWING;
                EqNP.s = IPS_BUSY;
        }
 
    	return result;
}

Best regards
Andreas
11 months 3 weeks ago #92367

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

  • Posts: 9
  • Thank you received: 2
Hi together,

my problem still exists. I did some further investigations in the logs. For whatever reason the Scheduler thinks that slewing to the target is complete even though the Goto method has not finished and the slew is far from beeing finished.
The scheduler says "Mount State changed to 3" which I believe is wrong and should be "Mount State changed to 2" but I don't know how I could fix that.
See log below.
[2023-10-24T15:58:55.525 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' altitude score is -1000 at 24/10 15:58"
[2023-10-24T15:58:55.525 CEST INFO ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' has a total score of -1000 at 24/10 15:58."
[2023-10-24T15:58:55.525 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' is selected for next observation with priority #10 and score -1000."
[2023-10-24T15:58:55.535 CEST INFO ][ org.kde.kstars.ekos.scheduler] - "Scheduler is awake. Jobs shall be started when ready..."
[2023-10-24T15:58:56.088 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] isSlewing returned false 0 "
[2023-10-24T15:58:56.093 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] ReadScopeStatus: Telescope tracking "
[2023-10-24T15:58:56.495 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking INDI Properties...
[2023-10-24T15:58:57.495 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Checking INDI properties.
[2023-10-24T15:58:57.533 CEST INFO ][ org.kde.kstars.ekos.scheduler] - Executing Job  "NGC 1746"
[2023-10-24T15:58:58.295 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] isSlewing returned false 0 "
[2023-10-24T15:58:58.295 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] ReadScopeStatus: Telescope tracking "
[2023-10-24T15:58:58.495 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Get next action...
[2023-10-24T15:58:58.495 CEST DEBG ][     org.kde.kstars.ekos.mount] - flipDelayHrs set to zero in slew, m_MFStatus= "FLIP_NONE"
[2023-10-24T15:58:58.496 CEST DEBG ][     org.kde.kstars.ekos.mount] - Slewing to RA= "05h 05m 17s" DEC= " 23° 48' 06\""
[2023-10-24T15:58:58.496 CEST DEBG ][     org.kde.kstars.ekos.mount] - Initial HA  11.6102 , flipDelayHrs  0 MFStatus  "FLIP_NONE"
[2023-10-24T15:58:58.499 CEST INFO ][     org.kde.kstars.ekos.align] - Target updated to JNow RA: "05h 05m 17s" DE: " 23° 48' 06\""
[2023-10-24T15:58:58.500 CEST DEBG ][           org.kde.kstars.indi] - ISD:Telescope sending coords RA: "05h 05m 17s" ( 5.08817 ) DE: " 23° 48' 06\"" ( 23.8018 )
[2023-10-24T15:58:58.502 CEST INFO ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' is slewing to target."
[2023-10-24T15:58:58.556 CEST INFO ][           org.kde.kstars.indi] - RasPi MC Driver :  "[INFO] Goto called RA=5.088171, DE=23.801786 "
[2023-10-24T15:58:59.496 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Mount State changed to 3
[2023-10-24T15:58:59.496 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Slewing stage...
[2023-10-24T15:58:59.496 CEST INFO ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' slew is complete."
[2023-10-24T15:59:00.602 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Get next action...
[2023-10-24T15:59:00.602 CEST DEBG ][   org.kde.kstars.ekos.capture] - Align State changed from "Idle" to "In Progress"
[2023-10-24T15:59:00.603 CEST INFO ][     org.kde.kstars.ekos.align] - "Bild wird aufgenommen ..."
[2023-10-24T15:59:00.605 CEST INFO ][ org.kde.kstars.ekos.scheduler] - "Job 'NGC 1746' is capturing and plate solving."
[2023-10-24T15:59:00.607 CEST INFO ][     org.kde.kstars.ekos.align] - Target updated to JNow RA: "05h 05m 17s" DE: " 23° 48' 06\""
[2023-10-24T15:59:00.607 CEST DEBG ][     org.kde.kstars.ekos.align] - Target Rotation updated to:  0
[2023-10-24T15:59:00.607 CEST DEBG ][ org.kde.kstars.ekos.scheduler] - Align State "In Progress"
[2023-10-24T15:59:00.653 CEST INFO ][           org.kde.kstars.indi] - CCD Simulator :  "[ERROR] 3x3 binning is not supported. "
[2023-10-24T15:59:01.572 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] isSlewing returned true 1 "
[2023-10-24T15:59:01.572 CEST DEBG ][           org.kde.kstars.indi] - RasPi MC Driver : "[DEBUG] TrackState=SCOPE_SLEWING. "
[2023-10-24T15:59:03.574 CEST INFO ][           org.kde.kstars.indi] - RasPi MC Driver :  "[INFO] Goto method finished. "
[2023-10-24T15:59:03.575 CEST DEBG ][     org.kde.kstars.ekos.mount] - Mount status changed from  "Verfolgung"  to  "Schwenken"
[2023-10-24T15:59:03.576 CEST DEBG ][     org.kde.kstars.ekos.guide] - "GPG::reset()"
[2023-10-24T15:59:03.576 CEST DEBG ][     org.kde.kstars.ekos.guide] - Resetting GPG
[2023-10-24T15:59:03.580 CEST INFO ][     org.kde.kstars.ekos.align] - "Slew detected, suspend solving..."
[2023-10-24T15:59:03.582 CEST INFO ][     org.kde.kstars.ekos.align] - "Aufnahme abgebrochen."
 

Best regards
Andreas
5 months 3 weeks ago #96690

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

  • Posts: 17
  • Thank you received: 3

Replied by John Pane on topic Slew complete problem

What mount is this? I have seen a problem like this on the LX850 mount because its High Precision Pointing involves first slewing to a star near the target, then slewing to the target.
5 months 3 weeks ago #96691

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

  • Posts: 9
  • Thank you received: 2
Hi John,

the mount controller is home built, based on a Raspberry Pi and a Arduino Due. It can be used with any equatorial mount that uses stepper motors. The problem seems to be within my INDI driver. I simply don't know why the Ekos scheduler immediately after sending the goto command thinks that the slew is complete.

I have identified where in the scheduler class the check happens where ekos thinks the slew is complete.
See below:
switch (currentJob->getStage())
    {
        case SchedulerJob::STAGE_SLEWING:
        {
            qCDebug(KSTARS_EKOS_SCHEDULER) << "Slewing stage...";
 
            if (status == ISD::Mount::MOUNT_TRACKING)
            {
                appendLogText(i18n("Job '%1' slew is complete.", currentJob->getName()));
                currentJob->setStage(SchedulerJob::STAGE_SLEW_COMPLETE);
                /* getNextAction is deferred to checkJobStage for dome support */
            }

I simply do not know why. As I set the TrackState to SCOPE_SLEWING immediately within the Goto method and the ReadScopeStatus method of my driver.

Best regards
Andreas
5 months 3 weeks ago #96695

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

Time to create page: 0.579 seconds