PDA

View Full Version : G-Code to the ShopBot Help



Timmy ShopBotter
11-07-2010, 08:54 PM
I was curious if anyone does any work with G-Codes and making them work on the shopbot. I am working with a ShopBot for my university and my goal is to get this machine running part files from NX 6.0. Unfortunately there isn't already a post processing unit for NX to the ShopBot. We tried using the post processing unit for a Haas machine and actually got it to run which seemed to be a big surprise. The dimensions were all correct on the part we modeled, however, a problem arises when we try to control the spindle and its movement speeds, jog speeds and cutting speeds. I tried looking around for ShopBot language to try and write my own post processing unit but had no luck finding anything. If anyone knows something could you please let me know.

Thanks,
Timmy

Gary Campbell
11-07-2010, 10:54 PM
Timmy...
The ShopBot will run Gcode. You will need to make sure the machine is a 4G or newer control board and uses the 3.6.XX version of SB3

There are a number of Gcode "M" commands that are supported. We run Thermwood Gcode thru the SB Link on our machine. It is however, interlaced with SB commands such as output switching, which you would need for the spindle on, etc commands. The move speeds are coded as an "F" command after each line, similar to TWD.

The "default" move and especially the jog, speeds are set from the console.

Here is a link to the supported commands: http://shopbotwiki.com/index.php?title=GCodeMain

Hope this helps

Timmy ShopBotter
11-08-2010, 12:04 PM
Thanks for getting back so quickly, what you have told me so far is helpful, but i have a few questions before i go testing this machine and breaking something. I figured i would just post some code and see if you could maybe help me make sense of it...

N0010 G40 G17 G90 G70
N0020 G91 G28 Z0.0
:0030 T01 M06
N0040 S10000 M03
N0050 G0 G90 X-.5 Y3.3469
N0060 G43 Z.5 H00
N0070 Z-.4
N0080 G1 Z-.5 F20. M08
N0090 G3 X-.25 Y3.75 I-.2 J.4031
N0100 G1 Y7.5
N0110 G2 X.5 Y8.25 I.75 J0.0
N0120 G1 X4.5
N0130 G2 X6.25 Y6.5 I0.0 J-1.75
N0140 G1 Y0.0
N0150 G2 X6. Y-.25 I-.25 J0.0
N0160 G1 X0.0
N0170 G2 X-.25 Y0.0 I0.0 J.25
N0180 G1 Y3.75
N0190 G3 X-.5 Y4.1531 I-.45 J0.0

Once again, this is for the post processor for a Haas machine, however most of it works on the ShopBot. Apparently the F Commands are supposed to control the feed speeds and they are set for 20 inches per minute (we are just cutting styrofoam right now). the problem is that the machine is cutting at a very slow speed, definitely not 20 inches per minute. Does the ShopBot support these F Commands, or should i ditch them an just stick with the M commands? Or is something typed in wrong?

Thanks for your help

srwtlc
11-08-2010, 01:45 PM
Tim,

As you may already know, the "N0010, N0020,..." are just line numbers. The first two lines are kind of machine setup parameters. G40 is cancel cutter compensation, G17 is X Y plane, G90 absolute movement, G91 incremental distance, G28 return home. I don't know for sure what ones Shopbot reads or ignores, but it will likely give a warning if there's a bad command.

The ":0030" is not one that it reads. It appears that it should be an N instead. Following that is T01 for tool 1 and M06 is a tool change by macro (likely ignored). The S10000 is the spindle rpm setting and that works if you have a spindle and speed controller. M03 is spindle start clockwise and that works for starting the spindle and M05 should turn it off. G43 and HH have to do with tool length offset (don't know if it works, but likely not). F20 is the move/cut speed but in inches/min and ShopBot runs in inches/sec so F20 will be translated to 0.33 inches/sec (something like F120 or more would be more like it depending on what machine you have and what you're cutting). M08 is coolant on (not needed). G0 is jog, G1 is move/cut, G2/3 are arcs. I apologize if you already know your Gcode.

If you narrow it down to this, it runs without error for me.

N0040 S12000 M03
N0050 G0 G90 X-.5 Y3.3469
N0070 Z-.4
N0080 G1 Z-.5 F120
N0090 G3 X-.25 Y3.75 I-.2 J.4031
N0100 G1 Y7.5
N0110 G2 X.5 Y8.25 I.75 J0.0
N0120 G1 X4.5
N0130 G2 X6.25 Y6.5 I0.0 J-1.75
N0140 G1 Y0.0
N0150 G2 X6. Y-.25 I-.25 J0.0
N0160 G1 X0.0
N0170 G2 X-.25 Y0.0 I0.0 J.25
N0180 G1 Y3.75
N0190 G3 X-.5 Y4.1531 I-.45 J0.0
M05
END

You could manually add in (or edit the post processor to do it if you can) a MS, xyspeed,zspeed (like MS,3,1. That way you can control both x and y feedrate and z feedrate separately) and JH for jog home. Look at the programming handbook for what you could mix in with the Gcode.

Like Gary said though, you need to have the right controller/control software versions for Gcode to be read/executed properly.

Scott

Timmy ShopBotter
11-09-2010, 01:27 AM
Scott, What you have told me is VERY helpful. Not gonna lie, i was trying to sound like i knew something about G-Code in the e-mail in hopes of actually making sense to someone. Apparently it worked! at least what you sent to me made sense. And that thing with the spindle speed being inches per second was probably a life saver. The code i posted was only a fragment of the entire code we had drawn up, but i figured the problem was somewhere in there after looking at what Gary had commented back with. This is awesome though. Hopefully we can get something up and running here in these next few days. Other than adjusting the move and Jog rates, is there anything else that comes to mind that alters from typical G-Code to sbp. format? I'm more so just focusing on things like the move speeds being different, like in inch/sec in stead of inch/min. Do you know if it will screw with radii of holes or rounded edges? It doesn't seem to make sense that it would, but i figured i'd ask.

Once again, thanks again for both of your help. If i have any more questions i'll be sure to ask.

-Tim

garyb
11-09-2010, 07:29 AM
Tim,
Scott and Gary have answered you well. the following link will give you two documents on Shopbots website which covers the use of and accepted g-codes
http://www.shopbottools.com/searchresults.htm?cx=007058511302222020632%3Alxjqz ewj5j0&cof=FORID%3A11&ie=UTF-8&q=supported+g-code&sa=Search#260

srwtlc
11-09-2010, 11:54 AM
Gary, thanks, I new there should be some info on running Gcode, but I wasn't finding it right off.

Tim, those pdf's should help you with what will and won't work. Go to the index and look for "Working with Gcode". Feedrate conversion should be handled just fine. So if your code says F180, the software will convert to 3 inches/sec. So you can think in terms of inches/minute, keeping in mind the type of tooling, chip load, and the ability of your machine to operate at said feedrate (material holddown will be a factor also). I'd do some testing to see that rapids and move/cut feedrates act as they should and as expected throughout the file. Arcs look to be fully supported.

Pay attention to the part on modal and non-modal as you wouldn't want a move/cut command to be executed with a rapid feedrate.

Scott

Edited: There's also the option of running it through the converter under File/Conversions to output a .sbp file. Also, in the above .pdf's, it states that a post for Fanuc is preferable if you program supports that.