Stepper Motor Disable

Home Forums DIY Sand Table Stepper Motor Disable

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #835
    dfronek
    Participant

    I have the robot working for the most part but I am having trouble with the stepper motor disable pin not working correctly. On power-up of the robot, the steppers are disabled but after any movement of the motors, the enable pin remains enabled and the steppers continue to draw power. On the cnc.html webpage, the status always remains “running”. I was under the impression that there is a built-in timeout feature to disable the motors after a set period of time. Is there something in the configuration I need to change to fix that?

    #837
    HendrikV22
    Participant

    Good evening dfronek,

    I’m having similar issues… after a pattern is drawn, the ball seems to be moving in small increments over time…. which at the end result in influencing the final pattern look…. I’m trying to play with the parameters on the bot configuration but no success so far….

    Kind Regards

    #839
    HendrikV22
    Participant

    Hi dfronek,

    I still did not manage to get this solved. I tried to review the code in visual Studio but coding is not my strong point… only basic c++ (Adruino coding for me). I’m going to ask one of our programmers at work to see if they can assist with understanding the code and see why this is happening. I’m experiencing some delays as we are all working from home due to the Covid pandemic and trying to have this discussion over Zoom makes it a bit challenging.

    will keep you updated if there are any developments.

    #841
    Matt G
    Keymaster

    So there is a configuration item that sets a timeout for the steppers to disable. The json attribute is “stepDisableSecs”.

    Now if your status says it’s still running, I don’t believe the timeout would actually engage.

    I also didn’t write the firmware, and the robot motion code is pretty intense. I find it easier to trace loaded into vs code, and searching for the json attribute usage to see what actually reads that, and then what would trigger the code that uses the stepper timeout.

    My Android app monitors the number of operations in the queue to calculate the state of the bot. I believe that’s available in the status rest endpoint. You can see the path to all the endpoints I’ve interfaced with in this Android file.
    https://github.com/grammesm/SandBot-Android/blob/master/app/src/main/java/com/alwaystinkering/sandbot/data/SandBotInterface.kt

    If you monitor the “qd” attribute in the status json, you can see how many operations are queued up. If that never hits 0, I wonder if whatever pattern you are running is never ending?

    • This reply was modified 2 years, 9 months ago by Matt G.
    #886
    papabuiltit
    Participant

    Has anyone found a fix for this? I’ve tried playing with the stepDisableSecs and no luck so far. The “Qd” value is 0 while this is happening. I’m noticing that the X and Y Steps and Position values (cnc.html) are not updated as the arm moves. I seems that only the “shoulder” motor is still moving. If I unplug the motor the arm stays in place. I’m using TMC2208 drivers on my robot if it makes any difference.

    #890
    jamesr
    Participant

    I had the same issue, looked at the code and found that the service that checks for the timeout is not being called.

    Follow these steps:
    open MotionHelper.cpp
    find the MotionHelper::service() section, line 422 when did it
    add this at the end

    // Check for motor timeout
    _motorEnabler.service();

    Then it will work a charm. Good luck

    #895
    papabuiltit
    Participant

    Got it! Thanks!

    #902
    bliksem
    Participant

    Thank you, that fixed one of my issues.

    #983
    geri
    Participant

    hello i tried to add. Unfortunately it did not work.
    is it so right or did i do it wrong? lg
    // Check if stop requested
    if (_stopRequested)
    {
    if (Utils::isTimeout(millis(), _stopRequestTimeMs, MAX_TIME_BEFORE_STOP_COMPLETE_MS))
    {
    _blocksToAddTotal = 0;
    _rampGenerator.stop();
    _trinamicsController.stop();
    _motionPipeline.clear();
    pause(false);
    setCurPosActualPosition();
    _stopRequested = false;
    //Check for motor timeout
    _motorEnabler.service();
    }
    }

    #984
    HendrikV22
    Participant

    Hi geri,

    I think you need to alocate the section after the last bracket. the section of code must fall under the main function call:

    `void MotionHelper::service()
    {… …
    //Check for motor timeout
    _motorEnabler.service();
    }

    Hope it works.

    HV

    #986
    geri
    Participant

    πŸ„·πŸ„ΈπŸ™‹πŸ»β€β™‚οΈ
    it still doesn’t work maybe you can someone post the section as he inserted it here Thank you Geri

    #1006
    geri
    Participant

    Hello
    i still haven’t solved the problem one arm keeps moving when i stop
    maybe someone else has a plan to solve it
    thank you

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.