BitSetter in the future?

EDIT removed Z12 from second to last line as this had the potential to cause a crash if using machine bed for zero

Howdy Folks,

Start with thanks to Warren Brown for reposting from Bulidbotics forum on this subject.
I’ve managed to write a tool change that mimicks a bit setter. There seems to have been some interest from some people out there on this. It works a bit differently than Carbide Motion but gets the job done, drawback to this is you have to probe both tools on every tool change, but don’t have to probe the first tool on the bit setter before zeroing work piece as is the case in Carbide Motion. I’ve tested this with Vectric and it works in all situations that I’ve attempted for different size materials etc. I’m just using the 1F probe flipped upside down no other probe or bit setter required.

Need to be careful and make sure you attach the magnet when prompted as this is set to seek all the way to the bottom of the Z slider. Also, if working with very thick material if the Z offset after you zero the Z to work piece is more than -25.4mm or -1 inch when I say more than I’m meaning 0 to -25.4mm or -1 inch, it will error as an over. I’ve tested with up to 2 1/4" thick material with Z slider on the lowest mounting point and 3/4" wasteboard.

This will make for very simple tool changes where the material is unlikely to be in the way. If you’re working with a large piece and need to set the probe on top somewhere you may run into an issue with height to change the bit. The code is mostly done in absolute values so I recommend trying to work from the area that I’ve specified but you can, of course, modify to your liking.

Here’s the code that I’ve entered into the Controller>Settings>tool-change dialogue box with some explanations in { } DO NOT ENTER these parentheses or anything between these parentheses!
BACKUP YOUR CONFIG before doing this. THIS IS AT YOUR OWN RISK. Also this is for the Woodworker, the machinist would need different X value on line #6.

I’ve tested it in as many different configurations as I can think of and it has worked for all of them. Once I had the controller pause when touching the probe and wouldn’t continue, but I’ve had that happen a couple times on a regular probe so feel it is likely a little hiccup with the controller.


