Home › Forums › DIY Sand Table › Stepper Motor Disable
- This topic has 11 replies, 7 voices, and was last updated 1 year, 10 months ago by geri.
-
AuthorPosts
-
July 9, 2021 at 6:43 pm #835dfronekParticipant
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?
July 9, 2021 at 7:28 pm #837HendrikV22ParticipantGood 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
July 11, 2021 at 2:52 pm #839HendrikV22ParticipantHi 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.
July 16, 2021 at 11:43 pm #841Matt GKeymasterSo 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.ktIf 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.
September 28, 2021 at 10:40 pm #886papabuiltitParticipantHas 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.
October 7, 2021 at 10:59 pm #890jamesrParticipantI 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
October 9, 2021 at 1:42 pm #895papabuiltitParticipantGot it! Thanks!
October 9, 2021 at 7:06 pm #902bliksemParticipantThank you, that fixed one of my issues.
January 12, 2022 at 6:55 pm #983geriParticipanthello 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();
}
}January 14, 2022 at 10:58 am #984HendrikV22ParticipantHi 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
January 15, 2022 at 8:39 am #986geriParticipantπ·πΈππ»ββοΈ
it still doesn’t work maybe you can someone post the section as he inserted it here Thank you GeriJune 18, 2022 at 8:03 am #1006geriParticipantHello
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 -
AuthorPosts
- You must be logged in to reply to this topic.