Regarding GRBL

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #565 Quote

    Hi ,

    I am a graduate student and we are working on the THOR project. We have few difficulties which we thought you might be able to help us out with. ;

    We’re not quite sure about how to utilize the code that is supplied under the “grbl” file. How would we upload it onto the Arduino (we have a Mega) and edit it? We read the instructions and the wiki but it is still not clear to us.

    We’re excited to get the robot assembled and running! Any help will be greatly appreciated! Thank you for taking the time to respond to all our questions.

    Regards,
    Pratik Chaudhari</blockquote

    #1117 Quote
    Angel LM
    Admin

    Hi Pratik!

    If you want to use the same firmware I’m using you have to compile the firmware first. How to do it:

    And then you have to upload the .hex file into your Arduino Mega. How to do it:

    That’s it!

    If you want to modify the code, first modify it using your favorite text editor then compile it and then upload it to the board 😉

    Hope it helps!

    Angel LM

    #1119 Quote

    I’m also writing here in case anyone else has a similar question. Getting the grbl on the Arduino was easy following those steps, so thank you. So what happens after that? How do we get the motors to move? I downloaded the Universal GCode sender and ran the test.gcode that is included in the grbl file you supplied but nothing really happened. Should the motors be moving when we press the X+ or X- buttons for example?
    Sorry to keep bothering you with simple questions, but once we pass that hurdle, we should be able to put everything together! So close!

    #1121 Quote
    Angel LM
    Admin

    Hi Burcu!

    I wrote this new page (GRBL & Gcode Control) at Thor’s wiki where is explained how to use the Gcodes to control the Thor motors!
    Do not hesitate on asking if you have more questions! 😉

    Angel LM

    #1123 Quote

    Hi ;Ángel,
    Thank you for that page, it is very helpful. For some reason, we can only move one motor on the X axis. When we first connected it, we could also run two other motors on the Y axis and Z axis but now they are not moving at all (no errors on the gcode side). We had tested all motors before so that is not the problem. We’re still trying to see if there are any faults in the connections but it doesn’t seem like it. Also when the test code is run, only one motor moves.
    Any idea what the problem might be?

    #1125 Quote
    Angel LM
    Admin

    Hi Burcu,

    I don’t get your problem 🙁
    Have you connected the motors following this diagram?
    Are you using the Universal GCode Sender?
    The “Active State” is not “Alarm” (highlighted in red) right?

    By the way, I’m not sure that the Test.gcode works, I’ll check it ASAP

    Let’s find out the issue 😛

    #1127 Quote

    Everything is connected according to that diagram. We are using Universal GCode Sender. Active State lights up green and says “run” when I send a command and is idle otherwise. It also says “ok” after every command but the only movement it does is the X+ and X- (both by manual entry and through the ‘machine control’ screen). We’ve checked the connections multiple times and it seems correct. ;
    Also, writing this in case anyone else has a similar problem and ends up reading this, one of the motors we received actually had different colorings for the wires (instead of black-green it was paired black-red). All motors have been tested for continuity.
    And when we run the test, we also only see some movement on the X+/-. According to the code, all motors should run after one another while the test is running but it isn’t happening.

    #1129 Quote
    Angel LM
    Admin

    Let’s try it without the test.gcode that I’m not sure that works hahaha

    If you send a gcode like this one:

    G0 A10 B10 C10 D10 X10 Y10 Z10

    All the motors move together? Everyone moves?

    The following gcode should move the motors to the initial position

    G0 A0 B0 C0 D0 X0 Y0 Z0

    #1131 Quote
    Angel LM
    Admin

    I missed an important thing, related to GRBL, the $$ parameters should be configured.

    Here are my current settings. You can check what these parameters mean in this post of the original GRBL wiki.

    Hope it helps!

    #1133 Quote

    Only one motor had been moving. Right now I am updating $$ parameters. I will write when I’m done with that and try again.

    #1135 Quote

    Nope, same problem. Only X moves and that is also kind of jerky. Definitely not smooth. Not sure how to identify and fix the problem 🙁

    #1137 Quote
    Angel LM
    Admin
    Hmmm… That’s strange

    What kind of drivers are you using? A4988? I’m thinking that could be a driver issue. Are they well tuned?

    Try to replace the driver of the 5th motor (“X axis”) for the one of the 1st motor (“A axis”) and try again the previous gcodes.

    Let’s see if the A motor moves!
    #1139 Quote

    Hey Angel!
    So the robot is assembled and the motors are working for the most part. However, I am not quite sure how to move it to a position that I want. I think that ;every time I reopen the connection it assumes that the angle at that moment is 0 for every axis, is that true? How do we define a home position that it can go to for starting it every time or is that not possible? Could you send/share an example gcode that you know works well? Right now we are sending a single command at a time, and sometimes it works and sometimes it doesn’t (probably because of the assumed position).
    Any help would be greatly appreciated.

    #1141 Quote
    Angel LM
    Admin

    Hi Burcu!

    I’m happy to know that the motors are working now, what was the problem?

    Regarding the home position question, do you have any position sensor in your Thor? In my case (the current design in my repository), Thor has 5 sensors (on the 5 first articulations) to set the home position when the board is connected (or the $h command is sent).

    If yours have not sensors this would the sequence:

    • When the Arduino Mega is connected to the PC it assumes that the current position is the home position (A=0º, B=0º, C=0º… and so on)
    • When the connection is established between the Arduino Mega and the GCode sender program, the current position is set as home position (A=0º, B=0º, C=0º… and so on) <- This happens everytime you close and open the serial connection
    • When the connection is established and you send a GCode the motors will move considering the home position.

    If it has sensors this would the sequence:

    • When the
      Arduino Mega is connected to the PC the robot will start the home sequence, moving its articulations until them reach the home position (A=0º, B=0º, C=0º… and so on)
    • When the
      connection is established between the Arduino Mega and the GCode sender
      program, the robot will start the home sequence, moving its articulations until
      them reach the home position (A=0º, B=0º, C=0º… and so on) <- This happens everytime you close and open the
      serial connection
    • When the connection is established and you send a GCode the motors will move considering the home position.

    In both cases, sending a single command should work…

    Can you share the GCode you are trying to send? I’ll try to replicate the issue.

    Just in case, there are a GCode command that switches between Absolute Positioning and Relative Positioning that may be the cause of that problem.

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