Welcome to Our Community

Some features disabled for guests. Register Today.

Ask Grbl CNC questions here.

Discussion in 'Control Software' started by Sonny Jeon, Aug 12, 2015.

  1. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    You can also try disabling PWM by commenting out the VARIABLE_SPINDLE line in config.h and recompiling. This will swap the spindle enable pin from D11 to D12. Z-limit is swapped from D12 to D11. When you disable PWM, Grbl will no longer require a spindle speed S word to turn it on since it's no longer used.
     
    Mark Carew and HPB like this.
  2. killer.naccarato

    Builder

    Joined:
    Apr 3, 2014
    Messages:
    4
    Likes Received:
    0
    update. still no fixes. but I disassembled the gantry and tore all the wheels apart for a full lube reassembled and tested wheels for friction. tight but able to spin with two fingers and a tiny bit of force. I tried the cut on a program that I can easily use ( sketchup) and found the same problem. that being said I did the distance travel test again and found to be fairly accurate so I tested it in different locations of the machine. IE. top left, top right, bottom left, bottom right and found the values to be different at every location. im thinking it could be a squaring issues, friction of some sort, or even backlash. if you have any ideas. the help would be much appreciated. ps. I have been working on this machine for quite sometime now. I have built it slowly over a couple years and would love for this hell to finally be over for the possibilities are endless but at this rate I will probably give up before im able to do what I want with it.
     
  3. Travis Hamilton

    Builder

    Joined:
    Dec 15, 2016
    Messages:
    27
    Likes Received:
    4
    Hey guys i just started using grbl 1.1 for a plasma cutter my problem is my feed speeds are slow and i can't seem to change them if i change steps per mm it moves good but when i change them so it goes the right distance it just goes slow and will not change speed at all i am using kl 4030 drivers and 8 wire 425oz motors wired in parallel. Is there a setting i need to change? I am really stumped here.
     
  4. HPB

    HPB Well-Known
    Builder

    Joined:
    Nov 28, 2015
    Messages:
    80
    Likes Received:
    52
    Steps per mm are to be set once and then not tampered with again unless you change motor resolution settings or make some hardware changes such as use a different belt or pulley, etc. you can change the feed rate in your Gcode. For e.g. G1 X100 F1000 will move the X axis motor 100mm at a feed rate of 1000mm/min. For a different feed rate simply alter this F value. Note that feed rate values apply only to G1 moves.
     
  5. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Grbl also has a lower step frequency limit due to the resolution of the 16-bit timer. For a 40step/mm axis, this translates to a 20mm/min, if I remember right. If you need slower, disable the ADAPTIVE_STEP_SMOOTHING option in config.h and recompile/upload. You can get well below 1mm/min without it.
     
  6. Travis Hamilton

    Builder

    Joined:
    Dec 15, 2016
    Messages:
    27
    Likes Received:
    4
    Thanks for the responses. Sonny my problem is it won't move fast enough if i change the feed rate to jog in ugs the speed does not change if i run a file it is the same speed even if i change the F commands in the file i will try a manual G1 code later and see what happens.
     
  7. Travis Hamilton

    Builder

    Joined:
    Dec 15, 2016
    Messages:
    27
    Likes Received:
    4
    Ok so i tryed the G1 code and i did get it to move faster i guess i was thinking inches per min instead of mm because the number increases have to be alot bigger to notice the difference. Can i change it to inches per min or should i just convert. Also was wondering wjat i need to change to use spindle enable to fire plasma torch i will use a relay for it so just need 5v to trigger relay. I read somewhere that a line of code needs to be changed fpr this but i am not sure. I would like to have torch come down make a switch then lift a certain distance fire torch then move down a bit and start the cut is this possible?
     
  8. DaveH24

    DaveH24 New
    Builder

    Joined:
    Feb 19, 2017
    Messages:
    17
    Likes Received:
    1
    Travis,
    I'm not sure if you're aware but there are configuration speed limits as well , this one also had me fooled for a while .
    Obviously , as Sonny has pointed out , you cannot exceed maximum capabilities of grbl , but these would stop you getting anywhere near those anyway.

    Grbl v1.1 Configuration · gnea/grbl Wiki · GitHub

    Regards
    Dave
     
  9. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    The default Grbl build uses variable PWM with voltage indicating RPM, so you will need to specify the 'S' word with the max rpm (your $31 setting) along with an M3 spindle enable command. Or you can disable the variable PWM by commenting out the VARIABLE_SPINDLE line in config.h. This will ignore any S spindle speed word, just require an M3 to enable to 5v, and will swap the digital pins from D11 to D12 (Z-limit goes from D12 to D11). The former option is easier if you already have everything wired up.
     
  10. Travis Hamilton

    Builder

    Joined:
    Dec 15, 2016
    Messages:
    27
    Likes Received:
    4
    Ok so i think i have got all this figured out now as long as i set spindle speed to max it should make the relay go, and Dave i think you are referring to the max speed in the grbl settings. Which i did know about but i have to reset pretty high because if i remember right 500 inches per min is like 12700 mm per min so default is way low. Thanks again guys i am sure i will be calling on you again before this thing is running lol.
     
  11. Foggy

    Foggy New
    Builder

    Joined:
    Jun 22, 2015
    Messages:
    8
    Likes Received:
    0
    Can anyone help me?

    I am trying to create a box joint jig. This is just basically just an X axis.

    What I need to do is to have the axis move / be controlled as follows.
    Move x then stop
    Wait for resume button to be pressed
    Move x then stop
    Wait for resume button to be pressed
    Continue next command.

    I have created a *.txt file as follows for testing.
    G19 X25
    !
    G19 X25

    However it does not stop at the ! and just carries on to the end.
    I only want it to action the next command on a button press.

    Any comments would be appreciated.

    Best wishes.
     
  12. Foggy

    Foggy New
    Builder

    Joined:
    Jun 22, 2015
    Messages:
    8
    Likes Received:
    0
    I think I found the answer.

    Replace the ~ with code M00 (Program stop).

    Best wishes.
     
  13. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    You could try M30, that is rewind to beginning and reset modes.

    Also, I would think you should use G01, or G00 for fast move, and not G19. Make sure you initialize to Relative Mode for movement.

    G01 X25
    G30

    Then just use your Run button. Or, you could just enter the first line in the manual g-code box on your G-Code Sender program and just execute it manually each time.

    MG
     
  14. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    I agree with using G1 or G0, but I disagree about using M30. He's trying to pause the program so he can perform the box joint cut and then hit resume to move the jig to next position of the program and pause for the next cut. The M0 'program pause' command is often used for this type of operation and seems to be a perfect solution for this case. An M30 'program end' would make it unnecessarily more complicated by reseting any g-code modes that may have been set at the start of the program.
     
  15. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Hi sonny:

    I somewhat agree, Sonny, but his program essentially only contains one line. With a box joint jig, you cut a slot, move the work over one position, cut the next slot, etc. The command is exactly the same every time. If you put your setup conditions at the top of the program, and use M30, it would just reset them and set them again. Otherwise, if he used the pause command, he would have to put in several iterations of:

    G01 X25
    M0
    G01 X25
    M0
    G01 X25
    M0
    etc for as many slots as you need

    This is kind of klunky, and a new program would have to be written for each set of box joints. Using M30, you would have one program to rule them all.:) It would be nice if you could use subroutines, doe GRBL support them?

    MG
     
  16. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    True, but that's assuming you are cutting box joints with equal spacing. I've actually recently looked into making one of these with Grbl. The advantage is you can use a single saw blade of any kerf size to make any sized box joint with multiple passes. You can also do variable size box joints or a "green and green" style joint with only two fingers on the ends. It would be better to create a full g-code program for this type of job, which can be done with a simple script.

    No Grbl will not support subroutines any time soon, if at all. To support it, it'll require access to the full g-code program so it can jump back in a program for loops. I've found that modern programming languages do a much better job of generating simple g-code program. For example, Python is easy to pick up by anyone and has much more powerful libraries to enable more complicated math, functions, preview plotting, etc. So, there isn't much of an incentive to add subroutines.
     
  17. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Yes, I agree with you wholeheartedly. It was a simple answer for a simple question. I really like the idea of a fully programmable box joint cutter that would not require a bunch of setup, like putting in a dado blade with spacers, etc. Something that would just do a single saw blade kerf multiple times to get the slots would be great. You just gave me an idea for a new research project!

    And, I fully understand about subroutines. This would better be handled by the G-Code Sender program, like UGS or GRBL Panel than GRBL itself. Hope you are watching guys!

    MG
     
  18. Foggy

    Foggy New
    Builder

    Joined:
    Jun 22, 2015
    Messages:
    8
    Likes Received:
    0
    Thank you both for your thoughts.
    Sonny. You picked up exactly on what I was trying to do. I did not realise that you could use Python. Just started to google and found an article that you wrote.
    Grbl: A Simple Python Interface
    I am definitely not a programmer, but it looks like a good start for me to google further.
    If you ever decide to look further at producing a script. I would definitely find a use for it.

    Once again. Thank you.

    Best wishes.
     
  19. Rego

    Rego New
    Builder

    Joined:
    Apr 11, 2017
    Messages:
    1
    Likes Received:
    1
    Hi Sonny i have a problem I use robbitin's grbl for servo it works fine but The circuit I'm trying to print on Plotter is made from hpxx2 .nc file Z and Z-1 tool up tool down doesn't move it needs M03 M05 commands to work any suggestions Mark told me to use a post processor i'm a newbie don't how to install that i use windows 7 for all my stuff command line stuff not so good at just wondering grbl mod.ps i'm not using a grbl shield suppose to work without it pin 11 from arduino works fine for servo just does'nt understand Z grbl command nc file
     
  20. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Sorry. I can only help with the mainstream Grbl, not forks with significant modifications, because I don't know what they modified and how.
     
  21. Gregg Carlson

    Builder

    Joined:
    Apr 24, 2017
    Messages:
    8
    Likes Received:
    0
    Hi Sonny,

    I am looking for the simplest method (commands and pins) to set two general purpose outputs on and off - e.g., relay 1 and relay 2. Don't care about PWM, don't want motion to stop, or any other complexity or timing issue. A third output would also be useful. I'll use Xs, Ys, Zs, Xd, Yd, Zd - so any other pins, maps, or modes (laser?) would be game. V1.1 of course.

    Thanks, Gregg
     
  22. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    You can easily control three relays without affecting motion or pwm with a few compile time options. However If you control your router / spindle manually the simplest method to control two relays would be to use the following defaults.
    Pin A3 (M8=on M9=off) -flood coolant
    Pin 11 (M3 S1000=on M5=off) -spindle enable

    Enabling compile time option #define ENABLE_M7 ( mist coolant ) will let you use the last available Pin A4 to get you a third pin to control a external relay.
    Pin A4 (M7=on M9=off)

    *I think I am one of only a few that actually use the above m7 option lol

    That does not mess with motion or pwm or any thing else. If you want to use the M3 ( spindle enable ) command separate from pwm you can move it to Pin 13 with the following compile time option. #define USE_SPINDLE_DIR_AS_ENABLE_PIN Pin 11 would remain pwm output and would still use S commands.
    Pin 13 (M3=on M5=off)
     
    #562 Kyo, Apr 24, 2017
    Last edited: Apr 24, 2017
  23. Gregg Carlson

    Builder

    Joined:
    Apr 24, 2017
    Messages:
    8
    Likes Received:
    0
    Thanks Sonny,

    Pin A3 and Pin11 both work great. Probably won't use PWM.

    Also got Pin A4 to work with that change - awesome! Thanks!!!

    Gregg
     
    #563 Gregg Carlson, Apr 25, 2017
    Last edited: Apr 25, 2017
  24. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    I shall take that as a compliment :D ( I am not Sonny lol ) I just happened to be logged in when you posted and have my boards set up to control three relays myself ( shop vac/dust shoe , coolant, spindle ) Glad to hear you got everything up and running..
     
  25. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,458
    Likes Received:
    1,915
    You are in luck. Just three weeks ago I was playing with a Gcode generator to run a box joint jig.
    So here it sees the first light of public day.....
    It is a python script for Python3 Download Python
    so you need to install that (and add it to your path, an option in the install)
    Just put my (unzipped) file on your desktop and a double click should open up this dialog....
    upload_2017-4-26_9-7-34.png

    NOTE that note about X+ direction! This makes sense on a saw, X+ moves the THE BLADE LEFT into the work (ie moves the stock right).
    I know this is kinda reverse of standard CNC machine setup, but it makes the Gcode easy to understand and generate, and makes sense on a table saw with the stock to the left of the blade..

    This program creates 2 different Gcode programs. For equal gap and pin widths you may only need one, but for unequal sizes you do need to run 2 different programs.
    With this you can do any gap and pin width that is greater than the blade width.

    This is version 0.001 of the program which I threw together as an exercise in learning python, so you are the alpha tester as I have not yet built my box jig, though I have run the generated code through GRBL 1.1.
    So, please let me know if it works, and in particular of the single sided glue allowance offset works. It may need to be applied to both sides of the gaps to achieve smooth fits.

    How to use it?
    1 - the first time you run it, click Edit|NC Directory and select the folder here you want to save the Gcode files. This gets remembered in an .ini file so you only have to do it once
    2 - Set the parameters
    3 - Click 'Write to files' which will ask for a name. That name is used as the basis for 2 output files.
    So if you enter 'boxy' it generates 2 files
    boxy-GAP.nc
    boxy-PIN.nc

    oh, just had an idea.... maybe one of those python stream scripts could be built into this to drive the jig directly.... hmmmm, have to think about this.... the problem is setting 0... could be done by hand and then power on, or could use another GUI to set up, close that, then use this to stream. what do you all think? I don't want to build in jogging and zeroing and so on, trying to KISS.

    Have fun
    PS: for LinuxCNC users, this will integrate with Axis. If it runs within Axis there will be a button for transferring the Gcode directly into the controller.
     

    Attached Files:

  26. Gregg Carlson

    Builder

    Joined:
    Apr 24, 2017
    Messages:
    8
    Likes Received:
    0
    Haha - thanks Kyo!!

     
  27. Gregg Carlson

    Builder

    Joined:
    Apr 24, 2017
    Messages:
    8
    Likes Received:
    0
    Is there a method to recover after a "!", other than a continue "~"?

    Options I'd like would be go home (x0y0z0), but it seems like your have to wipe the buffer first?

    I'm also trying to find out how to send a "cntrl-X" from VB6...?
     
  28. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Depends on what you mean by recover. If you mean resume, '~' is the correct method. To cancel a job and clear buffers, `ctrl-x` is the right thing to do. As long as the machine has completed the feed hold and is not in motion, it shouldn't throw an alarm. It will however reset g-code modal state and wipe any G92 and G43.1 offsets.
     
  29. Gregg Carlson

    Builder

    Joined:
    Apr 24, 2017
    Messages:
    8
    Likes Received:
    0
    Thanks. I'd like to go home - x0y0z0 - while abandoning the buffer (i.e. start over from home position). If I send cntrl-x, I'd guess the position would be lost, so a subsequent x0y0z0 wouldn't work (?) Or, while in pause, might it accept a jog "$j=0x0y0z0"? I suppose I could note the position, cntrl-x, then send it home in a reverse direction, cntrl-x again...?
     
  30. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Position is not lost, if the machine is properly reset. Only offsets are reset to defaults, which are cleared to zeros. You may want to operate in machine coordinates by using the G53 command after a reset or ensure the work coordinate system is set to what you want it to be. It defaults back to G54.
     

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