Welcome to Our Community

Some features disabled for guests. Register Today.

Arduino Mega GRBL - Stepper motor run on it's own

Discussion in 'CNC Mills/Routers' started by Fredzki, Jan 27, 2019.

Tags:
  1. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    Hey
    I have a strange problem. I'm in the middle of building my own CNC, controlled by an Arduino mega 2570 running GRBL version: gnea/grbl-Mega
    I have connected the Arduino mega 2560 to the stepper drives as shown here: Imgur

    If I just connect one stepper motor to this setup I can control it as I should be able to.
    There is a bit of chatter from it, and it doesn't move smoothly, but I think that comes down to finetuning of the stepper perimeters.
    When I connect a second stepper motor the first one just start spinning fast.
    I have tried with different stepper motors and every combination of the stepper drivers.
    What could be causing this?
    I'm at a lost right now...
    Thank you in advance!
     
  2. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Not sure I like logic ground being connected to power ground on that schematic. It's not necessarily bad, but creating loops that don't need to be created has never seemed sensible to me. You can also connect logic ground to ENA-, btw. Assuming you're gonna use Stepper Enable out on the Mega so you don't keep your motors constantly powered.

    One motor spinning all by itself without any USB input to the Arduino? That seems... Impossible?! There's no reason for the board to be defaulting to sending a high frequency square wave on any pin, let alone that particular one. Something sounds off. Some kind of EM interference, maybe?

    Have you got pictures of your specific electronic setup?
     
  3. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    It might be EM interference, currently, I'm not thinking that I need the use of enabling the stepper motors. I have leadscrews on all axis, and won't is able to move it by hand anyway.
    I have built the whole ordeal into a pc tower using the pc to control the input to the Arduino.
    The white wire coming from the PC PSU is 230VAC not shielded. All the wires from the stepper drivers to the stepper motors are shielded.
    The wires from the Arduino to the stepper drivers are nonshielded but they shouldn't be close enough to the 230VAC to be interfered with.
    Imgur
    Imgur
    Imgur
    Imgur

    Can't get pictures to show in this thread.
     
  4. GrayUK

    GrayUK Openbuilds Team Elder
    Staff Member Moderator Builder

    Joined:
    May 5, 2014
    Messages:
    1,668
    Likes Received:
    627
    So, if I am seeing this correctly, you have all the CNC electronics in the same case as the working Computer electronics?
    I've not considered this as a viable method in the past, and I would not be comfortable doing so, if only from a temperature point of view. That's a big old graphics card you have in there.
    I really don't know if this could lead to EM interference or any other element of this sort.
    I personally wouldn't combine the two systems that close, but as I say, maybe it is no problem at all.
    However, my usual M.O. is to build an electronics table-top set-up. Put tape on the steppers and make sure everything works correctly, before, installing into a unit.
     
  5. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    Yes, everything has been crammed into the pc case. It shouldn't overheat, I have added more cooling fans, but of course, I can't be sure of that.
    I usually build it up on a table but had too much confidence in my self this time... Guess that was misplaced.
    I will try to take it all out and build it up outside the pc case and try that. Maybe it will work.
    That's gonna take some time, but I will post my success or lack thereof when I'm done.
     
    GrayUK likes this.
  6. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Yeah, I'm kinda dubious about that setup. There's a reason PC chassis are still big ol' hunks of sheet steel with separate compartments all over the place. I'd definitely either nuke or shield that random mains cable running through there (more for the sake of the motherboard than the CNC gear), and yeah, absolutely +1 to getting it running on a bench first. I wanna see something like this:

    [​IMG]

    Just a big ol' mess of wires on a tabletop. Once it's figured out there, it should be easy to build into an enclosure (a separate one!). Even if you wanna build the PC into the CNC enclosure, I'd have a separate location for the steppers, power supplies, all that good stuff. Mine currently looks like this:

    Photo Jan 27, 11 09 58.jpg

    Not that you need to make a custom case for it, a 12x12x5" or thereabouts steel electrical box will work just fine! I just wanted to do that for my own practice (evidently, I need more).
     
  7. Gary Caruso

    Gary Caruso OpenBuilds Volunteer
    Staff Member Moderator Builder

    Joined:
    May 19, 2016
    Messages:
    1,193
    Likes Received:
    532
    I agree with Rob, run the Neg from the arduino to the negative signals (pul and dir) instead of using the power neg on the drivers.
    cheers
    Gary
     
  8. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    I have just pulled the whole thing out of the pc case, not including the PSU(too hard to get out without a lot of rewiring).
    It now works flawlessly.
    I can see that the big takeaway from this is to make it in a separate box...
    It would just have been much nicer with it all in the same enclosure... guess that was too much to ask for.
    It's probably some kind of EM interference.
    Wouldn't want my new CNC crashing when I use it just because I want it nice and neat...
    What have you used for a good enclosure for your CNC controller and drivers?
    Don't want mains wiring running freely when it's done.
    It's just annoying as hell when I have sunk a lot of time into this.
     
  9. Gary Caruso

    Gary Caruso OpenBuilds Volunteer
    Staff Member Moderator Builder

    Joined:
    May 19, 2016
    Messages:
    1,193
    Likes Received:
    532
    I'm using a nema4 electrical box made of steel, but before I "acquired" that I was going to use an old gutted pc case, without the pc in it.
    Regarding EM noise..work on your shielding and grounding!
    Something like this would work, but there are cheaper options..
    nema4
     
  10. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    Everything it's only that one white 230VAC wire is shielded.
    I have tried moving it closer to the electronics and that doesn't change a thing when its outside the pc.
    I have grounded everything possible, so it might just be that it's too cramped together.
     
  11. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Yep, a steel case with the entire case tied to ground is the way to go, for sure.

    You can also see that internally I have almost no mains wiring showing to the Arduino on my board; the bridge that the 12V power supply is sitting on also serves as an EM shield for the mains wires going into it and the 24V power supply to protect that bare Arduino. The only AC it'll see is from the tiny loop that comes up and out the back of the bridge to fork-connect into the mains terminal block there that splits the power into the two PSUs, which I may cover in a grounded wire coil or woven sheath as well. The whole thing is grounded via the two PSU cases, which ground the aluminum mounting plate, which grounds the enclosure via the standoffs (the little lathe-turned aluminum cylinder you see in the back of the case there). So any stray external RF or internal inductive coupling should be pretty heavily damped.
     
  12. GrayUK

    GrayUK Openbuilds Team Elder
    Staff Member Moderator Builder

    Joined:
    May 5, 2014
    Messages:
    1,668
    Likes Received:
    627
    Why not get yourself another used PC case, they're as cheap as chips, and build it in there? :rolleyes:
     
  13. Fredzki

    Fredzki New
    Builder

    Joined:
    Jan 27, 2019
    Messages:
    6
    Likes Received:
    1
    Thanks for the suggestions!
    I have found out that it was because I had connected the shielding from the wires in both ends.
    They were connected to both the PC case and the CNC, that made a ground loop which basically made it into a big antenna...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice