This is about something I wanted to do for a moment already. I've been using this small program quite often and find it very useful. It first start from a fellow Botter who shared some code about a surfacing routine and from that point, I and another Botter join in and hacked the guy code. After using it for about two years, and making some minor modifications to the hacked code version. I decide it was time for a tidy and some improvements I've been thinking about for some time. Recently, someone asked about a such utility and this give me the final kick to hacked the code some more up to a vision I had myself about it.
Here's the file's code to study with the README following it and a diagram demonstrating the code's behavior and relation between it's different block. (here's the link to download the package)
The ShopBot part file.
surfacing_along_XorY_axis.sbp'PACO - 2007
'-----------
'See 'surfacing_along_XorY_axis_README.txt' for details and instructions.
'-----------
IF &work_axis = x THEN GOTO WANNA_SKIP
IF &work_axis = y THEN GOTO WANNA_SKIP
START:
INPUT "Surfacing along X or Y" &work_axis
IF &work_axis = x THEN GOTO CONFIG
IF &work_axis = y THEN GOTO CONFIG
IF &work_axis <> x OR y THEN GOSUB MAKE_A_CHOICE
CONFIG:
INPUT "X distance?" &x_size
INPUT "Y distance?" &y_size
INPUT "Tool diameter?" &tool_diam
&tool_radius = &tool_diam / 2
INPUT "% Stepover?" &stepover
&stepover = &stepover / 100
&tool_stepover = &tool_diam * &stepover
INPUT "Stepdown? (Enter a positive value like 0.02 or 0.06)" &stepdown
&half_stepdown = &stepdown / 2
SKIP:
&start_x = %(1)
&start_y = %(2)
'Ready?
PAUSE
SO,1,1
SO,2,1
PAUSE 1
&depth = &stepdown
IF &work_axis = x THEN GOSUB X_AXIS
IF &work_axis = y THEN GOSUB Y_AXIS
X_AXIS:
BEGIN_X:
PRINT "Now at "; &depth; " of an inch deep."
J3,&start_x - &tool_radius,&start_y,0.03 - (&depth - &stepdown)
M3,&start_x + (2 * &tool_diam),&start_y,-&depth / 2
M3,&start_x - &tool_radius,&start_y,-&depth
LOOP_X:
MX, &start_x + &x_size + &tool_radius
&yvalue = %(2) + &tool_stepover
IF &yvalue > &y_size THEN GOTO FINISHED_X
MY,&yvalue
MX,&start_x - &tool_radius
&yvalue = %(2) + &tool_stepover
IF &yvalue > &y_size THEN GOTO FINISHED_X
MY,&yvalue
GOTO LOOP_X
FINISHED_X:
JZ,%(28)
INPUT "Another pass? Y to continue, H for an half pass or N to end" &cont
IF &cont = h THEN &stepdown = &half_stepdown
IF &cont = n THEN GOSUB THATS_IT
&depth = &depth + &stepdown
J2,&start_x,&start_y
GOTO BEGIN_X
RETURN
Y_AXIS:
BEGIN_Y:
PRINT "Now at "; &depth; " of an inch deep."
J3,&start_x,&start_y - &tool_radius,0.03 - (&depth - &stepdown)
M3,&start_x,&start_y + (2 * &tool_diam),-&depth / 2
M3,&start_x,&start_y - &tool_radius,-&depth
LOOP_Y:
MY, &start_y + &y_size + &tool_radius
&xvalue = %(1) + &tool_stepover
IF &xvalue > &x_size THEN GOTO FINISHED_Y
MX,&xvalue
MY,&start_y - &tool_radius
&xvalue = %(1) + &tool_stepover
IF &xvalue > &x_size THEN GOTO FINISHED_Y
MX,&xvalue
GOTO LOOP_Y
FINISHED_Y:
JZ,%(28)
INPUT "Another pass? Y to continue, H for an half pass or N to end" &cont
IF &cont = h THEN &stepdown = &half_stepdown
IF &cont = n THEN GOSUB THATS_IT
&depth = &depth + &stepdown
J2,&start_x,&start_y
GOTO BEGIN_Y
RETURN
MAKE_A_CHOICE:
'Enter either X or Y!
PAUSE
GOTO START
WANNA_SKIP:
INPUT "Skip settings? Y or N" &skip
IF &skip = y THEN GOTO SKIP
IF &skip <> y THEN GOTO START
THATS_IT:
SO,1,0
SO,2,0
JH
PRINT "You removed a total of "; &depth; " of an inch of material."
IF &depth > 0.5 THEN PRINT "I hope that there still something remaining?"
END
The README text file about it.
surfacing_along_XorY_axis_README.txtPACO - 2007
-----------
David Buchsbaum (original idea) and Mike Richard (contributor) deserve credit on this project (2005). See the bellow URL for forum discussion...
http://www.talkshopbot.com/forum/messages/29/7427.html?1113888158#POST23422
http://www.talkshopbot.com/forum/messages/312/18228.html?1171076306#POST46411
I have personally benefit from other programming skill and I'm very happy to share this particular project with any body else completely freely... just give me, and the previously mentioned author and contributor, credit for the code. Thanks! This is, from all small SB coding I made, the one that I use the most aside Z zero and X&Y zeroing customizations. I believe you may find it handy too. Let me know!
-----------
The program is intend for surfacing material such as warped lumber, glue up board or anything that you need to be as flat as possible. It could be use for surfacing the spoilboard too; this actually prove to faster than with the pocketing strategy.
The program start by checking if a specifically related variable has one of the two relevant values (&working axis=x or y). If so, the user is offered to skip the settings configuration part and proceed on the surfacing from previously entered setting values. This is good if you just want repeat the process. The user still have the option to re-edit the settings. If the test variable doesn't contain a relevant value (&working axis=not x or y or even nothing), you have to go through the settings configurations part.
The settings configuration start by asking the user to choose either X or Y axis to work along with. The tool will go back and forth along the chosen axis. Next is the X size of the material to surface then the Y size. Cutter diameter is the fourth setting, stepover is the fifth and stepdown is the sixth. For the stepover, the user just need to enter a percentage value (of the cutter diameter) he want to use without any '%' character. Stepdown refer to depth of cut; the user enter the depth of cut per pass without the '-' sign. Passes (stepdown) are cumulative and displayed (PRINT on the 'Part file message screen').
Once all settings are configured, the user get a last prompt (Ready?) and then the tool proceed to surfacing. The tool will ramp in the cut both as gradually plunging (a first stroke of twice the tool diameter and half the stepdown) and start from outside the material size (see bellow for further details *5). It'll go back and forth along the chosen axis, overshooting the ends until it surface all the material area then raise to 'Safe Z' (VC value) and ask if the user want to perform another pass or an half pass (half the stepdown or depth of cut). This last option has prove valuable when you and to rough out the bulk first then make final pass with less material removal. At the point where the user chose to not do any further pass and answer N when prompt to, the tool will jog back the home (initial X and Y and VC Safe Z).
PLEASE, READ THE FOLLOWING IMPORTANT POINTS AS THEY ARE CRITICAL TO GOOD OPERATION OF THE PROGRAM.
-----------
*1 - There's lines in the code that you may want to change depending on your tool configuration; line 31-32 and 101-102 are used to turn on and off devices (in my case it's the router and the dust collector).
*2 - The program assume that the tool bit is zeroed on top of the material (warped lumber: highest point).
*3 - The program assume the user will have zeroed X & Y axis at the lower left corner (center of the tool bit at the lower left bounding box working envelope).
*4 - The program assume the user have previously set the tool to correct RPM, feed speed, plunge speed and any other related configuration (ramping settings).
*5 - The program will overshoot the ends to avoid tool marking as it ramp down to a stop. Plan ahead that you need a working envelope of at least the longest measurement plus the tool bit diameter (the program overshoot the tool bit radius at each ends).
*6 - Don't be surprised to see the tool ramping in as it start a pass; some fly cutter can't be plunge in very deep.
-----------
04/2005 - Original idea came up from David Buchsbaum. I and Mike Richard hacked David's code to play with and challenge ourselves coding the ShopBot part file code.
07/2006 - Implemented the Y axis version.
12/2006 - Implemented a main file (custom cut) to choose one or the other axis version.
02/2007 - Major clean up and tidy of the code. Implementation of a few ideas: simplifications, half pass (half stepdown), overshoot the ends (to avoid tool marking), re-use of previous settings, display (print on the Part file message screen) of the depth of cut progression. To do: new stepover algorithm to avoid air cutting the final stroke or leaving a thin strip of not machined material. This can happen under certain tool diameter, stepover and material width settings combinations...
-----------
surfacing_along_XorY_axis diagram
Enjoy the utility. Let know of any bugs. I welcome feedback (good or bad). Let me know what you think.
Paco 8-)
Sunday, February 11, 2007
Surfacing along axis, a ShopBot routine
Posted by
Paco
at
3:08 PM
Labels: CNC, programing, router, ShopBot
Subscribe to:
Post Comments (Atom)



0 comments:
Post a Comment