M70 {Pause modal}
S0 {Spinle to zero}
G21 G40 G49 {Metric, cancel tool offsets}
G17 G90 {XY, Absolute Coordinates}
G53 G0 Z-10 {Move to 10mm below absolute zero}
G53 G0 X800 Y15 {Move to bottom right, you may need to change these coordinates if you
pocket a hole for probe}
G92.2 {Temporarily suspend offsets}
G53 G0 Z-70 {Move to -70MM absolute}
M0 (MSG, Wait for the spindle to stop. Attach Probe, Click “Continue”) {Prompt for 1st probe cycle}
G38.2 Z-133 F100 {First probe}
#5000=#<_Z> {Store Value from first probe}
G53 G0 Z-70 {Move to -70 absolute}
M0 (MSG, Change Tool, Attach Probe. Click “Continue”) {Prompt for tool change and attach magnet}
G38.2 Z-133 F100 {Second Probe with new tool}
#4999=#<_Z> {Store Value from second probe}
G92.3 {Restore original offsets}
G0 Z25.4 {Move to 25.4mm above original Z}
G92 Z[#5000-#4999+25.4] {Calculate diff in tool height, set new Z0}
G53 G0 Z-10 {Move 10mm below absolute zero}
M0(MSG, REMOVE MAGNET!!! Click “Continue”) {Don’t forget this}
G0 X0 Y0 {Return to Workpiece XY 0}
M72 {Restore modal}


Trying to post a video as well but am having trouble getting it to email from my phone. Feel free to send me any questions, I’ll do my best to answer them. And again a big shout out to Warren Brown!!

Here’s the code again without explanations so you can copy and paste.

M70
S0
G21 G40 G49
G17 G90
G53 G0 Z-10
G53 G0 X800 Y15
G92.2
G53 G0 Z-70
M0 (MSG, Wait for the spindle to stop. Attach Probe, Click “Continue”)
G38.2 Z-133 F100
#5000=#<_Z>
G53 G0 Z-70
M0 (MSG, Change Tool, Attach Probe. Click “Continue”)
G38.2 Z-133 F100
#4999=#<_Z>
G92.3
G0 Z25.4
G92 Z[#5000-#4999+25.4]
G53 G0 Z-10
M0(MSG, REMOVE MAGNET!!! Click “Continue”)
G0 X0 Y0
M72

3 Likes

Video of bit setter mod. I’ve since pocketed out a spot in the corner for the probe.

4 Likes

Resolved by removing Z12 from second to last line

There is a potential for a crash with this code that I overlooked. It would be possible to have a crash when using machine bed for zero. This code is written to put Z to 12mm after tool change so if using machine bed for zero and workpiece is thicker than 12mm it will be a problem. Will work on a solution to this. I think the easiest solution will be to just remove the Z12 call on the second last line and let the software move bit down after tool change.

I also should have mentioned that due to
the many possible combinations of router/spindle and Z slider configurations the Z heights may need to be altered to suit your setup.

This was written with Makita with Z on lowest position and a 3/4” wasteboard.

Any updates or changes to this @BNB187?

Do you manually inject this or did you add it to the post processor?

No modification required to PP the code gets entered into the settings on the controller. For this version just copy and paste everything into the tool_change dialogue box and it will run automatically when file calls for a M6.

I’ve been using the 2.0 version that is linked here for several weeks. It measures the first tool at the beginning of the file and then only has to measure the each subsequent tool when you make the change instead of probing both tools at tool change. Drawback is if using the laser the code in the program_start dialogue has to be disabled on the 2.0 version. I’m likely going to switch back to this version that measures both tools when the M6 is called now that I have my laser.

Keep in mind the machine must be homed for this to work properly. And I’ve only tested with 1.0.5 firmware.

1 Like

So big upgrade to this code with a huge shout out to @Cryptonym he re-wrote my very basic code to include subroutines. Really streamlined everything, top notch work Warren! So this version will measure both tools at the first tool change, each subsequent change will only need to measure the new tool. Also, it will carry the tool # forward to the correct dialogue box. Also, I added a move towards the middle of the machine for the actual changing of the bit, little easier than working way off in the corner. This version will not cause problems with the laser.

So this has been tested with the Onefinity PP for Vectric. I’m not sure how other PP’s or software will work with this code. Firmware 1.0.8. I suspect that all the 1F PP’s will be similar so should work for them. IF your gcode has an M06 command for the FIRST tool there is some modifications that can be made to avoid the first probe sequence that would be unnecessary.

In the program-start dialogue box under settings in the flyout menu copy and paste the following:

(Runs at program start)
G90 (Absolute distance mode)
G17 (Select XY plane)
#5000=-999
o10 sub
G53 G0 Z-10
G53 G0 X780 Y50
o15 if [[#5000] EQ -999]
M0 (msg, Remove Dust Boot, Attach Magnet, Click “Continue”…)
o15 else
G53 G0 X600
M0 (debug, Remove Dust Boot, Insert Tool #<_selected_tool>, Attach Magnet, Click “Continue”…)
G53 G0 X780
o15 endif
G92.2
G53 G0 Z-70
G38.2 Z-133 F100
G0 Z[#<_Z>+1] F100
G38.2 Z-133 F25
o10 endsub

In the tool-change dialogue in the settings copy and paste the following:

(Runs on M6, tool-change)
M70
S0 M5
G21 G40 G49 G17 G90
o20 if [[#5000] EQ -999]
o10 call
#5000 = #<_Z>
G53 G0 Z-10
G92.3
o20 endif
o10 call
#4999= #<_Z>
G92.3
G0 Z25.4
G92 Z[#5000-#4999+25.4]
G53 G0 Z-10
#5000 = #4999
M0(MSG,Remove Probe, Install Dust Boot, Click “Continue”…)
G0 X0 Y0
M72

3 Likes

Hi all,
First off, great work on the bit setter macro.

I just tried using the above macro but ran into some issues.
Here is the listing of steps along with behavior and prompts that occurred on my machine.
Sorry it is very long and I hope it makes sense.

  1. Boot machine
  2. Home machine
  3. Install material and probe XYZ using probe
  4. Load file and click on Play

=> First problem:

  • at this point the router turns on (i am using the IOT relay) and positions itself at the home location.
  • A prompt comes up with these instructions:
    – Insert tool 202
    – Click Continue when spindle is up to speed
  • Click on Continue
  • First cut is performed

Cut is completed:

  1. Router goes to home position and turns off
  2. Router goes to probe site
    – Prompt:
    — Insert Tool 203
    — Remove dust boot
    — Attach magnet
    — Click Continue
  3. Z probe occurs
  4. Router then moves to center and the following prompt comes up:
    – Remove dust boot
    – Insert tool 203
    – Click Continue
  5. Router goes to probe site right away not asking to attach probe magnet and performs probe. After probe,
    – Prompt:
    — Remove Probe
    — Install dust boot
    — Click Continue
  6. Router moves to home position and turns on
  • Prompt:
    – Click Continue when spindle is up to speed
  1. Second cut happens
  2. Router moves to Home position
  3. Router moves to probe site
  4. Router moves to middle of table
  • Prompt:
    – Insert tool 202
    – Remove dust boot
    – Insert tool 202
    – Attach probe
    – Click Continue
  1. Router moves to probe site and does probe of Z
  • Prompt:
    – Remove probe
    – Install dust boot
    – Click Continue
  1. Router moves to home position
  • Prompt:
    – Click Continue when spindle is up to speed

How are would it be to change the macro so it is simpler to use?
Maybe something as follows:

  1. Home machine
    1.1 Install material

  2. Probe XYZ using probe

  3. Load file
    3.1 Hit Play button

  4. Router should move to middle of table and prompt to :
    4.1 Remove dust boot
    4.2 Insert proper tool (with tool number)
    4.3 Click on Continue

  5. Router should move to far right (probing position) and prompt to :
    5.1 Attach magnet
    5.2 Click on Continue

  6. Probe Z occurs and then prompts to :
    6.1 Remove magnet
    6.2 Click on Continue

  7. Router moves back to middle of table and prompts to :
    7.1 Attach dust boot
    7.2 Click Continue when ready

  8. Router moves back to home position and power’s on using IOT relay
    8.1 Prompt to click on Continue once spindle is up to speed

  9. Once cut is finished, repeat steps 4 through 8 for the next tool change

Am I over simplifying the process or is there something I am not understanding?

Thanks for your patience.
Looking forward to your feedback.
S

1 Like

It is set up that way so if you are using only one bit you don’t have to go through the extra probe cycle.

Hi Scott,

That is fine when you are doing your probing with the same bit that your first cut is using (usually a 1/4 or 1/8 inch endmill.
What about if you need to probe XYZ with a 1/4 endmill and your tool path is using a V-bit or bowl bit for the first carve? Then you have to make sure you remember to do the extra probing at the start before “playing” the file.

So, you would have to do the Probe XYZ and then change your bit and re-probe your Z with the new V-bit or bowl bit for examples.

That means there are 2 different procedures.
1 for when you have a single tool.
1 for when you have multiple tool changes.
Or am I missing something?

I am not sure about anyone else but I, for one, would not mind the extra step(s) if it brings consistency to the whole process… :slight_smile:

Just my thoughts.

1 Like

Ok folks,

I created a test pattern to cut. Basically 3 squares.
The first square is set to a 90 degree V-bit, the other 2 are 1/4 inch endmills.

I have just confirmed the following.

I power up the machine, home it and probe the XYZ using the probe on the stock.
I load the file, and click play.
Since the first tool is not the 1/4 endmill used to do the probing, I was expecting this new updated macro to prompt me to insert the proper tool and do a probe Z cycle. This did not happen. Instead, the router turns on, a prompt comes up telling to insert the proper tool but I cannot do this at this point as the router is already running. If I click on Continue, the machine will cut the first square even tho the bit is wrong.

The latter part of the macro seems to be working properly but without having the part part working correctly, I don’t see any point in continuing.

I am more than willing to do some more testing if someone would be willing to provide some code for me to test.
I have looked at the G-Code sites but it seems fairly complicated to me.

@Cryptonym & @BNB187 Any idea how this could be fixed?

Thanks to everyone for their input.

Using vectric? The post processor for that makes some odd choices in my mind. It kind of creates bitsetter incompatible code.

They built unneeded logic into it to prompt for changes and router power. I have my bitsetter code, a video and my take on an improved post processor for vectric posted in the Onefinity Facebook forum. I rip out the redundant prompts and rely on my macro code to do changes. It is probably searchable under bitsetter or bit setter.

I do not have the vectric products.

Note there are several variants of the bitset code from different people. Experiment as you see fit, but mixing my PP logic with others may not go great.

If you are up to an experiment, change post processor to generic GRBL. That should have no extra sauce in it, so to speak.

I recommend you air carve in tests, set your Z zero artificially high above the surface.

1 Like

Thanks Warren for the quick response.

Yes, I am using VCarve Pro V11.
When I try to select the G-Code (.tap) PP, I get a red message indicating the PP does not support tool changes.
Grbl PP also does the same thing.

Could you let me know which PP I should be using?

Thanks

The script assumes the 1st bit is ready at the start. Mount the workpiece, probe X and Y, swap bit if using a V or whatever, and set Z zero. When started, it is ready.

When it gets to tool 2, it will then do the initial in run probe to figure out the end of the mill. Then prompt for next tool and probe it to establish relative Z zero. On 3rd tool or later, it just prompts for change and probes new bit, since the desired Z zero plane is stored.

Maybe all your missing is a change to thinking what state the bit must be in prior to the run?

As to the iot relay issue, I’m not sure what is triggering that. Did you inject gcode in the post processor? That really just sounds like a code issue somewhere other than the macro. I think the L1 and L2 outputs are triggered by M7/M8 commands, and off by M9. So to be doubly sure, you could place an M9 on the line immediately before all M0 in the bitset code. The needed M7 or M8 would probably go just before the M72 near the bottom…but test with nothing sharp installed! If it doesn’t come up to speed quick enough before cutting, you’d have to maybe add a M4 P2 or something like that after M7/M8 to add a pause.

1 Like

As I said, I don’t have any vectric stuff, so I can’t say much on the specifics. Maybe Mike will reply, he has vcarve and is a great guy. Sorry. Wish I knew that product.

Is there one for Carbide brand machine, like shapeoko? Maybe try that, but keep finger near your estop on screen, no idea if it has anything odd in it.

Thanks Warren,

No worries, I will try different PP in the software.

I understand what you are saying about changing the way we do things, I would just like to simplify the process for other people in the shop that might use the machine. :slight_smile:

That being said, when Onefinity does the XYZ probing, it asks for the tool size in the machine.
Would there be a way then to compare that to the first tool in the code and then launch the macro accordingly if a bit change is required?
Or automatically assume the first bit is not the correct one and prompt for a bit change. If none is needed, a simply click on Continue would do the trick.

I am pretty sure I am using the generic PP for Onefinity in VCarve.

Let me know what you think.

Again, thanks so much for your time.

I have been using Vetric PP for the 1F and the “Bitsetter” code forever now and not 1 issue with it.

you are not missing anything.
Like Warren Brown said
The script assumes the 1st bit is ready at the start. Mount the workpiece, probe X and Y, swap bit if using a V or whatever, and set Z zero. When started, it is ready.

So I’m using Vectric and using the code as I posted it. You are correct you will not be prompted to change the tool when you push play. You still need to do this as if you were not using the macro.

Probe XYZ, change to the first tool, probe Z, press play. Yes the dialogue pops up with the tool number at the beginning that is really quite useless, it can be taken out of the PP if you really want but it really doesn’t have any impact on anything.

1 Like